@ai-matrx/vault 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -101,7 +101,7 @@ var init_keepass_xml_worker_client = __esm({
101
101
  });
102
102
 
103
103
  // src/VaultApp.tsx
104
- import { useCallback as useCallback5, useEffect as useEffect22, useMemo as useMemo6, useRef as useRef19, useState as useState39 } from "react";
104
+ import { useCallback as useCallback5, useEffect as useEffect23, useMemo as useMemo6, useRef as useRef19, useState as useState40 } from "react";
105
105
  import { DropdownMenu as DropdownMenu6, DropdownMenuContent as DropdownMenuContent6, DropdownMenuItem as DropdownMenuItem5, DropdownMenuTrigger as DropdownMenuTrigger6 } from "@ai-matrx/design-system";
106
106
  import { Button as Button33, SearchField as SearchField4, Select as Select11 } from "@ai-matrx/design-system/controls";
107
107
  import { confirm as confirm13 } from "@ai-matrx/kit/confirm-opener";
@@ -135,7 +135,7 @@ function NoticeProvider({ notify, children }) {
135
135
  }
136
136
 
137
137
  // src/activity/HistoryPanel.tsx
138
- import { useCallback as useCallback3, useEffect as useEffect6, useRef as useRef5, useState as useState6 } from "react";
138
+ import { useCallback as useCallback3, useEffect as useEffect7, useRef as useRef5, useState as useState7 } from "react";
139
139
  import { Button as Button4, Badge as Badge2 } from "@ai-matrx/design-system/controls";
140
140
  import { confirm } from "@ai-matrx/kit/confirm-opener";
141
141
 
@@ -146,89 +146,90 @@ import { Button, Field } from "@ai-matrx/design-system/controls";
146
146
 
147
147
  // src/glyphs.tsx
148
148
  import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
149
- function glyph(paths) {
149
+ function glyph(paths, air = [1, 1]) {
150
+ const style = { "--matrx-glyph-air-l": air[0], "--matrx-glyph-air-r": air[1] };
150
151
  return function VaultGlyph({ className }) {
151
- return /* @__PURE__ */ jsx2("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: paths });
152
+ return /* @__PURE__ */ jsx2("svg", { className, style, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: paths });
152
153
  };
153
154
  }
154
155
  var KeyGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
155
156
  /* @__PURE__ */ jsx2("circle", { cx: "7.5", cy: "15.5", r: "5.5" }),
156
157
  /* @__PURE__ */ jsx2("path", { d: "m21 2-9.6 9.6M15.5 7.5l3 3" })
157
- ] }));
158
+ ] }), [1, 2]);
158
159
  var GlobeGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
159
160
  /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "10" }),
160
161
  /* @__PURE__ */ jsx2("path", { d: "M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
161
- ] }));
162
+ ] }), [1, 1]);
162
163
  var NoteGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
163
164
  /* @__PURE__ */ jsx2("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
164
165
  /* @__PURE__ */ jsx2("path", { d: "M14 2v4a2 2 0 0 0 2 2h4M16 13H8M16 17H8" })
165
- ] }));
166
+ ] }), [3, 3]);
166
167
  var CardGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
167
168
  /* @__PURE__ */ jsx2("rect", { x: "2", y: "5", width: "20", height: "14", rx: "2" }),
168
169
  /* @__PURE__ */ jsx2("path", { d: "M2 10h20" })
169
- ] }));
170
+ ] }), [1, 1]);
170
171
  var PersonGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
171
172
  /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "8", r: "5" }),
172
173
  /* @__PURE__ */ jsx2("path", { d: "M20 21a8 8 0 0 0-16 0" })
173
- ] }));
174
+ ] }), [3, 3]);
174
175
  var DatabaseGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
175
176
  /* @__PURE__ */ jsx2("ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }),
176
177
  /* @__PURE__ */ jsx2("path", { d: "M3 5v14a9 3 0 0 0 18 0V5M3 12a9 3 0 0 0 18 0" })
177
- ] }));
178
+ ] }), [2, 2]);
178
179
  var ServerGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
179
180
  /* @__PURE__ */ jsx2("rect", { x: "2", y: "2", width: "20", height: "8", rx: "2" }),
180
181
  /* @__PURE__ */ jsx2("rect", { x: "2", y: "14", width: "20", height: "8", rx: "2" }),
181
182
  /* @__PURE__ */ jsx2("path", { d: "M6 6h.01M6 18h.01" })
182
- ] }));
183
- var TerminalGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "m4 17 6-6-6-6M12 19h8" }) }));
183
+ ] }), [1, 1]);
184
+ var TerminalGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "m4 17 6-6-6-6M12 19h8" }) }), [3, 3]);
184
185
  var FileGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
185
186
  /* @__PURE__ */ jsx2("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
186
187
  /* @__PURE__ */ jsx2("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" })
187
- ] }));
188
- var CodeGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "m16 18 6-6-6-6M8 6l-6 6 6 6" }) }));
189
- var StarGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M12 2l3.1 6.3 6.9 1-5 4.9 1.2 6.8L12 17.8 5.8 21l1.2-6.8-5-4.9 6.9-1z" }));
190
- var PlusGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M12 5v14M5 12h14" }));
188
+ ] }), [3, 3]);
189
+ var CodeGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "m16 18 6-6-6-6M8 6l-6 6 6 6" }) }), [1, 1]);
190
+ var StarGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M12 2l3.1 6.3 6.9 1-5 4.9 1.2 6.8L12 17.8 5.8 21l1.2-6.8-5-4.9 6.9-1z" }), [1, 1]);
191
+ var PlusGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M12 5v14M5 12h14" }), [4, 4]);
191
192
  var CopyGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
192
193
  /* @__PURE__ */ jsx2("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
193
194
  /* @__PURE__ */ jsx2("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
194
- ] }));
195
+ ] }), [1, 1]);
195
196
  var EyeGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
196
197
  /* @__PURE__ */ jsx2("path", { d: "M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7z" }),
197
198
  /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "3" })
198
- ] }));
199
- var EyeOffGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M10.7 5.1A10.4 10.4 0 0 1 12 5c6.4 0 10 7 10 7a17 17 0 0 1-2.2 3.2M6.6 6.6A17 17 0 0 0 2 12s3.6 7 10 7a9.7 9.7 0 0 0 5.4-1.6M2 2l20 20" }) }));
199
+ ] }), [1, 1]);
200
+ var EyeOffGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M10.7 5.1A10.4 10.4 0 0 1 12 5c6.4 0 10 7 10 7a17 17 0 0 1-2.2 3.2M6.6 6.6A17 17 0 0 0 2 12s3.6 7 10 7a9.7 9.7 0 0 0 5.4-1.6M2 2l20 20" }) }), [1, 1]);
200
201
  var LockGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
201
202
  /* @__PURE__ */ jsx2("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
202
203
  /* @__PURE__ */ jsx2("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
203
- ] }));
204
- var ExternalGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }) }));
205
- var TrashGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }) }));
204
+ ] }), [2, 2]);
205
+ var ExternalGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }) }), [2, 2]);
206
+ var TrashGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }) }), [2, 2]);
206
207
  var ArchiveGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
207
208
  /* @__PURE__ */ jsx2("rect", { x: "2", y: "3", width: "20", height: "5", rx: "1" }),
208
209
  /* @__PURE__ */ jsx2("path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8M10 12h4" })
209
- ] }));
210
+ ] }), [1, 1]);
210
211
  var TagGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
211
212
  /* @__PURE__ */ jsx2("path", { d: "M12.6 2.6A2 2 0 0 0 11.2 2H4a2 2 0 0 0-2 2v7.2a2 2 0 0 0 .6 1.4l8.7 8.7a2.4 2.4 0 0 0 3.4 0l6.6-6.6a2.4 2.4 0 0 0 0-3.4z" }),
212
213
  /* @__PURE__ */ jsx2("circle", { cx: "7.5", cy: "7.5", r: ".5" })
213
- ] }));
214
- var ShieldGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M20 13c0 5-3.5 7.5-7.7 8.9a1 1 0 0 1-.6 0C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.2-2.7a1.2 1.2 0 0 1 1.6 0C14.5 3.8 17 5 19 5a1 1 0 0 1 1 1z" }) }));
214
+ ] }), [1, 1]);
215
+ var ShieldGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M20 13c0 5-3.5 7.5-7.7 8.9a1 1 0 0 1-.6 0C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.2-2.7a1.2 1.2 0 0 1 1.6 0C14.5 3.8 17 5 19 5a1 1 0 0 1 1 1z" }) }), [3, 3]);
215
216
  var BuildingGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
216
217
  /* @__PURE__ */ jsx2("rect", { x: "4", y: "2", width: "16", height: "20", rx: "2" }),
217
218
  /* @__PURE__ */ jsx2("path", { d: "M9 22v-4h6v4M8 6h.01M16 6h.01M12 6h.01M12 10h.01M12 14h.01M16 10h.01M16 14h.01M8 10h.01M8 14h.01" })
218
- ] }));
219
+ ] }), [3, 3]);
219
220
  var UsersGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
220
221
  /* @__PURE__ */ jsx2("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }),
221
222
  /* @__PURE__ */ jsx2("circle", { cx: "9", cy: "7", r: "4" }),
222
223
  /* @__PURE__ */ jsx2("path", { d: "M22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8" })
223
- ] }));
224
- var ChevronLeftGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "m15 18-6-6 6-6" }));
224
+ ] }), [1, 1]);
225
+ var ChevronLeftGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "m15 18-6-6 6-6" }), [8, 8]);
225
226
  var GridGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
226
227
  /* @__PURE__ */ jsx2("rect", { x: "3", y: "3", width: "7", height: "7", rx: "1" }),
227
228
  /* @__PURE__ */ jsx2("rect", { x: "14", y: "3", width: "7", height: "7", rx: "1" }),
228
229
  /* @__PURE__ */ jsx2("rect", { x: "3", y: "14", width: "7", height: "7", rx: "1" }),
229
230
  /* @__PURE__ */ jsx2("rect", { x: "14", y: "14", width: "7", height: "7", rx: "1" })
230
- ] }));
231
- var PlugGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M12 22v-5M9 8V2M15 8V2M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8z" }) }));
231
+ ] }), [2, 2]);
232
+ var PlugGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M12 22v-5M9 8V2M15 8V2M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8z" }) }), [5, 5]);
232
233
  var FAMILY_GLYPHS = {
233
234
  databases: DatabaseGlyph,
234
235
  server_network: ServerGlyph,
@@ -242,78 +243,78 @@ function definitionGlyph(key, family) {
242
243
  if (key === "username_password" || key === "website_login") return GlobeGlyph;
243
244
  return FAMILY_GLYPHS[family] ?? KeyGlyph;
244
245
  }
245
- var XGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M18 6 6 18M6 6l12 12" }));
246
+ var XGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M18 6 6 18M6 6l12 12" }), [5, 5]);
246
247
  var PencilGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
247
248
  /* @__PURE__ */ jsx2("path", { d: "M12 20h9" }),
248
249
  /* @__PURE__ */ jsx2("path", { d: "M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z" })
249
- ] }));
250
+ ] }), [2, 2]);
250
251
  var ClockGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
251
252
  /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "10" }),
252
253
  /* @__PURE__ */ jsx2("path", { d: "M12 6v6l4 2" })
253
- ] }));
254
+ ] }), [1, 1]);
254
255
  var MoreGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
255
256
  /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "1" }),
256
257
  /* @__PURE__ */ jsx2("circle", { cx: "19", cy: "12", r: "1" }),
257
258
  /* @__PURE__ */ jsx2("circle", { cx: "5", cy: "12", r: "1" })
258
- ] }));
259
- var ShareGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8M16 6l-4-4-4 4M12 2v13" }) }));
259
+ ] }), [3, 3]);
260
+ var ShareGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8M16 6l-4-4-4 4M12 2v13" }) }), [3, 3]);
260
261
  var HistoryGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
261
262
  /* @__PURE__ */ jsx2("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
262
263
  /* @__PURE__ */ jsx2("path", { d: "M3 3v5h5M12 7v5l4 2" })
263
- ] }));
264
- var ListGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01" }));
264
+ ] }), [2, 2]);
265
+ var ListGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01" }), [2, 2]);
265
266
  var SettingsGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
266
267
  /* @__PURE__ */ jsx2("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }),
267
268
  /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "3" })
268
- ] }));
269
- var ImportGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3" }));
270
- var ExportGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12" }));
271
- var ChevronDownGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "m6 9 6 6 6-6" }));
272
- var ChevronRightGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "m9 18 6-6-6-6" }));
273
- var SortGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "m3 16 4 4 4-4M7 20V4M21 8l-4-4-4 4M17 4v16" }));
269
+ ] }), [2, 2]);
270
+ var ImportGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3" }), [2, 2]);
271
+ var ExportGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12" }), [2, 2]);
272
+ var ChevronDownGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "m6 9 6 6 6-6" }), [5, 5]);
273
+ var ChevronRightGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "m9 18 6-6-6-6" }), [8, 8]);
274
+ var SortGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "m3 16 4 4 4-4M7 20V4M21 8l-4-4-4 4M17 4v16" }), [2, 2]);
274
275
  var UserGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
275
276
  /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "8", r: "4" }),
276
277
  /* @__PURE__ */ jsx2("path", { d: "M6 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2" })
277
- ] }));
278
- var MoveGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M5 9 2 12l3 3M9 5l3-3 3 3M15 19l-3 3-3-3M19 9l3 3-3 3M2 12h20M12 2v20" }));
278
+ ] }), [5, 5]);
279
+ var MoveGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M5 9 2 12l3 3M9 5l3-3 3 3M15 19l-3 3-3-3M19 9l3 3-3 3M2 12h20M12 2v20" }), [1, 1]);
279
280
  var SafeGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
