@adecore/agents-react 0.41.1 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/chat/actions.js +4 -0
  2. package/dist/chat/logic/lightbox.d.ts +31 -0
  3. package/dist/chat/logic/lightbox.js +61 -0
  4. package/dist/chat/logic/timeline.d.ts +1 -0
  5. package/dist/chat/logic/timeline.js +3 -0
  6. package/dist/chat/ui/AnsiOutput.d.ts +3 -2
  7. package/dist/chat/ui/AnsiOutput.js +26 -22
  8. package/dist/chat/ui/ImageView.d.ts +3 -0
  9. package/dist/chat/ui/ImageView.js +761 -437
  10. package/dist/chat/ui/intelligent-ui/renderers/content.js +4 -2
  11. package/dist/chat/ui/rows/MessageRows.js +10 -8
  12. package/dist/chat/ui/rows/Rows.js +42 -39
  13. package/dist/chat/ui/rows/WorkRows.d.ts +4 -2
  14. package/dist/chat/ui/rows/WorkRows.js +580 -211
  15. package/dist/chat/ui/rows/WorkflowRow.js +43 -41
  16. package/dist/host.d.ts +1 -0
  17. package/dist/locales/en/agent-chat.d.ts +9 -0
  18. package/dist/locales/en/agent-chat.js +11 -2
  19. package/dist/locales/nl/agent-chat.d.ts +9 -0
  20. package/dist/locales/nl/agent-chat.js +11 -2
  21. package/package.json +8 -8
  22. package/src/chat/actions.ts +1 -0
  23. package/src/chat/logic/lightbox.ts +88 -0
  24. package/src/chat/logic/timeline.ts +13 -2
  25. package/src/chat/ui/AnsiOutput.tsx +13 -2
  26. package/src/chat/ui/ImageView.tsx +255 -63
  27. package/src/chat/ui/intelligent-ui/renderers/content.tsx +4 -2
  28. package/src/chat/ui/rows/MessageRows.tsx +10 -8
  29. package/src/chat/ui/rows/Rows.tsx +9 -1
  30. package/src/chat/ui/rows/WorkRows.tsx +127 -27
  31. package/src/chat/ui/rows/WorkflowRow.tsx +1 -1
  32. package/src/host.ts +2 -0
  33. package/src/locales/en/agent-chat.ts +11 -2
  34. package/src/locales/nl/agent-chat.ts +11 -2
@@ -1,480 +1,763 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useRef, useState } from 'react';
2
+ import { createContext, useContext, useId, useLayoutEffect, useRef, useState, useSyncExternalStore } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import clsx from 'clsx';
5
- import { ImageOff, Minus, Plus, RotateCcw } from 'lucide-react';
5
+ import { ChevronLeft, ChevronRight, ImageOff, Minus, Plus, RotateCcw } from 'lucide-react';
6
6
  import { ButtonGroup, CloseButton, Dialog, Icon, IconButton, Tooltip } from '@adecore/ui';
7
+ import { formatNumber } from '@adecore/ui/format';
8
+ import { BUTTON_STEP, clamped, MAX_SCALE, MIN_SCALE, START, stepped, wheeled, zoomed } from '../logic/lightbox.js';
7
9
  import { DisplayImage } from './DisplayImage.js';
10
+ /* The pictures of one group in the order they stand on the page, which is the order the arrows walk. */
8
11
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
9
- const MIN_SCALE = 1;
10
- const MAX_SCALE = 8;
11
- // One wheel notch, small enough that a trackpad flick does not jump past the detail it aimed at.
12
- const WHEEL_STEP = 1.0015;
13
- const BUTTON_STEP = 1.5;
14
- const START = {
15
- scale: 1,
16
- x: 0,
17
- y: 0
18
- };
12
+ function createImageGroupStore() {
13
+ const images = new Map();
14
+ const listeners = new Set();
15
+ let snapshot = [];
16
+ const changed = () => {
17
+ snapshot = [...images.values()].sort((a, b) => {
18
+ if (a.element === null || b.element === null) {
19
+ return 0;
20
+ }
21
+ return a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
22
+ });
23
+ for (const listener of listeners) {
24
+ listener();
25
+ }
26
+ };
27
+ return {
28
+ set(image) {
29
+ const current = images.get(image.key);
30
+ if (current?.src === image.src && current.alt === image.alt && current.element === image.element) {
31
+ return;
32
+ }
33
+ images.set(image.key, image);
34
+ changed();
35
+ },
36
+ remove(key) {
37
+ if (images.delete(key)) {
38
+ changed();
39
+ }
40
+ },
41
+ subscribe(listener) {
42
+ listeners.add(listener);
43
+ return () => {
44
+ listeners.delete(listener);
45
+ };
46
+ },
47
+ snapshot: () => snapshot
48
+ };
49
+ }
50
+ const ImageGroupContext = createContext(null);
19
51
  /*
20
- * Zooms around a point, which is what makes a wheel over a detail feel like a magnifier instead of
21
- * a slider. The pixel under the pointer stays where it is while everything else moves away from it.
22
- * `x` and `y` are offsets from the middle of the frame, so a scale of 1 is always centered.
52
+ * Thumbnails inside open one lightbox together, where the arrow keys walk from one to the next.
53
+ * A thumbnail with actions of its own, or one its caller opens from a control, stays on its own.
23
54
  */
