@instructure/platform-notebook 0.6.0 → 0.7.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.
package/dist/index.js CHANGED
@@ -1,40 +1,40 @@
1
- import { jsx as i, jsxs as b, Fragment as Ve } from "react/jsx-runtime";
2
- import { createContext as Pe, useMemo as oe, useContext as _e, useReducer as Fe, useRef as re, useEffect as J, useState as H, useCallback as K } from "react";
1
+ import { jsx as i, jsxs as S, Fragment as Ve } from "react/jsx-runtime";
2
+ import { createContext as Pe, useMemo as oe, useContext as _e, useReducer as Fe, useRef as re, useEffect as J, useState as B, useCallback as Q } from "react";
3
3
  import { createPortal as Ze } from "react-dom";
4
4
  import { z as a } from "zod";
5
5
  import Je from "diff-match-patch";
6
- import { useQueryClient as pe, useMutation as Ne, useQuery as et } from "@tanstack/react-query";
7
- import { IconQuestionLine as ye, IconPinLine as be, IconWarningLine as tt, IconArrowOpenDownLine as nt, IconEditLine as me, IconTrashLine as le, IconArrowOpenStartLine as ot, IconArrowOpenEndLine as rt, IconArrowStartLine as st } from "@instructure/ui-icons";
6
+ import { useQueryClient as ge, useMutation as pe, useQuery as et } from "@tanstack/react-query";
7
+ import { IconQuestionLine as Ne, IconPinLine as ye, IconWarningLine as tt, IconEditLine as fe, IconTrashLine as le, IconArrowOpenStartLine as nt, IconArrowOpenEndLine as ot, IconArrowStartLine as rt } from "@instructure/ui-icons";
8
8
  import { Menu as ee } from "@instructure/ui-menu";
9
- import { Flex as v } from "@instructure/ui-flex";
10
- import { TruncateText as he } from "@instructure/ui-truncate-text";
9
+ import { Flex as I } from "@instructure/ui-flex";
10
+ import { TruncateText as me } from "@instructure/ui-truncate-text";
11
11
  import { ScreenReaderContent as Me } from "@instructure/ui-a11y-content";
12
12
  import { SimpleSelect as we } from "@instructure/ui-simple-select";
13
- import { CloseButton as it, Button as U, IconButton as X } from "@instructure/ui-buttons";
13
+ import { CloseButton as st, Button as $, IconButton as Y } from "@instructure/ui-buttons";
14
14
  import { Heading as ae } from "@instructure/ui-heading";
15
- import { Tray as lt } from "@instructure/ui-tray";
16
- import { View as Q } from "@instructure/ui-view";
17
- import { Text as z } from "@instructure/ui-text";
15
+ import { Tray as it } from "@instructure/ui-tray";
16
+ import { View as q } from "@instructure/ui-view";
17
+ import { Text as U } from "@instructure/ui-text";
18
18
  import { TextArea as He } from "@instructure/ui-text-area";