280
281
  /* @__PURE__ */ jsx2("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
281
282
  /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "4" }),
282
283
  /* @__PURE__ */ jsx2("path", { d: "M12 8v1M12 15v1M8 12h1M15 12h1" })
283
- ] }));
284
+ ] }), [2, 2]);
284
285
  var RestoreGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
285
286
  /* @__PURE__ */ jsx2("path", { d: "M3 12a9 9 0 1 0 3-6.7L3 8" }),
286
287
  /* @__PURE__ */ jsx2("path", { d: "M3 3v5h5" })
287
- ] }));
288
+ ] }), [2, 2]);
288
289
  var QrGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
289
290
  /* @__PURE__ */ jsx2("rect", { x: "3", y: "3", width: "7", height: "7", rx: "1" }),
290
291
  /* @__PURE__ */ jsx2("rect", { x: "14", y: "3", width: "7", height: "7", rx: "1" }),
291
292
  /* @__PURE__ */ jsx2("rect", { x: "3", y: "14", width: "7", height: "7", rx: "1" }),
292
293
  /* @__PURE__ */ jsx2("path", { d: "M14 14h3v3h-3zM20 14v.01M14 20h.01M17 20h4v-3" })
293
- ] }));
294
+ ] }), [2, 2]);
294
295
  var CameraGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
295
296
  /* @__PURE__ */ jsx2("path", { d: "M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3z" }),
296
297
  /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "13", r: "3" })
297
- ] }));
298
- var CheckGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M20 6 9 17l-5-5" }));
298
+ ] }), [1, 1]);
299
+ var CheckGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M20 6 9 17l-5-5" }), [3, 3]);
299
300
  var PowerGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
300
301
  /* @__PURE__ */ jsx2("path", { d: "M12 2v10" }),
301
302
  /* @__PURE__ */ jsx2("path", { d: "M18.4 6.6a9 9 0 1 1-12.77.04" })
302
- ] }));
303
+ ] }), [2, 2]);
303
304
  var RefreshGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
304
305
  /* @__PURE__ */ jsx2("path", { d: "M21 12a9 9 0 0 1-15.5 6.2L3 16" }),
305
306
  /* @__PURE__ */ jsx2("path", { d: "M3 12a9 9 0 0 1 15.5-6.2L21 8" }),
306
307
  /* @__PURE__ */ jsx2("path", { d: "M21 3v5h-5M3 21v-5h5" })
307
- ] }));
308
- var SlidersGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6" }) }));
308
+ ] }), [2, 2]);
309
+ var SlidersGlyph = glyph(/* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2("path", { d: "M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6" }) }), [0, 0]);
309
310
  var DownloadGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
310
311
  /* @__PURE__ */ jsx2("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
311
312
  /* @__PURE__ */ jsx2("path", { d: "m7 10 5 5 5-5M12 15V3" })
312
- ] }));
313
+ ] }), [2, 2]);
313
314
  var UploadGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
314
315
  /* @__PURE__ */ jsx2("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
315
316
  /* @__PURE__ */ jsx2("path", { d: "m17 8-5-5-5 5M12 3v12" })
316
- ] }));
317
+ ] }), [2, 2]);
317
318
  var FingerprintGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
318
319
  /* @__PURE__ */ jsx2("path", { d: "M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4" }),
319
320
  /* @__PURE__ */ jsx2("path", { d: "M14 13.12c0 2.38 0 6.38-1 8.88" }),
@@ -324,8 +325,8 @@ var FingerprintGlyph = glyph(/* @__PURE__ */ jsxs2(Fragment, { children: [
324
325
  /* @__PURE__ */ jsx2("path", { d: "M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2" }),
325
326
  /* @__PURE__ */ jsx2("path", { d: "M8.65 22c.21-.66.45-1.32.57-2" }),
326
327
  /* @__PURE__ */ jsx2("path", { d: "M9 6.8a6 6 0 0 1 9 5.2v2" })
327
- ] }));
328
- var SendGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M14.5 21.7a.5.5 0 0 0 .9 0L22 3a.5.5 0 0 0-.6-.6L2.3 9.1a.5.5 0 0 0 0 .9l7.9 3.2a2 2 0 0 1 1.1 1.1zM21.9 2.1 10.9 13.1" }));
328
+ ] }), [1, 1]);
329
+ var SendGlyph = glyph(/* @__PURE__ */ jsx2("path", { d: "M14.5 21.7a.5.5 0 0 0 .9 0L22 3a.5.5 0 0 0-.6-.6L2.3 9.1a.5.5 0 0 0 0 .9l7.9 3.2a2 2 0 0 1 1.1 1.1zM21.9 2.1 10.9 13.1" }), [1, 1]);
329
330
 
330
331
  // src/auth/identity.ts
331
332
  var SAME_PERSON = "That signed in a different account. Use the account this vault belongs to.";
@@ -488,7 +489,7 @@ function ConfirmIdentityDialog({ open, identity, onDone, onCancel }) {
488
489
  }
489
490
 
490
491
  // src/FieldRows.tsx
491
- import { useEffect as useEffect4, useState as useState4 } from "react";
492
+ import { useEffect as useEffect5, useState as useState5 } from "react";
492
493
  import { Badge, Button as Button2, Field as Field2, Textarea } from "@ai-matrx/design-system/controls";
493
494
  import { cn as cn3 } from "@ai-matrx/design-system";
494
495
 
@@ -530,11 +531,27 @@ function useElementWidth(ref) {
530
531
  }
531
532
 
532
533
  // src/ui.tsx
533
- import { createContext as createContext3, useContext as useContext3 } from "react";
534
+ import { createContext as createContext3, useContext as useContext3, useEffect as useEffect4, useState as useState4 } from "react";
534
535
  import { Dialog as Dialog2, DialogContent as DialogContent2, DialogFooter, DialogHeader as DialogHeader2, DialogTitle as DialogTitle2 } from "@ai-matrx/design-system";
535
536
  import { cn as cn2 } from "@ai-matrx/design-system";
536
537
  import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
537
538
  var InPanel = createContext3(false);