24
- function zoomed(view, factor, pointX, pointY) {
25
- const scale = Math.min(MAX_SCALE, Math.max(MIN_SCALE, view.scale * factor));
26
- if (scale === MIN_SCALE) {
27
- return START;
55
+ export function ImageGroup(t0) {
56
+ const $ = _c(17);
57
+ const {
58
+ children
59
+ } = t0;
60
+ const [store] = useState(createImageGroupStore);
61
+ const images = useSyncExternalStore(store.subscribe, store.snapshot, store.snapshot);
62
+ let t1;
63
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
64
+ t1 = {
65
+ key: null,
66
+ open: false
67
+ };
68
+ $[0] = t1;
69
+ } else {
70
+ t1 = $[0];
71
+ }
72
+ const [shown, setShown] = useState(t1);
73
+ let t2;
74
+ if ($[1] !== images || $[2] !== shown) {
75
+ let t3;
76
+ if ($[4] !== shown) {
77
+ t3 = image => image.key === shown.key;
78
+ $[4] = shown;
79
+ $[5] = t3;
80
+ } else {
81
+ t3 = $[5];
82
+ }
83
+ t2 = images.findIndex(t3);
84
+ $[1] = images;
85
+ $[2] = shown;
86
+ $[3] = t2;
87
+ } else {
88
+ t2 = $[3];
89
+ }
90
+ const index = t2;
91
+ let t3;
92
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
93
+ t3 = key => setShown({
94
+ key,
95
+ open: true
96
+ });
97
+ $[6] = t3;
98
+ } else {
99
+ t3 = $[6];
100
+ }
101
+ let t4;
102
+ if ($[7] !== store) {
103
+ t4 = {
104
+ store,
105
+ open: t3
106
+ };
107
+ $[7] = store;
108
+ $[8] = t4;
109
+ } else {
110
+ t4 = $[8];
111
+ }
112
+ let t5;
113
+ if ($[9] !== images || $[10] !== index || $[11] !== shown) {
114
+ t5 = index !== -1 && /*#__PURE__*/_jsx(Lightbox, {
115
+ images: images,
116
+ index: index,
117
+ open: shown.open,
118
+ onOpenChange: open => setShown(current => ({
119
+ ...current,
120
+ open
121
+ })),
122
+ onIndexChange: next => setShown({
123
+ key: images[next]?.key ?? null,
124
+ open: true
125
+ })
126
+ });
127
+ $[9] = images;
128
+ $[10] = index;
129
+ $[11] = shown;
130
+ $[12] = t5;
131
+ } else {
132
+ t5 = $[12];
133
+ }
134
+ let t6;
135
+ if ($[13] !== children || $[14] !== t4 || $[15] !== t5) {
136
+ t6 = /*#__PURE__*/_jsxs(ImageGroupContext, {
137
+ value: t4,
138
+ children: [children, t5]
139
+ });
140
+ $[13] = children;
141
+ $[14] = t4;
142
+ $[15] = t5;
143
+ $[16] = t6;
144
+ } else {
145
+ t6 = $[16];
28
146
  }
29
- const ratio = scale / view.scale;
147
+ return t6;
148
+ }
149
+ /* A press on an arrow or a zoom button is the button's, never the start of a pan or a zoom of the stage. */
150
+ function onControl(target) {
151
+ return target instanceof Element && target.closest('button') !== null;
152
+ }
153
+ /* Where the pointer sits against the middle of the stage, which is what the transform counts from. */
154
+ function pointIn(stage, event) {
155
+ const rect = stage.getBoundingClientRect();
30
156
  return {
31
- scale,
32
- x: pointX - (pointX - view.x) * ratio,
33
- y: pointY - (pointY - view.y) * ratio
157
+ x: event.clientX - rect.left - rect.width / 2,
158
+ y: event.clientY - rect.top - rect.height / 2
159
+ };
160
+ }
161
+ function boundsOf(stage) {
162
+ const picture = stage.querySelector('img');
163
+ return {
164
+ image: {
165
+ width: picture?.offsetWidth ?? 0,
166
+ height: picture?.offsetHeight ?? 0
167
+ },
168
+ frame: {
169
+ width: stage.clientWidth,
170
+ height: stage.clientHeight
171
+ }
34
172
  };
35
173
  }