19
- import { Pill as Oe } from "@instructure/ui-pill";
20
- import { Spinner as at } from "@instructure/ui-spinner";
21
- const ct = a.object({
19
+ import { Pill as ke } from "@instructure/ui-pill";
20
+ import { Spinner as lt } from "@instructure/ui-spinner";
21
+ const at = a.object({
22
22
  startContainer: a.string(),
23
23
  endContainer: a.string(),
24
24
  startOffset: a.number(),
25
25
  endOffset: a.number()
26
- }), dt = a.object({
26
+ }), ct = a.object({
27
27
  start: a.number(),
28
28
  end: a.number()
29
- }), Ee = a.object({
29
+ }), be = a.object({
30
30
  selectedText: a.string(),
31
31
  hasNoHighlightAnymore: a.boolean().optional(),
32
- textPosition: dt.nullable(),
33
- range: ct.nullable(),
32
+ textPosition: ct.nullable(),
33
+ range: at.nullable(),
34
34
  pageLastModifiedAt: a.string()
35
35
  });
36
- var A = /* @__PURE__ */ ((n) => (n.IMPORTANT = "Important", n.CONFUSING = "Confusing", n))(A || {});
37
- const Se = a.enum([
36
+ var k = /* @__PURE__ */ ((n) => (n.IMPORTANT = "Important", n.CONFUSING = "Confusing", n))(k || {});
37
+ const Ee = a.enum([
38
38
  "Important",
39
39
  "Confusing"
40
40
  /* CONFUSING */
@@ -51,32 +51,32 @@ const Se = a.enum([
51
51
  objectId: a.string(),
52
52
  objectType: a.string(),
53
53
  userText: a.string().optional(),
54
- reaction: a.array(Se),
55
- highlightData: Ee,
54
+ reaction: a.array(Ee),
55
+ highlightData: be,
56
56
  createdAt: a.string(),
57
57
  updatedAt: a.string()
58
- }), ut = a.object({
58
+ }), dt = a.object({
59
59
  cursor: a.string(),
60
60
  node: ce
61
61
  });
62
62
  a.object({
63
63
  notes: a.object({
64
- edges: a.array(ut),
64
+ edges: a.array(dt),
65
65
  nodes: a.array(ce),
66
66
  pageInfo: Be
67
67
  })
68
68
  });
69
- const ft = a.object({
69
+ const ut = a.object({
70
70
  type: a.string(),
71
71
  id: a.string()
72
- }), mt = a.object({
72
+ }), ft = a.object({
73
73
  courseId: a.string().optional(),
74
- learningObject: ft.optional(),
74
+ learningObject: ut.optional(),
75
75
  reactions: a.array(a.string()).optional()
76
76
  }).optional();
77
77
  a.object({
78
78
  courseId: a.string().optional(),
79
- filter: mt,
79
+ filter: ft,
80
80
  pageParams: Be.optional(),
81
81
  direction: a.enum(["next", "prev"]).optional(),
82
82
  pageSize: a.number().optional()
@@ -86,8 +86,8 @@ a.object({
86
86
  objectId: a.string(),
87
87
  objectType: a.string(),
88
88
  userText: a.string().optional(),
89
- reaction: a.array(Se),
90
- highlightData: Ee
89
+ reaction: a.array(Ee),
90
+ highlightData: be
91
91
  });
92
92
  a.object({
93
93
  createNote: ce
@@ -95,8 +95,8 @@ a.object({
95
95
  a.object({
96
96
  id: a.string(),
97
97
  userText: a.string().optional(),
98
- reaction: a.array(Se),
99
- highlightData: Ee
98
+ reaction: a.array(Ee),
99
+ highlightData: be
100
100
  });
101
101
  a.object({
102
102
  updateNote: ce
@@ -105,7 +105,7 @@ a.object({
105
105
  deleteNote: a.string()
106
106
  });
107
107
  var We = /* @__PURE__ */ ((n) => (n[n.FORWARDS = 1] = "FORWARDS", n[n.BACKWARDS = 2] = "BACKWARDS", n))(We || {});
108
- class $ {
108
+ class G {
109
109
  constructor(e, t) {
110
110
  this.start = e, this.end = t;
111
111
  }
@@ -123,17 +123,17 @@ class $ {
123
123
  return o.setStart(e.node, e.offset), o.setEnd(t.node, t.offset), o;
124
124
  }
125
125
  static fromRange(e) {
126
- const t = B.fromPoint(e.startContainer, e.startOffset), o = B.fromPoint(e.endContainer, e.endOffset);
127
- return !t || !o ? null : new $(t, o);
126
+ const t = W.fromPoint(e.startContainer, e.startOffset), o = W.fromPoint(e.endContainer, e.endOffset);
127
+ return !t || !o ? null : new G(t, o);
128
128
  }
129
129
  static fromOffsets(e, t, o) {
130
- return new $(new B(e, t), new B(e, o));
130
+ return new G(new W(e, t), new W(e, o));
131
131
  }
132
132
  relativeTo(e) {
133
- return new $(this.start.relativeTo(e), this.end.relativeTo(e));
133
+ return new G(this.start.relativeTo(e), this.end.relativeTo(e));
134
134
  }
135
135
  }
136
- class B {
136
+ class W {
137
137
  constructor(e, t) {
138
138
  t < 0 && console.error("Offset is invalid"), this.element = e, this.offset = t;
139
139
  }
@@ -155,9 +155,9 @@ class B {
155
155
  static fromCharOffset(e, t) {
156
156
  switch (e.nodeType) {
157
157
  case Node.TEXT_NODE:
158
- return B.fromPoint(e, t);
158
+ return W.fromPoint(e, t);
159
159
  case Node.ELEMENT_NODE:
160
- return new B(e, t);
160
+ return new W(e, t);
161
161
  default:
162
162
  return console.error("Node is not an element or text node"), null;
163
163
  }
@@ -170,7 +170,7 @@ class B {
170
170
  if (!e.parentElement)
171
171
  return console.error("Text node has no parent"), null;
172
172
  const o = De(e) + t;
173
- return new B(e.parentElement, o);
173
+ return new W(e.parentElement, o);
174
174
  }
175
175
  case Node.ELEMENT_NODE: {
176
176
  if (t < 0 || t > e.childNodes.length)
@@ -178,7 +178,7 @@ class B {
178
178
  let o = 0;
179
179
  for (let r = 0; r < t; r++)
180
180
  o += je(e.childNodes[r]);
181
- return new B(e, o);
181
+ return new W(e, o);
182
182
  }
183
183
  default:
184
184
  return console.error("Point is not in an element or text node"), null;
@@ -190,33 +190,33 @@ class B {
190
190
  let t = this.element, o = this.offset;
191
191
  for (; t !== e; )
192
192
  o += De(t), t.parentElement && (t = t.parentElement);
193
- return new B(t, o);
193
+ return new W(t, o);
194
194
  }
195
195
  }
196
- const ht = (n) => {
196
+ const mt = (n) => {
197
197
  const e = n.nodeName.toLowerCase();
198
198
  return e === "#text" ? "text()" : e;
199
199
  };
200
- function gt(n) {
200
+ function ht(n) {
201
201
  let e = 0, t = n;
202
202
  for (; t; )
203
203
  t.nodeName === n.nodeName && (e += 1), t = t.previousSibling;
204
204
  return e;
205
205
  }
206
- const pt = (n) => {
207
- const e = ht(n), t = gt(n);
206
+ const gt = (n) => {
207
+ const e = mt(n), t = ht(n);
208
208
  return `${e}[${t}]`;
209
- }, ke = (n, e) => {
209
+ }, Oe = (n, e) => {
210
210
  let t = "", o = n;
211
211
  for (; o !== e; ) {
212
212
  if (!o) {
213
213
  console.error("Node is not a descendant of root");
214
214
  return;
215
215
  }
216
- t = `${pt(o)}/${t}`, o = o.parentNode;
216
+ t = `${gt(o)}/${t}`, o = o.parentNode;
217
217
  }
218
218
  return t = `/${t}`, t = t.replace(/\/$/, ""), t;
219
- }, Nt = (n, e, t) => {
219
+ }, pt = (n, e, t) => {
220
220
  const o = e.toUpperCase();
221
221
  let r = -1;
222
222
  for (let s = 0; s < n.children.length; s++) {
@@ -225,41 +225,41 @@ const pt = (n) => {
225
225
  return l;
226
226
  }
227
227
  return null;
228
- }, yt = (n, e) => {
228
+ }, Nt = (n, e) => {
229
229
  if (!(n.match(/^(\/[A-Za-z0-9-]+(\[[0-9]+])?)+$/) !== null))
230
230
  return console.error("Expression is not a simple XPath"), null;
231
231
  const o = n.split("/");
232
232
  let r = e;
233
233
  o.shift();
234
234
  for (const s of o) {
235
- let l, d;
235
+ let l, c;
236
236
  const m = s.indexOf("[");
237
237
  if (m !== -1) {
238
238
  l = s.slice(0, m);
239
239
  const g = s.slice(m + 1, s.indexOf("]"));
240
- if (d = Number.parseInt(g, 10) - 1, d < 0)
240
+ if (c = Number.parseInt(g, 10) - 1, c < 0)
241
241
  return null;
242
242
  } else
243
- l = s, d = 0;
244
- const c = Nt(r, l, d);
245
- if (!c)
243
+ l = s, c = 0;
244
+ const d = pt(r, l, c);
245
+ if (!d)
246
246
  return null;
247
- r = c;
247
+ r = d;
248
248
  }
249
249
  return r;
250
250
  }, Re = (n, e = document.body) => {
251
251
  try {
252
- return yt(n, e);
252
+ return Nt(n, e);
253
253
  } catch {
254
254
  return document.evaluate(`.${n}`, e, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
255
255
  }
256
256
  };
257
- class Y {
257
+ class V {
258
258
  constructor(e, t) {
259
259
  this.root = e, this.range = t;
260
260
  }
261
261
  static fromRange(e, t) {
262
- return new Y(e, t);
262
+ return new V(e, t);
263
263
  }
264
264
  static fromSelector(e, t) {
265
265
  if (!(t != null && t.startContainer) || !(t != null && t.endContainer))
@@ -270,18 +270,18 @@ class Y {
270
270
  const r = Re(t.endContainer, e);
271
271
  if (!r)
272
272
  return console.error("Failed to resolve endContainer XPath"), null;
273
- const s = B.fromCharOffset(o, t.startOffset), l = B.fromCharOffset(r, t.endOffset);
273
+ const s = W.fromCharOffset(o, t.startOffset), l = W.fromCharOffset(r, t.endOffset);
274
274
  if (!s || !l)
275
275
  return null;
276
- const d = new $(s, l).toRange();
277
- return d ? new Y(e, d) : null;
276
+ const c = new G(s, l).toRange();
277
+ return c ? new V(e, c) : null;
278
278
  }
279
279
  toRange() {
280
280
  return this.range;
281
281
  }
282
282
  toSelector() {
283
283
  var s;
284
- const e = (s = $.fromRange(this.range)) == null ? void 0 : s.toRange(), t = e && $.fromRange(e), o = t && ke(t.start.element, this.root), r = t && ke(t.end.element, this.root);
284
+ const e = (s = G.fromRange(this.range)) == null ? void 0 : s.toRange(), t = e && G.fromRange(e), o = t && Oe(t.start.element, this.root), r = t && Oe(t.end.element, this.root);
285
285
  return !o || !r ? null : {
286
286
  startContainer: o,
287
287
  startOffset: t.start.offset,
@@ -290,17 +290,17 @@ class Y {
290
290
  };
291
291
  }
292
292
  }
293
- class G {
293
+ class K {
294
294
  constructor(e, t, o) {
295
295
  this.root = e, this.start = t, this.end = o;
296
296
  }
297
297
  static fromRange(e, t) {
298
298
  var r;
299
- const o = (r = $.fromRange(t)) == null ? void 0 : r.relativeTo(e);
300
- return o ? new G(e, o.start.offset, o.end.offset) : null;
299
+ const o = (r = G.fromRange(t)) == null ? void 0 : r.relativeTo(e);
300
+ return o ? new K(e, o.start.offset, o.end.offset) : null;
301
301
  }
302
302
  static fromSelector(e, t) {
303
- return new G(e, t.start, t.end);
303
+ return new K(e, t.start, t.end);
304
304
  }
305
305
  toSelector() {
306
306
  return {
@@ -309,7 +309,7 @@ class G {
309
309
  };
310
310
  }
311
311
  toRange() {
312
- return $.fromOffsets(this.root, this.start, this.end).toRange();
312
+ return G.fromOffsets(this.root, this.start, this.end).toRange();
313
313
  }
314
314
  }
315
315
  const je = (n) => {
@@ -329,62 +329,62 @@ const je = (n) => {
329
329
  }, ze = (n, ...e) => {
330
330
  let t = e.shift();
331
331
  const o = n.ownerDocument.createNodeIterator(n, NodeFilter.SHOW_TEXT), r = [];
332
- let s = o.nextNode(), l = null, d = 0;
332
+ let s = o.nextNode(), l = null, c = 0;
333
333
  for (; t !== void 0 && s; )
334
- l = s, d + l.data.length > t ? (r.push({ node: l, offset: t - d }), t = e.shift()) : (s = o.nextNode(), d += l.data.length);
335
- for (; t !== void 0 && l && d === t; )
334
+ l = s, c + l.data.length > t ? (r.push({ node: l, offset: t - c }), t = e.shift()) : (s = o.nextNode(), c += l.data.length);
335
+ for (; t !== void 0 && l && c === t; )
336
336
  r.push({ node: l, offset: l.data.length }), t = e.shift();
337
337
  return t !== void 0 && console.error("Offset exceeds text length"), r;
338
- }, bt = (n, e, t, o) => {
338
+ }, yt = (n, e, t, o) => {
339
339
  const r = t - e;
340
- return Math.abs(r - o) <= 5 ? G.fromSelector(n, {
340
+ return Math.abs(r - o) <= 5 ? K.fromSelector(n, {
341
341
  start: e,
342
342
  end: t
343
343
  }) : null;
344
- }, Et = (n, e, t, o) => {
344
+ }, bt = (n, e, t, o) => {
345
345
  const r = new Je();
346
346
  r.Match_Distance = 5e3;
347
347
  const s = n.textContent;
348
348
  if (!s)
349
349
  return null;
350
350
  if (e.length > 32) {
351
- const l = e.slice(0, 32), d = e.slice(-32), m = o - t;
352
- let c = r.match_main(s, l, t);
353
- const g = r.match_main(s, d, o), h = g + d.length;
354
- if (c === -1 || g === -1)
351
+ const l = e.slice(0, 32), c = e.slice(-32), m = o - t;
352
+ let d = r.match_main(s, l, t);
353
+ const g = r.match_main(s, c, o), h = g + c.length;
354
+ if (d === -1 || g === -1)
355
355
  return null;
356
- const u = h - c, E = Math.abs(u - m);
357
- if ((c > h || E > 5) && (r.Match_Distance = e.length + 100, c = r.match_main(s, l, h), c !== -1 && c < h))
358
- return bt(n, c, h, m);
359
- if (c < h && E <= 5)
360
- return G.fromSelector(n, {
361
- start: c,
356
+ const u = h - d, E = Math.abs(u - m);
357
+ if ((d > h || E > 5) && (r.Match_Distance = e.length + 100, d = r.match_main(s, l, h), d !== -1 && d < h))
358
+ return yt(n, d, h, m);
359
+ if (d < h && E <= 5)
360
+ return K.fromSelector(n, {
361
+ start: d,
362
362
  end: h
363
363
  });
364
364
  } else {
365
365
  const l = r.match_main(s, e, t);
366
366
  if (l !== -1)
367
- return G.fromSelector(n, {
367
+ return K.fromSelector(n, {
368
368
  start: l,
369
369
  end: l + e.length
370
370
  });
371
371
  }
372
372
  return null;
373
- }, St = (n, e) => {
373
+ }, Et = (n, e) => {
374
374
  if (!e) return null;
375
375
  const { highlightData: t } = n, { textPosition: o, selectedText: r } = t;
376
- return Et(
376
+ return bt(
377
377
  e,
378
378
  r,
379
379
  (o == null ? void 0 : o.start) ?? 0,
380
380
  (o == null ? void 0 : o.end) ?? 0
381
381
  );
382
- }, Ct = (n, e, t) => {
382
+ }, St = (n, e, t) => {
383
383
  const o = [], r = [];
384
384
  for (const s of e) {
385
- const l = St(s, n);
385
+ const l = Et(s, n);
386
386
  if (l) {
387
- const d = l.toRange(), m = d && Y.fromRange(n, d);
387
+ const c = l.toRange(), m = c && V.fromRange(n, c);
388
388
  o.push({
389
389
  id: s.id,
390
390
  reaction: s.reaction,
@@ -414,23 +414,23 @@ const je = (n) => {
414
414
  var l;
415
415
  if (!e) return;
416
416
  const { highlightData: t, id: o } = n, { range: r } = t ?? {};
417
- r && ((l = Y.fromSelector(e, r)) == null ? void 0 : l.toRange()) && Rt({ id: o });
417
+ r && ((l = V.fromSelector(e, r)) == null ? void 0 : l.toRange()) && Ot({ id: o });
418
418
  }, vt = (n) => {
419
419
  const e = document.getElementById(ve(n));
420
420
  if (e) {
421
421
  const t = e.getBoundingClientRect();
422
422
  t.top >= 0 && t.left >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight) && t.right <= (window.innerWidth || document.documentElement.clientWidth) || e.scrollIntoView({ behavior: "smooth", block: "start" });
423
423
  }
424
- }, se = 90, ie = 172, It = (n) => {
424
+ }, se = 90, ie = 172, Tt = (n) => {
425
425
  const e = n.getClientRects();
426
426
  if (!e.length)
427
427
  return null;
428
- const t = e[0], o = e[e.length - 1], r = 4, s = 16, l = window.innerWidth || document.documentElement.clientWidth, d = window.innerHeight || document.documentElement.clientHeight, m = (f) => {
429
- const I = f + ie;
430
- return f >= s && I <= l - s;
431
- }, c = (f) => {
432
- const I = f + se;
433
- return f >= s && I <= d - s;
428
+ const t = e[0], o = e[e.length - 1], r = 4, s = 16, l = window.innerWidth || document.documentElement.clientWidth, c = window.innerHeight || document.documentElement.clientHeight, m = (f) => {
429
+ const v = f + ie;
430
+ return f >= s && v <= l - s;
431
+ }, d = (f) => {
432
+ const v = f + se;
433
+ return f >= s && v <= c - s;
434
434
  };
435
435
  let g;
436
436
  const h = t.right - ie;
@@ -441,28 +441,28 @@ const je = (n) => {
441
441
  if (m(f))
442
442
  g = f;
443
443
  else {
444
- const O = (t.left + t.right) / 2 - ie / 2;
445
- m(O) ? g = O : h < s ? g = s : g = l - ie - s;
444
+ const y = (t.left + t.right) / 2 - ie / 2;
445
+ m(y) ? g = y : h < s ? g = s : g = l - ie - s;
446
446
  }
447
447
  }
448
448
  let u;
449
449
  const E = o.bottom + r;
450
- if (c(E))
450
+ if (d(E))
451
451
  u = E;
452
452
  else {
453
453
  const f = t.top - se - r;
454
- c(f) ? u = f : E + se > d - s ? u = d - se - s : u = s;
454
+ d(f) ? u = f : E + se > c - s ? u = c - se - s : u = s;
455
455
  }
456
456
  return { top: u, left: g };
457
- }, Tt = (n, e) => {
457
+ }, It = (n, e) => {
458
458
  for (const t of e)
459
459
  if (n.start < t.end && n.end > t.start)
460
460
  return !0;
461
461
  return !1;
462
- }, Ce = (n) => `highlight-wrapper-${n}`, ve = (n) => `${Ce(n)}-start`, Ue = (n) => `${Ce(n)}-end`, ne = (n) => `[data-highlight-id="${CSS.escape(n)}"]`, de = (n, e) => {
462
+ }, Se = (n) => `highlight-wrapper-${n}`, ve = (n) => `${Se(n)}-start`, Ue = (n) => `${Se(n)}-end`, ne = (n) => `[data-highlight-id="${CSS.escape(n)}"]`, Te = (n, e) => {
463
463
  const t = Number.parseInt(n.slice(1, 3), 16), o = Number.parseInt(n.slice(3, 5), 16), r = Number.parseInt(n.slice(5, 7), 16);
464
464
  return `rgba(${t}, ${o}, ${r}, ${e})`;
465
- }, xt = (n, e) => {
465
+ }, Ct = (n, e) => {
466
466
  var t;
467
467
  try {
468
468
  const o = ((t = e.nodeValue) == null ? void 0 : t.length) ?? e.childNodes.length;
@@ -470,7 +470,7 @@ const je = (n) => {
470
470
  } catch {
471
471
  return !1;
472
472
  }
473
- }, wt = (n) => {
473
+ }, xt = (n) => {
474
474
  var s;
475
475
  if (n.collapsed)
476
476
  return [];
@@ -480,7 +480,7 @@ const je = (n) => {
480
480
  const t = [], o = (s = e == null ? void 0 : e.ownerDocument) == null ? void 0 : s.createNodeIterator(e, NodeFilter.SHOW_TEXT);
481
481
  let r = (o == null ? void 0 : o.nextNode()) || null;
482
482
  for (; r; ) {
483
- if (!xt(n, r)) {
483
+ if (!Ct(n, r)) {
484
484
  r = (o == null ? void 0 : o.nextNode()) || null;
485
485
  continue;
486
486
  }
@@ -492,49 +492,49 @@ const je = (n) => {
492
492
  l === n.endContainer && n.endOffset < l.data.length && l.splitText(n.endOffset), t.push(l), r = (o == null ? void 0 : o.nextNode()) || null;
493
493
  }
494
494
  return t;
495
- }, Ot = (n, e, t) => {
495
+ }, wt = (n, e, t) => {
496
496
  if (n.collapsed) return;
497
- const o = e.id ?? "", r = Ce(o);
497
+ const o = e.id ?? "", r = Se(o);
498
498
  if (document.getElementById(ve(o))) {
499
499
  kt(e, t);
500
500
  return;
501
501
  }
502
- const l = e.type === A.IMPORTANT ? t.colors.importantBackground : t.colors.confusingBackground, m = e.id === e.selectedNoteId ? l : de(l, 0.5), c = e.type === A.IMPORTANT ? t.colors.importantUnderline : t.colors.confusingUnderline, g = e.type === A.IMPORTANT ? "solid" : "dashed", h = n.toString(), u = document.createElement("span");
502
+ const l = e.type === k.IMPORTANT ? t.colors.importantBackground : t.colors.confusingBackground, m = e.id === e.selectedNoteId ? l : Te(l, 0.5), d = e.type === k.IMPORTANT ? t.colors.importantUnderline : t.colors.confusingUnderline, g = e.type === k.IMPORTANT ? "solid" : "dashed", h = n.toString(), u = document.createElement("span");
503
503
  u.id = `${r}-start`, u.className = "highlight-marker-start", u.dataset.highlightId = o || "", u.setAttribute("role", "button"), u.setAttribute("tabindex", "0"), u.setAttribute("aria-label", h), u.style.position = "relative", u.style.fontSize = "0", u.style.lineHeight = "0", u.style.width = "0", u.style.height = "0", u.style.margin = "0", u.style.padding = "0", u.style.border = "0";
504
504
  const E = document.createElement("span");
505
505
  E.id = Ue(o), E.className = "highlight-marker-end", E.dataset.highlightId = o || "";
506
506
  const f = n.cloneRange();
507
507
  f.collapse(!1), f.insertNode(E);
508
- const I = n.cloneRange();
509
- I.collapse(!0), I.insertNode(u);
510
- const O = document.createRange();
511
- O.setStartAfter(u), O.setEndBefore(E);
512
- const T = wt(O).filter((N) => N.textContent && N.textContent.length > 0);
513
- T.forEach((N, x) => {
514
- var V;
515
- const R = N.parentElement;
516
- if ((R == null ? void 0 : R.dataset.highlightId) === o) return;
517
- const P = x === 0, C = x === T.length - 1, W = T.length === 1;
518
- let L;
519
- W ? L = "single" : P ? L = "first" : C ? L = "last" : L = "middle";
508
+ const v = n.cloneRange();
509
+ v.collapse(!0), v.insertNode(u);
510
+ const y = document.createRange();
511
+ y.setStartAfter(u), y.setEndBefore(E);
512
+ const _ = xt(y).filter((p) => p.textContent && p.textContent.length > 0);
513
+ _.forEach((p, C) => {
514
+ var j;
515
+ const w = p.parentElement;
516
+ if ((w == null ? void 0 : w.dataset.highlightId) === o) return;
517
+ const x = C === 0, R = C === _.length - 1, P = _.length === 1;
518
+ let M;
519
+ P ? M = "single" : x ? M = "first" : R ? M = "last" : M = "middle";
520
520
  const D = document.createElement("span");
521
- D.className = "highlight-content", D.dataset.highlightId = o || "", D.dataset.position = L, D.style.backgroundColor = m, D.style.textDecorationLine = "underline", D.style.textDecorationColor = c, D.style.textDecorationStyle = g, D.style.textDecorationThickness = t.borderWidthSmall, D.style.textUnderlineOffset = t.underlineOffset, D.style.cursor = "pointer", D.addEventListener("click", (w) => {
522
- var y;
523
- w.target.tagName !== "A" && ((y = e.onClick) == null || y.call(e));
524
- }), (V = N.parentNode) == null || V.insertBefore(D, N), D.appendChild(N);
525
- }), u.addEventListener("click", (N) => {
526
- var x;
527
- N.target.tagName !== "A" && ((x = e.onClick) == null || x.call(e));
528
- }), u.addEventListener("keydown", (N) => {
529
- var x;
530
- if (N.key === "Enter" || N.key === " ")
531
- N.preventDefault(), (x = e.onClick) == null || x.call(e);
532
- else if (N.key === "Tab" && !N.shiftKey) {
533
- const R = document.querySelectorAll(ne(o));
534
- for (const P of R) {
535
- const C = P.querySelector("a");
536
- if (C) {
537
- N.preventDefault(), C.focus();
521
+ D.className = "highlight-content", D.dataset.highlightId = o || "", D.dataset.position = M, D.style.backgroundColor = m, D.style.textDecorationLine = "underline", D.style.textDecorationColor = d, D.style.textDecorationStyle = g, D.style.textDecorationThickness = t.borderWidthSmall, D.style.textUnderlineOffset = t.underlineOffset, D.style.cursor = "pointer", D.addEventListener("click", (O) => {
522
+ var b;
523
+ O.target.tagName !== "A" && ((b = e.onClick) == null || b.call(e));
524
+ }), (j = p.parentNode) == null || j.insertBefore(D, p), D.appendChild(p);
525
+ }), u.addEventListener("click", (p) => {
526
+ var C;
527
+ p.target.tagName !== "A" && ((C = e.onClick) == null || C.call(e));
528
+ }), u.addEventListener("keydown", (p) => {
529
+ var C;
530
+ if (p.key === "Enter" || p.key === " ")
531
+ p.preventDefault(), (C = e.onClick) == null || C.call(e);
532
+ else if (p.key === "Tab" && !p.shiftKey) {
533
+ const w = document.querySelectorAll(ne(o));
534
+ for (const x of w) {
535
+ const R = x.querySelector("a");
536
+ if (R) {
537
+ p.preventDefault(), R.focus();
538
538
  break;
539
539
  }
540
540
  }
@@ -542,26 +542,26 @@ const je = (n) => {
542
542
  }), u.addEventListener("focus", () => {
543
543
  document.querySelectorAll(
544
544
  ne(o)
545
- ).forEach((x) => {
546
- x.classList.add("highlight-focused");
545
+ ).forEach((C) => {
546
+ C.classList.add("highlight-focused");
547
547
  });
548
548
  }), u.addEventListener("blur", () => {
549
549
  document.querySelectorAll(
550
550
  ne(o)
551
- ).forEach((x) => {
552
- x.classList.remove("highlight-focused");
551
+ ).forEach((C) => {
552
+ C.classList.remove("highlight-focused");
553
553
  });
554
554
  });
555
555
  };
556
556
  function kt(n, e) {
557
- const t = n.type === A.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, r = n.id === n.selectedNoteId ? t : de(t, 0.5);
557
+ const t = n.type === k.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, r = n.id === n.selectedNoteId ? t : Te(t, 0.5);
558
558
  document.querySelectorAll(
559
559
  ne(n.id ?? "")
560
560
  ).forEach((l) => {
561
561
  l.style.backgroundColor = r;
562
562
  });
563
563
  }
564
- const Rt = (n) => {
564
+ const Ot = (n) => {
565
565
  const e = n.id ?? "", t = document.getElementById(ve(e)), o = document.getElementById(Ue(e));
566
566
  document.querySelectorAll(
567
567
  ne(e)
@@ -575,18 +575,18 @@ const Rt = (n) => {
575
575
  all: ["notebook"],
576
576
  notes: (n) => ["notebook", "notes", n]
577
577
  };
578
- function Dt(n) {
579
- const e = pe();
580
- return Ne({
578
+ function Rt(n) {
579
+ const e = ge();
580
+ return pe({
581
581
  mutationFn: (t) => n.createNote(t),
582
582
  onSuccess: () => {
583
583
  e.invalidateQueries({ queryKey: te.all });
584
584
  }
585
585
  });
586
586
  }
587
- function At(n) {
588
- const e = pe();
589
- return Ne({
587
+ function Dt(n) {
588
+ const e = ge();
589
+ return pe({
590
590
  mutationFn: (t) => n.deleteNote(t),
591
591
  onSuccess: () => {
592
592
  e.invalidateQueries({ queryKey: te.all });
@@ -604,19 +604,19 @@ function $e({
604
604
  enabled: e
605
605
  });
606
606
  }
607
- function Lt(n) {
608
- const e = pe();
609
- return Ne({
607
+ function At(n) {
608
+ const e = ge();
609
+ return pe({
610
610
  mutationFn: ({ id: t, input: o }) => n.updateNote(t, o),
611
611
  onMutate: async ({ id: t, input: o }) => {
612
612
  await e.cancelQueries({ queryKey: te.all });
613
613
  const s = e.getQueryCache().findAll({ queryKey: te.all }), l = /* @__PURE__ */ new Map();
614
- for (const d of s) {
615
- const m = d.state.data;
616
- m && (l.set(d.queryKey, m), e.setQueryData(d.queryKey, {
614
+ for (const c of s) {
615
+ const m = c.state.data;
616
+ m && (l.set(c.queryKey, m), e.setQueryData(c.queryKey, {
617
617
  ...m,
618
618
  notes: m.notes.map(
619
- (c) => c.id === t ? { ...c, ...o, updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : c
619
+ (d) => d.id === t ? { ...d, ...o, updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : d
620
620
  )
621
621
  }));
622
622
  }
@@ -632,48 +632,48 @@ function Lt(n) {
632
632
  }
633
633
  });
634
634
  }
635
- const Pt = "Notebook", _t = "Notes", Ft = "Important", Mt = "Unclear", Ht = "Back", Bt = "Edit note", Wt = "Save", jt = "Cancel", zt = "Delete note", Ut = "note", $t = "Add note (optional)", Gt = "Remove from Notebook", qt = "Add a note (optional).", Kt = "Mark important", Xt = "Mark unclear", Qt = "Saved to Notebook.", Yt = "Note updated", Vt = "Note deleted", Zt = "Error saving to Notebook.", Jt = "Error updating note", en = "Note deletion failed", tn = "Loading notes", nn = "Failed to load notes", on = "Start capturing your notes", rn = "Your notes from learning materials will appear here. Highlight key ideas, reflections, or questions as you learn—they'll all be saved in your Notebook for easy review later.", sn = "Nothing here yet", ln = "Adjust your filters or create a new note to get started.", an = "You have no notes for the selected filter", cn = "Previous page", dn = "Next page", un = "All courses", fn = "All notes", mn = "Close Notebook panel", hn = "To use the Notebook feature, highlight an excerpt from your learning material to flag it as 'confusing' or 'important' and leave an optional note.", gn = "The content you highlighted is no longer available.", Ie = {
636
- notebook: Pt,
637
- notes: _t,
638
- important: Ft,
639
- unclear: Mt,
640
- back: Ht,
641
- editNote: Bt,
642
- save: Wt,
643
- cancel: jt,
644
- deleteNote: zt,
645
- note: Ut,
646
- addNotePrompt: $t,
647
- removeFromNotebook: Gt,
635
+ const Lt = "Notebook", Pt = "Notes", _t = "Important", Ft = "Unclear", Mt = "Back", Ht = "Edit note", Bt = "Save", Wt = "Cancel", jt = "Delete note", zt = "note", Ut = "Add note (optional)", $t = "Remove from Notebook", qt = "Add a note (optional)", Gt = "Mark important", Kt = "Mark unclear", Xt = "Saved to Notebook.", Qt = "Note updated", Yt = "Note deleted", Vt = "Error saving to Notebook.", Zt = "Error updating note", Jt = "Note deletion failed", en = "Loading notes", tn = "Failed to load notes", nn = "Start capturing your notes", on = "Your notes from learning materials will appear here. Highlight key ideas, reflections, or questions as you learn—they'll all be saved in your Notebook for easy review later.", rn = "Nothing here yet", sn = "Adjust your filters or create a new note to get started.", ln = "You have no notes for the selected filter", an = "Previous page", cn = "Next page", dn = "All courses", un = "All notes", fn = "Close Notebook panel", mn = "To use the Notebook feature, highlight an excerpt from your learning material to flag it as 'confusing' or 'important' and leave an optional note.", hn = "The content you highlighted is no longer available.", Ie = {
636
+ notebook: Lt,
637
+ notes: Pt,
638
+ important: _t,
639
+ unclear: Ft,
640
+ back: Mt,
641
+ editNote: Ht,
642
+ save: Bt,
643
+ cancel: Wt,
644
+ deleteNote: jt,
645
+ note: zt,
646
+ addNotePrompt: Ut,
647
+ removeFromNotebook: $t,
648
648
  addNoteOptional: qt,
649
- markImportant: Kt,
650
- markUnclear: Xt,
651
- savedToNotebook: Qt,
652
- noteUpdated: Yt,
653
- noteDeleted: Vt,
654
- errorSavingNote: Zt,
655
- errorUpdatingNote: Jt,
656
- noteDeletionFailed: en,
657
- loadingNotes: tn,
658
- failedToLoadNotes: nn,
659
- emptyStateHeading: on,
660
- emptyStateDescription: rn,
661
- nothingHereYet: sn,
662
- adjustFiltersOrCreate: ln,
663
- noNotesForFilter: an,
664
- previousPage: cn,
665
- nextPage: dn,
666
- allCourses: un,
667
- allNotes: fn,
668
- closeNotebookPanel: mn,
669
- featureDescription: hn,
670
- highlightUnavailable: gn
671
- }, Ge = Pe(null);
672
- function qe(n, e) {
649
+ markImportant: Gt,
650
+ markUnclear: Kt,
651
+ savedToNotebook: Xt,
652
+ noteUpdated: Qt,
653
+ noteDeleted: Yt,
654
+ errorSavingNote: Vt,
655
+ errorUpdatingNote: Zt,
656
+ noteDeletionFailed: Jt,
657
+ loadingNotes: en,
658
+ failedToLoadNotes: tn,
659
+ emptyStateHeading: nn,
660
+ emptyStateDescription: on,
661
+ nothingHereYet: rn,
662
+ adjustFiltersOrCreate: sn,
663
+ noNotesForFilter: ln,
664
+ previousPage: an,
665
+ nextPage: cn,
666
+ allCourses: dn,
667
+ allNotes: un,
668
+ closeNotebookPanel: fn,
669
+ featureDescription: mn,
670
+ highlightUnavailable: hn
671
+ }, qe = Pe(null);
672
+ function Ge(n, e) {
673
673
  const t = Ie[n] ?? n;
674
674
  return e ? t.replace(/%\{([^}]+)}/g, (o, r) => String(e[r] ?? `%{${r}}`)) : t;
675
675
  }
676
- function pn({
676
+ function gn({
677
677
  translations: n,
678
678
  translate: e,
679
679
  children: t
@@ -681,22 +681,22 @@ function pn({
681
681
  const o = oe(
682
682
  () => ({
683
683
  translations: { ...Ie, ...n },
684
- translate: e ?? qe
684
+ translate: e ?? Ge
685
685
  }),
686
686
  [n, e]
687
687
  );
688
- return /* @__PURE__ */ i(Ge.Provider, { value: o, children: t });
688
+ return /* @__PURE__ */ i(qe.Provider, { value: o, children: t });
689
689
  }
690
- function q() {
691
- const n = _e(Ge);
692
- return n || { translations: Ie, translate: qe };
690
+ function X() {
691
+ const n = _e(qe);
692
+ return n || { translations: Ie, translate: Ge };
693
693
  }
694
- const Nn = {
694
+ const pn = {
695
695
  selectedNoteId: null,
696
696
  isNoteEditing: !1,
697
697
  isTrayOpen: !1
698
698
  };
699
- function yn(n, e) {
699
+ function Nn(n, e) {
700
700
  switch (e.type) {
701
701
  case "SELECT_NOTE":
702
702
  return {
@@ -717,7 +717,7 @@ function yn(n, e) {
717
717
  }
718
718
  }
719
719
  const Ke = Pe(null);
720
- function Xn({
720
+ function Kn({
721
721
  api: n,
722
722
  currentUserId: e,
723
723
  objectId: t,
@@ -725,11 +725,11 @@ function Xn({
725
725
  courseId: r,
726
726
  pageLastModifiedAt: s,
727
727
  onAnalyticsEvent: l,
728
- translations: d,
728
+ translations: c,
729
729
  translate: m,
730
- children: c
730
+ children: d
731
731
  }) {
732
- const [g, h] = Fe(yn, Nn), u = oe(
732
+ const [g, h] = Fe(Nn, pn), u = oe(
733
733
  () => ({
734
734
  api: n,
735
735
  currentUserId: e,
@@ -756,7 +756,7 @@ function Xn({
756
756
  g
757
757
  ]
758
758
  );
759
- return /* @__PURE__ */ i(Ke.Provider, { value: u, children: /* @__PURE__ */ i(pn, { translations: d, translate: m, children: c }) });
759
+ return /* @__PURE__ */ i(Ke.Provider, { value: u, children: /* @__PURE__ */ i(gn, { translations: c, translate: m, children: d }) });
760
760
  }
761
761
  function Xe() {
762
762
  const n = _e(Ke);
@@ -764,22 +764,22 @@ function Xe() {
764
764
  throw new Error("useNotebook must be used within a NotebookProvider");
765
765
  return n;
766
766
  }
767
- const bn = ({ currentType: n, onSelectReaction: e }) => {
768
- const { translations: t } = q(), o = re(null), r = re(null);
767
+ const yn = ({ currentType: n, onSelectReaction: e }) => {
768
+ const { translations: t } = X(), o = re(null), r = re(null);
769
769
  return J(() => {
770
- n === A.CONFUSING && o.current ? o.current.focus() : n === A.IMPORTANT && r.current ? r.current.focus() : o.current && o.current.focus();
771
- }, [n]), /* @__PURE__ */ b(ee, { children: [
772
- /* @__PURE__ */ b(ee.Item, { ref: o, onClick: () => e(A.CONFUSING), children: [
773
- /* @__PURE__ */ i(ye, { size: "x-small" }),
770
+ n === k.CONFUSING && o.current ? o.current.focus() : n === k.IMPORTANT && r.current ? r.current.focus() : o.current && o.current.focus();
771
+ }, [n]), /* @__PURE__ */ S(ee, { children: [
772
+ /* @__PURE__ */ S(ee.Item, { ref: o, onClick: () => e(k.CONFUSING), children: [
773
+ /* @__PURE__ */ i(Ne, { size: "x-small" }),
774
774
  ` ${t.markUnclear}`
775
775
  ] }),
776
- /* @__PURE__ */ b(ee.Item, { ref: r, onClick: () => e(A.IMPORTANT), children: [
777
- /* @__PURE__ */ i(be, { size: "x-small" }),
776
+ /* @__PURE__ */ S(ee.Item, { ref: r, onClick: () => e(k.IMPORTANT), children: [
777
+ /* @__PURE__ */ i(ye, { size: "x-small" }),
778
778
  ` ${t.markImportant}`
779
779
  ] })
780
780
  ] });
781
- }, ue = "notebook-inline-reaction-menu";
782
- function Qn({
781
+ }, de = "notebook-inline-reaction-menu";
782
+ function Xn({
783
783
  containerRef: n,
784
784
  highlightTheme: e,
785
785
  debounceTime: t = 500
@@ -789,9 +789,9 @@ function Qn({
789
789
  objectId: r,
790
790
  objectType: s,
791
791
  courseId: l,
792
- pageLastModifiedAt: d,
792
+ pageLastModifiedAt: c,
793
793
  selectedNoteId: m,
794
- selectNote: c,
794
+ selectNote: d,
795
795
  openTray: g
796
796
  } = Xe(), { data: h } = $e({
797
797
  api: o,
@@ -800,174 +800,174 @@ function Qn({
800
800
  },
801
801
  courseId: l,
802
802
  pageSize: 100
803
- }), { mutate: u } = Dt(o), { mutate: E } = Lt(o), { mutate: f } = At(o), I = re([]), [O, k] = H([]), [T, N] = H(null), [x, R] = H(""), [P, C] = H(null), [W, L] = H(!1);
803
+ }), { mutate: u } = Rt(o), { mutate: E } = At(o), { mutate: f } = Dt(o), v = re([]), [y, L] = B([]), [_, p] = B(null), [C, w] = B(""), [x, R] = B(null), [P, M] = B(!1);
804
804
  J(() => {
805
- const w = n.current;
806
- if (!w) return;
807
- const y = w.closest(".user_content") ?? w;
808
- if (y.classList.contains("enhanced")) {
809
- L(!0);
805
+ const O = n.current;
806
+ if (!O) return;
807
+ const b = O.closest(".user_content") ?? O;
808
+ if (b.classList.contains("enhanced")) {
809
+ M(!0);
810
810
  return;
811
811
  }
812
- const _ = new MutationObserver((F) => {
813
- for (const M of F)
814
- if (M.type === "attributes" && M.attributeName === "class" && M.target.classList.contains("enhanced")) {
815
- L(!0), _.disconnect();
812
+ const N = new MutationObserver((F) => {
813
+ for (const H of F)
814
+ if (H.type === "attributes" && H.attributeName === "class" && H.target.classList.contains("enhanced")) {
815
+ M(!0), N.disconnect();
816
816
  return;
817
817
  }
818
818
  });
819
- return _.observe(y, { attributes: !0, attributeFilter: ["class"] }), () => _.disconnect();
819
+ return N.observe(b, { attributes: !0, attributeFilter: ["class"] }), () => N.disconnect();
820
820
  }, [n]), J(() => {
821
- if (!W || !n.current) return;
822
- let y = null;
823
- const _ = () => {
824
- y && clearTimeout(y), y = setTimeout(() => {
821
+ if (!P || !n.current) return;
822
+ let b = null;
823
+ const N = () => {
824
+ b && clearTimeout(b), b = setTimeout(() => {
825
825
  var xe;
826
- const S = window.getSelection(), p = n.current;
827
- if (!(S != null && S.rangeCount) || !p) return;
828
- const j = S.toString().trim();
829
- if (j === "") return;
830
- const Z = S.getRangeAt(0);
831
- if (!p.contains(Z.commonAncestorContainer)) return;
832
- const Te = (xe = G.fromRange(p, Z)) == null ? void 0 : xe.toSelector();
833
- Te && !Tt(Te, O) && (N(Z.cloneRange()), R(j), C(It(Z)));
826
+ const T = window.getSelection(), A = n.current;
827
+ if (!(T != null && T.rangeCount) || !A) return;
828
+ const z = T.toString().trim();
829
+ if (z === "") return;
830
+ const Z = T.getRangeAt(0);
831
+ if (!A.contains(Z.commonAncestorContainer)) return;
832
+ const Ce = (xe = K.fromRange(A, Z)) == null ? void 0 : xe.toSelector();
833
+ Ce && !It(Ce, y) && (p(Z.cloneRange()), w(z), R(Tt(Z)));
834
834
  }, t);
835
- }, F = (S) => {
836
- if (!(S.target instanceof Node)) return;
837
- const p = document.getElementById(ue);
838
- p != null && p.contains(S.target) ? (S.preventDefault(), S.stopImmediatePropagation()) : (C(null), N(null), R(""));
839
- }, M = () => {
840
- C(null), N(null), R("");
835
+ }, F = (T) => {
836
+ if (!(T.target instanceof Node)) return;
837
+ const A = document.getElementById(de);
838
+ A != null && A.contains(T.target) ? (T.preventDefault(), T.stopImmediatePropagation()) : (R(null), p(null), w(""));
839
+ }, H = () => {
840
+ R(null), p(null), w("");
841
841
  };
842
- return document.addEventListener("selectionchange", _), document.addEventListener("mousedown", F), document.addEventListener("touchstart", F), window.addEventListener("scroll", M, !0), () => {
843
- y && clearTimeout(y), document.removeEventListener("selectionchange", _), document.removeEventListener("mousedown", F), document.removeEventListener("touchstart", F), window.removeEventListener("scroll", M, !0);
842
+ return document.addEventListener("selectionchange", N), document.addEventListener("mousedown", F), document.addEventListener("touchstart", F), window.addEventListener("scroll", H, !0), () => {
843
+ b && clearTimeout(b), document.removeEventListener("selectionchange", N), document.removeEventListener("mousedown", F), document.removeEventListener("touchstart", F), window.removeEventListener("scroll", H, !0);
844
844
  };
845
- }, [W, O, t, n]), J(() => {
845
+ }, [P, y, t, n]), J(() => {
846
846
  m && vt(m);
847
847
  }, [m]);
848
- const D = K(
849
- (w) => {
850
- var j;
851
- const y = n.current;
852
- if (!y || !w.highlightData) return null;
853
- const { highlightData: _, reaction: F, id: M } = w, { range: S } = _, p = S && ((j = Y.fromSelector(y, S)) == null ? void 0 : j.toRange());
854
- if (p) {
848
+ const D = Q(
849
+ (O) => {
850
+ var z;
851
+ const b = n.current;
852
+ if (!b || !O.highlightData) return null;
853
+ const { highlightData: N, reaction: F, id: H } = O, { range: T } = N, A = T && ((z = V.fromSelector(b, T)) == null ? void 0 : z.toRange());
854
+ if (A) {
855
855
  const Z = {
856
- id: M,
856
+ id: H,
857
857
  selectedNoteId: m,
858
858
  type: F[0],
859
859
  onClick: () => {
860
- c(M), g();
860
+ d(H), g();
861
861
  }
862
862
  };
863
- return Ot(p, Z, e), _.textPosition;
863
+ return wt(A, Z, e), N.textPosition;
864
864
  }
865
865
  return null;
866
866
  },
867
- [n, m, e, c, g]
867
+ [n, m, e, d, g]
868
868
  );
869
869
  J(() => {
870
- if (!W || !h || !n.current) return;
871
- const w = n.current, y = h.notes, _ = /* @__PURE__ */ new Set(), F = [], M = [];
872
- if (y.length === 0) {
873
- if (I.current.length > 0) {
874
- for (const S of I.current)
875
- Ae(S, w);
876
- I.current = [], k([]);
870
+ if (!P || !h || !n.current) return;
871
+ const O = n.current, b = h.notes, N = /* @__PURE__ */ new Set(), F = [], H = [];
872
+ if (b.length === 0) {
873
+ if (v.current.length > 0) {
874
+ for (const T of v.current)
875
+ Ae(T, O);
876
+ v.current = [], L([]);
877
877
  }
878
878
  return;
879
879
  }
880
- if (d && y[0].highlightData.pageLastModifiedAt !== d) {
881
- const { notesForUpdate: S, noteIdsForDelete: p } = Ct(
882
- w,
883
- y,
884
- d
880
+ if (c && b[0].highlightData.pageLastModifiedAt !== c) {
881
+ const { notesForUpdate: T, noteIdsForDelete: A } = St(
882
+ O,
883
+ b,
884
+ c
885
885
  );
886
- for (const j of S)
887
- E({ id: j.id, input: j });
888
- for (const j of p)
889
- f(j);
886
+ for (const z of T)
887
+ E({ id: z.id, input: z });
888
+ for (const z of A)
889
+ f(z);
890
890
  } else {
891
- for (const S of y) {
892
- const p = D(S);
893
- _.add(S.id), p && (F.push(S), M.push(p));
891
+ for (const T of b) {
892
+ const A = D(T);
893
+ N.add(T.id), A && (F.push(T), H.push(A));
894
894
  }
895
- for (const S of I.current)
896
- _.has(S.id) || Ae(S, w);
897
- k(M), I.current = F;
895
+ for (const T of v.current)
896
+ N.has(T.id) || Ae(T, O);
897
+ L(H), v.current = F;
898
898
  }
899
899
  }, [
900
- W,
900
+ P,
901
901
  h,
902
902
  D,
903
- d,
903
+ c,
904
904
  n,
905
905
  E,
906
906
  f
907
907
  ]);
908
- const V = (w) => {
909
- const y = n.current;
910
- if (!T || !y) return;
911
- const _ = Y.fromRange(y, T), F = G.fromRange(y, T);
908
+ const j = (O) => {
909
+ const b = n.current;
910
+ if (!_ || !b) return;
911
+ const N = V.fromRange(b, _), F = K.fromRange(b, _);
912
912
  u(
913
913
  {
914
914
  courseId: l,
915
915
  objectId: r,
916
916
  objectType: s,
917
917
  userText: "",
918
- reaction: [w],
918
+ reaction: [O],
919
919
  highlightData: {
920
- selectedText: x,
920
+ selectedText: C,
921
921
  textPosition: (F == null ? void 0 : F.toSelector()) ?? null,
922
- range: _.toSelector(),
923
- pageLastModifiedAt: d ?? ""
922
+ range: N.toSelector(),
923
+ pageLastModifiedAt: c ?? ""
924
924
  }
925
925
  },
926
926
  {
927
- onSuccess: (M) => {
928
- var p;
929
- const S = M.id;
930
- N(null), R(""), C(null), (p = window.getSelection()) == null || p.removeAllRanges(), c(S), g();
927
+ onSuccess: (H) => {
928
+ var A;
929
+ const T = H.id;
930
+ p(null), w(""), R(null), (A = window.getSelection()) == null || A.removeAllRanges(), d(T), g();
931
931
  }
932
932
  }
933
933
  );
934
934
  };
935
- return !T || !P ? null : Ze(
935
+ return !_ || !x ? null : Ze(
936
936
  /* @__PURE__ */ i(
937
937
  "div",
938
938
  {
939
- id: ue,
939
+ id: de,
940
940
  role: "toolbar",
941
941
  style: {
942
942
  position: "fixed",
943
943
  zIndex: 100,
944
- top: P.top,
945
- left: P.left,
944
+ top: x.top,
945
+ left: x.left,
946
946
  whiteSpace: "nowrap"
947
947
  },
948
- onBlur: (w) => {
949
- const y = document.getElementById(ue);
950
- y != null && y.contains(w.relatedTarget) || (C(null), N(null), R(""));
948
+ onBlur: (O) => {
949
+ const b = document.getElementById(de);
950
+ b != null && b.contains(O.relatedTarget) || (R(null), p(null), w(""));
951
951
  },
952
- children: /* @__PURE__ */ i(bn, { onSelectReaction: V })
952
+ children: /* @__PURE__ */ i(yn, { onSelectReaction: j })
953
953
  }
954
954
  ),
955
955
  document.body
956
956
  );
957
957
  }
958
- const En = (n, e) => ({
959
- backgroundColor: n === A.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
960
- underlineColor: n === A.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
961
- underlineStyle: n === A.IMPORTANT ? "solid" : "dashed"
962
- }), ge = ({
958
+ const bn = (n, e) => ({
959
+ backgroundColor: n === k.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
960
+ underlineColor: n === k.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
961
+ underlineStyle: n === k.IMPORTANT ? "solid" : "dashed"
962
+ }), he = ({
963
963
  children: n,
964
- type: e = A.IMPORTANT,
964
+ type: e = k.IMPORTANT,
965
965
  isCardActive: t = !0,
966
966
  theme: o
967
967
  }) => {
968
- const r = En(e, o), l = {
968
+ const r = bn(e, o), l = {
969
969
  position: "relative",
970
- backgroundColor: t ? r.backgroundColor : de(r.backgroundColor, 0.5),
970
+ backgroundColor: t ? r.backgroundColor : Te(r.backgroundColor, 0.5),
971
971
  textDecorationLine: "underline",
972
972
  textDecorationStyle: r.underlineStyle,
973
973
  textDecorationColor: r.underlineColor,
@@ -977,17 +977,17 @@ const En = (n, e) => ({
977
977
  };
978
978
  return /* @__PURE__ */ i("span", { "data-note-highlight": "true", style: l, children: n });
979
979
  }, Qe = () => {
980
- const { translations: n } = q();
981
- return /* @__PURE__ */ b(v, { gap: "xx-small", alignItems: "start", as: "div", children: [
982
- /* @__PURE__ */ i(v.Item, { as: "div", children: /* @__PURE__ */ i(tt, { color: "error" }) }),
983
- /* @__PURE__ */ i(v.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ i(he, { maxLines: 3, children: n.highlightUnavailable }) })
980
+ const { translations: n } = X();
981
+ return /* @__PURE__ */ S(I, { gap: "xx-small", alignItems: "start", as: "div", children: [
982
+ /* @__PURE__ */ i(I.Item, { as: "div", children: /* @__PURE__ */ i(tt, { color: "error" }) }),
983
+ /* @__PURE__ */ i(I.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ i(me, { maxLines: 3, children: n.highlightUnavailable }) })
984
984
  ] });
985
- }, Sn = {
985
+ }, En = {
986
986
  filter: null,
987
987
  courseFilter: null,
988
988
  pageParamsWithDirection: {}
989
989
  };
990
- function Cn(n, e) {
990
+ function Sn(n, e) {
991
991
  switch (e.type) {
992
992
  case "SET_FILTER":
993
993
  return { ...n, filter: e.payload, pageParamsWithDirection: {} };
@@ -999,67 +999,67 @@ function Cn(n, e) {
999
999
  return n;
1000
1000
  }
1001
1001
  }
1002
- function Yn({
1002
+ function Qn({
1003
1003
  api: n,
1004
1004
  courseId: e,
1005
1005
  enableCourseFilter: t = !1,
1006
1006
  learningObject: o,
1007
1007
  pageSize: r = 16
1008
1008
  }) {
1009
- const [s, l] = Fe(Cn, Sn), { filter: d, courseFilter: m, pageParamsWithDirection: c } = s;
1009
+ const [s, l] = Fe(Sn, En), { filter: c, courseFilter: m, pageParamsWithDirection: d } = s;
1010
1010
  J(() => {
1011
- Object.keys(c).length > 0 && l({ type: "SET_PAGE_PARAMS_WITH_DIRECTION", payload: {} });
1011
+ Object.keys(d).length > 0 && l({ type: "SET_PAGE_PARAMS_WITH_DIRECTION", payload: {} });
1012
1012
  }, [r]);
1013
- const g = t ? m : e, { direction: h, pageParams: u } = c, E = h === "next" ? (u == null ? void 0 : u.endCursor) ?? void 0 : h === "prev" ? (u == null ? void 0 : u.startCursor) ?? void 0 : void 0, { data: f, isLoading: I, isError: O } = $e({
1013
+ const g = t ? m : e, { direction: h, pageParams: u } = d, E = h === "next" ? (u == null ? void 0 : u.endCursor) ?? void 0 : h === "prev" ? (u == null ? void 0 : u.startCursor) ?? void 0 : void 0, { data: f, isLoading: v, isError: y } = $e({
1014
1014
  api: n,
1015
1015
  filter: {
1016
1016
  ...g ? { courseId: g } : {},
1017
- ...d ? { reactions: [d] } : {},
1017
+ ...c ? { reactions: [c] } : {},
1018
1018
  ...o ? { learningObject: o } : {}
1019
1019
  },
1020
1020
  cursor: E,
1021
1021
  direction: h,
1022
1022
  pageSize: r
1023
- }), k = (f == null ? void 0 : f.notes) ?? [], T = f == null ? void 0 : f.pageInfo, N = K(() => {
1023
+ }), L = (f == null ? void 0 : f.notes) ?? [], _ = f == null ? void 0 : f.pageInfo, p = Q(() => {
1024
1024
  l({
1025
1025
  type: "SET_PAGE_PARAMS_WITH_DIRECTION",
1026
1026
  payload: { pageParams: f == null ? void 0 : f.pageInfo, direction: "next" }
1027
1027
  });
1028
- }, [f == null ? void 0 : f.pageInfo]), x = K(() => {
1028
+ }, [f == null ? void 0 : f.pageInfo]), C = Q(() => {
1029
1029
  l({
1030
1030
  type: "SET_PAGE_PARAMS_WITH_DIRECTION",
1031
1031
  payload: { pageParams: f == null ? void 0 : f.pageInfo, direction: "prev" }
1032
1032
  });
1033
- }, [f == null ? void 0 : f.pageInfo]), R = K((C) => {
1034
- l({ type: "SET_FILTER", payload: C });
1035
- }, []), P = K((C) => {
1036
- l({ type: "SET_COURSE_FILTER", payload: C });
1033
+ }, [f == null ? void 0 : f.pageInfo]), w = Q((R) => {
1034
+ l({ type: "SET_FILTER", payload: R });
1035
+ }, []), x = Q((R) => {
1036
+ l({ type: "SET_COURSE_FILTER", payload: R });
1037
1037
  }, []);
1038
1038
  return {
1039
- notes: k,
1040
- pageInfo: T,
1041
- isLoading: I,
1042
- isError: O,
1043
- filter: d,
1039
+ notes: L,
1040
+ pageInfo: _,
1041
+ isLoading: v,
1042
+ isError: y,
1043
+ filter: c,
1044
1044
  courseFilter: m,
1045
- setFilter: R,
1046
- setCourseFilter: P,
1047
- fetchNextPage: N,
1048
- fetchPreviousPage: x
1045
+ setFilter: w,
1046
+ setCourseFilter: x,
1047
+ fetchNextPage: p,
1048
+ fetchPreviousPage: C
1049
1049
  };
1050
1050
  }
1051
- const fe = "all";
1052
- function Vn({ filter: n, setFilter: e }) {
1053
- const { translations: t } = q(), o = oe(
1051
+ const ue = "all";
1052
+ function Yn({ filter: n, setFilter: e }) {
1053
+ const { translations: t } = X(), o = oe(
1054
1054
  () => [
1055
- { label: t.allNotes, value: fe },
1056
- { label: t.important, value: A.IMPORTANT },
1057
- { label: t.unclear, value: A.CONFUSING }
1055
+ { label: t.allNotes, value: ue },
1056
+ { label: t.important, value: k.IMPORTANT },
1057
+ { label: t.unclear, value: k.CONFUSING }
1058
1058
  ],
1059
1059
  [t]
1060
- ), r = K(
1061
- (l, { value: d }) => {
1062
- e(!d || d === fe ? null : d);
1060
+ ), r = Q(
1061
+ (l, { value: c }) => {
1062
+ e(!c || c === ue ? null : c);
1063
1063
  },
1064
1064
  [e]
1065
1065
  );
@@ -1069,7 +1069,7 @@ function Vn({ filter: n, setFilter: e }) {
1069
1069
  we,
1070
1070
  {
1071
1071
  renderLabel: /* @__PURE__ */ i(Me, { children: t.notes }),
1072
- value: n ?? fe,
1072
+ value: n ?? ue,
1073
1073
  onChange: r,
1074
1074
  children: o.map((l) => /* @__PURE__ */ i(we.Option, { id: l.value, value: l.value, children: l.label }, l.value))
1075
1075
  }
@@ -1080,21 +1080,21 @@ function Vn({ filter: n, setFilter: e }) {
1080
1080
  handleReactionFilterChange: r
1081
1081
  };
1082
1082
  }
1083
- const Zn = ({ children: n }) => {
1084
- const { isTrayOpen: e, closeTray: t } = Xe(), { translations: o } = q();
1083
+ const Vn = ({ children: n }) => {
1084
+ const { isTrayOpen: e, closeTray: t } = Xe(), { translations: o } = X();
1085
1085
  return /* @__PURE__ */ i(
1086
- lt,
1086
+ it,
1087
1087
  {
1088
1088
  label: o.notebook,
1089
1089
  open: e,
1090
1090
  onDismiss: t,
1091
1091
  placement: "end",
1092
1092
  size: "regular",
1093
- children: /* @__PURE__ */ b(v, { direction: "column", height: "100vh", children: [
1094
- /* @__PURE__ */ i(v.Item, { children: /* @__PURE__ */ i(Q, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ b(v, { justifyItems: "space-between", alignItems: "center", children: [
1093
+ children: /* @__PURE__ */ S(I, { direction: "column", height: "100vh", children: [
1094
+ /* @__PURE__ */ i(I.Item, { children: /* @__PURE__ */ i(q, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ S(I, { justifyItems: "space-between", alignItems: "center", children: [
1095
1095
  /* @__PURE__ */ i(ae, { level: "h3", children: o.notebook }),
1096
1096
  /* @__PURE__ */ i(
1097
- it,
1097
+ st,
1098
1098
  {
1099
1099
  screenReaderLabel: o.closeNotebookPanel,
1100
1100
  onClick: t,
@@ -1103,53 +1103,49 @@ const Zn = ({ children: n }) => {
1103
1103
  }
1104
1104
  )
1105
1105
  ] }) }) }),
1106
- /* @__PURE__ */ i(v.Item, { shouldGrow: !0, shouldShrink: !0, overflowY: "auto", overflowX: "hidden", children: n })
1106
+ /* @__PURE__ */ i(I.Item, { shouldGrow: !0, shouldShrink: !0, overflowY: "auto", overflowX: "hidden", children: n })
1107
1107
  ] })
1108
1108
  }
1109
1109
  );
1110
1110
  }, vn = {
1111
- [A.IMPORTANT]: {
1112
- color: "info",
1111
+ [k.IMPORTANT]: {
1112
+ color: "success",
1113
1113
  translationKey: "important",
1114
- icon: /* @__PURE__ */ i(be, { size: "x-small" })
1114
+ icon: /* @__PURE__ */ i(ye, { size: "x-small" })
1115
1115
  },
1116
- [A.CONFUSING]: {
1116
+ [k.CONFUSING]: {
1117
1117
  color: "danger",
1118
1118
  translationKey: "unclear",
1119
- icon: /* @__PURE__ */ i(ye, { size: "x-small" })
1119
+ icon: /* @__PURE__ */ i(Ne, { size: "x-small" })
1120
1120
  }
1121
1121
  }, Ye = ({ type: n, onTypeChange: e, renderAsMenuTrigger: t = !1 }) => {
1122
- const { translations: o } = q(), r = vn[n], s = o[r.translationKey], [l, d] = H(!1), m = re(null), c = re(null), g = K(
1122
+ const { translations: o } = X(), r = vn[n], s = o[r.translationKey], [l, c] = B(!1), m = re(null), d = re(null), g = Q(
1123
1123
  (h) => {
1124
- e == null || e(h), d(!1);
1124
+ e == null || e(h), c(!1);
1125
1125
  },
1126
1126
  [e]
1127
1127
  );
1128
- return t && e ? /* @__PURE__ */ b(
1128
+ return t && e ? /* @__PURE__ */ S(
1129
1129
  ee,
1130
1130
  {
1131
1131
  placement: "bottom start",
1132
1132
  show: l,
1133
- onToggle: (h) => d(h),
1133
+ onToggle: (h) => c(h),
1134
1134
  shouldHideOnSelect: !0,
1135
1135
  shouldFocusTriggerOnClose: !0,
1136
- trigger: /* @__PURE__ */ b(Oe, { color: r.color, renderIcon: r.icon, children: [
1137
- s,
1138
- " ",
1139
- /* @__PURE__ */ i(nt, { size: "x-small" })
1140
- ] }),
1136
+ trigger: /* @__PURE__ */ i(ke, { color: r.color, renderIcon: r.icon, children: s }),
1141
1137
  children: [
1142
- /* @__PURE__ */ b(ee.Item, { ref: m, onClick: () => g(A.CONFUSING), children: [
1143
- /* @__PURE__ */ i(ye, { size: "x-small" }),
1138
+ /* @__PURE__ */ S(ee.Item, { ref: m, onClick: () => g(k.CONFUSING), children: [
1139
+ /* @__PURE__ */ i(Ne, { size: "x-small" }),
1144
1140
  ` ${o.markUnclear}`
1145
1141
  ] }),
1146
- /* @__PURE__ */ b(ee.Item, { ref: c, onClick: () => g(A.IMPORTANT), children: [
1147
- /* @__PURE__ */ i(be, { size: "x-small" }),
1142
+ /* @__PURE__ */ S(ee.Item, { ref: d, onClick: () => g(k.IMPORTANT), children: [
1143
+ /* @__PURE__ */ i(ye, { size: "x-small" }),
1148
1144
  ` ${o.markImportant}`
1149
1145
  ] })
1150
1146
  ]
1151
1147
  }
1152
- ) : /* @__PURE__ */ i(Oe, { color: r.color, renderIcon: r.icon, children: s });
1148
+ ) : /* @__PURE__ */ i(q, { display: "inline-flex", children: /* @__PURE__ */ i(ke, { color: r.color, renderIcon: r.icon, children: s }) });
1153
1149
  };
1154
1150
  function Le(n, e) {
1155
1151
  return (n instanceof Date ? n : new Date(n)).toLocaleString(e, {
@@ -1158,7 +1154,7 @@ function Le(n, e) {
1158
1154
  day: "numeric"
1159
1155
  });
1160
1156
  }
1161
- const In = ({
1157
+ const Tn = ({
1162
1158
  noteId: n,
1163
1159
  date: e,
1164
1160
  highlight: t,
@@ -1166,246 +1162,238 @@ const In = ({
1166
1162
  type: r,
1167
1163
  onClick: s,
1168
1164
  onDelete: l,
1169
- onSaveNote: d,
1165
+ onSaveNote: c,
1170
1166
  onTypeChange: m,
1171
- isActive: c,
1167
+ isActive: d,
1172
1168
  isPanelView: g = !1,
1173
1169
  courseName: h,
1174
1170
  locale: u,
1175
1171
  highlightTheme: E,
1176
- cardTheme: f,
1177
- renderLink: I,
1178
- href: O
1172
+ renderLink: f,
1173
+ href: v
1179
1174
  }) => {
1180
- const { translations: k } = q(), [T, N] = H(!1), [x, R] = H(!1), [P, C] = H(o || ""), [W, L] = H(!1), D = r === A.IMPORTANT ? k.important : k.unclear, V = (p) => {
1181
- p.key === "Enter" && (p.preventDefault(), s == null || s());
1182
- }, w = [D, k.note];
1183
- t && w.push(t), o && w.push(o), e && w.push(Le(e, u)), h && w.push(h);
1184
- const y = w.join(", "), _ = r === A.CONFUSING ? f.confusingBorderColor : f.importantBorderColor, M = {
1185
- borderStyle: "solid",
1186
- borderColor: c || T ? _ : de(_, 0.5),
1187
- borderWidth: "0.0625rem 0.0625rem 0.25rem 0.25rem",
1188
- borderRadius: "1rem",
1189
- padding: "1rem",
1190
- cursor: x ? "default" : "pointer",
1191
- position: "relative"
1192
- }, S = (
1193
- // biome-ignore lint/a11y/noStaticElementInteractions: role is conditionally set to "button"
1194
- // biome-ignore lint/a11y/useAriaPropsSupportedByRole: aria-label applies when role="button"
1195
- /* @__PURE__ */ b(
1196
- "div",
1197
- {
1198
- role: O || x ? void 0 : "button",
1199
- "aria-label": O ? void 0 : y,
1200
- "aria-pressed": O || x ? void 0 : c,
1201
- tabIndex: O || c ? -1 : 0,
1202
- "data-testid": "note-card",
1203
- onClick: c ? void 0 : s,
1204
- onMouseEnter: () => N(!0),
1205
- onMouseLeave: () => N(!1),
1206
- onKeyDown: c ? void 0 : V,
1207
- style: M,
1208
- children: [
1209
- /* @__PURE__ */ b(v, { direction: "column", gap: "small", children: [
1210
- /* @__PURE__ */ i(
1211
- Ye,
1212
- {
1213
- type: r,
1214
- onTypeChange: g && m ? (p) => m(n, p) : void 0,
1215
- renderAsMenuTrigger: g && !!m && !!c
1216
- }
1217
- ),
1218
- t ? /* @__PURE__ */ i("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: /* @__PURE__ */ i(z, { children: c && g ? /* @__PURE__ */ i(
1219
- ge,
1220
- {
1221
- type: r,
1222
- isCardActive: !!c || T,
1223
- theme: E,
1224
- children: t
1225
- }
1226
- ) : /* @__PURE__ */ i(he, { maxLines: 3, truncate: "word", children: /* @__PURE__ */ i(
1227
- ge,
1228
- {
1229
- type: r,
1230
- isCardActive: !!c || T,
1231
- theme: E,
1232
- children: t
1233
- }
1234
- ) }) }) }) : /* @__PURE__ */ i(Qe, {}),
1235
- /* @__PURE__ */ b(v, { direction: "column", gap: c ? "small" : "none", children: [
1236
- x && g ? /* @__PURE__ */ b(v, { direction: "column", gap: "x-small", children: [
1237
- /* @__PURE__ */ i(
1238
- He,
1175
+ const { translations: y } = X(), [L, _] = B(!1), [p, C] = B(!1), [w, x] = B(o || ""), [R, P] = B(!1), M = r === k.IMPORTANT ? y.important : y.unclear, D = (N) => {
1176
+ N.key === "Enter" && (N.preventDefault(), s == null || s());
1177
+ }, j = [M, y.note];
1178
+ t && j.push(t), o && j.push(o), e && j.push(Le(e, u)), h && j.push(h);
1179
+ const O = j.join(", "), b = /* @__PURE__ */ S(
1180
+ q,
1181
+ {
1182
+ as: "div",
1183
+ borderWidth: "small",
1184
+ borderRadius: "medium",
1185
+ padding: "small",
1186
+ position: "relative",
1187
+ role: v || p ? void 0 : "button",
1188
+ "aria-label": v ? void 0 : O,
1189
+ "aria-pressed": v || p ? void 0 : d,
1190
+ tabIndex: v || d ? -1 : 0,
1191
+ "data-testid": "note-card",
1192
+ onClick: d ? void 0 : s,
1193
+ onMouseEnter: () => _(!0),
1194
+ onMouseLeave: () => _(!1),
1195
+ onKeyDown: d ? void 0 : D,
1196
+ cursor: p ? "default" : "pointer",
1197
+ children: [
1198
+ /* @__PURE__ */ S(I, { direction: "column", gap: "small", children: [
1199
+ /* @__PURE__ */ i(
1200
+ Ye,
1201
+ {
1202
+ type: r,
1203
+ onTypeChange: g && m ? (N) => m(n, N) : void 0,
1204
+ renderAsMenuTrigger: g && !!m && !!d
1205
+ }
1206
+ ),
1207
+ t ? /* @__PURE__ */ i("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: /* @__PURE__ */ i(U, { children: d && g ? /* @__PURE__ */ i(
1208
+ he,
1209
+ {
1210
+ type: r,
1211
+ isCardActive: !!d || L,
1212
+ theme: E,
1213
+ children: t
1214
+ }
1215
+ ) : /* @__PURE__ */ i(me, { maxLines: 3, truncate: "word", children: /* @__PURE__ */ i(
1216
+ he,
1217
+ {
1218
+ type: r,
1219
+ isCardActive: !!d || L,
1220
+ theme: E,
1221
+ children: t
1222
+ }
1223
+ ) }) }) }) : /* @__PURE__ */ i(Qe, {}),
1224
+ /* @__PURE__ */ S(I, { direction: "column", gap: "small", children: [
1225
+ p && g ? /* @__PURE__ */ S(I, { direction: "column", gap: "x-small", children: [
1226
+ /* @__PURE__ */ i(
1227
+ He,
1228
+ {
1229
+ label: /* @__PURE__ */ i(Me, { children: y.editNote }),
1230
+ value: w,
1231
+ onChange: (N) => x(N.target.value),
1232
+ placeholder: y.addNoteOptional
1233
+ }
1234
+ ),
1235
+ /* @__PURE__ */ S(I, { gap: "xx-small", children: [
1236
+ /* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1237
+ $,
1239
1238
  {
1240
- label: /* @__PURE__ */ i(Me, { children: k.editNote }),
1241
- value: P,
1242
- onChange: (p) => C(p.target.value),
1243
- placeholder: k.addNoteOptional
1239
+ display: "block",
1240
+ size: "small",
1241
+ "data-testid": "note-card-cancel",
1242
+ onClick: () => {
1243
+ x(o || ""), C(!1);
1244
+ },
1245
+ children: y.cancel
1244
1246
  }
1245
- ),
1246
- /* @__PURE__ */ b(v, { gap: "xx-small", children: [
1247
- /* @__PURE__ */ i(v.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1248
- U,
1247
+ ) }),
1248
+ /* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1249
+ $,
1250
+ {
1251
+ display: "block",
1252
+ color: "primary",
1253
+ size: "small",
1254
+ "data-testid": "note-card-save",
1255
+ onClick: () => {
1256
+ c == null || c(n, w), C(!1);
1257
+ },
1258
+ interaction: w.trim() ? "enabled" : "disabled",
1259
+ children: y.save
1260
+ }
1261
+ ) })
1262
+ ] })
1263
+ ] }) : o ? /* @__PURE__ */ i("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: d && g ? /* @__PURE__ */ S(U, { children: [
1264
+ o,
1265
+ " ",
1266
+ /* @__PURE__ */ i(
1267
+ Y,
1268
+ {
1269
+ size: "small",
1270
+ withBackground: !1,
1271
+ withBorder: !1,
1272
+ screenReaderLabel: y.editNote,
1273
+ "data-testid": "note-card-edit",
1274
+ onClick: (N) => {
1275
+ N.stopPropagation(), C(!0);
1276
+ },
1277
+ children: /* @__PURE__ */ i(fe, {})
1278
+ }
1279
+ )
1280
+ ] }) : /* @__PURE__ */ i(U, { children: /* @__PURE__ */ i(me, { maxLines: 3, truncate: "word", children: o }) }) }) : g && d ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ S(U, { color: "secondary", children: [
1281
+ y.addNotePrompt,
1282
+ " ",
1283
+ /* @__PURE__ */ i(
1284
+ Y,
1285
+ {
1286
+ size: "small",
1287
+ withBackground: !1,
1288
+ withBorder: !1,
1289
+ screenReaderLabel: y.editNote,
1290
+ "data-testid": "note-card-edit",
1291
+ onClick: (N) => {
1292
+ N.stopPropagation(), C(!0);
1293
+ },
1294
+ children: /* @__PURE__ */ i(fe, {})
1295
+ }
1296
+ )
1297
+ ] }) }) : null,
1298
+ /* @__PURE__ */ S(I, { justifyItems: "space-between", alignItems: "center", children: [
1299
+ /* @__PURE__ */ i(U, { size: "small", color: "secondary", children: Le(e, u) }),
1300
+ d && l && /* @__PURE__ */ i(
1301
+ Y,
1302
+ {
1303
+ size: "small",
1304
+ withBackground: !1,
1305
+ withBorder: !1,
1306
+ color: "danger",
1307
+ screenReaderLabel: y.deleteNote,
1308
+ "data-testid": "note-card-delete",
1309
+ onClick: (N) => {
1310
+ N.stopPropagation(), P(!0);
1311
+ },
1312
+ children: /* @__PURE__ */ i(le, {})
1313
+ }
1314
+ )
1315
+ ] }),
1316
+ h && /* @__PURE__ */ i(U, { size: "small", color: "secondary", children: h })
1317
+ ] })
1318
+ ] }),
1319
+ R && l && /* @__PURE__ */ i(
1320
+ q,
1321
+ {
1322
+ as: "div",
1323
+ background: "primary",
1324
+ padding: "medium",
1325
+ borderRadius: "large",
1326
+ position: "absolute",
1327
+ insetBlockStart: "0",
1328
+ insetBlockEnd: "0",
1329
+ insetInlineStart: "0",
1330
+ insetInlineEnd: "0",
1331
+ stacking: "above",
1332
+ children: /* @__PURE__ */ S(
1333
+ I,
1334
+ {
1335
+ direction: "column",
1336
+ justifyItems: "center",
1337
+ alignItems: "center",
1338
+ gap: "x-small",
1339
+ height: "100%",
1340
+ children: [
1341
+ /* @__PURE__ */ i(
1342
+ $,
1249
1343
  {
1250
1344
  display: "block",
1345
+ color: "danger",
1251
1346
  size: "small",
1252
- "data-testid": "note-card-cancel",
1253
- onClick: () => {
1254
- C(o || ""), R(!1);
1347
+ renderIcon: /* @__PURE__ */ i(le, {}),
1348
+ "data-testid": "note-card-confirm-delete",
1349
+ onClick: (N) => {
1350
+ N.stopPropagation(), l(n), P(!1);
1255
1351
  },
1256
- children: k.cancel
1352
+ children: y.deleteNote
1257
1353
  }
1258
- ) }),
1259
- /* @__PURE__ */ i(v.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1260
- U,
1354
+ ),
1355
+ /* @__PURE__ */ i(
1356
+ $,
1261
1357
  {
1262
1358
  display: "block",
1263
- color: "primary",
1264
1359
  size: "small",
1265
- "data-testid": "note-card-save",
1266
- onClick: () => {
1267
- d == null || d(n, P), R(!1);
1360
+ "data-testid": "note-card-cancel-delete",
1361
+ onClick: (N) => {
1362
+ N.stopPropagation(), P(!1);
1268
1363
  },
1269
- interaction: P.trim() ? "enabled" : "disabled",
1270
- children: k.save
1364
+ children: y.cancel
1271
1365
  }
1272
- ) })
1273
- ] })
1274
- ] }) : o ? /* @__PURE__ */ i("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: c && g ? /* @__PURE__ */ b(z, { children: [
1275
- o,
1276
- " ",
1277
- /* @__PURE__ */ i(
1278
- X,
1279
- {
1280
- size: "small",
1281
- withBackground: !1,
1282
- withBorder: !1,
1283
- screenReaderLabel: k.editNote,
1284
- "data-testid": "note-card-edit",
1285
- onClick: (p) => {
1286
- p.stopPropagation(), R(!0);
1287
- },
1288
- children: /* @__PURE__ */ i(me, {})
1289
- }
1290
- )
1291
- ] }) : /* @__PURE__ */ i(z, { children: /* @__PURE__ */ i(he, { maxLines: 3, truncate: "word", children: o }) }) }) : g && c ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ b(z, { color: "secondary", children: [
1292
- k.addNotePrompt,
1293
- " ",
1294
- /* @__PURE__ */ i(
1295
- X,
1296
- {
1297
- size: "small",
1298
- withBackground: !1,
1299
- withBorder: !1,
1300
- screenReaderLabel: k.editNote,
1301
- "data-testid": "note-card-edit",
1302
- onClick: (p) => {
1303
- p.stopPropagation(), R(!0);
1304
- },
1305
- children: /* @__PURE__ */ i(me, {})
1306
- }
1307
- )
1308
- ] }) }) : null,
1309
- /* @__PURE__ */ b(v, { justifyItems: "space-between", alignItems: "center", children: [
1310
- /* @__PURE__ */ i(z, { size: "small", color: "secondary", children: Le(e, u) }),
1311
- c && l && /* @__PURE__ */ i(
1312
- X,
1313
- {
1314
- size: "small",
1315
- withBackground: !1,
1316
- withBorder: !1,
1317
- color: "danger",
1318
- screenReaderLabel: k.deleteNote,
1319
- "data-testid": "note-card-delete",
1320
- onClick: (p) => {
1321
- p.stopPropagation(), L(!0);
1322
- },
1323
- children: /* @__PURE__ */ i(le, {})
1324
- }
1325
- )
1326
- ] }),
1327
- h && /* @__PURE__ */ i(z, { size: "small", color: "secondary", children: h })
1328
- ] })
1329
- ] }),
1330
- W && l && /* @__PURE__ */ i(
1331
- Q,
1332
- {
1333
- as: "div",
1334
- background: "primary",
1335
- padding: "medium",
1336
- borderRadius: "large",
1337
- position: "absolute",
1338
- insetBlockStart: "0",
1339
- insetBlockEnd: "0",
1340
- insetInlineStart: "0",
1341
- insetInlineEnd: "0",
1342
- stacking: "above",
1343
- children: /* @__PURE__ */ b(
1344
- v,
1345
- {
1346
- direction: "column",
1347
- justifyItems: "center",
1348
- alignItems: "center",
1349
- gap: "x-small",
1350
- height: "100%",
1351
- children: [
1352
- /* @__PURE__ */ i(
1353
- U,
1354
- {
1355
- display: "block",
1356
- color: "danger",
1357
- size: "small",
1358
- renderIcon: /* @__PURE__ */ i(le, {}),
1359
- "data-testid": "note-card-confirm-delete",
1360
- onClick: (p) => {
1361
- p.stopPropagation(), l(n), L(!1);
1362
- },
1363
- children: k.deleteNote
1364
- }
1365
- ),
1366
- /* @__PURE__ */ i(
1367
- U,
1368
- {
1369
- display: "block",
1370
- size: "small",
1371
- "data-testid": "note-card-cancel-delete",
1372
- onClick: (p) => {
1373
- p.stopPropagation(), L(!1);
1374
- },
1375
- children: k.cancel
1376
- }
1377
- )
1378
- ]
1379
- }
1380
- )
1381
- }
1382
- )
1383
- ]
1384
- }
1385
- )
1366
+ )
1367
+ ]
1368
+ }
1369
+ )
1370
+ }
1371
+ )
1372
+ ]
1373
+ }
1386
1374
  );
1387
- return O && I ? I({ href: O, children: S, ariaLabel: y }) : S;
1375
+ return v && f ? f({ href: v, children: b, ariaLabel: O }) : b;
1388
1376
  };
1389
- function Tn(n, e) {
1377
+ function In(n, e) {
1390
1378
  const t = Array.from({ length: e }, () => []);
1391
1379
  return n.forEach((o, r) => {
1392
1380
  t[r % e].push(o);
1393
1381
  }), t;
1394
1382
  }
1395
- const xn = {
1383
+ const Cn = {
1396
1384
  display: "flex",
1397
1385
  gap: "1rem",
1398
1386
  padding: "1rem",
1399
1387
  boxSizing: "border-box",
1400
1388
  width: "100%",
1401
1389
  alignItems: "flex-start"
1402
- }, wn = {
1390
+ }, xn = {
1403
1391
  display: "flex",
1404
1392
  flexDirection: "column",
1405
1393
  gap: "1rem",
1406
1394
  flex: 1,
1407
1395
  minWidth: 0
1408
- }, Jn = ({
1396
+ }, Zn = ({
1409
1397
  notes: n,
1410
1398
  isLoading: e,
1411
1399
  isError: t,
@@ -1413,30 +1401,29 @@ const xn = {
1413
1401
  onPreviousPage: r,
1414
1402
  onNextPage: s,
1415
1403
  onNoteSelect: l,
1416
- onNoteDelete: d,
1404
+ onNoteDelete: c,
1417
1405
  onNoteSave: m,
1418
- onNoteTypeChange: c,
1406
+ onNoteTypeChange: d,
1419
1407
  selectedNoteId: g,
1420
1408
  hasActiveFilter: h = !1,
1421
1409
  columnCount: u = 1,
1422
1410
  highlightTheme: E,
1423
- cardTheme: f,
1424
- locale: I,
1425
- renderNoteLink: O,
1426
- noteHref: k
1411
+ locale: f,
1412
+ renderNoteLink: v,
1413
+ noteHref: y
1427
1414
  }) => {
1428
- const { translations: T } = q(), N = oe(
1429
- () => Tn(n, u),
1415
+ const { translations: L } = X(), _ = oe(
1416
+ () => In(n, u),
1430
1417
  [n, u]
1431
- ), x = (o == null ? void 0 : o.hasNextPage) || (o == null ? void 0 : o.hasPreviousPage);
1418
+ ), p = (o == null ? void 0 : o.hasNextPage) || (o == null ? void 0 : o.hasPreviousPage);
1432
1419
  if (e)
1433
- return /* @__PURE__ */ i(Q, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ i(at, { renderTitle: T.loadingNotes }) });
1420
+ return /* @__PURE__ */ i(q, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ i(lt, { renderTitle: L.loadingNotes }) });
1434
1421
  if (t)
1435
- return /* @__PURE__ */ i(Q, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ i(ae, { level: "h4", children: T.failedToLoadNotes }) });
1422
+ return /* @__PURE__ */ i(q, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ i(ae, { level: "h4", children: L.failedToLoadNotes }) });
1436
1423
  if (n.length === 0) {
1437
- const R = h ? T.nothingHereYet : T.emptyStateHeading, P = h ? T.adjustFiltersOrCreate : T.emptyStateDescription;
1438
- return /* @__PURE__ */ b(
1439
- v,
1424
+ const C = h ? L.nothingHereYet : L.emptyStateHeading, w = h ? L.adjustFiltersOrCreate : L.emptyStateDescription;
1425
+ return /* @__PURE__ */ S(
1426
+ I,
1440
1427
  {
1441
1428
  direction: "column",
1442
1429
  alignItems: "center",
@@ -1445,67 +1432,66 @@ const xn = {
1445
1432
  gap: "small",
1446
1433
  "data-testid": "empty-notes",
1447
1434
  children: [
1448
- /* @__PURE__ */ i(ae, { level: "h3", children: R }),
1449
- /* @__PURE__ */ i(z, { color: "secondary", children: P })
1435
+ /* @__PURE__ */ i(ae, { level: "h3", children: C }),
1436
+ /* @__PURE__ */ i(U, { color: "secondary", children: w })
1450
1437
  ]
1451
1438
  }
1452
1439
  );
1453
1440
  }
1454
- return /* @__PURE__ */ b(Ve, { children: [
1455
- /* @__PURE__ */ i("div", { style: xn, "data-testid": "notes-grid", children: N.map((R, P) => (
1441
+ return /* @__PURE__ */ S(Ve, { children: [
1442
+ /* @__PURE__ */ i("div", { style: Cn, "data-testid": "notes-grid", children: _.map((C, w) => (
1456
1443
  // biome-ignore lint/suspicious/noArrayIndexKey: columns are positional, index is stable
1457
- /* @__PURE__ */ i("div", { style: wn, children: R.map((C) => {
1458
- var W;
1444
+ /* @__PURE__ */ i("div", { style: xn, children: C.map((x) => {
1445
+ var R;
1459
1446
  return /* @__PURE__ */ i(
1460
- In,
1447
+ Tn,
1461
1448
  {
1462
- noteId: C.id,
1463
- date: C.createdAt,
1464
- type: C.reaction[0] ?? A.IMPORTANT,
1465
- highlight: (W = C.highlightData) == null ? void 0 : W.selectedText,
1466
- note: C.userText,
1467
- isActive: g === C.id,
1449
+ noteId: x.id,
1450
+ date: x.createdAt,
1451
+ type: x.reaction[0] ?? k.IMPORTANT,
1452
+ highlight: (R = x.highlightData) == null ? void 0 : R.selectedText,
1453
+ note: x.userText,
1454
+ isActive: g === x.id,
1468
1455
  isPanelView: !!g,
1469
- onClick: l ? () => l(C.id) : void 0,
1470
- onDelete: d ? (L) => d(L) : void 0,
1471
- onSaveNote: m ? (L, D) => m(L, D) : void 0,
1472
- onTypeChange: c ? (L, D) => c(L, D) : void 0,
1456
+ onClick: l ? () => l(x.id) : void 0,
1457
+ onDelete: c ? (P) => c(P) : void 0,
1458
+ onSaveNote: m ? (P, M) => m(P, M) : void 0,
1459
+ onTypeChange: d ? (P, M) => d(P, M) : void 0,
1473
1460
  highlightTheme: E,
1474
- cardTheme: f,
1475
- locale: I,
1476
- renderLink: O,
1477
- href: k ? k(C.id, C) : void 0
1461
+ locale: f,
1462
+ renderLink: v,
1463
+ href: y ? y(x.id, x) : void 0
1478
1464
  },
1479
- C.id
1465
+ x.id
1480
1466
  );
1481
- }) }, P)
1467
+ }) }, w)
1482
1468
  )) }),
1483
- x && /* @__PURE__ */ b(v, { justifyItems: "center", gap: "small", padding: "small", "data-testid": "notes-pagination", children: [
1469
+ p && /* @__PURE__ */ S(I, { justifyItems: "center", gap: "small", padding: "small", "data-testid": "notes-pagination", children: [
1484
1470
  /* @__PURE__ */ i(
1485
- X,
1471
+ Y,
1486
1472
  {
1487
1473
  size: "small",
1488
- screenReaderLabel: T.previousPage,
1474
+ screenReaderLabel: L.previousPage,
1489
1475
  "data-testid": "notes-prev-page",
1490
1476
  interaction: o != null && o.hasPreviousPage ? "enabled" : "disabled",
1491
1477
  onClick: r,
1492
- children: /* @__PURE__ */ i(ot, {})
1478
+ children: /* @__PURE__ */ i(nt, {})
1493
1479
  }
1494
1480
  ),
1495
1481
  /* @__PURE__ */ i(
1496
- X,
1482
+ Y,
1497
1483
  {
1498
1484
  size: "small",
1499
- screenReaderLabel: T.nextPage,
1485
+ screenReaderLabel: L.nextPage,
1500
1486
  "data-testid": "notes-next-page",
1501
1487
  interaction: o != null && o.hasNextPage ? "enabled" : "disabled",
1502
1488
  onClick: s,
1503
- children: /* @__PURE__ */ i(rt, {})
1489
+ children: /* @__PURE__ */ i(ot, {})
1504
1490
  }
1505
1491
  )
1506
1492
  ] })
1507
1493
  ] });
1508
- }, eo = ({
1494
+ }, Jn = ({
1509
1495
  noteText: n,
1510
1496
  reaction: e,
1511
1497
  highlightText: t,
@@ -1513,26 +1499,26 @@ const xn = {
1513
1499
  onSave: r,
1514
1500
  onDelete: s,
1515
1501
  onTypeChange: l,
1516
- onBack: d,
1502
+ onBack: c,
1517
1503
  editing: m = !1
1518
1504
  }) => {
1519
- const { translations: c } = q(), [g, h] = H(m), [u, E] = H(n || ""), [f, I] = H(!1);
1520
- return /* @__PURE__ */ b(v, { direction: "column", gap: "small", "data-testid": "single-note", children: [
1521
- t != null ? /* @__PURE__ */ i(Q, { as: "div", children: /* @__PURE__ */ i(z, { children: /* @__PURE__ */ i(ge, { type: e, isCardActive: !0, theme: o, children: t }) }) }) : /* @__PURE__ */ i(Qe, {}),
1505
+ const { translations: d } = X(), [g, h] = B(m), [u, E] = B(n || ""), [f, v] = B(!1);
1506
+ return /* @__PURE__ */ S(I, { direction: "column", gap: "small", "data-testid": "single-note", children: [
1507
+ t != null ? /* @__PURE__ */ i(q, { as: "div", children: /* @__PURE__ */ i(U, { children: /* @__PURE__ */ i(he, { type: e, isCardActive: !0, theme: o, children: t }) }) }) : /* @__PURE__ */ i(Qe, {}),
1522
1508
  /* @__PURE__ */ i(Ye, { type: e, onTypeChange: l, renderAsMenuTrigger: !!l }),
1523
- g ? /* @__PURE__ */ b(v, { direction: "column", gap: "x-small", children: [
1509
+ g ? /* @__PURE__ */ S(I, { direction: "column", gap: "x-small", children: [
1524
1510
  /* @__PURE__ */ i(
1525
1511
  He,
1526
1512
  {
1527
- label: c.addNoteOptional,
1513
+ label: d.addNoteOptional,
1528
1514
  value: u,
1529
- onChange: (O) => E(O.target.value),
1515
+ onChange: (y) => E(y.target.value),
1530
1516
  resize: "vertical"
1531
1517
  }
1532
1518
  ),
1533
- /* @__PURE__ */ b(v, { gap: "xx-small", children: [
1534
- /* @__PURE__ */ i(v.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1535
- U,
1519
+ /* @__PURE__ */ S(I, { gap: "xx-small", children: [
1520
+ /* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1521
+ $,
1536
1522
  {
1537
1523
  display: "block",
1538
1524
  size: "small",
@@ -1540,11 +1526,11 @@ const xn = {
1540
1526
  onClick: () => {
1541
1527
  E(n || ""), h(!1);
1542
1528
  },
1543
- children: c.cancel
1529
+ children: d.cancel
1544
1530
  }
1545
1531
  ) }),
1546
- /* @__PURE__ */ i(v.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1547
- U,
1532
+ /* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1533
+ $,
1548
1534
  {
1549
1535
  display: "block",
1550
1536
  color: "primary",
@@ -1553,57 +1539,57 @@ const xn = {
1553
1539
  onClick: () => {
1554
1540
  r(u), h(!1);
1555
1541
  },
1556
- children: c.save
1542
+ children: d.save
1557
1543
  }
1558
1544
  ) })
1559
1545
  ] })
1560
- ] }) : /* @__PURE__ */ b(v, { direction: "column", gap: "small", children: [
1561
- n && /* @__PURE__ */ b(Q, { as: "div", children: [
1562
- /* @__PURE__ */ i(ae, { level: "h4", margin: "0 0 xx-small 0", children: c.note }),
1563
- /* @__PURE__ */ i(z, { children: n })
1546
+ ] }) : /* @__PURE__ */ S(I, { direction: "column", gap: "small", children: [
1547
+ n && /* @__PURE__ */ S(q, { as: "div", children: [
1548
+ /* @__PURE__ */ i(ae, { level: "h4", margin: "0 0 xx-small 0", children: d.note }),
1549
+ /* @__PURE__ */ i(U, { children: n })
1564
1550
  ] }),
1565
- /* @__PURE__ */ b(v, { justifyItems: "space-between", children: [
1551
+ /* @__PURE__ */ S(I, { justifyItems: "space-between", children: [
1566
1552
  /* @__PURE__ */ i(
1567
- U,
1553
+ $,
1568
1554
  {
1569
1555
  size: "small",
1570
- renderIcon: /* @__PURE__ */ i(st, {}),
1556
+ renderIcon: /* @__PURE__ */ i(rt, {}),
1571
1557
  "data-testid": "single-note-back",
1572
- onClick: () => d == null ? void 0 : d(),
1573
- children: c.back
1558
+ onClick: () => c == null ? void 0 : c(),
1559
+ children: d.back
1574
1560
  }
1575
1561
  ),
1576
- /* @__PURE__ */ b(v, { gap: "xx-small", children: [
1562
+ /* @__PURE__ */ S(I, { gap: "xx-small", children: [
1577
1563
  s && /* @__PURE__ */ i(
1578
- X,
1564
+ Y,
1579
1565
  {
1580
1566
  size: "small",
1581
1567
  withBackground: !1,
1582
1568
  withBorder: !1,
1583
1569
  color: "danger",
1584
- screenReaderLabel: c.deleteNote,
1570
+ screenReaderLabel: d.deleteNote,
1585
1571
  "data-testid": "single-note-delete",
1586
- onClick: () => I(!0),
1572
+ onClick: () => v(!0),
1587
1573
  children: /* @__PURE__ */ i(le, {})
1588
1574
  }
1589
1575
  ),
1590
1576
  /* @__PURE__ */ i(
1591
- X,
1577
+ Y,
1592
1578
  {
1593
1579
  size: "small",
1594
1580
  withBackground: !1,
1595
1581
  withBorder: !1,
1596
- screenReaderLabel: c.editNote,
1582
+ screenReaderLabel: d.editNote,
1597
1583
  "data-testid": "single-note-edit",
1598
1584
  onClick: () => h(!0),
1599
- children: /* @__PURE__ */ i(me, {})
1585
+ children: /* @__PURE__ */ i(fe, {})
1600
1586
  }
1601
1587
  )
1602
1588
  ] })
1603
1589
  ] }),
1604
- f && s && /* @__PURE__ */ i(Q, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ b(v, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
1590
+ f && s && /* @__PURE__ */ i(q, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ S(I, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
1605
1591
  /* @__PURE__ */ i(
1606
- U,
1592
+ $,
1607
1593
  {
1608
1594
  display: "block",
1609
1595
  color: "danger",
@@ -1611,19 +1597,19 @@ const xn = {
1611
1597
  renderIcon: /* @__PURE__ */ i(le, {}),
1612
1598
  "data-testid": "single-note-confirm-delete",
1613
1599
  onClick: () => {
1614
- s(), I(!1);
1600
+ s(), v(!1);
1615
1601
  },
1616
- children: c.deleteNote
1602
+ children: d.deleteNote
1617
1603
  }
1618
1604
  ),
1619
1605
  /* @__PURE__ */ i(
1620
- U,
1606
+ $,
1621
1607
  {
1622
1608
  display: "block",
1623
1609
  size: "small",
1624
1610
  "data-testid": "single-note-cancel-delete",
1625
- onClick: () => I(!1),
1626
- children: c.cancel
1611
+ onClick: () => v(!1),
1612
+ children: d.cancel
1627
1613
  }
1628
1614
  )
1629
1615
  ] }) })
@@ -1631,25 +1617,25 @@ const xn = {
1631
1617
  ] });
1632
1618
  };
1633
1619
  export {
1634
- Qn as ContentWithNoteWrapper,
1635
- ge as Highlight,
1620
+ Xn as ContentWithNoteWrapper,
1621
+ he as Highlight,
1636
1622
  Qe as HighlightError,
1637
- In as NoteCard,
1623
+ Tn as NoteCard,
1638
1624
  Ye as NoteChip,
1639
- bn as NoteReactionMenu,
1640
- Xn as NotebookProvider,
1641
- pn as NotebookTranslationsProvider,
1642
- Zn as NotebookTray,
1643
- Jn as NotesListView,
1644
- A as REACTION_TYPE,
1645
- eo as SingleNote,
1646
- de as createTransparentColor,
1647
- Dt as useCreateNote,
1648
- At as useDeleteNote,
1625
+ yn as NoteReactionMenu,
1626
+ Kn as NotebookProvider,
1627
+ gn as NotebookTranslationsProvider,
1628
+ Vn as NotebookTray,
1629
+ Zn as NotesListView,
1630
+ k as REACTION_TYPE,
1631
+ Jn as SingleNote,
1632
+ Te as createTransparentColor,
1633
+ Rt as useCreateNote,
1634
+ Dt as useDeleteNote,
1649
1635
  $e as useGetNotes,
1650
1636
  Xe as useNotebook,
1651
- q as useNotebookTranslations,
1652
- Yn as useNotesData,
1653
- Vn as useReactionFilter,
1654
- Lt as useUpdateNote
1637
+ X as useNotebookTranslations,
1638
+ Qn as useNotesData,
1639
+ Yn as useReactionFilter,
1640
+ At as useUpdateNote
1655
1641
  };