539
+ var Room = createContext3(null);
540
+ var ROOMY_AT = 560;
541
+ function useRoomOf(ref) {
542
+ const [room, setRoom] = useState4(null);
543
+ useEffect4(() => {
544
+ const el = ref.current;
545
+ if (!el || typeof ResizeObserver === "undefined") return;
546
+ const read = () => setRoom(el.getBoundingClientRect().width >= ROOMY_AT ? "roomy" : "compact");
547
+ read();
548
+ const ro = new ResizeObserver(read);
549
+ ro.observe(el);
550
+ return () => ro.disconnect();
551
+ }, [ref]);
552
+ return room;
553
+ }
554
+ var RoomProvider = Room.Provider;
538
555
  function Section({ title, actions, children, className }) {
539
556
  const flat = useContext3(InPanel);
540
557
  return /* @__PURE__ */ jsxs4("section", { className: cn2("flex flex-col gap-1.5", className), children: [
@@ -545,10 +562,16 @@ function Section({ title, actions, children, className }) {
545
562
  /* @__PURE__ */ jsx4("div", { className: flat ? "-mx-3 flex flex-col sm:-mx-4" : "flex flex-col rounded-xl border border-border bg-card py-1", children })
546
563
  ] });
547
564
  }
565
+ var ROW_GRID = {
566
+ compact: "grid-cols-[5.75rem_minmax(0,1fr)_auto] gap-x-2 px-3",
567
+ roomy: "grid-cols-[9rem_minmax(0,1fr)_auto] gap-x-3 px-4",
568
+ viewport: "grid-cols-[5.75rem_minmax(0,1fr)_auto] gap-x-2 px-3 sm:grid-cols-[9rem_minmax(0,1fr)_auto] sm:gap-x-3 sm:px-4"
569
+ };
548
570
  function Row({ label, hint, children, actions, top = false, className }) {
549
- return /* @__PURE__ */ jsxs4("div", { className: cn2("grid min-h-11 grid-cols-[5.75rem_minmax(0,1fr)_auto] gap-x-2 px-3 py-1 sm:grid-cols-[9rem_minmax(0,1fr)_auto] sm:gap-x-3 sm:px-4", top ? "items-start" : "items-center", className), children: [
571
+ const room = useContext3(Room);
572
+ return /* @__PURE__ */ jsxs4("div", { className: cn2("grid min-h-11 py-1", ROW_GRID[room ?? "viewport"], top ? "items-start" : "items-center", className), children: [
550
573
  /* @__PURE__ */ jsxs4("div", { className: cn2("flex min-w-0 flex-col text-xs leading-tight text-muted-foreground", top && "pt-2.5"), children: [
551
- /* @__PURE__ */ jsx4("span", { className: "line-clamp-2 break-words sm:truncate", children: label }),
574
+ /* @__PURE__ */ jsx4("span", { className: room === "roomy" ? "truncate" : room === "compact" ? "line-clamp-2 break-words" : "line-clamp-2 break-words sm:truncate", children: label }),
552
575
  hint ? /* @__PURE__ */ jsx4("span", { className: "line-clamp-2 break-words text-xs text-disabled-foreground", children: hint }) : null
553
576
  ] }),
554
577
  /* @__PURE__ */ jsx4("div", { className: cn2("min-w-0 text-sm", top && "py-1.5"), children }),
@@ -589,14 +612,14 @@ function SecretRow({ port, item, field, extra }) {
589
612
  const confirmed = useConfirmed();
590
613
  const copyValue = useCopy();
591
614
  const secret = useTransientSecret();
592
- const [plain, setPlain] = useState4(null);
593
- const [busy, setBusy] = useState4(false);
594
- const [error, setError] = useState4(null);
615
+ const [plain, setPlain] = useState5(null);
616
+ const [busy, setBusy] = useState5(false);
617
+ const [error, setError] = useState5(null);
595
618
  const sealed = field.handling === "sealed";
596
619
  const visible = field.handling === "visible";
597
620
  const off = field.active === false;
598
621
  const canSee = !sealed && !off && (visible ? item.capabilities.canUse : item.capabilities.canReveal);
599
- useEffect4(() => {
622
+ useEffect5(() => {
600
623
  if (!visible || !canSee) return;
601
624
  let live = true;
602
625
  port.reveal(item, field.key).then(
@@ -684,7 +707,7 @@ function AddRow({ label, onAdd, children = "Add" }) {
684
707
  return /* @__PURE__ */ jsx5(Row, { label, children: onAdd ? /* @__PURE__ */ jsx5("button", { type: "button", className: "text-sm text-muted-foreground hover:text-primary", onClick: onAdd, children }) : /* @__PURE__ */ jsx5("span", { className: "text-disabled-foreground", children: "\u2014" }) });
685
708
  }
686
709
  function EditRow({ label, hint, value, onChange, placeholder, secret = false, multiline = false, onRemove, removeLabel, actions, autoFocus, onBlur, inputMode }) {
687
- const [shown, setShown] = useState4(false);
710
+ const [shown, setShown] = useState5(false);
688
711
  return /* @__PURE__ */ jsx5(
689
712
  Row,
690
713
  {
@@ -701,7 +724,7 @@ function EditRow({ label, hint, value, onChange, placeholder, secret = false, mu
701
724
  );
702
725
  }
703
726
  function CustomEditRow({ label, value, onLabel, onValue, secret, onRemove }) {
704
- const [shown, setShown] = useState4(false);
727
+ const [shown, setShown] = useState5(false);
705
728
  return /* @__PURE__ */ jsx5(
706
729
  Row,
707
730
  {
@@ -839,6 +862,10 @@ function rebaseDraft(oldBase, newBase, draft) {
839
862
  authenticator: draft.authenticator
840
863
  };
841
864
  }
865
+ function panesShown(mode, specialView, showingDetail) {
866
+ if (mode === "stack") return { list: !showingDetail, detail: showingDetail };
867
+ return { list: true, detail: !specialView };
868
+ }
842
869
 
843
870
  // src/definitions.ts
844
871
  var FAMILY_LABELS = {
@@ -925,9 +952,10 @@ function inferFromUrl(raw, definitions) {
925
952
  } catch {
926
953
  return null;
927
954
  }
928
- if (!url.hostname.includes(".")) return null;
955
+ const bare = url.hostname === "localhost" || /^\d{1,3}(\.\d{1,3}){3}$/.test(url.hostname) || url.hostname.startsWith("[");
956
+ if (!bare && !url.hostname.includes(".")) return null;
929
957
  const labels = url.hostname.replace(/^www\./, "").split(".");
930
- const brand = labels.length > 1 ? labels[labels.length - 2] ?? labels[0] ?? "" : labels[0] ?? "";
958
+ const brand = bare ? url.host : labels.length > 1 ? labels[labels.length - 2] ?? labels[0] ?? "" : labels[0] ?? "";
931
959
  const login = definitions.find((d) => d.key === "website_login") ?? definitions.find((d) => d.key === "username_password");
932
960
  const alternatives = definitions.filter((d) => d.providerKey !== null && d.providerKey.toLowerCase() === brand.toLowerCase()).map((d) => d.key);
933
961
  return {
@@ -1164,19 +1192,19 @@ var HistoryChangedError = class extends Error {
1164
1192
  };
1165
1193
 
1166
1194
  // src/activity/ActivityPanel.tsx
1167
- import { useEffect as useEffect5, useRef as useRef4, useState as useState5 } from "react";
1195
+ import { useEffect as useEffect6, useRef as useRef4, useState as useState6 } from "react";
1168
1196
  import { Button as Button3 } from "@ai-matrx/design-system/controls";
1169
1197
  import { cn as cn4 } from "@ai-matrx/design-system";
1170
1198
  import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
1171
1199
  var PAGE = 50;
1172
1200
  var MAX = 500;
1173
1201
  function ActivityPanel({ item, port, onClose }) {
1174
- const [limit, setLimit] = useState5(PAGE);
1175
- const [entries, setEntries] = useState5(null);
1176
- const [loading, setLoading] = useState5(true);
1177
- const [error, setError] = useState5(null);
1202
+ const [limit, setLimit] = useState6(PAGE);
1203
+ const [entries, setEntries] = useState6(null);
1204
+ const [loading, setLoading] = useState6(true);
1205
+ const [error, setError] = useState6(null);
1178
1206
  const generation = useRef4(0);
1179
- useEffect5(() => {
1207
+ useEffect6(() => {
1180
1208
  const g = ++generation.current;
1181
1209
  setLoading(true);
1182
1210
  setError(null);
@@ -1224,11 +1252,11 @@ var MASK2 = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\
1224
1252
  var messageOf = (e, fallback) => wasCancelled(e) ? null : e instanceof Error ? e.message : fallback;
1225
1253
  function HistoryPanel({ item, port, arg, onClose, onChanged }) {
1226
1254
  const eligible = historyEligible(item);
1227
- const [page, setPage] = useState6(null);
1228
- const [loading, setLoading] = useState6(eligible);
1229
- const [more, setMore] = useState6(false);
1230
- const [error, setError] = useState6(null);
1231
- const [notice, setNotice] = useState6(null);
1255
+ const [page, setPage] = useState7(null);
1256
+ const [loading, setLoading] = useState7(eligible);
1257
+ const [more, setMore] = useState7(false);
1258
+ const [error, setError] = useState7(null);
1259
+ const [notice, setNotice] = useState7(null);
1232
1260
  const generation = useRef5(0);
1233
1261
  const load = useCallback3(async () => {
1234
1262
  const g = ++generation.current;
@@ -1243,7 +1271,7 @@ function HistoryPanel({ item, port, arg, onClose, onChanged }) {
1243
1271
  if (generation.current === g) setLoading(false);
1244
1272
  }
1245
1273
  }, [port, item]);
1246
- useEffect6(() => {
1274
+ useEffect7(() => {
1247
1275
  if (!eligible) return;
1248
1276
  void load();
1249
1277
  return () => {
@@ -1300,7 +1328,7 @@ function HistoryRow({ item, port, page, entry, label, onRestored, onConflict, on
1300
1328
  const confirmed = useConfirmed();
1301
1329
  const secret = useTransientSecret();
1302
1330
  const copyValue = useCopy();
1303
- const [busy, setBusy] = useState6(false);
1331
+ const [busy, setBusy] = useState7(false);
1304
1332
  const when = formatDate(entry.recordedAt, true);
1305
1333
  async function read() {
1306
1334
  if (secret.value !== null) return secret.value;
@@ -1359,16 +1387,16 @@ function HistoryRow({ item, port, page, entry, label, onRestored, onConflict, on
1359
1387
  }
1360
1388
 
1361
1389
  // src/authenticator/AuthenticatorView.tsx
1362
- import { useEffect as useEffect10, useState as useState12 } from "react";
1390
+ import { useEffect as useEffect11, useState as useState13 } from "react";
1363
1391
  import { Button as Button9 } from "@ai-matrx/design-system/controls";
1364
1392
  import { cn as cn6, DropdownMenu as DropdownMenu2, DropdownMenuContent as DropdownMenuContent2, DropdownMenuItem as DropdownMenuItem2, DropdownMenuSeparator as DropdownMenuSeparator2, DropdownMenuTrigger as DropdownMenuTrigger2, TextInputDialog } from "@ai-matrx/design-system";
1365
1393
 
1366
1394
  // src/authenticator/AddOtpPanel.tsx
1367
- import { useState as useState11 } from "react";
1395
+ import { useState as useState12 } from "react";
1368
1396
  import { Button as Button8, Field as Field4, Select as Select2 } from "@ai-matrx/design-system/controls";
1369
1397
 
1370
1398
  // src/authenticator/CodeParts.tsx
1371
- import { useEffect as useEffect7, useRef as useRef6, useState as useState7 } from "react";
1399
+ import { useEffect as useEffect8, useRef as useRef6, useState as useState8 } from "react";
1372
1400
  import { Button as Button5 } from "@ai-matrx/design-system/controls";
1373
1401
  import { cn as cn5 } from "@ai-matrx/design-system";
1374
1402
 
@@ -1506,10 +1534,10 @@ function CountdownRing({ remaining, period, loading = false, className }) {
1506
1534
  ] });
1507
1535
  }
1508
1536
  function useCopied() {
1509
- const [copied, setCopied] = useState7(false);
1537
+ const [copied, setCopied] = useState8(false);
1510
1538
  const copyValue = useCopy();
1511
1539
  const t = useRef6(null);
1512
- useEffect7(() => () => void (t.current && clearTimeout(t.current)), []);
1540
+ useEffect8(() => () => void (t.current && clearTimeout(t.current)), []);
1513
1541
  return {
1514
1542
  copied,
1515
1543
  copy: async (code) => {
@@ -1546,7 +1574,7 @@ function CopyCodeButton({ live, label }) {
1546
1574
  }
1547
1575
 
1548
1576
  // src/authenticator/live-code.ts
1549
- import { useEffect as useEffect8, useRef as useRef7, useState as useState8, useSyncExternalStore } from "react";
1577
+ import { useEffect as useEffect9, useRef as useRef7, useState as useState9, useSyncExternalStore } from "react";
1550
1578
  var listeners = /* @__PURE__ */ new Set();
1551
1579
  var second = Math.floor(Date.now() / 1e3);
1552
1580
  var timer = null;
@@ -1583,13 +1611,13 @@ function useLiveCode(port, item, enabled) {
1583
1611
  const confirmed = useConfirmed();
1584
1612
  const now = useSecond();
1585
1613
  const period = item.authenticator?.period && item.authenticator.period > 0 ? item.authenticator.period : 30;
1586
- const [state, setState] = useState8(null);
1587
- const [error, setError] = useState8(null);
1588
- const [round, setRound] = useState8(0);
1614
+ const [state, setState] = useState9(null);
1615
+ const [error, setError] = useState9(null);
1616
+ const [round, setRound] = useState9(0);
1589
1617
  const inflight = useRef7(false);
1590
1618
  const latest = useRef7({ port, item, confirmed });
1591
1619
  latest.current = { port, item, confirmed };
1592
- useEffect8(() => {
1620
+ useEffect9(() => {
1593
1621
  if (!enabled) {
1594
1622
  setState(null);
1595
1623
  setError(null);
@@ -1613,7 +1641,7 @@ function useLiveCode(port, item, enabled) {
1613
1641
  };
1614
1642
  }, [enabled, item.id, round]);
1615
1643
  const remaining = state ? Math.max(0, state.expiresAt - now) : 0;
1616
- useEffect8(() => {
1644
+ useEffect9(() => {
1617
1645
  if (enabled && state && remaining <= 0 && !inflight.current && !error) setRound((n) => n + 1);
1618
1646
  }, [enabled, state, remaining, error]);
1619
1647
  return {
@@ -1630,7 +1658,7 @@ function useLiveCode(port, item, enabled) {
1630
1658
  }
1631
1659
 
1632
1660
  // src/authenticator/Setup.tsx
1633
- import { useEffect as useEffect9, useRef as useRef8, useState as useState9 } from "react";
1661
+ import { useEffect as useEffect10, useRef as useRef8, useState as useState10 } from "react";
1634
1662
  import { Button as Button6, Field as Field3 } from "@ai-matrx/design-system/controls";
1635
1663
 
1636
1664
  // src/authenticator/qr.ts
@@ -1686,8 +1714,8 @@ function imageFrom(data) {
1686
1714
  // src/authenticator/Setup.tsx
1687
1715
  import { Fragment as Fragment4, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
1688
1716
  function useCanScan() {
1689
- const [ok, setOk] = useState9(false);
1690
- useEffect9(() => {
1717
+ const [ok, setOk] = useState10(false);
1718
+ useEffect10(() => {
1691
1719
  let live = true;
1692
1720
  void canDecodeQrLocally().then((d) => live && setOk(d && hasCamera()));
1693
1721
  return () => {
@@ -1698,10 +1726,10 @@ function useCanScan() {
1698
1726
  }
1699
1727
  function QrScanPanel({ open, onResult, onClose }) {
1700
1728
  const video = useRef8(null);
1701
- const [error, setError] = useState9(null);
1729
+ const [error, setError] = useState10(null);
1702
1730
  const done = useRef8(onResult);
1703
1731
  done.current = onResult;
1704
- useEffect9(() => {
1732
+ useEffect10(() => {
1705
1733
  if (!open) return;
1706
1734
  let stream = null;
1707
1735
  let live = true;
@@ -1761,15 +1789,15 @@ function QrScanPanel({ open, onResult, onClose }) {
1761
1789
  function OtpSetupRow({ value, onChange, label = "One-time password", placeholder = "Setup key or otpauth link", disabled = false, autoFocus = false, onImage, onRecognized, status }) {
1762
1790
  const file = useRef8(null);
1763
1791
  const canScan = useCanScan();
1764
- const [scanning, setScanning] = useState9(false);
1765
- const [reading, setReading] = useState9(false);
1766
- const [imageError, setImageError] = useState9(null);
1767
- const [dragging, setDragging] = useState9(false);
1792
+ const [scanning, setScanning] = useState10(false);
1793
+ const [reading, setReading] = useState10(false);
1794
+ const [imageError, setImageError] = useState10(null);
1795
+ const [dragging, setDragging] = useState10(false);
1768
1796
  const { parsed, error } = tryParseEnrollment(value);
1769
1797
  const recognised = useRef8(onRecognized);
1770
1798
  recognised.current = onRecognized;
1771
1799
  const parsedKey = parsed ? `${parsed.issuer ?? ""}|${parsed.account ?? ""}|${parsed.raw.length}` : "";
1772
- useEffect9(() => {
1800
+ useEffect10(() => {
1773
1801
  if (parsed) recognised.current?.(parsed);
1774
1802
  }, [parsedKey]);
1775
1803
  const takeText = (text) => {
@@ -1879,7 +1907,7 @@ function OtpSetupRow({ value, onChange, label = "One-time password", placeholder
1879
1907
  }
1880
1908
 
1881
1909
  // src/authenticator/TotpRows.tsx
1882
- import { useState as useState10 } from "react";
1910
+ import { useState as useState11 } from "react";
1883
1911
  import { Button as Button7, Select } from "@ai-matrx/design-system/controls";
1884
1912
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@ai-matrx/design-system";
1885
1913
  import { confirm as confirm2 } from "@ai-matrx/kit/confirm-opener";
@@ -1901,10 +1929,10 @@ function otpActionError(e, what) {
1901
1929
  }
1902
1930
  function useOtpActions(port, item, onChanged) {
1903
1931
  const confirmed = useConfirmed();
1904
- const [busy, setBusy] = useState10(false);
1905
- const [error, setError] = useState10(null);
1906
- const [enabledNow, setEnabledNow] = useState10(null);
1907
- const [removed, setRemoved] = useState10(false);
1932
+ const [busy, setBusy] = useState11(false);
1933
+ const [error, setError] = useState11(null);
1934
+ const [enabledNow, setEnabledNow] = useState11(null);
1935
+ const [removed, setRemoved] = useState11(false);
1908
1936
  const enabled = enabledNow ?? item.authenticator?.enabled ?? false;
1909
1937
  const run = async (what, op) => {
1910
1938
  setBusy(true);
@@ -1986,7 +2014,7 @@ function TotpRow({ port, item, onChanged }) {
1986
2014
  }
1987
2015
  function TotpEditRow({ value, onChange, hasExisting, item, port, onEnrolled, onRecognized }) {
1988
2016
  const confirmed = useConfirmed();
1989
- const [status, setStatus] = useState10(null);
2017
+ const [status, setStatus] = useState11(null);
1990
2018
  const uploadImage = item && port ? async (file) => {
1991
2019
  setStatus("Adding from image\u2026");
1992
2020
  try {
@@ -2019,9 +2047,9 @@ var MFA_OPTIONS = [
2019
2047
  { value: "push_or_other", label: "Other method" }
2020
2048
  ];
2021
2049
  function TwoFactorMethodRow({ port, item, onChanged }) {
2022
- const [value, setValue] = useState10(mfaMethodOf(item));
2023
- const [busy, setBusy] = useState10(false);
2024
- const [error, setError] = useState10(null);
2050
+ const [value, setValue] = useState11(mfaMethodOf(item));
2051
+ const [busy, setBusy] = useState11(false);
2052
+ const [error, setError] = useState11(null);
2025
2053
  const canEdit = item.capabilities.canEdit || item.capabilities.canManage;
2026
2054
  return /* @__PURE__ */ jsx10(Row, { label: "Two-factor", hint: error ? /* @__PURE__ */ jsx10("span", { className: "text-destructive", children: error }) : void 0, children: /* @__PURE__ */ jsx10(
2027
2055
  Select,
@@ -2069,17 +2097,17 @@ function normalizeWebsite(raw) {
2069
2097
  function AddOtpPanel({ port, items, definitions, itemId = null, onClose, onChanged, onDone }) {
2070
2098
  const confirmed = useConfirmed();
2071
2099
  const candidates = items.filter((i) => !i.authenticator && !i.deletion && (i.capabilities.canEdit || i.capabilities.canManage)).sort((a, b) => a.name.localeCompare(b.name, void 0, { sensitivity: "base" }));
2072
- const [input, setInput] = useState11("");
2073
- const [image, setImage] = useState11(null);
2074
- const [target, setTarget] = useState11(itemId && candidates.some((c) => c.id === itemId) ? itemId : NEW);
2075
- const [targetChosen, setTargetChosen] = useState11(Boolean(itemId));
2076
- const [name, setName] = useState11("");
2077
- const [nameTouched, setNameTouched] = useState11(false);
2078
- const [website, setWebsite] = useState11("");
2079
- const [busy, setBusy] = useState11(false);
2080
- const [error, setError] = useState11(null);
2081
- const [created, setCreated] = useState11(null);
2082
- const [saved, setSaved] = useState11(null);
2100
+ const [input, setInput] = useState12("");
2101
+ const [image, setImage] = useState12(null);
2102
+ const [target, setTarget] = useState12(itemId && candidates.some((c) => c.id === itemId) ? itemId : NEW);
2103
+ const [targetChosen, setTargetChosen] = useState12(Boolean(itemId));
2104
+ const [name, setName] = useState12("");
2105
+ const [nameTouched, setNameTouched] = useState12(false);
2106
+ const [website, setWebsite] = useState12("");
2107
+ const [busy, setBusy] = useState12(false);
2108
+ const [error, setError] = useState12(null);
2109
+ const [created, setCreated] = useState12(null);
2110
+ const [saved, setSaved] = useState12(null);
2083
2111
  const { parsed } = tryParseEnrollment(input);
2084
2112
  const isNew = target === NEW;
2085
2113
  const websiteUrl = normalizeWebsite(website);
@@ -2224,13 +2252,13 @@ function otpGroups(items, entries, query, hidden = /* @__PURE__ */ new Set()) {
2224
2252
  return [...groups.entries()].sort(([a, x], [b, y]) => rank(a) - rank(b) || x.label.localeCompare(y.label)).map(([key, g]) => ({ key, ...g }));
2225
2253
  }
2226
2254
  function AuthenticatorView({ port, items, definitions, query, onOpen, onChanged, header }) {
2227
- const [entries, setEntries] = useState12(/* @__PURE__ */ new Map());
2228
- const [hidden, setHidden] = useState12(/* @__PURE__ */ new Set());
2229
- const [adding, setAdding] = useState12(false);
2230
- const [renaming, setRenaming] = useState12(null);
2231
- const [renameError, setRenameError] = useState12(null);
2232
- const [renameBusy, setRenameBusy] = useState12(false);
2233
- useEffect10(() => {
2255
+ const [entries, setEntries] = useState13(/* @__PURE__ */ new Map());
2256
+ const [hidden, setHidden] = useState13(/* @__PURE__ */ new Set());
2257
+ const [adding, setAdding] = useState13(false);
2258
+ const [renaming, setRenaming] = useState13(null);
2259
+ const [renameError, setRenameError] = useState13(null);
2260
+ const [renameBusy, setRenameBusy] = useState13(false);
2261
+ useEffect11(() => {
2234
2262
  let live = true;
2235
2263
  port.authenticator.list().then(
2236
2264
  (list) => live && setEntries(new Map(list.map((e) => [e.itemId, e]))),
@@ -2374,7 +2402,7 @@ function OtpListRow({ port, item, family, entry, onOpen, onRename, onChanged, on
2374
2402
  }
2375
2403
 
2376
2404
  // src/fields/SettingsPanels.tsx
2377
- import { useRef as useRef9, useState as useState13 } from "react";
2405
+ import { useRef as useRef9, useState as useState14 } from "react";
2378
2406
  import { Badge as Badge3, Button as Button10, DisclosureHeader, Field as Field5, SegmentedControl, Select as Select3, Switch } from "@ai-matrx/design-system/controls";
2379
2407
  import { confirm as confirm3 } from "@ai-matrx/kit/confirm-opener";
2380
2408
 
@@ -2459,8 +2487,8 @@ function withoutCode(codes, index) {
2459
2487
  import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
2460
2488
  var say = (e, fallback) => e instanceof Error && e.message ? e.message : fallback;
2461
2489
  function useSaver(onChanged) {
2462
- const [busy, setBusy] = useState13(null);
2463
- const [error, setError] = useState13(null);
2490
+ const [busy, setBusy] = useState14(null);
2491
+ const [error, setError] = useState14(null);
2464
2492
  const save = async (what, step) => {
2465
2493
  setBusy(what);
2466
2494
  setError(null);
@@ -2489,8 +2517,8 @@ function FieldSettingsPanel(props) {
2489
2517
  }
2490
2518
  function FieldSettings({ item, port, field, onClose, onChanged }) {
2491
2519
  const { busy, error, setError, save } = useSaver((next) => onChanged(next));
2492
- const [envDraft, setEnvDraft] = useState13(field.envKey ?? "");
2493
- const [descDraft, setDescDraft] = useState13(field.description);
2520
+ const [envDraft, setEnvDraft] = useState14(field.envKey ?? "");
2521
+ const [descDraft, setDescDraft] = useState14(field.description);
2494
2522
  const envRef = useRef9(null);
2495
2523
  const canEdit = item.capabilities.canEdit;
2496
2524
  const envProblem = envKeyProblem(envDraft);
@@ -2584,7 +2612,7 @@ function FieldSettings({ item, port, field, onClose, onChanged }) {
2584
2612
  function ItemSettingsPanel({ item, port, onClose, onChanged, onPanel }) {
2585
2613
  const { busy, error, save } = useSaver((next) => onChanged(next));
2586
2614
  const confirmed = useConfirmed();
2587
- const [advanced, setAdvanced] = useState13(false);
2615
+ const [advanced, setAdvanced] = useState14(false);
2588
2616
  const canEdit = item.capabilities.canEdit;
2589
2617
  const hasWebsite = item.loginUrls.length > 0;
2590
2618
  const promotable = canEdit ? promotableUrlFields(item) : [];
@@ -2655,7 +2683,7 @@ function ItemSettingsPanel({ item, port, onClose, onChanged, onPanel }) {
2655
2683
  }
2656
2684
 
2657
2685
  // src/generator/PasswordGenerator.tsx
2658
- import { createContext as createContext4, useContext as useContext4, useEffect as useEffect11, useRef as useRef10, useState as useState14 } from "react";
2686
+ import { createContext as createContext4, useContext as useContext4, useEffect as useEffect12, useRef as useRef10, useState as useState15 } from "react";
2659
2687
  import { Popover, PopoverContent, PopoverTrigger, cn as cn7 } from "@ai-matrx/design-system";
2660
2688
  import { Button as Button11, NumberStepper, SegmentedControl as SegmentedControl2, Select as Select4, Switch as Switch2 } from "@ai-matrx/design-system/controls";
2661
2689
 
@@ -2725,12 +2753,12 @@ function useGeneratorLimitsSource() {
2725
2753
  }
2726
2754
  var MASK3 = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
2727
2755
  function PasswordGenerator({ limits: source, onUse, useLabel = "Use" }) {
2728
- const [settings, setSettings] = useState14(DEFAULT_SETTINGS);
2729
- const [limits, setLimits] = useState14({ state: "loading" });
2730
- const [round, setRound] = useState14(0);
2731
- const [candidate, setCandidate] = useState14(null);
2732
- const [revealed, setRevealed] = useState14(false);
2733
- const [note, setNote] = useState14(null);
2756
+ const [settings, setSettings] = useState15(DEFAULT_SETTINGS);
2757
+ const [limits, setLimits] = useState15({ state: "loading" });
2758
+ const [round, setRound] = useState15(0);
2759
+ const [candidate, setCandidate] = useState15(null);
2760
+ const [revealed, setRevealed] = useState15(false);
2761
+ const [note, setNote] = useState15(null);
2734
2762
  const copyValue = useCopy();
2735
2763
  const expiry = useRef10(null);
2736
2764
  const drop = () => {
@@ -2757,7 +2785,7 @@ function PasswordGenerator({ limits: source, onUse, useLabel = "Use" }) {
2757
2785
  setNote({ tone: "muted", text: "Expired. Generate a new one." });
2758
2786
  }, GENERATED_VALUE_TTL_MS);
2759
2787
  };
2760
- useEffect11(() => {
2788
+ useEffect12(() => {
2761
2789
  let live = true;
2762
2790
  setLimits({ state: "loading" });
2763
2791
  source().then((raw) => {
@@ -2776,7 +2804,7 @@ function PasswordGenerator({ limits: source, onUse, useLabel = "Use" }) {
2776
2804
  live = false;
2777
2805
  };
2778
2806
  }, [source, round]);
2779
- useEffect11(() => () => {
2807
+ useEffect12(() => () => {
2780
2808
  if (expiry.current) clearTimeout(expiry.current);
2781
2809
  }, []);
2782
2810
  if (limits.state === "loading") return /* @__PURE__ */ jsx14("p", { className: "px-1 py-3 text-sm text-muted-foreground", "aria-live": "polite", children: "Reading limits\u2026" });
@@ -2862,7 +2890,7 @@ function OptionLine({ label, hint, children }) {
2862
2890
  function GenerateButton({ onUse, label, limits, disabled }) {
2863
2891
  const fromHost = useGeneratorLimitsSource();
2864
2892
  const source = limits ?? fromHost;
2865
- const [open, setOpen] = useState14(false);
2893
+ const [open, setOpen] = useState15(false);
2866
2894
  if (!source) return null;
2867
2895
  const name = label ?? "Generate password";
2868
2896
  return /* @__PURE__ */ jsxs14(Popover, { open, onOpenChange: setOpen, children: [
@@ -2903,7 +2931,7 @@ function importLimitsFrom(resolved) {
2903
2931
  }
2904
2932
 
2905
2933
  // src/io/BackupPanel.tsx
2906
- import { useEffect as useEffect12, useRef as useRef11, useState as useState16 } from "react";
2934
+ import { useEffect as useEffect13, useRef as useRef11, useState as useState17 } from "react";
2907
2935
  import { Button as Button13, Field as Field6, SegmentedControl as SegmentedControl3, Switch as Switch3 } from "@ai-matrx/design-system/controls";
2908
2936
  import { downloadFile } from "@ai-matrx/kit/download";
2909
2937
  import { confirm as confirm4 } from "@ai-matrx/kit/confirm-opener";
@@ -2996,7 +3024,7 @@ function startNewRestoreRun(preview) {
2996
3024
  }
2997
3025
 
2998
3026
  // src/io/lines.tsx
2999
- import { useState as useState15 } from "react";
3027
+ import { useState as useState16 } from "react";
3000
3028
  import { Checkbox } from "@ai-matrx/design-system";
3001
3029
  import { Badge as Badge4, Button as Button12, DisclosureHeader as DisclosureHeader2 } from "@ai-matrx/design-system/controls";
3002
3030
  import { Fragment as Fragment8, jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
@@ -3009,7 +3037,7 @@ function PickLine({ checked, onChange, disabled = false, title, detail, badge, t
3009
3037
  ] });
3010
3038
  }
3011
3039
  function Windowed({ items, size = 150, render }) {
3012
- const [all, setAll] = useState15(false);
3040
+ const [all, setAll] = useState16(false);
3013
3041
  const shown = all ? items : items.slice(0, size);
3014
3042
  return /* @__PURE__ */ jsxs15(Fragment8, { children: [
3015
3043
  shown.map(render),
@@ -3020,7 +3048,7 @@ function Windowed({ items, size = 150, render }) {
3020
3048
  ] });
3021
3049
  }
3022
3050
  function More({ title = "More", children }) {
3023
- const [open, setOpen] = useState15(false);
3051
+ const [open, setOpen] = useState16(false);
3024
3052
  return /* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-2", children: [
3025
3053
  /* @__PURE__ */ jsx15(DisclosureHeader2, { open, title, onClick: () => setOpen((o) => !o) }),
3026
3054
  open ? children : null
@@ -3061,19 +3089,19 @@ function BackupPanel({ port, items, onClose, onChanged }) {
3061
3089
  const confirmed = useConfirmed();
3062
3090
  const fileInput = useRef11(null);
3063
3091
  const abort = useRef11(null);
3064
- const [mode, setMode] = useState16("backup");
3065
- const [busy, setBusy] = useState16(false);
3066
- const [error, setError] = useState16(null);
3067
- const [passphrase, setPassphrase] = useState16("");
3068
- const [repeat, setRepeat] = useState16("");
3069
- const [accepted, setAccepted] = useState16(false);
3070
- const [selected, setSelected] = useState16(/* @__PURE__ */ new Set());
3071
- const [backup, setBackup] = useState16(null);
3072
- const [file, setFile] = useState16(null);
3073
- const [restorePreview, setRestorePreview] = useState16(null);
3074
- const [runId, setRunId] = useState16(null);
3075
- const [result, setResult] = useState16(null);
3076
- useEffect12(() => () => abort.current?.abort(), []);
3092
+ const [mode, setMode] = useState17("backup");
3093
+ const [busy, setBusy] = useState17(false);
3094
+ const [error, setError] = useState17(null);
3095
+ const [passphrase, setPassphrase] = useState17("");
3096
+ const [repeat, setRepeat] = useState17("");
3097
+ const [accepted, setAccepted] = useState17(false);
3098
+ const [selected, setSelected] = useState17(/* @__PURE__ */ new Set());
3099
+ const [backup, setBackup] = useState17(null);
3100
+ const [file, setFile] = useState17(null);
3101
+ const [restorePreview, setRestorePreview] = useState17(null);
3102
+ const [runId, setRunId] = useState17(null);
3103
+ const [result, setResult] = useState17(null);
3104
+ useEffect13(() => () => abort.current?.abort(), []);
3077
3105
  const switchMode = (next) => {
3078
3106
  abort.current?.abort();
3079
3107
  setMode(next);
@@ -3244,7 +3272,7 @@ function BackupPanel({ port, items, onClose, onChanged }) {
3244
3272
  }
3245
3273
 
3246
3274
  // src/io/ExportPanel.tsx
3247
- import { useMemo, useState as useState17 } from "react";
3275
+ import { useMemo, useState as useState18 } from "react";
3248
3276
  import { Button as Button14, Select as Select5 } from "@ai-matrx/design-system/controls";
3249
3277
  import { downloadFile as downloadFile2 } from "@ai-matrx/kit/download";
3250
3278
  import { confirm as confirm5 } from "@ai-matrx/kit/confirm-opener";
@@ -3269,11 +3297,11 @@ function omissionText2(omissions) {
3269
3297
  function ExportPanel({ port, items, onClose }) {
3270
3298
  const confirmed = useConfirmed();
3271
3299
  const logins = useMemo(() => items.filter((i) => i.definitionKey === WEBSITE_LOGIN), [items]);
3272
- const [profile, setProfile] = useState17("matrx_login_csv_v1");
3273
- const [selected, setSelected] = useState17(/* @__PURE__ */ new Set());
3274
- const [preview, setPreview] = useState17(null);
3275
- const [busy, setBusy] = useState17(false);
3276
- const [error, setError] = useState17(null);
3300
+ const [profile, setProfile] = useState18("matrx_login_csv_v1");
3301
+ const [selected, setSelected] = useState18(/* @__PURE__ */ new Set());
3302
+ const [preview, setPreview] = useState18(null);
3303
+ const [busy, setBusy] = useState18(false);
3304
+ const [error, setError] = useState18(null);
3277
3305
  const format = FORMATS.find((f) => f.value === profile);
3278
3306
  const reasons = new Map(preview?.items.map((p) => [p.item_id, p]) ?? []);
3279
3307
  const eligible = preview?.items.filter((p) => p.eligible).length ?? 0;
@@ -3398,7 +3426,7 @@ function ExportPanel({ port, items, onClose }) {
3398
3426
  }
3399
3427
 
3400
3428
  // src/io/ImportPanel.tsx
3401
- import { useEffect as useEffect13, useMemo as useMemo2, useRef as useRef12, useState as useState18 } from "react";
3429
+ import { useEffect as useEffect14, useMemo as useMemo2, useRef as useRef12, useState as useState19 } from "react";
3402
3430
  import { Button as Button15, Select as Select6, Switch as Switch4, Textarea as Textarea2 } from "@ai-matrx/design-system/controls";
3403
3431
 
3404
3432
  // src/io/csv-import.ts
@@ -4261,20 +4289,20 @@ function ImportPanel({ port, host, items, organizations, onClose, onChanged, lim
4261
4289
  const abort = useRef12(null);
4262
4290
  const stop = useRef12(false);
4263
4291
  const keys = useRef12(/* @__PURE__ */ new Map());
4264
- const [source, setSource] = useState18("auto");
4265
- const [envText, setEnvText] = useState18("");
4266
- const [injectSandbox, setInjectSandbox] = useState18(false);
4267
- const [fileName, setFileName] = useState18(null);
4268
- const [reading, setReading] = useState18(false);
4269
- const [draft, setDraft] = useState18(null);
4270
- const [destination, setDestination] = useState18(ME);
4271
- const [browserFill, setBrowserFill] = useState18(false);
4272
- const [approvedVisible, setApprovedVisible] = useState18(false);
4273
- const [selected, setSelected] = useState18(/* @__PURE__ */ new Set());
4274
- const [running, setRunning] = useState18(null);
4275
- const [done, setDone] = useState18(null);
4276
- const [error, setError] = useState18(null);
4277
- useEffect13(
4292
+ const [source, setSource] = useState19("auto");
4293
+ const [envText, setEnvText] = useState19("");
4294
+ const [injectSandbox, setInjectSandbox] = useState19(false);
4295
+ const [fileName, setFileName] = useState19(null);
4296
+ const [reading, setReading] = useState19(false);
4297
+ const [draft, setDraft] = useState19(null);
4298
+ const [destination, setDestination] = useState19(ME);
4299
+ const [browserFill, setBrowserFill] = useState19(false);
4300
+ const [approvedVisible, setApprovedVisible] = useState19(false);
4301
+ const [selected, setSelected] = useState19(/* @__PURE__ */ new Set());
4302
+ const [running, setRunning] = useState19(null);
4303
+ const [done, setDone] = useState19(null);
4304
+ const [error, setError] = useState19(null);
4305
+ useEffect14(
4278
4306
  () => () => {
4279
4307
  abort.current?.abort();
4280
4308
  stop.current = true;
@@ -4537,7 +4565,7 @@ function Notices({ draft }) {
4537
4565
  }
4538
4566
 
4539
4567
  // src/ItemList.tsx
4540
- import { useEffect as useEffect16, useRef as useRef15, useState as useState26 } from "react";
4568
+ import { useEffect as useEffect17, useRef as useRef15, useState as useState27 } from "react";
4541
4569
  import { DropdownMenu as DropdownMenu4, DropdownMenuContent as DropdownMenuContent4, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger as DropdownMenuTrigger4 } from "@ai-matrx/design-system";
4542
4570
  import { cn as cn13 } from "@ai-matrx/design-system";
4543
4571
  import { Button as Button22, SearchField } from "@ai-matrx/design-system/controls";
@@ -4557,14 +4585,14 @@ function ItemIcon({ definitionKey, family, site, size = "md", inverted = false }
4557
4585
  }
4558
4586
 
4559
4587
  // src/ItemPane.tsx
4560
- import { useEffect as useEffect15, useMemo as useMemo3, useRef as useRef14, useState as useState25 } from "react";
4588
+ import { useEffect as useEffect16, useMemo as useMemo3, useRef as useRef14, useState as useState26 } from "react";
4561
4589
  import { DropdownMenu as DropdownMenu3, DropdownMenuContent as DropdownMenuContent3, DropdownMenuItem as DropdownMenuItem3, DropdownMenuSeparator as DropdownMenuSeparator3, DropdownMenuTrigger as DropdownMenuTrigger3 } from "@ai-matrx/design-system";
4562
4590
  import { cn as cn12 } from "@ai-matrx/design-system";
4563
4591
  import { Badge as Badge7, Button as Button21, CONTROLS_CONTAINER_CLASS, OptionCombobox, Switch as Switch5 } from "@ai-matrx/design-system/controls";
4564
4592
  import { confirm as confirm9 } from "@ai-matrx/kit/confirm-opener";
4565
4593
 
4566
4594
  // src/activity/FilesSection.tsx
4567
- import { useRef as useRef13, useState as useState19 } from "react";
4595
+ import { useRef as useRef13, useState as useState20 } from "react";
4568
4596
  import { Badge as Badge5, Button as Button16, Field as Field7, SegmentedControl as SegmentedControl4 } from "@ai-matrx/design-system/controls";
4569
4597
  import { cn as cn9 } from "@ai-matrx/design-system";
4570
4598
  import { confirm as confirm6 } from "@ai-matrx/kit/confirm-opener";
@@ -4580,10 +4608,10 @@ var PROTECTION = [
4580
4608
  function FilesSection({ item, port, editing, onChanged }) {
4581
4609
  const confirmed = useConfirmed();
4582
4610
  const canEdit = editing && item.capabilities.canEdit;
4583
- const [busy, setBusy] = useState19(null);
4584
- const [error, setError] = useState19(null);
4585
- const [pending, setPending] = useState19(null);
4586
- const [dragging, setDragging] = useState19(false);
4611
+ const [busy, setBusy] = useState20(null);
4612
+ const [error, setError] = useState20(null);
4613
+ const [pending, setPending] = useState20(null);
4614
+ const [dragging, setDragging] = useState20(false);
4587
4615
  const picker = useRef13(null);
4588
4616
  if (!canEdit && item.attachments.length === 0) return null;
4589
4617
  async function run(key, work, fallback) {
@@ -4660,7 +4688,7 @@ function FilesSection({ item, port, editing, onChanged }) {
4660
4688
  );
4661
4689
  }
4662
4690
  function EditableFile({ port, item: it, file: a, busy: b, run: go, onDownload, onTooBig }) {
4663
- const [open, setOpen] = useState19(false);
4691
+ const [open, setOpen] = useState20(false);
4664
4692
  const replacer = useRef13(null);
4665
4693
  async function remove() {
4666
4694
  const yes = await confirm6({ title: `Delete ${a.label}?`, description: "The encrypted file is removed from this item.", confirmLabel: "Delete", variant: "destructive" });
@@ -4719,9 +4747,9 @@ function Protection({ value, locked, onChange }) {
4719
4747
  );
4720
4748
  }
4721
4749
  function NewFile({ file, busy, onAdd, onCancel }) {
4722
- const [label, setLabel] = useState19(file.name);
4723
- const [description, setDescription] = useState19("");
4724
- const [handling, setHandling] = useState19("revealable");
4750
+ const [label, setLabel] = useState20(file.name);
4751
+ const [description, setDescription] = useState20("");
4752
+ const [handling, setHandling] = useState20("revealable");
4725
4753
  async function add() {
4726
4754
  if (handling === "sealed" && !await confirmSeal(label)) return;
4727
4755
  await onAdd({ label: label.trim(), description: description.trim() || null, handling });
@@ -4741,10 +4769,10 @@ function NewFile({ file, busy, onAdd, onCancel }) {
4741
4769
  ] });
4742
4770
  }
4743
4771
  function FileDetailsRows({ file, busy, onSave, onCancel }) {
4744
- const [label, setLabel] = useState19(file.label);
4745
- const [description, setDescription] = useState19(file.description);
4746
- const [fileName, setFileName] = useState19(file.fileName);
4747
- const [handling, setHandling] = useState19(file.handling);
4772
+ const [label, setLabel] = useState20(file.label);
4773
+ const [description, setDescription] = useState20(file.description);
4774
+ const [fileName, setFileName] = useState20(file.fileName);
4775
+ const [handling, setHandling] = useState20(file.handling);
4748
4776
  const changed = label !== file.label || description !== file.description || fileName !== file.fileName || handling !== file.handling;
4749
4777
  async function save() {
4750
4778
  if (handling === "sealed" && file.handling !== "sealed" && !await confirmSeal(label)) return;
@@ -4771,7 +4799,7 @@ function confirmSeal(label) {
4771
4799
  }
4772
4800
 
4773
4801
  // src/fields/RecoveryCodesRow.tsx
4774
- import { useState as useState20 } from "react";
4802
+ import { useState as useState21 } from "react";
4775
4803
  import { Badge as Badge6, Button as Button17, Textarea as Textarea3 } from "@ai-matrx/design-system/controls";
4776
4804
  import { Fragment as Fragment13, jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
4777
4805
  var MASK4 = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
@@ -4780,9 +4808,9 @@ function RecoveryCodesRow({ item, field, port, onChanged }) {
4780
4808
  const confirmed = useConfirmed();
4781
4809
  const copyValue = useCopy();
4782
4810
  const secret = useTransientSecret();
4783
- const [busy, setBusy] = useState20(false);
4784
- const [error, setError] = useState20(null);
4785
- const [draft, setDraft] = useState20(null);
4811
+ const [busy, setBusy] = useState21(false);
4812
+ const [error, setError] = useState21(null);
4813
+ const [draft, setDraft] = useState21(null);
4786
4814
  const canEdit = item.capabilities.canEdit;
4787
4815
  const run = async (step) => {
4788
4816
  setBusy(true);
@@ -5017,7 +5045,7 @@ function targetLabel(t) {
5017
5045
  }
5018
5046
 
5019
5047
  // src/extension/UseOnSiteButton.tsx
5020
- import { useState as useState21 } from "react";
5048
+ import { useState as useState22 } from "react";
5021
5049
  import { Button as Button18 } from "@ai-matrx/design-system/controls";
5022
5050
  import { jsx as jsx22 } from "react/jsx-runtime";
5023
5051
  function canUseOnSite(item, pageUrl) {
@@ -5025,7 +5053,7 @@ function canUseOnSite(item, pageUrl) {
5025
5053
  }
5026
5054
  function UseOnSiteButton({ port, item, pageUrl, onChanged }) {
5027
5055
  const notify = useNotify();
5028
- const [busy, setBusy] = useState21(false);
5056
+ const [busy, setBusy] = useState22(false);
5029
5057
  if (!canUseOnSite(item, pageUrl)) return null;
5030
5058
  const site = pageSite(pageUrl);
5031
5059
  const run = async () => {
@@ -5044,7 +5072,7 @@ function UseOnSiteButton({ port, item, pageUrl, onChanged }) {
5044
5072
  }
5045
5073
 
5046
5074
  // src/sharing/SharePanel.tsx
5047
- import { useEffect as useEffect14, useState as useState24 } from "react";
5075
+ import { useEffect as useEffect15, useState as useState25 } from "react";
5048
5076
  import { confirm as confirm8 } from "@ai-matrx/kit/confirm-opener";
5049
5077
  import { Button as Button20, DisclosureHeader as DisclosureHeader3, Field as Field9, RegionSkeleton, Select as Select8 } from "@ai-matrx/design-system/controls";
5050
5078
  import { cn as cn11 } from "@ai-matrx/design-system";
@@ -5101,7 +5129,7 @@ function shareSummary(grants) {
5101
5129
  var MEMBER_CHOICE_DEFAULT = "default";
5102
5130
 
5103
5131
  // src/sharing/parts.tsx
5104
- import { useState as useState22 } from "react";
5132
+ import { useState as useState23 } from "react";
5105
5133
  import { cn as cn10 } from "@ai-matrx/design-system";
5106
5134
  import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
5107
5135
  var message = (e, fallback) => {
@@ -5110,9 +5138,9 @@ var message = (e, fallback) => {
5110
5138
  };
5111
5139
  function useAction() {
5112
5140
  const confirmed = useConfirmed();
5113
- const [busy, setBusy] = useState22(null);
5114
- const [error, setError] = useState22(null);
5115
- const [notice, setNotice] = useState22(null);
5141
+ const [busy, setBusy] = useState23(null);
5142
+ const [error, setError] = useState23(null);
5143
+ const [notice, setNotice] = useState23(null);
5116
5144
  async function run(key, fn, done) {
5117
5145
  setBusy(key);
5118
5146
  setError(null);
@@ -5146,7 +5174,7 @@ function StatusLine({ error, notice }) {
5146
5174
  }
5147
5175
 
5148
5176
  // src/sharing/MovePanel.tsx
5149
- import { useState as useState23 } from "react";
5177
+ import { useState as useState24 } from "react";
5150
5178
  import { confirm as confirm7 } from "@ai-matrx/kit/confirm-opener";
5151
5179
  import { Button as Button19, Field as Field8, Select as Select7 } from "@ai-matrx/design-system/controls";
5152
5180
  import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
@@ -5155,9 +5183,9 @@ function MovePanel({ item, port, organizations, onClose, onChanged }) {
5155
5183
  const { busy, error, notice, run, setNotice } = useAction();
5156
5184
  const moves = moveDestinations(item, organizations);
5157
5185
  const copies = copyDestinations(organizations, item);
5158
- const [moveTo, setMoveTo] = useState23("");
5159
- const [copyTo, setCopyTo] = useState23("");
5160
- const [email, setEmail] = useState23("");
5186
+ const [moveTo, setMoveTo] = useState24("");
5187
+ const [copyTo, setCopyTo] = useState24("");
5188
+ const [email, setEmail] = useState24("");
5161
5189
  const passkey = isPasskey(item);
5162
5190
  const canMove = item.capabilities.canManage && !passkey && moves.length > 0;
5163
5191
  const canGive = item.capabilities.canManage && item.owner.kind === "me" && !passkey;
@@ -5238,11 +5266,11 @@ function MovePanel({ item, port, organizations, onClose, onChanged }) {
5238
5266
  // src/sharing/SharePanel.tsx
5239
5267
  import { Fragment as Fragment14, jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
5240
5268
  function useGrants(port, item) {
5241
- const [grants, setGrants] = useState24(null);
5242
- const [loadError, setLoadError] = useState24(null);
5243
- const [nonce, setNonce] = useState24(0);
5269
+ const [grants, setGrants] = useState25(null);
5270
+ const [loadError, setLoadError] = useState25(null);
5271
+ const [nonce, setNonce] = useState25(0);
5244
5272
  const allowed = item.capabilities.canManage;
5245
- useEffect14(() => {
5273
+ useEffect15(() => {
5246
5274
  if (!allowed) return;
5247
5275
  let live = true;
5248
5276
  setLoadError(null);
@@ -5259,9 +5287,9 @@ function useGrants(port, item) {
5259
5287
  function SharePanel({ item, port, organizations, onClose, onChanged }) {
5260
5288
  const { grants, setGrants, loadError, reload } = useGrants(port, item);
5261
5289
  const { busy, error, notice, run } = useAction();
5262
- const [email, setEmail] = useState24("");
5263
- const [level, setLevel] = useState24("use");
5264
- const [more, setMore] = useState24(false);
5290
+ const [email, setEmail] = useState25("");
5291
+ const [level, setLevel] = useState25("use");
5292
+ const [more, setMore] = useState25(false);
5265
5293
  const isOrg = item.owner.kind === "organization" && item.owner.organizationId !== null;
5266
5294
  const orgName = item.owner.label;
5267
5295
  const people = (grants ?? []).filter((g) => g.kind === "person");
@@ -5383,8 +5411,8 @@ function SharePanel({ item, port, organizations, onClose, onChanged }) {
5383
5411
  function IntoOrganization({ item, port, organizations, grants, onShared }) {
5384
5412
  const { busy, error, notice, run } = useAction();
5385
5413
  const open = organizations.filter((o) => !grants.some((g) => g.organizationId === o.id));
5386
- const [target, setTarget] = useState24("");
5387
- const [level, setLevel] = useState24("use");
5414
+ const [target, setTarget] = useState25("");
5415
+ const [level, setLevel] = useState25("use");
5388
5416
  const chosen = open.find((o) => o.id === target);
5389
5417
  if (item.owner.kind !== "me") return null;
5390
5418
  return /* @__PURE__ */ jsx25(Section, { title: "Share into organization", children: open.length > 0 ? /* @__PURE__ */ jsxs23(Fragment14, { children: [
@@ -5419,10 +5447,10 @@ var CHOICES = [
5419
5447
  { value: "editor", label: "Can edit", meta: "See and change" }
5420
5448
  ];
5421
5449
  function MemberAccess({ port, organizationId, organizationName }) {
5422
- const [list, setList] = useState24(null);
5423
- const [loadError, setLoadError] = useState24(null);
5450
+ const [list, setList] = useState25(null);
5451
+ const [loadError, setLoadError] = useState25(null);
5424
5452
  const { busy, error, run } = useAction();
5425
- useEffect14(() => {
5453
+ useEffect15(() => {
5426
5454
  let live = true;
5427
5455
  port.sharing.memberAccess(organizationId).then(
5428
5456
  (l) => live && setList(l),
@@ -5454,9 +5482,9 @@ function MemberAccess({ port, organizationId, organizationName }) {
5454
5482
  ] });
5455
5483
  }
5456
5484
  function SharingSummary({ item, port, className }) {
5457
- const [text, setText] = useState24("");
5485
+ const [text, setText] = useState25("");
5458
5486
  const allowed = item.capabilities.canManage;
5459
- useEffect14(() => {
5487
+ useEffect15(() => {
5460
5488
  if (!allowed) return;
5461
5489
  let live = true;
5462
5490
  port.sharing.grants(item).then(
@@ -5481,7 +5509,7 @@ function ItemPane(props) {
5481
5509
  const editing = mode !== "view";
5482
5510
  const seedName = seed?.name ?? "";
5483
5511
  const seedUrl = seed?.url ?? "";
5484
- const [loaded, setLoaded] = useState25({});
5512
+ const [loaded, setLoaded] = useState26({});
5485
5513
  const base = useMemo3(() => {
5486
5514
  const b = draftOf(item);
5487
5515
  if (!item) {
@@ -5491,20 +5519,22 @@ function ItemPane(props) {
5491
5519
  b.values = { ...loaded };
5492
5520
  return b;
5493
5521
  }, [item, seedName, seedUrl, loaded]);
5494
- const [draft, setDraft] = useState25(base);
5495
- const [tagsText, setTagsText] = useState25(base.tags.join(", "));
5496
- const [showTags, setShowTags] = useState25(false);
5497
- const [showDescription, setShowDescription] = useState25(false);
5498
- const [owner, setOwner] = useState25(defaultOwner ?? "me");
5499
- const [recipient, setRecipient] = useState25("");
5500
- const [generatePrivately, setGeneratePrivately] = useState25(false);
5501
- const [busy, setBusy] = useState25(false);
5502
- const [error, setError] = useState25(null);
5503
- const [destinations, setDestinations] = useState25({});
5522
+ const [draft, setDraft] = useState26(base);
5523
+ const [tagsText, setTagsText] = useState26(base.tags.join(", "));
5524
+ const [showTags, setShowTags] = useState26(false);
5525
+ const [showDescription, setShowDescription] = useState26(false);
5526
+ const [owner, setOwner] = useState26(defaultOwner ?? "me");
5527
+ const [recipient, setRecipient] = useState26("");
5528
+ const [generatePrivately, setGeneratePrivately] = useState26(false);
5529
+ const [busy, setBusy] = useState26(false);
5530
+ const [error, setError] = useState26(null);
5531
+ const [destinations, setDestinations] = useState26({});
5504
5532
  const dirty = editing && isDirty(base, draft);
5505
5533
  const declared = definition?.fields ?? [];
5506
5534
  const prev = useRef14(null);
5507
- useEffect15(() => {
5535
+ const paneRef = useRef14(null);
5536
+ const room = useRoomOf(paneRef);
5537
+ useEffect16(() => {
5508
5538
  const was = prev.current;
5509
5539
  const id = item?.id ?? null;
5510
5540
  if (was && was.id === id && was.mode === mode && editing) {
@@ -5517,18 +5547,18 @@ function ItemPane(props) {
5517
5547
  }
5518
5548
  prev.current = { base, id, mode };
5519
5549
  }, [base, mode, item?.id, editing]);
5520
- useEffect15(() => {
5550
+ useEffect16(() => {
5521
5551
  setLoaded({});
5522
5552
  setShowTags(false);
5523
5553
  setShowDescription(false);
5524
5554
  }, [item?.id, mode]);
5525
- useEffect15(() => onDirty(dirty), [dirty, onDirty]);
5555
+ useEffect16(() => onDirty(dirty), [dirty, onDirty]);
5526
5556
  const keepKey = draftKey(item?.id ?? null, definition?.key ?? item?.definitionKey ?? null);
5527
- useEffect15(() => {
5557
+ useEffect16(() => {
5528
5558
  if (editing && dirty) keepDraft(keepKey, item?.updatedAt ?? "new", draft);
5529
5559
  else if (!editing) dropKeptDraft(keepKey);
5530
5560
  }, [editing, dirty, draft, keepKey, item?.updatedAt]);
5531
- useEffect15(() => {
5561
+ useEffect16(() => {
5532
5562
  if (!editing || !item) return;
5533
5563
  let live = true;
5534
5564
  for (const f of item.fields) {
@@ -5692,7 +5722,7 @@ function ItemPane(props) {
5692
5722
  ] }) : null
5693
5723
  ] });
5694
5724
  const filesProps = item ? { item, port, host, definition, organizations, arg: null, onClose: () => void 0, onChanged, onPanel } : null;
5695
- return /* @__PURE__ */ jsxs24("article", { "aria-label": item?.name ?? "New item", className: cn12(CONTROLS_CONTAINER_CLASS, "flex h-full min-h-0 flex-col bg-background"), children: [
5725
+ return /* @__PURE__ */ jsx26(RoomProvider, { value: room, children: /* @__PURE__ */ jsxs24("article", { ref: paneRef, "aria-label": item?.name ?? "New item", className: cn12(CONTROLS_CONTAINER_CLASS, "flex h-full min-h-0 flex-col bg-background"), children: [
5696
5726
  header,
5697
5727
  error ? /* @__PURE__ */ jsx26("div", { role: "alert", className: "border-b border-border bg-muted px-5 py-2 text-sm text-destructive", children: error }) : null,
5698
5728
  notice && !editing ? /* @__PURE__ */ jsx26("div", { role: "status", className: "border-b border-border bg-muted px-5 py-2 text-sm text-warning", children: notice }) : null,
@@ -5855,7 +5885,7 @@ function ItemPane(props) {
5855
5885
  formatDate(item.createdAt)
5856
5886
  ] })
5857
5887
  ] }) : null }) })
5858
- ] });
5888
+ ] }) });
5859
5889
  }
5860
5890
 
5861
5891
  // src/ItemList.tsx
@@ -5875,7 +5905,7 @@ function ItemList({ title, items, definitions, port, selectedId, onSelect, query
5875
5905
  const rest = matchingIds ? items.filter((i) => !matchingIds.has(i.id)) : items;
5876
5906
  const ordered = [...pinned, ...rest];
5877
5907
  const listRef = useRef15(null);
5878
- useEffect16(() => {
5908
+ useEffect17(() => {
5879
5909
  if (selectedId) listRef.current?.querySelector(`[data-item="${selectedId}"]`)?.scrollIntoView({ block: "nearest" });
5880
5910
  }, [selectedId, items.length]);
5881
5911
  const familyOf2 = (key) => definitions.find((d) => d.key === key)?.family ?? "generic";
@@ -5926,7 +5956,7 @@ function ListRow({ item, family, port, on, onSelect, withOwner }) {
5926
5956
  const confirmed = useConfirmed();
5927
5957
  const copy = useCopy();
5928
5958
  const notify = useNotify();
5929
- const [busy, setBusy] = useState26(false);
5959
+ const [busy, setBusy] = useState27(false);
5930
5960
  const user = item.fields.find((f) => USERNAME_KEYS.test(f.key) && f.handling !== "sealed");
5931
5961
  const secret = item.fields.find((f) => f.key === "password" && f.handling === "revealable");
5932
5962
  const quick = async (key, label) => {
@@ -5966,7 +5996,7 @@ function ListRow({ item, family, port, on, onSelect, withOwner }) {
5966
5996
  }
5967
5997
 
5968
5998
  // src/lists/TrashView.tsx
5969
- import { useState as useState28 } from "react";
5999
+ import { useState as useState29 } from "react";
5970
6000
  import { Button as Button24 } from "@ai-matrx/design-system/controls";
5971
6001
 
5972
6002
  // src/lists/logic.ts
@@ -6039,16 +6069,16 @@ function refusalText(reason) {
6039
6069
  }
6040
6070
 
6041
6071
  // src/lists/RestorePanel.tsx
6042
- import { useEffect as useEffect17, useState as useState27 } from "react";
6072
+ import { useEffect as useEffect18, useState as useState28 } from "react";
6043
6073
  import { Button as Button23 } from "@ai-matrx/design-system/controls";
6044
6074
  import { Fragment as Fragment16, jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
6045
6075
  var count = (n, one) => `${n} ${one}${n === 1 ? "" : "s"}`;
6046
6076
  function RestorePanel({ lists, item, restore, onClose }) {
6047
- const [preview, setPreview] = useState27(null);
6048
- const [error, setError] = useState27(null);
6049
- const [busy, setBusy] = useState27(false);
6050
- const [loading, setLoading] = useState27(Boolean(lists.preview));
6051
- useEffect17(() => {
6077
+ const [preview, setPreview] = useState28(null);
6078
+ const [error, setError] = useState28(null);
6079
+ const [busy, setBusy] = useState28(false);
6080
+ const [loading, setLoading] = useState28(Boolean(lists.preview));
6081
+ useEffect18(() => {
6052
6082
  if (!lists.preview) return;
6053
6083
  let live = true;
6054
6084
  lists.preview(item).then(
@@ -6108,10 +6138,10 @@ function RestorePanel({ lists, item, restore, onClose }) {
6108
6138
  import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
6109
6139
  function TrashView({ port, deleted, query, header, onChanged }) {
6110
6140
  const confirmed = useConfirmed();
6111
- const [busyId, setBusyId] = useState28(null);
6112
- const [message2, setMessage] = useState28(null);
6141
+ const [busyId, setBusyId] = useState29(null);
6142
+ const [message2, setMessage] = useState29(null);
6113
6143
  const shown = deleted.filter((i) => matchesQuery2(i, query));
6114
- const [restoring, setRestoring] = useState28(null);
6144
+ const [restoring, setRestoring] = useState29(null);
6115
6145
  const restore = async (item, deletionId) => {
6116
6146
  setBusyId(item.id);
6117
6147
  setMessage(null);
@@ -6146,12 +6176,12 @@ function TrashView({ port, deleted, query, header, onChanged }) {
6146
6176
  }
6147
6177
 
6148
6178
  // src/NewItemFlow.tsx
6149
- import { useMemo as useMemo4, useState as useState29 } from "react";
6179
+ import { useMemo as useMemo4, useState as useState30 } from "react";
6150
6180
  import { cn as cn14 } from "@ai-matrx/design-system";
6151
6181
  import { Button as Button25, Field as Field10, SearchField as SearchField2 } from "@ai-matrx/design-system/controls";
6152
6182
  import { jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
6153
6183
  function NewItemFlow({ definitions, url, onUrl, onChoose, onCancel }) {
6154
- const [search, setSearch] = useState29("");
6184
+ const [search, setSearch] = useState30("");
6155
6185
  const guess = useMemo4(() => inferFromUrl(url, definitions), [url, definitions]);
6156
6186
  const common = COMMON_DEFINITION_KEYS.map((k) => definitions.find((d) => d.key === k)).filter((d) => d !== void 0);
6157
6187
  const matches = useMemo4(() => {
@@ -6218,7 +6248,7 @@ function NewItemFlow({ definitions, url, onUrl, onChoose, onCancel }) {
6218
6248
  }
6219
6249
 
6220
6250
  // src/sharing/SecureLinkPanel.tsx
6221
- import { useEffect as useEffect18, useRef as useRef16, useState as useState30 } from "react";
6251
+ import { useEffect as useEffect19, useRef as useRef16, useState as useState31 } from "react";
6222
6252
  import { confirm as confirm10 } from "@ai-matrx/kit/confirm-opener";
6223
6253
  import { Checkbox as Checkbox2 } from "@ai-matrx/design-system";
6224
6254
  import { Badge as Badge8, Button as Button26, Field as Field11, RegionSkeleton as RegionSkeleton2, SegmentedControl as SegmentedControl5, Textarea as Textarea4 } from "@ai-matrx/design-system/controls";
@@ -6300,20 +6330,20 @@ import { jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
6300
6330
  function SecureLinkPanel({ item, port, onClose }) {
6301
6331
  const sharing = port.sharing;
6302
6332
  const { busy, error, notice, run, setNotice } = useAction();
6303
- const [remedy, setRemedy] = useState30(null);
6304
- const [options, setOptions] = useState30(null);
6305
- const [optionsError, setOptionsError] = useState30(null);
6306
- const [sent, setSent] = useState30(null);
6307
- const [sentError, setSentError] = useState30(null);
6308
- const [nonce, setNonce] = useState30(0);
6309
- const [email, setEmail] = useState30("");
6310
- const [phone, setPhone] = useState30("");
6311
- const [name, setName] = useState30("");
6312
- const [linkBy, setLinkBy] = useState30("email");
6313
- const [fields, setFields] = useState30([]);
6314
- const [note, setNote] = useState30("");
6315
- const [sameChannelSent, setSameChannelSent] = useState30(false);
6316
- useEffect18(() => {
6333
+ const [remedy, setRemedy] = useState31(null);
6334
+ const [options, setOptions] = useState31(null);
6335
+ const [optionsError, setOptionsError] = useState31(null);
6336
+ const [sent, setSent] = useState31(null);
6337
+ const [sentError, setSentError] = useState31(null);
6338
+ const [nonce, setNonce] = useState31(0);
6339
+ const [email, setEmail] = useState31("");
6340
+ const [phone, setPhone] = useState31("");
6341
+ const [name, setName] = useState31("");
6342
+ const [linkBy, setLinkBy] = useState31("email");
6343
+ const [fields, setFields] = useState31([]);
6344
+ const [note, setNote] = useState31("");
6345
+ const [sameChannelSent, setSameChannelSent] = useState31(false);
6346
+ useEffect19(() => {
6317
6347
  let live = true;
6318
6348
  setOptionsError(null);
6319
6349
  sharing.secureLinkOptions(item).then(
@@ -6328,7 +6358,7 @@ function SecureLinkPanel({ item, port, onClose }) {
6328
6358
  live = false;
6329
6359
  };
6330
6360
  }, [sharing, item]);
6331
- useEffect18(() => {
6361
+ useEffect19(() => {
6332
6362
  const list = sharing.sentSecureLinks;
6333
6363
  if (!list) return;
6334
6364
  let live = true;
@@ -6341,9 +6371,9 @@ function SecureLinkPanel({ item, port, onClose }) {
6341
6371
  live = false;
6342
6372
  };
6343
6373
  }, [sharing, item, nonce]);
6344
- const [phoneTyped, setPhoneTyped] = useState30(false);
6374
+ const [phoneTyped, setPhoneTyped] = useState31(false);
6345
6375
  const prefilled = useRef16(false);
6346
- useEffect18(() => {
6376
+ useEffect19(() => {
6347
6377
  const lookup = sharing.phoneOnFile;
6348
6378
  if (!lookup || phoneTyped) return;
6349
6379
  const clear = () => {
@@ -6497,7 +6527,7 @@ function sentMeta(row, options) {
6497
6527
  }
6498
6528
 
6499
6529
  // src/devices/DevicesPanel.tsx
6500
- import { useCallback as useCallback4, useEffect as useEffect19, useState as useState31 } from "react";
6530
+ import { useCallback as useCallback4, useEffect as useEffect20, useState as useState32 } from "react";
6501
6531
  import { confirm as confirm11 } from "@ai-matrx/kit/confirm-opener";
6502
6532
  import { Button as Button27, RegionSkeleton as RegionSkeleton3 } from "@ai-matrx/design-system/controls";
6503
6533
 
@@ -6587,9 +6617,9 @@ function ErrorLine2({ text }) {
6587
6617
  function DevicesPanel({ port, onClose }) {
6588
6618
  const confirmed = useConfirmed();
6589
6619
  const notify = useNotify();
6590
- const [devices, setDevices] = useState31(null);
6591
- const [error, setError] = useState31(null);
6592
- const [busyId, setBusyId] = useState31(null);
6620
+ const [devices, setDevices] = useState32(null);
6621
+ const [error, setError] = useState32(null);
6622
+ const [busyId, setBusyId] = useState32(null);
6593
6623
  const load = useCallback4(async () => {
6594
6624
  setError(null);
6595
6625
  try {
@@ -6598,7 +6628,7 @@ function DevicesPanel({ port, onClose }) {
6598
6628
  setError(messageOf3(e, "Your browsers could not be read."));
6599
6629
  }
6600
6630
  }, [port]);
6601
- useEffect19(() => {
6631
+ useEffect20(() => {
6602
6632
  void load();
6603
6633
  }, [load]);
6604
6634
  const revoke = async (device) => {
@@ -6656,10 +6686,10 @@ function ApprovePanel({ port, host, onClose, approvalKey, label, kind = "browser
6656
6686
  const where = isMac ? "the Mac app" : "the extension";
6657
6687
  const passkeys = port.devices.passkeys;
6658
6688
  const here = passkeys?.available() ?? false;
6659
- const [methods, setMethods] = useState31(null);
6660
- const [busy, setBusy] = useState31(null);
6661
- const [error, setError] = useState31(null);
6662
- const [approvedUntil, setApprovedUntil] = useState31(null);
6689
+ const [methods, setMethods] = useState32(null);
6690
+ const [busy, setBusy] = useState32(null);
6691
+ const [error, setError] = useState32(null);
6692
+ const [approvedUntil, setApprovedUntil] = useState32(null);
6663
6693
  const load = useCallback4(async () => {
6664
6694
  setError(null);
6665
6695
  try {
@@ -6668,7 +6698,7 @@ function ApprovePanel({ port, host, onClose, approvalKey, label, kind = "browser
6668
6698
  setError(messageOf3(e, "Your account could not be checked."));
6669
6699
  }
6670
6700
  }, [port]);
6671
- useEffect19(() => {
6701
+ useEffect20(() => {
6672
6702
  if (key && here) void load();
6673
6703
  }, [key, here, load]);
6674
6704
  const approve = async () => {
@@ -6756,7 +6786,7 @@ function ApprovePanel({ port, host, onClose, approvalKey, label, kind = "browser
6756
6786
  }
6757
6787
 
6758
6788
  // src/native/NativeImportPanel.tsx
6759
- import { useEffect as useEffect21, useMemo as useMemo5, useState as useState33 } from "react";
6789
+ import { useEffect as useEffect22, useMemo as useMemo5, useState as useState34 } from "react";
6760
6790
  import { confirm as confirm12 } from "@ai-matrx/kit/confirm-opener";
6761
6791
  import { Badge as Badge9, Button as Button28, Select as Select9 } from "@ai-matrx/design-system/controls";
6762
6792
 
@@ -6819,12 +6849,12 @@ async function loadFullPreview(bridge, operationId, current) {
6819
6849
  }
6820
6850
 
6821
6851
  // src/native/use-native-import.ts
6822
- import { useEffect as useEffect20, useRef as useRef17, useState as useState32 } from "react";
6852
+ import { useEffect as useEffect21, useRef as useRef17, useState as useState33 } from "react";
6823
6853
  var fail = (e, fallback) => e instanceof Error && e.message ? e.message : fallback;
6824
6854
  var RESTART = "Your account changed. The import was stopped; start it again.";
6825
6855
  function useNativeImport(bridge, stillAllowed, onImported) {
6826
- const [screen, setScreen] = useState32({ kind: "idle", message: null });
6827
- const [busy, setBusy] = useState32(false);
6856
+ const [screen, setScreen] = useState33({ kind: "idle", message: null });
6857
+ const [busy, setBusy] = useState33(false);
6828
6858
  const generation = useRef17(0);
6829
6859
  const mounted = useRef17(false);
6830
6860
  const op = useRef17(null);
@@ -7002,7 +7032,7 @@ function useNativeImport(bridge, stillAllowed, onImported) {
7002
7032
  };
7003
7033
  const invalidateRef = useRef17(invalidate);
7004
7034
  invalidateRef.current = invalidate;
7005
- useEffect20(() => {
7035
+ useEffect21(() => {
7006
7036
  mounted.current = true;
7007
7037
  const off = bridge.subscribe?.(() => {
7008
7038
  if (op.current) invalidateRef.current(RESTART);
@@ -7035,13 +7065,13 @@ function NativeImportPanel({ bridge, readLimits, activeOrganizationId, organizat
7035
7065
  }
7036
7066
  function Importer({ bridge, readLimits, activeOrganizationId, organizations, onClose, onChanged }) {
7037
7067
  const options = useMemo5(() => organizations.map((o) => ({ value: o.id, label: o.name })), [organizations]);
7038
- const [organizationId, setOrganizationId] = useState33(() => organizations.some((o) => o.id === activeOrganizationId) ? activeOrganizationId : organizations[0]?.id ?? "");
7039
- const [limits, setLimits] = useState33(null);
7040
- const [limitError, setLimitError] = useState33(null);
7068
+ const [organizationId, setOrganizationId] = useState34(() => organizations.some((o) => o.id === activeOrganizationId) ? activeOrganizationId : organizations[0]?.id ?? "");
7069
+ const [limits, setLimits] = useState34(null);
7070
+ const [limitError, setLimitError] = useState34(null);
7041
7071
  const flow = useNativeImport(bridge, (id) => organizations.some((o) => o.id === id), onChanged);
7042
7072
  const { screen, busy } = flow;
7043
7073
  const orgName = organizations.find((o) => o.id === organizationId)?.name ?? "this organization";
7044
- useEffect21(() => {
7074
+ useEffect22(() => {
7045
7075
  if (!readLimits || !organizationId) return;
7046
7076
  let live = true;
7047
7077
  setLimits(null);
@@ -7102,20 +7132,20 @@ function Importer({ bridge, readLimits, activeOrganizationId, organizations, onC
7102
7132
  }
7103
7133
 
7104
7134
  // src/extension/PageView.tsx
7105
- import { useState as useState37 } from "react";
7135
+ import { useState as useState38 } from "react";
7106
7136
  import { DropdownMenu as DropdownMenu5, DropdownMenuContent as DropdownMenuContent5, DropdownMenuItem as DropdownMenuItem4, DropdownMenuTrigger as DropdownMenuTrigger5 } from "@ai-matrx/design-system";
7107
7137
  import { Button as Button32 } from "@ai-matrx/design-system/controls";
7108
7138
 
7109
7139
  // src/extension/CaptureCard.tsx
7110
- import { useState as useState34, useSyncExternalStore as useSyncExternalStore2 } from "react";
7140
+ import { useState as useState35, useSyncExternalStore as useSyncExternalStore2 } from "react";
7111
7141
  import { Button as Button29, SearchField as SearchField3 } from "@ai-matrx/design-system/controls";
7112
7142
  import { Fragment as Fragment19, jsx as jsx34, jsxs as jsxs32 } from "react/jsx-runtime";
7113
7143
  var SEARCH_FROM = 4;
7114
7144
  function CaptureCard({ capture, onChanged }) {
7115
7145
  const prompt = useSyncExternalStore2(capture.subscribe, capture.get, capture.get);
7116
7146
  const notify = useNotify();
7117
- const [busy, setBusy] = useState34(false);
7118
- const [q, setQ] = useState34("");
7147
+ const [busy, setBusy] = useState35(false);
7148
+ const [q, setQ] = useState35("");
7119
7149
  if (!prompt) return null;
7120
7150
  const decide = async (d) => {
7121
7151
  setBusy(true);
@@ -7171,15 +7201,15 @@ function CaptureCard({ capture, onChanged }) {
7171
7201
  }
7172
7202
 
7173
7203
  // src/extension/FillSetupCard.tsx
7174
- import { useRef as useRef18, useState as useState35, useSyncExternalStore as useSyncExternalStore3 } from "react";
7204
+ import { useRef as useRef18, useState as useState36, useSyncExternalStore as useSyncExternalStore3 } from "react";
7175
7205
  import { Button as Button30, Field as Field12 } from "@ai-matrx/design-system/controls";
7176
7206
  import { jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
7177
7207
  function FillSetupCard({ fillSetup }) {
7178
7208
  const notify = useNotify();
7179
7209
  const state = useSyncExternalStore3(fillSetup.subscribe, fillSetup.get, fillSetup.get);
7180
7210
  const box = useRef18(null);
7181
- const [busy, setBusy] = useState35(false);
7182
- const [error, setError] = useState35(null);
7211
+ const [busy, setBusy] = useState36(false);
7212
+ const [error, setError] = useState36(null);
7183
7213
  if (state.status !== "off") return null;
7184
7214
  const finish = async (run) => {
7185
7215
  setBusy(true);
@@ -7244,7 +7274,7 @@ function FillSetupCard({ fillSetup }) {
7244
7274
  }
7245
7275
 
7246
7276
  // src/extension/PageGenerator.tsx
7247
- import { useState as useState36 } from "react";
7277
+ import { useState as useState37 } from "react";
7248
7278
  import { Popover as Popover2, PopoverContent as PopoverContent2, PopoverTrigger as PopoverTrigger2 } from "@ai-matrx/design-system";
7249
7279
  import { Button as Button31 } from "@ai-matrx/design-system/controls";
7250
7280
  import { Fragment as Fragment20, jsx as jsx36, jsxs as jsxs34 } from "react/jsx-runtime";
@@ -7253,10 +7283,10 @@ function PageGenerator({ fields }) {
7253
7283
  const limits = useGeneratorLimitsSource();
7254
7284
  const copy = useCopy();
7255
7285
  const held = useTransientSecret(HOLD_MS);
7256
- const [open, setOpen] = useState36(false);
7257
- const [busy, setBusy] = useState36(false);
7258
- const [targets, setTargets] = useState36([]);
7259
- const [said, setSaid] = useState36(null);
7286
+ const [open, setOpen] = useState37(false);
7287
+ const [busy, setBusy] = useState37(false);
7288
+ const [targets, setTargets] = useState37([]);
7289
+ const [said, setSaid] = useState37(null);
7260
7290
  if (!limits) return null;
7261
7291
  const say3 = setSaid;
7262
7292
  const put = async (targetId, value2) => {
@@ -7320,8 +7350,8 @@ function PageGenerator({ fields }) {
7320
7350
  // src/extension/PageView.tsx
7321
7351
  import { jsx as jsx37, jsxs as jsxs35 } from "react/jsx-runtime";
7322
7352
  function PageView({ port, page, fill, capture, fillSetup, newPasswordFields, items, definitions, onOpen, onNewForPage, onBrowse, onChanged, header }) {
7323
- const [running, setRunning] = useState37(null);
7324
- const [said, setSaid] = useState37(null);
7353
+ const [running, setRunning] = useState38(null);
7354
+ const [said, setSaid] = useState38(null);
7325
7355
  const site = pageSite(page.url);
7326
7356
  const state = page.matchState ?? { status: "ready" };
7327
7357
  const fillable = new Set(page.fillableItemIds ?? page.matchingItemIds);
@@ -7405,7 +7435,7 @@ function MatchRow({ itemId, item, tag, family, port, busy, running, onOpen, onFi
7405
7435
  const confirmed = useConfirmed();
7406
7436
  const copy = useCopy();
7407
7437
  const notify = useNotify();
7408
- const [reading, setReading] = useState37(false);
7438
+ const [reading, setReading] = useState38(false);
7409
7439
  const usable = item?.capabilities.canUse ?? false;
7410
7440
  const user = usable ? item?.fields.find((f) => USERNAME_KEYS.test(f.key) && f.handling !== "sealed" && f.active) : void 0;
7411
7441
  const secret = usable && item?.capabilities.canReveal ? item?.fields.find((f) => f.key === "password" && f.handling === "revealable" && f.active) : void 0;
@@ -7450,7 +7480,7 @@ function MatchRow({ itemId, item, tag, family, port, busy, running, onOpen, onFi
7450
7480
  }
7451
7481
 
7452
7482
  // src/Sidebar.tsx
7453
- import { useState as useState38 } from "react";
7483
+ import { useState as useState39 } from "react";
7454
7484
  import { cn as cn15 } from "@ai-matrx/design-system";
7455
7485
  import { Select as Select10 } from "@ai-matrx/design-system/controls";
7456
7486
  import { jsx as jsx38, jsxs as jsxs36 } from "react/jsx-runtime";
@@ -7533,7 +7563,7 @@ function Group({ title, children }) {
7533
7563
  ] });
7534
7564
  }
7535
7565
  function Sidebar({ vault, choices, onVault, view, allCount, deletedCount, views, hasFavorites, hasRecents, onView, onPanel, nativeProvider, hasNativeImport = false, hasPage = false }) {
7536
- const [tagsOpen, setTagsOpen] = useState38(view.startsWith("tag:"));
7566
+ const [tagsOpen, setTagsOpen] = useState39(view.startsWith("tag:"));
7537
7567
  return /* @__PURE__ */ jsxs36("nav", { "aria-label": "Vault", className: "flex h-full min-h-0 flex-col border-r border-sidebar-border bg-sidebar-background text-sidebar-foreground", children: [
7538
7568
  /* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2 px-3 pb-2 pt-3", children: [
7539
7569
  /* @__PURE__ */ jsx38(SafeGlyph, { className: "size-5 shrink-0 text-primary" }),
@@ -7575,7 +7605,7 @@ function Sidebar({ vault, choices, onVault, view, allCount, deletedCount, views,
7575
7605
 
7576
7606
  // src/VaultApp.tsx
7577
7607
  import { jsx as jsx39, jsxs as jsxs37 } from "react/jsx-runtime";
7578
- var FULL_AT = 960;
7608
+ var FULL_AT = 1120;
7579
7609
  var SPLIT_AT = 640;
7580
7610
  var NO_HOST = {};
7581
7611
  var ITEM_PANELS = {
@@ -7593,8 +7623,8 @@ var generatorLimitsFrom = (knobs) => knobs ? async () => {
7593
7623
  } : void 0;
7594
7624
  function ImportWithLimits(props) {
7595
7625
  const { knobs, ...rest } = props;
7596
- const [state, setState] = useState39(null);
7597
- useEffect22(() => {
7626
+ const [state, setState] = useState40(null);
7627
+ useEffect23(() => {
7598
7628
  if (!knobs) return setState({ error: "Import is not set up for this organization yet." });
7599
7629
  knobs().then(
7600
7630
  (r) => {
@@ -7618,16 +7648,16 @@ function Workspace({ port, host = NO_HOST, layout = "auto", location, onLocation
7618
7648
  const width = useElementWidth(rootRef);
7619
7649
  const mode = layout !== "auto" ? layout : width >= FULL_AT ? "full" : width >= SPLIT_AT ? "split" : "stack";
7620
7650
  const notify = useNotify();
7621
- const [snap, setSnap] = useState39(null);
7622
- const [items, setItems] = useState39([]);
7623
- const [deleted, setDeleted] = useState39([]);
7624
- const [favorites, setFavorites] = useState39(null);
7625
- const [recents, setRecents] = useState39(null);
7626
- const [error, setError] = useState39(null);
7627
- const [inner, setInner] = useState39(DEFAULT_LOCATION);
7651
+ const [snap, setSnap] = useState40(null);
7652
+ const [items, setItems] = useState40([]);
7653
+ const [deleted, setDeleted] = useState40([]);
7654
+ const [favorites, setFavorites] = useState40(null);
7655
+ const [recents, setRecents] = useState40(null);
7656
+ const [error, setError] = useState40(null);
7657
+ const [inner, setInner] = useState40(DEFAULT_LOCATION);
7628
7658
  const loc = location ?? inner;
7629
7659
  const dirty = useRef19(false);
7630
- const [notice, setNotice] = useState39(null);
7660
+ const [notice, setNotice] = useState40(null);
7631
7661
  const move = useCallback5(
7632
7662
  (next, how) => {
7633
7663
  if (!location) setInner(next);
@@ -7671,8 +7701,8 @@ function Workspace({ port, host = NO_HOST, layout = "auto", location, onLocation
7671
7701
  knobsRef.current?.().catch(() => void 0);
7672
7702
  port.lists.recents?.list().then(setRecents, () => void 0);
7673
7703
  }, [port]);
7674
- useEffect22(load, [load]);
7675
- useEffect22(() => {
7704
+ useEffect23(load, [load]);
7705
+ useEffect23(() => {
7676
7706
  if (!loc.itemId || !port.lists.recents) return;
7677
7707
  const id = loc.itemId;
7678
7708
  port.lists.recents.record(id).then(() => setRecents((r) => [id, ...(r ?? []).filter((x) => x !== id)]), () => void 0);
@@ -7932,7 +7962,7 @@ function Workspace({ port, host = NO_HOST, layout = "auto", location, onLocation
7932
7962
  );
7933
7963
  }
7934
7964
  const grid = mode === "full" ? "grid-cols-[15rem_21rem_minmax(0,1fr)]" : mode === "split" ? "grid-cols-[19rem_minmax(0,1fr)]" : "grid-cols-1";
7935
- const detailHere = specialView ? false : true;
7965
+ const shown = panesShown(mode, specialView !== null, showingDetail);
7936
7966
  return /* @__PURE__ */ jsxs37("div", { ref: rootRef, className: "flex h-full min-h-0 w-full flex-col bg-background text-foreground", children: [
7937
7967
  snap.unavailable.length > 0 ? /* @__PURE__ */ jsxs37("div", { role: "status", className: "flex items-center gap-3 border-b border-border bg-muted px-4 py-2 text-sm", children: [
7938
7968
  /* @__PURE__ */ jsxs37("span", { className: "min-w-0 flex-1 truncate text-warning", children: [
@@ -7962,8 +7992,8 @@ function Workspace({ port, host = NO_HOST, layout = "auto", location, onLocation
7962
7992
  hasPage: host.page !== void 0
7963
7993
  }
7964
7994
  ) : null,
7965
- mode === "stack" && showingDetail ? null : /* @__PURE__ */ jsx39("div", { className: specialView && mode !== "stack" ? "col-span-2 min-h-0" : "min-h-0", children: list }),
7966
- detailHere ? mode === "stack" ? showingDetail ? detail : null : detail : null,
7995
+ shown.list ? /* @__PURE__ */ jsx39("div", { className: specialView && mode !== "stack" ? "col-span-2 min-h-0" : "min-h-0", children: list }) : null,
7996
+ shown.detail ? detail : null,
7967
7997
  panel
7968
7998
  ] })
7969
7999
  ] });
@@ -8720,6 +8750,9 @@ function createApiVaultPort(api, options = {}) {
8720
8750
  provider_key: definition.providerKey,
8721
8751
  tags: draft.tags,
8722
8752
  login_urls: draft.loginUrls,
8753
+ // A login a person saves with its website is offered on that website (the server's own
8754
+ // default is off, which made "Save a login" on a page answer "No saved login" there).
8755
+ ...draft.loginUrls.length > 0 ? { browser_fill_enabled: true } : {},
8723
8756
  notes: draft.notes || null,
8724
8757
  principal: organizationId ? { type: "organization", organization_id: organizationId } : { type: "user" },
8725
8758
  initiation: "user",