36
- /* An image on its own, large: the wheel and the buttons zoom, dragging pans, Escape closes. */
174
+ /* Pictures large and on their own: a pinch zooms, two fingers pan, the arrow keys walk the group, Escape closes. */
37
175
  function Lightbox(t0) {
38
- const $ = _c(83);
176
+ const $ = _c(112);
39
177
  const {
40
- src,
41
- alt,
178
+ images,
179
+ index,
42
180
  open,
43
181
  onOpenChange,
182
+ onIndexChange,
44
183
  actions
45
184
  } = t0;
46
185
  const {
47
186
  t
48
187
  } = useTranslation("agent-chat");
49
188
  const [view, setView] = useState(START);
189
+ const [viewed, setViewed] = useState(index);
190
+ const stageElementRef = useRef(null);
191
+ const dragRef = useRef(null);
192
+ const movedRef = useRef(false);
193
+ const image = images[index];
50
194
  let t1;
51
- if ($[0] !== alt) {
52
- t1 = alt.slice(alt.lastIndexOf("/") + 1);
53
- $[0] = alt;
54
- $[1] = t1;
195
+ if ($[0] !== images.length || $[1] !== index) {
196
+ t1 = stepped(index, images.length, -1);
197
+ $[0] = images.length;
198
+ $[1] = index;
199
+ $[2] = t1;
55
200
  } else {
56
- t1 = $[1];
201
+ t1 = $[2];
57
202
  }
58
- const name = t1;
203
+ const previous = t1;
59
204
  let t2;
60
- if ($[2] !== name) {
61
- t2 = /*#__PURE__*/_jsx("span", {
62
- className: "min-w-0 truncate text-xs text-text",
63
- children: name
64
- });
65
- $[2] = name;
66
- $[3] = t2;
205
+ if ($[3] !== images.length || $[4] !== index) {
206
+ t2 = stepped(index, images.length, 1);
207
+ $[3] = images.length;
208
+ $[4] = index;
209
+ $[5] = t2;
67
210
  } else {
68
- t2 = $[3];
211
+ t2 = $[5];
212
+ }
213
+ const next = t2;
214
+ if (viewed !== index) {
215
+ setViewed(index);
216
+ setView(START);
69
217
  }
70
- const title = t2;
71
- const frameRef = useRef(null);
72
- const dragRef = useRef(null);
73
218
  if (!open && view !== START) {
74
219
  setView(START);
75
220
  }
221
+ if (image === undefined) {
222
+ return null;
223
+ }
76
224
  let t3;
77
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
78
- t3 = event => {
79
- const rect = frameRef.current?.getBoundingClientRect();
80
- if (!rect) {
81
- return {
82
- x: 0,
83
- y: 0
84
- };
85
- }
86
- return {
87
- x: event.clientX - rect.left - rect.width / 2,
88
- y: event.clientY - rect.top - rect.height / 2
89
- };
90
- };
91
- $[4] = t3;
225
+ if ($[6] !== image.alt) {
226
+ t3 = image.alt.slice(image.alt.lastIndexOf("/") + 1);
227
+ $[6] = image.alt;
228
+ $[7] = t3;
92
229
  } else {
93
- t3 = $[4];
230
+ t3 = $[7];
94
231
  }
95
- const pointIn = t3;
232
+ const name = t3;
96
233
  let t4;
97
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
98
- t4 = factor => setView(current => zoomed(current, factor, 0, 0));
99
- $[5] = t4;
234
+ if ($[8] !== name) {
235
+ t4 = /*#__PURE__*/_jsx("span", {
236
+ className: "min-w-0 truncate text-xs text-text",
237
+ children: name
238
+ });
239
+ $[8] = name;
240
+ $[9] = t4;
100
241
  } else {
101
- t4 = $[5];
242
+ t4 = $[9];
102
243
  }
103
- const zoomButton = t4;
244
+ const title = t4;
104
245
  let t5;
105
- if ($[6] !== alt) {
106
- t5 = /*#__PURE__*/_jsx(Dialog.Title, {
107
- className: "sr-only",
108
- children: alt
109
- });
110
- $[6] = alt;
111
- $[7] = t5;
246
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
247
+ t5 = stage => {
248
+ stageElementRef.current = stage;
249
+ if (stage === null) {
250
+ return;
251
+ }
252
+ const onWheel = event => {
253
+ event.preventDefault();
254
+ const point = pointIn(stage, event);
255
+ const bounds = boundsOf(stage);
256
+ setView(current => wheeled(current, event, point, bounds));
257
+ };
258
+ stage.addEventListener("wheel", onWheel, {
259
+ passive: false
260
+ });
261
+ return () => stage.removeEventListener("wheel", onWheel);
262
+ };
263
+ $[10] = t5;
112
264
  } else {
113
- t5 = $[7];
265
+ t5 = $[10];
114
266
  }
267
+ const stageRef = t5;
115
268
  let t6;
116
- if ($[8] !== alt || $[9] !== name || $[10] !== title) {
117
- t6 = name === alt ? title : /*#__PURE__*/_jsx(Tooltip, {
118
- label: alt,
119
- children: title
120
- });
121
- $[8] = alt;
122
- $[9] = name;
123
- $[10] = title;
269
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
270
+ t6 = factor => {
271
+ const stage_0 = stageElementRef.current;
272
+ if (stage_0 !== null) {
273
+ const bounds_0 = boundsOf(stage_0);
274
+ setView(current_0 => zoomed(current_0, factor, {
275
+ x: 0,
276
+ y: 0
277
+ }, bounds_0));
278
+ }
279
+ };
124
280
  $[11] = t6;
125
281
  } else {
126
282
  t6 = $[11];
127
283
  }
284
+ const zoomButton = t6;
128
285
  let t7;
129
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
130
- t7 = /*#__PURE__*/_jsx("span", {
131
- className: "grow"
132
- });
133
- $[12] = t7;
286
+ if ($[12] !== onIndexChange) {
287
+ t7 = to => {
288
+ if (to !== null) {
289
+ onIndexChange?.(to);
290
+ }
291
+ };
292
+ $[12] = onIndexChange;
293
+ $[13] = t7;
134
294
  } else {
135
- t7 = $[12];
295
+ t7 = $[13];
136
296
  }
297
+ const step = t7;
137
298
  let t8;
138
- if ($[13] !== view.scale) {
139
- t8 = Math.round(view.scale * 100);
140
- $[13] = view.scale;
141
- $[14] = t8;
299
+ if ($[14] !== next || $[15] !== previous || $[16] !== step) {
300
+ t8 = event_0 => {
301
+ if (event_0.altKey || event_0.ctrlKey || event_0.metaKey || event_0.shiftKey) {
302
+ return;
303
+ }
304
+ const to_0 = event_0.key === "ArrowLeft" ? previous : event_0.key === "ArrowRight" ? next : null;
305
+ if (to_0 !== null) {
306
+ event_0.preventDefault();
307
+ step(to_0);
308
+ }
309
+ };
310
+ $[14] = next;
311
+ $[15] = previous;
312
+ $[16] = step;
313
+ $[17] = t8;
142
314
  } else {
143
- t8 = $[14];
315
+ t8 = $[17];
144
316
  }
317
+ const onKeyDown = t8;
145
318
  let t9;
146
- if ($[15] !== t8) {
147
- t9 = /*#__PURE__*/_jsxs("span", {
148
- className: "tabular-nums text-xs text-text-faint",
149
- children: [t8, "%"]
319
+ if ($[18] !== image.alt) {
320
+ t9 = /*#__PURE__*/_jsx(Dialog.Title, {
321
+ className: "sr-only",
322
+ children: image.alt
150
323
  });
151
- $[15] = t8;
152
- $[16] = t9;
324
+ $[18] = image.alt;
325
+ $[19] = t9;
153
326
  } else {
154
- t9 = $[16];
327
+ t9 = $[19];
155
328
  }
156
- let t10;
157
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
158
- t10 = /*#__PURE__*/_jsx("span", {});
159
- $[17] = t10;
329
+ const t10 = view.scale * 100;
330
+ let t11;
331
+ if ($[20] !== t10) {
332
+ t11 = formatNumber(t10);
333
+ $[20] = t10;
334
+ $[21] = t11;
160
335
  } else {
161
- t10 = $[17];
336
+ t11 = $[21];
162
337
  }
163
- let t11;
164
- if ($[18] !== t) {
165
- t11 = t("image.zoomOut");
166
- $[18] = t;
167
- $[19] = t11;
338
+ let t12;
339
+ if ($[22] !== t11) {
340
+ t12 = /*#__PURE__*/_jsxs("span", {
341
+ className: "tabular-nums text-xs text-text-faint",
342
+ children: [t11, "%"]
343
+ });
344
+ $[22] = t11;
345
+ $[23] = t12;
168
346
  } else {
169
- t11 = $[19];
347
+ t12 = $[23];
170
348
  }
171
- const t12 = view.scale <= MIN_SCALE;
172
349
  let t13;
173
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
174
- t13 = () => zoomButton(1 / BUTTON_STEP);
175
- $[20] = t13;
350
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
351
+ t13 = /*#__PURE__*/_jsx("span", {});
352
+ $[24] = t13;
176
353
  } else {
177
- t13 = $[20];
354
+ t13 = $[24];
178
355
  }
179
356
  let t14;
180
- if ($[21] !== t11 || $[22] !== t12) {
181
- t14 = /*#__PURE__*/_jsx(IconButton, {
357
+ if ($[25] !== t) {
358
+ t14 = t("image.zoomOut");
359
+ $[25] = t;
360
+ $[26] = t14;
361
+ } else {
362
+ t14 = $[26];
363
+ }
364
+ const t15 = view.scale <= MIN_SCALE;
365
+ let t16;
366
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
367
+ t16 = () => zoomButton(1 / BUTTON_STEP);
368
+ $[27] = t16;
369
+ } else {
370
+ t16 = $[27];
371
+ }
372
+ let t17;
373
+ if ($[28] !== t14 || $[29] !== t15) {
374
+ t17 = /*#__PURE__*/_jsx(IconButton, {
182
375
  icon: Minus,
183
376
  size: "sm",
184
- label: t11,
185
- disabled: t12,
186
- onClick: t13
377
+ label: t14,
378
+ disabled: t15,
379
+ onClick: t16
187
380
  });
188
- $[21] = t11;
189
- $[22] = t12;
190
- $[23] = t14;
381
+ $[28] = t14;
382
+ $[29] = t15;
383
+ $[30] = t17;
191
384
  } else {
192
- t14 = $[23];
385
+ t17 = $[30];
193
386
  }
194
- let t15;
195
- if ($[24] !== t) {
196
- t15 = t("image.zoomIn");
197
- $[24] = t;
198
- $[25] = t15;
387
+ let t18;
388
+ if ($[31] !== t) {
389
+ t18 = t("image.zoomIn");
390
+ $[31] = t;
391
+ $[32] = t18;
199
392
  } else {
200
- t15 = $[25];
393
+ t18 = $[32];
201
394
  }
202
- const t16 = view.scale >= MAX_SCALE;
203
- let t17;
204
- if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
205
- t17 = () => zoomButton(BUTTON_STEP);
206
- $[26] = t17;
395
+ const t19 = view.scale >= MAX_SCALE;
396
+ let t20;
397
+ if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
398
+ t20 = () => zoomButton(BUTTON_STEP);
399
+ $[33] = t20;
207
400
  } else {
208
- t17 = $[26];
401
+ t20 = $[33];
209
402
  }
210
- let t18;
211
- if ($[27] !== t15 || $[28] !== t16) {
212
- t18 = /*#__PURE__*/_jsx(IconButton, {
403
+ let t21;
404
+ if ($[34] !== t18 || $[35] !== t19) {
405
+ t21 = /*#__PURE__*/_jsx(IconButton, {
213
406
  icon: Plus,
214
407
  size: "sm",
215
- label: t15,
216
- disabled: t16,
217
- onClick: t17
408
+ label: t18,
409
+ disabled: t19,
410
+ onClick: t20
218
411
  });
219
- $[27] = t15;
220
- $[28] = t16;
221
- $[29] = t18;
412
+ $[34] = t18;
413
+ $[35] = t19;
414
+ $[36] = t21;
222
415
  } else {
223
- t18 = $[29];
416
+ t21 = $[36];
224
417
  }
225
- let t19;
226
- if ($[30] !== t) {
227
- t19 = t("image.reset");
228
- $[30] = t;
229
- $[31] = t19;
418
+ let t22;
419
+ if ($[37] !== t) {
420
+ t22 = t("image.reset");
421
+ $[37] = t;
422
+ $[38] = t22;
230
423
  } else {
231
- t19 = $[31];
424
+ t22 = $[38];
232
425
  }
233
- const t20 = view.scale === MIN_SCALE;
234
- let t21;
235
- if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
236
- t21 = () => setView(START);
237
- $[32] = t21;
426
+ const t23 = view.scale === MIN_SCALE;
427
+ let t24;
428
+ if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
429
+ t24 = () => setView(START);
430
+ $[39] = t24;
238
431
  } else {
239
- t21 = $[32];
432
+ t24 = $[39];
240
433
  }
241
- let t22;
242
- if ($[33] !== t19 || $[34] !== t20) {
243
- t22 = /*#__PURE__*/_jsx(IconButton, {
434
+ let t25;
435
+ if ($[40] !== t22 || $[41] !== t23) {
436
+ t25 = /*#__PURE__*/_jsx(IconButton, {
244
437
  icon: RotateCcw,
245
438
  size: "sm",
246
- label: t19,
247
- disabled: t20,
248
- onClick: t21
439
+ label: t22,
440
+ disabled: t23,
441
+ onClick: t24
249
442
  });
250
- $[33] = t19;
251
- $[34] = t20;
252
- $[35] = t22;
443
+ $[40] = t22;
444
+ $[41] = t23;
445
+ $[42] = t25;
253
446
  } else {
254
- t22 = $[35];
447
+ t25 = $[42];
255
448
  }
256
- let t23;
257
- if ($[36] !== t14 || $[37] !== t18 || $[38] !== t22) {
258
- t23 = /*#__PURE__*/_jsxs(ButtonGroup, {
259
- render: t10,
260
- children: [t14, t18, t22]
449
+ let t26;
450
+ if ($[43] !== t17 || $[44] !== t21 || $[45] !== t25) {
451
+ t26 = /*#__PURE__*/_jsxs(ButtonGroup, {
452
+ render: t13,
453
+ children: [t17, t21, t25]
261
454
  });
262
- $[36] = t14;
263
- $[37] = t18;
264
- $[38] = t22;
265
- $[39] = t23;
455
+ $[43] = t17;
456
+ $[44] = t21;
457
+ $[45] = t25;
458
+ $[46] = t26;
266
459
  } else {
267
- t23 = $[39];
460
+ t26 = $[46];
268
461
  }
269
- let t24;
270
- if ($[40] !== t) {
271
- t24 = t("common.action.close");
272
- $[40] = t;
273
- $[41] = t24;
462
+ let t27;
463
+ if ($[47] !== t) {
464
+ t27 = t("common.action.close");
465
+ $[47] = t;
466
+ $[48] = t27;
274
467
  } else {
275
- t24 = $[41];
468
+ t27 = $[48];
276
469
  }
277
- let t25;
278
- if ($[42] !== t24) {
279
- t25 = /*#__PURE__*/_jsx(CloseButton, {
280
- label: t24,
470
+ let t28;
471
+ if ($[49] !== t27) {
472
+ t28 = /*#__PURE__*/_jsx(CloseButton, {
473
+ label: t27,
281
474
  kbd: "esc",
282
475
  className: "ml-1",
283
476
  dialog: true
284
477
  });
285
- $[42] = t24;
286
- $[43] = t25;
478
+ $[49] = t27;
479
+ $[50] = t28;
287
480
  } else {
288
- t25 = $[43];
481
+ t28 = $[50];
289
482
  }
290
- let t26;
291
- if ($[44] !== actions || $[45] !== t23 || $[46] !== t25 || $[47] !== t6 || $[48] !== t9) {
292
- t26 = /*#__PURE__*/_jsxs("div", {
293
- className: "flex h-11 shrink-0 items-center gap-2 border-b border-border pr-2 pl-3",
294
- children: [t6, t7, t9, t23, actions, t25]
483
+ let t29;
484
+ if ($[51] !== actions || $[52] !== t12 || $[53] !== t26 || $[54] !== t28) {
485
+ t29 = /*#__PURE__*/_jsxs("div", {
486
+ className: "lightbox-bar flex h-12 shrink-0 items-center justify-end gap-2 pl-3",
487
+ children: [t12, t26, actions, t28]
295
488
  });
296
- $[44] = actions;
297
- $[45] = t23;
298
- $[46] = t25;
299
- $[47] = t6;
300
- $[48] = t9;
301
- $[49] = t26;
489
+ $[51] = actions;
490
+ $[52] = t12;
491
+ $[53] = t26;
492
+ $[54] = t28;
493
+ $[55] = t29;
302
494
  } else {
303
- t26 = $[49];
495
+ t29 = $[55];
304
496
  }
305
- const t27 = view.scale > MIN_SCALE && "cursor-grab";
306
- let t28;
307
- if ($[50] !== t27) {
308
- t28 = clsx("lightbox-frame grid place-items-center overflow-hidden bg-surface-sunken", t27);
309
- $[50] = t27;
310
- $[51] = t28;
497
+ const t30 = view.scale > MIN_SCALE && "cursor-grab";
498
+ let t31;
499
+ if ($[56] !== t30) {
500
+ t31 = clsx("lightbox-stage relative grid min-h-0 grow place-items-center overflow-hidden", t30);
501
+ $[56] = t30;
502
+ $[57] = t31;
311
503
  } else {
312
- t28 = $[51];
504
+ t31 = $[57];
313
505
  }
314
- let t29;
315
- let t30;
316
- if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
317
- t29 = e => {
318
- const point = pointIn(e);
319
- setView(current_0 => zoomed(current_0, WHEEL_STEP ** -e.deltaY, point.x, point.y));
320
- };
321
- t30 = e_0 => {
322
- const point_0 = pointIn(e_0);
323
- setView(current_1 => current_1.scale > MIN_SCALE ? START : zoomed(current_1, 2, point_0.x, point_0.y));
506
+ let t32;
507
+ if ($[58] === Symbol.for("react.memo_cache_sentinel")) {
508
+ t32 = e => {
509
+ if (onControl(e.target)) {
510
+ return;
511
+ }
512
+ const point_0 = pointIn(e.currentTarget, e);
513
+ const bounds_1 = boundsOf(e.currentTarget);
514
+ setView(current_1 => current_1.scale > MIN_SCALE ? START : zoomed(current_1, 2, point_0, bounds_1));
324
515
  };
325
- $[52] = t29;
326
- $[53] = t30;
516
+ $[58] = t32;
327
517
  } else {
328
- t29 = $[52];
329
- t30 = $[53];
518
+ t32 = $[58];
330
519
  }
331
- let t31;
332
- if ($[54] !== view.scale || $[55] !== view.x || $[56] !== view.y) {
333
- t31 = e_1 => {
334
- if (view.scale <= MIN_SCALE) {
520
+ let t33;
521
+ if ($[59] !== view.scale || $[60] !== view.x || $[61] !== view.y) {
522
+ t33 = e_0 => {
523
+ movedRef.current = false;
524
+ if (view.scale <= MIN_SCALE || onControl(e_0.target)) {
335
525
  return;
336
526
  }
337
- e_1.currentTarget.setPointerCapture(e_1.pointerId);
527
+ e_0.currentTarget.setPointerCapture(e_0.pointerId);
338
528
  dragRef.current = {
339
- pointerId: e_1.pointerId,
340
- x: e_1.clientX - view.x,
341
- y: e_1.clientY - view.y
529
+ pointerId: e_0.pointerId,
530
+ x: e_0.clientX - view.x,
531
+ y: e_0.clientY - view.y
342
532
  };
343
533
  };
344
- $[54] = view.scale;
345
- $[55] = view.x;
346
- $[56] = view.y;
347
- $[57] = t31;
534
+ $[59] = view.scale;
535
+ $[60] = view.x;
536
+ $[61] = view.y;
537
+ $[62] = t33;
348
538
  } else {
349
- t31 = $[57];
539
+ t33 = $[62];
350
540
  }
351
- let t32;
352
- let t33;
353
541
  let t34;
354
- if ($[58] === Symbol.for("react.memo_cache_sentinel")) {
355
- t32 = e_2 => {
542
+ let t35;
543
+ let t36;
544
+ if ($[63] === Symbol.for("react.memo_cache_sentinel")) {
545
+ t34 = e_1 => {
356
546
  const drag = dragRef.current;
357
- if (drag?.pointerId === e_2.pointerId) {
358
- setView(current_2 => ({
359
- ...current_2,
360
- x: e_2.clientX - drag.x,
361
- y: e_2.clientY - drag.y
362
- }));
547
+ if (drag?.pointerId !== e_1.pointerId) {
548
+ return;
363
549
  }
550
+ movedRef.current = true;
551
+ const bounds_2 = boundsOf(e_1.currentTarget);
552
+ setView(current_2 => clamped({
553
+ ...current_2,
554
+ x: e_1.clientX - drag.x,
555
+ y: e_1.clientY - drag.y
556
+ }, bounds_2));
364
557
  };
365
- t33 = () => {
558
+ t35 = () => {
366
559
  dragRef.current = null;
367
560
  };
368
- t34 = () => {
561
+ t36 = () => {
369
562
  dragRef.current = null;
370
563
  };
371
- $[58] = t32;
372
- $[59] = t33;
373
- $[60] = t34;
564
+ $[63] = t34;
565
+ $[64] = t35;
566
+ $[65] = t36;
567
+ } else {
568
+ t34 = $[63];
569
+ t35 = $[64];
570
+ t36 = $[65];
571
+ }
572
+ let t37;
573
+ if ($[66] !== onOpenChange) {
574
+ t37 = e_2 => {
575
+ if (e_2.target === e_2.currentTarget && !movedRef.current) {
576
+ onOpenChange(false);
577
+ }
578
+ };
579
+ $[66] = onOpenChange;
580
+ $[67] = t37;
374
581
  } else {
375
- t32 = $[58];
376
- t33 = $[59];
377
- t34 = $[60];
582
+ t37 = $[67];
378
583
  }
379
- let t35;
380
- if ($[61] !== view.x) {
381
- t35 = Math.round(view.x);
382
- $[61] = view.x;
383
- $[62] = t35;
584
+ const t38 = image.key;
585
+ const t39 = image.src;
586
+ const t40 = image.alt;
587
+ let t41;
588
+ if ($[68] !== view.x) {
589
+ t41 = Math.round(view.x);
590
+ $[68] = view.x;
591
+ $[69] = t41;
384
592
  } else {
385
- t35 = $[62];
593
+ t41 = $[69];
386
594
  }
387
- let t36;
388
- if ($[63] !== view.y) {
389
- t36 = Math.round(view.y);
390
- $[63] = view.y;
391
- $[64] = t36;
392
- } else {
393
- t36 = $[64];
394
- }
395
- const t37 = `translate(${t35}px, ${t36}px) scale(${view.scale})`;
396
- let t38;
397
- if ($[65] !== t37) {
398
- t38 = {
399
- transform: t37
595
+ let t42;
596
+ if ($[70] !== view.y) {
597
+ t42 = Math.round(view.y);
598
+ $[70] = view.y;
599
+ $[71] = t42;
600
+ } else {
601
+ t42 = $[71];
602
+ }
603
+ const t43 = `translate(${t41}px, ${t42}px) scale(${view.scale})`;
604
+ let t44;
605
+ if ($[72] !== t43) {
606
+ t44 = {
607
+ transform: t43
400
608
  };
401
- $[65] = t37;
402
- $[66] = t38;
609
+ $[72] = t43;
610
+ $[73] = t44;
403
611
  } else {
404
- t38 = $[66];
612
+ t44 = $[73];
405
613
  }
406
- let t39;
407
- if ($[67] !== alt || $[68] !== src || $[69] !== t38) {
408
- t39 = /*#__PURE__*/_jsx(DisplayImage, {
409
- src: src,
410
- alt: alt,
614
+ let t45;
615
+ if ($[74] !== image.alt || $[75] !== image.key || $[76] !== image.src || $[77] !== t44) {
616
+ t45 = /*#__PURE__*/_jsx(DisplayImage, {
617
+ src: t39,
618
+ alt: t40,
411
619
  draggable: false,
412
620
  className: "select-none",
413
- style: t38
621
+ style: t44
622
+ }, t38);
623
+ $[74] = image.alt;
624
+ $[75] = image.key;
625
+ $[76] = image.src;
626
+ $[77] = t44;
627
+ $[78] = t45;
628
+ } else {
629
+ t45 = $[78];
630
+ }
631
+ let t46;
632
+ if ($[79] !== images.length || $[80] !== next || $[81] !== previous || $[82] !== step || $[83] !== t) {
633
+ t46 = images.length > 1 && /*#__PURE__*/_jsxs(_Fragment, {
634
+ children: [/*#__PURE__*/_jsx(IconButton, {
635
+ icon: ChevronLeft,
636
+ label: t("image.previous"),
637
+ kbd: "\u2190",
638
+ disabled: previous === null,
639
+ className: "absolute top-1/2 left-4 -translate-y-1/2",
640
+ onClick: () => step(previous)
641
+ }), /*#__PURE__*/_jsx(IconButton, {
642
+ icon: ChevronRight,
643
+ label: t("image.next"),
644
+ kbd: "\u2192",
645
+ disabled: next === null,
646
+ className: "absolute top-1/2 right-4 -translate-y-1/2",
647
+ onClick: () => step(next)
648
+ })]
649
+ });
650
+ $[79] = images.length;
651
+ $[80] = next;
652
+ $[81] = previous;
653
+ $[82] = step;
654
+ $[83] = t;
655
+ $[84] = t46;
656
+ } else {
657
+ t46 = $[84];
658
+ }
659
+ let t47;
660
+ if ($[85] !== t31 || $[86] !== t33 || $[87] !== t37 || $[88] !== t45 || $[89] !== t46) {
661
+ t47 = /*#__PURE__*/_jsxs("div", {
662
+ ref: stageRef,
663
+ className: t31,
664
+ onDoubleClick: t32,
665
+ onPointerDown: t33,
666
+ onPointerMove: t34,
667
+ onPointerUp: t35,
668
+ onPointerCancel: t36,
669
+ onClick: t37,
670
+ children: [t45, t46]
671
+ });
672
+ $[85] = t31;
673
+ $[86] = t33;
674
+ $[87] = t37;
675
+ $[88] = t45;
676
+ $[89] = t46;
677
+ $[90] = t47;
678
+ } else {
679
+ t47 = $[90];
680
+ }
681
+ let t48;
682
+ if ($[91] !== image.alt || $[92] !== name || $[93] !== title) {
683
+ t48 = name === image.alt ? title : /*#__PURE__*/_jsx(Tooltip, {
684
+ label: image.alt,
685
+ children: title
686
+ });
687
+ $[91] = image.alt;
688
+ $[92] = name;
689
+ $[93] = title;
690
+ $[94] = t48;
691
+ } else {
692
+ t48 = $[94];
693
+ }
694
+ let t49;
695
+ if ($[95] !== images.length || $[96] !== index || $[97] !== t) {
696
+ t49 = images.length > 1 && /*#__PURE__*/_jsx("span", {
697
+ className: "shrink-0 tabular-nums text-xs text-text-faint",
698
+ children: t("image.position", {
699
+ index: formatNumber(index + 1),
700
+ count: formatNumber(images.length)
701
+ })
414
702
  });
415
- $[67] = alt;
416
- $[68] = src;
417
- $[69] = t38;
418
- $[70] = t39;
419
- } else {
420
- t39 = $[70];
421
- }
422
- let t40;
423
- if ($[71] !== t28 || $[72] !== t31 || $[73] !== t39) {
424
- t40 = /*#__PURE__*/_jsx("div", {
425
- ref: frameRef,
426
- className: t28,
427
- onWheel: t29,
428
- onDoubleClick: t30,
429
- onPointerDown: t31,
430
- onPointerMove: t32,
431
- onPointerUp: t33,
432
- onPointerCancel: t34,
433
- children: t39
703
+ $[95] = images.length;
704
+ $[96] = index;
705
+ $[97] = t;
706
+ $[98] = t49;
707
+ } else {
708
+ t49 = $[98];
709
+ }
710
+ let t50;
711
+ if ($[99] !== t48 || $[100] !== t49) {
712
+ t50 = /*#__PURE__*/_jsxs("div", {
713
+ className: "flex h-12 shrink-0 items-center justify-center gap-3 px-3",
714
+ children: [t48, t49]
434
715
  });
435
- $[71] = t28;
436
- $[72] = t31;
437
- $[73] = t39;
438
- $[74] = t40;
716
+ $[99] = t48;
717
+ $[100] = t49;
718
+ $[101] = t50;
439
719
  } else {
440
- t40 = $[74];
720
+ t50 = $[101];
441
721
  }
442
- let t41;
443
- if ($[75] !== t26 || $[76] !== t40 || $[77] !== t5) {
444
- t41 = /*#__PURE__*/_jsxs(Dialog.Popup, {
722
+ let t51;
723
+ if ($[102] !== onKeyDown || $[103] !== t29 || $[104] !== t47 || $[105] !== t50 || $[106] !== t9) {
724
+ t51 = /*#__PURE__*/_jsxs(Dialog.Popup, {
445
725
  backdropClassName: "lightbox-backdrop",
446
- className: "flex min-w-72 flex-col",
447
- children: [t5, t26, t40]
726
+ className: "lightbox",
727
+ onKeyDown: onKeyDown,
728
+ children: [t9, t29, t47, t50]
448
729
  });
449
- $[75] = t26;
450
- $[76] = t40;
451
- $[77] = t5;
452
- $[78] = t41;
453
- } else {
454
- t41 = $[78];
455
- }
456
- let t42;
457
- if ($[79] !== onOpenChange || $[80] !== open || $[81] !== t41) {
458
- t42 = /*#__PURE__*/_jsx(Dialog.Root, {
730
+ $[102] = onKeyDown;
731
+ $[103] = t29;
732
+ $[104] = t47;
733
+ $[105] = t50;
734
+ $[106] = t9;
735
+ $[107] = t51;
736
+ } else {
737
+ t51 = $[107];
738
+ }
739
+ let t52;
740
+ if ($[108] !== onOpenChange || $[109] !== open || $[110] !== t51) {
741
+ t52 = /*#__PURE__*/_jsx(Dialog.Root, {
459
742
  open: open,
460
743
  onOpenChange: onOpenChange,
461
- children: t41
744
+ children: t51
462
745
  });
463
- $[79] = onOpenChange;
464
- $[80] = open;
465
- $[81] = t41;
466
- $[82] = t42;
746
+ $[108] = onOpenChange;
747
+ $[109] = open;
748
+ $[110] = t51;
749
+ $[111] = t52;
467
750
  } else {
468
- t42 = $[82];
751
+ t52 = $[111];
469
752
  }
470
- return t42;
753
+ return t52;
471
754
  }
472
755
  /*
473
756
  * A thumbnail that opens the same image large. The button is the picture, so there is nothing to aim at.
474
757
  * The image is bytes where the host keeps them; until they are here a quiet square stands in for it.
475
758
  */
476
759
  export function ImageThumb(t0) {
477
- const $ = _c(37);
760
+ const $ = _c(47);
478
761
  const {
479
762
  source,
480
763
  alt,
@@ -484,161 +767,202 @@ export function ImageThumb(t0) {
484
767
  open: openProp,
485
768
  onOpenChange
486
769
  } = t0;
770
+ const key = useId();
771
+ const buttonRef = useRef(null);
772
+ const context = useContext(ImageGroupContext);
773
+ const group = actions === undefined && openProp === undefined ? context : null;
487
774
  const [ownOpen, setOwnOpen] = useState(false);
488
775
  const open = openProp ?? ownOpen;
776
+ const {
777
+ url: src,
778
+ failure
779
+ } = source;
489
780
  let t1;
490
- if ($[0] !== onOpenChange) {
491
- t1 = next => {
492
- setOwnOpen(next);
493
- onOpenChange?.(next);
781
+ if ($[0] !== aspect) {
782
+ t1 = aspect === undefined ? undefined : {
783
+ aspectRatio: aspect
494
784
  };
495
- $[0] = onOpenChange;
785
+ $[0] = aspect;
496
786
  $[1] = t1;
497
787
  } else {
498
788
  t1 = $[1];
499
789
  }
500
- const setOpen = t1;
501
- const {
502
- url: src,
503
- failure
504
- } = source;
790
+ const ratio = t1;
505
791
  let t2;
506
- if ($[2] !== aspect) {
507
- t2 = aspect === undefined ? undefined : {
508
- aspectRatio: aspect
792
+ let t3;
793
+ if ($[2] !== alt || $[3] !== group || $[4] !== key || $[5] !== src) {
794
+ t2 = () => {
795
+ if (group === null || src === null) {
796
+ return;
797
+ }
798
+ group.store.set({
799
+ key,
800
+ src,
801
+ alt,
802
+ element: buttonRef.current
803
+ });
804
+ return () => group.store.remove(key);
509
805
  };
510
- $[2] = aspect;
511
- $[3] = t2;
806
+ t3 = [group, key, src, alt];
807
+ $[2] = alt;
808
+ $[3] = group;
809
+ $[4] = key;
810
+ $[5] = src;
811
+ $[6] = t2;
812
+ $[7] = t3;
813
+ } else {
814
+ t2 = $[6];
815
+ t3 = $[7];
816
+ }
817
+ useLayoutEffect(t2, t3);
818
+ let t4;
819
+ if ($[8] !== onOpenChange) {
820
+ t4 = next => {
821
+ setOwnOpen(next);
822
+ onOpenChange?.(next);
823
+ };
824
+ $[8] = onOpenChange;
825
+ $[9] = t4;
512
826
  } else {
513
- t2 = $[3];
827
+ t4 = $[9];
514
828
  }
515
- const ratio = t2;
829
+ const setOpen = t4;
516
830
  if (src === null) {
517
- const t3 = aspect === undefined ? "size-16" : "w-full";
518
- let t4;
519
- if ($[4] !== t3) {
520
- t4 = clsx("grid place-items-center rounded-lg border border-border bg-surface-sunken text-text-faint", t3);
521
- $[4] = t3;
522
- $[5] = t4;
831
+ const t5 = aspect === undefined ? "size-16" : "w-full";
832
+ let t6;
833
+ if ($[10] !== t5) {
834
+ t6 = clsx("grid place-items-center rounded-lg border border-border bg-surface-sunken text-text-faint", t5);
835
+ $[10] = t5;
836
+ $[11] = t6;
523
837
  } else {
524
- t4 = $[5];
838
+ t6 = $[11];
525
839
  }
526
- let t5;
527
- if ($[6] !== failure) {
528
- t5 = failure !== null && /*#__PURE__*/_jsx(Tooltip, {
840
+ let t7;
841
+ if ($[12] !== failure) {
842
+ t7 = failure !== null && /*#__PURE__*/_jsx(Tooltip, {
529
843
  label: failure,
530
844
  children: /*#__PURE__*/_jsx(Icon, {
531
845
  icon: ImageOff,
532
846
  size: 14
533
847
  })
534
848
  });
535
- $[6] = failure;
536
- $[7] = t5;
849
+ $[12] = failure;
850
+ $[13] = t7;
537
851
  } else {
538
- t5 = $[7];
852
+ t7 = $[13];
539
853
  }
540
- let t6;
541
- if ($[8] !== ratio || $[9] !== t4 || $[10] !== t5) {
542
- t6 = /*#__PURE__*/_jsx("span", {
543
- className: t4,
854
+ let t8;
855
+ if ($[14] !== ratio || $[15] !== t6 || $[16] !== t7) {
856
+ t8 = /*#__PURE__*/_jsx("span", {
857
+ className: t6,
544
858
  style: ratio,
545
- children: t5
859
+ children: t7
546
860
  });
547
- $[8] = ratio;
548
- $[9] = t4;
549
- $[10] = t5;
550
- $[11] = t6;
861
+ $[14] = ratio;
862
+ $[15] = t6;
863
+ $[16] = t7;
864
+ $[17] = t8;
551
865
  } else {
552
- t6 = $[11];
866
+ t8 = $[17];
553
867
  }
554
- return t6;
868
+ return t8;
555
869
  }
556
- const t3 = aspect !== undefined && "w-full";
557
- let t4;
558
- if ($[12] !== t3) {
559
- t4 = clsx("block overflow-hidden rounded-lg border border-border", t3);
560
- $[12] = t3;
561
- $[13] = t4;
870
+ const t5 = aspect !== undefined && "w-full";
871
+ let t6;
872
+ if ($[18] !== t5) {
873
+ t6 = clsx("block overflow-hidden rounded-lg border border-border", t5);
874
+ $[18] = t5;
875
+ $[19] = t6;
562
876
  } else {
563
- t4 = $[13];
877
+ t6 = $[19];
564
878
  }
565
- let t5;
566
- if ($[14] !== setOpen) {
567
- t5 = () => setOpen(true);
568
- $[14] = setOpen;
569
- $[15] = t5;
879
+ let t7;
880
+ if ($[20] !== group || $[21] !== key || $[22] !== setOpen) {
881
+ t7 = () => group === null ? setOpen(true) : group.open(key);
882
+ $[20] = group;
883
+ $[21] = key;
884
+ $[22] = setOpen;
885
+ $[23] = t7;
570
886
  } else {
571
- t5 = $[15];
887
+ t7 = $[23];
572
888
  }
573
- const t6 = aspect !== undefined && "size-full object-contain";
574
- let t7;
575
- if ($[16] !== className || $[17] !== t6) {
576
- t7 = clsx(t6, className);
577
- $[16] = className;
578
- $[17] = t6;
579
- $[18] = t7;
889
+ const t8 = aspect !== undefined && "size-full object-contain";
890
+ let t9;
891
+ if ($[24] !== className || $[25] !== t8) {
892
+ t9 = clsx(t8, className);
893
+ $[24] = className;
894
+ $[25] = t8;
895
+ $[26] = t9;
580
896
  } else {
581
- t7 = $[18];
897
+ t9 = $[26];
582
898
  }
583
- let t8;
584
- if ($[19] !== alt || $[20] !== src || $[21] !== t7) {
585
- t8 = /*#__PURE__*/_jsx(DisplayImage, {
899
+ let t10;
900
+ if ($[27] !== alt || $[28] !== src || $[29] !== t9) {
901
+ t10 = /*#__PURE__*/_jsx(DisplayImage, {
586
902
  src: src,
587
903
  alt: alt,
588
- className: t7
904
+ className: t9
589
905
  });
590
- $[19] = alt;
591
- $[20] = src;
592
- $[21] = t7;
593
- $[22] = t8;
906
+ $[27] = alt;
907
+ $[28] = src;
908
+ $[29] = t9;
909
+ $[30] = t10;
594
910
  } else {
595
- t8 = $[22];
911
+ t10 = $[30];
596
912
  }
597
- let t9;
598
- if ($[23] !== ratio || $[24] !== t4 || $[25] !== t5 || $[26] !== t8) {
599
- t9 = /*#__PURE__*/_jsx("button", {
913
+ let t11;
914
+ if ($[31] !== ratio || $[32] !== t10 || $[33] !== t6 || $[34] !== t7) {
915
+ t11 = /*#__PURE__*/_jsx("button", {
916
+ ref: buttonRef,
600
917
  type: "button",
601
- className: t4,
918
+ className: t6,
602
919
  style: ratio,
603
- onClick: t5,
604
- children: t8
920
+ onClick: t7,
921
+ children: t10
605
922
  });
606
- $[23] = ratio;
607
- $[24] = t4;
608
- $[25] = t5;
609
- $[26] = t8;
610
- $[27] = t9;
611
- } else {
612
- t9 = $[27];
613
- }
614
- let t10;
615
- if ($[28] !== actions || $[29] !== alt || $[30] !== open || $[31] !== setOpen || $[32] !== src) {
616
- t10 = /*#__PURE__*/_jsx(Lightbox, {
617
- src: src,
618
- alt: alt,
923
+ $[31] = ratio;
924
+ $[32] = t10;
925
+ $[33] = t6;
926
+ $[34] = t7;
927
+ $[35] = t11;
928
+ } else {
929
+ t11 = $[35];
930
+ }
931
+ let t12;
932
+ if ($[36] !== actions || $[37] !== alt || $[38] !== group || $[39] !== key || $[40] !== open || $[41] !== setOpen || $[42] !== src) {
933
+ t12 = group === null && /*#__PURE__*/_jsx(Lightbox, {
934
+ images: [{
935
+ key,
936
+ src,
937
+ alt,
938
+ element: null
939
+ }],
940
+ index: 0,
619
941
  open: open,
620
942
  onOpenChange: setOpen,
621
943
  actions: actions
622
944
  });
623
- $[28] = actions;
624
- $[29] = alt;
625
- $[30] = open;
626
- $[31] = setOpen;
627
- $[32] = src;
628
- $[33] = t10;
945
+ $[36] = actions;
946
+ $[37] = alt;
947
+ $[38] = group;
948
+ $[39] = key;
949
+ $[40] = open;
950
+ $[41] = setOpen;
951
+ $[42] = src;
952
+ $[43] = t12;
629
953
  } else {
630
- t10 = $[33];
954
+ t12 = $[43];
631
955
  }
632
- let t11;
633
- if ($[34] !== t10 || $[35] !== t9) {
634
- t11 = /*#__PURE__*/_jsxs(_Fragment, {
635
- children: [t9, t10]
956
+ let t13;
957
+ if ($[44] !== t11 || $[45] !== t12) {
958
+ t13 = /*#__PURE__*/_jsxs(_Fragment, {
959
+ children: [t11, t12]
636
960
  });
637
- $[34] = t10;
638
- $[35] = t9;
639
- $[36] = t11;
961
+ $[44] = t11;
962
+ $[45] = t12;
963
+ $[46] = t13;
640
964
  } else {
641
- t11 = $[36];
965
+ t13 = $[46];
642
966
  }
643
- return t11;
967
+ return t13;
644
968
  }