@instructure/platform-notebook 1.10.3 → 1.11.1

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,107 +1,111 @@
1
1
  import { jsx as i, jsxs as T, Fragment as Xe } from "react/jsx-runtime";
2
- import { createContext as Ve, useMemo as he, useContext as Qe, useReducer as Ye, useRef as F, useEffect as W, useState as G, useCallback as K } from "react";
3
- import { createPortal as ht } from "react-dom";
4
- import { z as f } from "zod";
5
- import pt from "diff-match-patch";
6
- import { useQueryClient as ke, useMutation as Oe, useQuery as yt } from "@tanstack/react-query";
7
- import { CloseButton as Nt, Button as ne, IconButton as me } from "@instructure/ui-buttons/v11_7";
8
- import { Flex as x } from "@instructure/ui-flex/v11_7";
9
- import { Heading as Se } from "@instructure/ui-heading/v11_7";
2
+ import { createContext as Ve, useMemo as pe, useContext as Qe, useReducer as Ye, useRef as F, useEffect as q, useState as W, useCallback as K } from "react";
3
+ import { createPortal as pt } from "react-dom";
4
+ import { z as d } from "zod";
5
+ import yt from "diff-match-patch";
6
+ import { useQueryClient as ke, useMutation as Le, useQuery as Nt } from "@tanstack/react-query";
7
+ import { CloseButton as bt, Button as ne, IconButton as ge } from "@instructure/ui-buttons/v11_7";
8
+ import { Flex as I } from "@instructure/ui-flex/v11_7";
9
+ import { Heading as ve } from "@instructure/ui-heading/v11_7";
10
10
  import { Tray as Et } from "@instructure/ui-tray/v11_7";
11
11
  import { View as V } from "@instructure/ui-view/v11_7";
12
- import { IconQuestionLine as Le, IconPinLine as Ae, IconWarningLine as bt, IconNoteLine as Tt, IconEditLine as Re, IconTrashLine as Te, IconArrowStartLine as St } from "@instructure/ui-icons";
13
- import { Menu as ue } from "@instructure/ui-menu/v11_7";
14
- import { TruncateText as be } from "@instructure/ui-truncate-text/v11_7";
12
+ import { IconQuestionLine as Ae, IconPinLine as De, IconWarningLine as Tt, NotebookInstUIIcon as St, IconEditLine as Oe, IconTrashLine as Se, IconArrowStartLine as vt } from "@instructure/ui-icons";
13
+ import { Menu as fe } from "@instructure/ui-menu/v11_7";
14
+ import { TruncateText as Te } from "@instructure/ui-truncate-text/v11_7";
15
15
  import { SimpleSelect as He } from "@instructure/ui-simple-select/v11_7";
16
- import { Text as te } from "@instructure/ui-text/v11_7";
17
- import { ScreenReaderContent as pe } from "@instructure/ui-a11y-content";
16
+ import { Text as Z } from "@instructure/ui-text/v11_7";
17
+ import { ScreenReaderContent as ye } from "@instructure/ui-a11y-content";
18
18
  import { Dialog as Ct } from "@instructure/ui-dialog";
19
19
  import { TextArea as Ze } from "@instructure/ui-text-area/v11_7";
20
- import { Pill as Ue } from "@instructure/ui-pill/v11_7";
21
- import { Pagination as vt } from "@instructure/ui-pagination/v11_7";
22
- import { Spinner as It } from "@instructure/ui-spinner/v11_7";
23
- const xt = f.object({
24
- startContainer: f.string(),
25
- endContainer: f.string(),
26
- startOffset: f.number(),
27
- endOffset: f.number()
28
- }), Rt = f.object({
29
- start: f.number(),
30
- end: f.number()
31
- }), De = f.object({
32
- selectedText: f.string(),
33
- hasNoHighlightAnymore: f.boolean().optional(),
34
- textPosition: Rt.nullable(),
35
- range: xt.nullable(),
36
- pageLastModifiedAt: f.string()
20
+ import { Pill as $e } from "@instructure/ui-pill/v11_7";
21
+ import { Pagination as It } from "@instructure/ui-pagination/v11_7";
22
+ import { Spinner as xt } from "@instructure/ui-spinner/v11_7";
23
+ const Rt = d.object({
24
+ startContainer: d.string(),
25
+ endContainer: d.string(),
26
+ startOffset: d.number(),
27
+ endOffset: d.number()
28
+ }), Ot = d.object({
29
+ start: d.number(),
30
+ end: d.number()
31
+ }), Pe = d.object({
32
+ selectedText: d.string(),
33
+ hasNoHighlightAnymore: d.boolean().optional(),
34
+ textPosition: Ot.nullable(),
35
+ range: Rt.nullable(),
36
+ pageLastModifiedAt: d.string()
37
37
  });
38
- var k = /* @__PURE__ */ ((t) => (t.IMPORTANT = "Important", t.CONFUSING = "Confusing", t))(k || {});
39
- const Pe = f.enum([
38
+ var L = /* @__PURE__ */ ((t) => (t.IMPORTANT = "Important", t.CONFUSING = "Confusing", t))(L || {});
39
+ const _e = d.enum([
40
40
  "Important",
41
41
  "Confusing"
42
42
  /* CONFUSING */
43
- ]), wt = f.object({
44
- totalCount: f.number().nullish(),
45
- totalNrOfPages: f.number().nullish()
46
- }), Ce = f.object({
47
- id: f.string(),
48
- rootAccountUuid: f.string(),
49
- userId: f.string(),
50
- courseId: f.string(),
51
- objectId: f.string(),
52
- objectType: f.string(),
53
- userText: f.string().optional(),
54
- reaction: f.array(Pe),
55
- highlightData: De,
56
- createdAt: f.string(),
57
- updatedAt: f.string()
58
- }), kt = f.object({
59
- cursor: f.string(),
43
+ ]), wt = d.object({
44
+ totalCount: d.number().nullish(),
45
+ totalNrOfPages: d.number().nullish()
46
+ }), Ce = d.object({
47
+ id: d.string(),
48
+ rootAccountUuid: d.string(),
49
+ userId: d.string(),
50
+ courseId: d.string(),
51
+ objectId: d.string(),
52
+ objectType: d.string(),
53
+ userText: d.string().optional(),
54
+ reaction: d.array(_e),
55
+ highlightData: Pe,
56
+ // Set by the host when the note's highlight is gone specifically because its source
57
+ // (the page/assignment/quiz it was captured from) was unpublished or deleted, as opposed
58
+ // to the note never having had a highlight. Selects the HighlightError reason in NoteCard.
59
+ highlightSourceUnavailable: d.boolean().optional(),
60
+ createdAt: d.string(),
61
+ updatedAt: d.string()
62
+ }), kt = d.object({
63
+ cursor: d.string(),
60
64
  node: Ce
61
65
  });
62
- f.object({
63
- notes: f.object({
64
- edges: f.array(kt),
65
- nodes: f.array(Ce),
66
+ d.object({
67
+ notes: d.object({
68
+ edges: d.array(kt),
69
+ nodes: d.array(Ce),
66
70
  pageInfo: wt
67
71
  })
68
72
  });
69
- const Ot = f.object({
70
- type: f.string(),
71
- id: f.string()
72
- }), Lt = f.object({
73
- courseId: f.string().optional(),
74
- learningObject: Ot.optional(),
75
- reactions: f.array(f.string()).optional()
73
+ const Lt = d.object({
74
+ type: d.string(),
75
+ id: d.string()
76
+ }), At = d.object({
77
+ courseId: d.string().optional(),
78
+ learningObject: Lt.optional(),
79
+ reactions: d.array(d.string()).optional()
76
80
  }).optional();
77
- f.object({
78
- courseId: f.string().optional(),
79
- filter: Lt,
80
- offset: f.number().optional(),
81
- pageSize: f.number().optional()
81
+ d.object({
82
+ courseId: d.string().optional(),
83
+ filter: At,
84
+ offset: d.number().optional(),
85
+ pageSize: d.number().optional()
82
86
  });
83
- f.object({
84
- courseId: f.string(),
85
- objectId: f.string(),
86
- objectType: f.string(),
87
- userText: f.string().optional(),
88
- reaction: f.array(Pe),
89
- highlightData: De
87
+ d.object({
88
+ courseId: d.string(),
89
+ objectId: d.string(),
90
+ objectType: d.string(),
91
+ userText: d.string().optional(),
92
+ reaction: d.array(_e),
93
+ highlightData: Pe
90
94
  });
91
- f.object({
95
+ d.object({
92
96
  createNote: Ce
93
97
  });
94
- f.object({
95
- id: f.string(),
96
- userText: f.string().optional(),
97
- reaction: f.array(Pe),
98
- highlightData: De
98
+ d.object({
99
+ id: d.string(),
100
+ userText: d.string().optional(),
101
+ reaction: d.array(_e),
102
+ highlightData: Pe
99
103
  });
100
- f.object({
104
+ d.object({
101
105
  updateNote: Ce
102
106
  });
103
- f.object({
104
- deleteNote: f.string()
107
+ d.object({
108
+ deleteNote: d.string()
105
109
  });
106
110
  var Je = /* @__PURE__ */ ((t) => (t[t.FORWARDS = 1] = "FORWARDS", t[t.BACKWARDS = 2] = "BACKWARDS", t))(Je || {});
107
111
  class oe {
@@ -200,18 +204,18 @@ class X {
200
204
  return new X(n, o);
201
205
  }
202
206
  }
203
- const At = (t) => {
207
+ const Dt = (t) => {
204
208
  const e = t.nodeName.toLowerCase();
205
209
  return e === "#text" ? "text()" : e;
206
210
  };
207
- function Dt(t) {
211
+ function Pt(t) {
208
212
  let e = 0, n = t;
209
213
  for (; n; )
210
214
  n.nodeName === t.nodeName && (e += 1), n = n.previousSibling;
211
215
  return e;
212
216
  }
213
- const Pt = (t) => {
214
- const e = At(t), n = Dt(t);
217
+ const _t = (t) => {
218
+ const e = Dt(t), n = Pt(t);
215
219
  return `${e}[${n}]`;
216
220
  }, Ge = (t, e) => {
217
221
  let n = "", o = t;
@@ -220,10 +224,10 @@ const Pt = (t) => {
220
224
  console.error("Node is not a descendant of root");
221
225
  return;
222
226
  }
223
- n = `${Pt(o)}/${n}`, o = o.parentNode;
227
+ n = `${_t(o)}/${n}`, o = o.parentNode;
224
228
  }
225
229
  return n = `/${n}`, n = n.replace(/\/$/, ""), n;
226
- }, _t = (t, e, n) => {
230
+ }, Ft = (t, e, n) => {
227
231
  const o = e.toUpperCase();
228
232
  let r = -1;
229
233
  for (let s = 0; s < t.children.length; s++) {
@@ -232,7 +236,7 @@ const Pt = (t) => {
232
236
  return l;
233
237
  }
234
238
  return null;
235
- }, Ft = (t, e) => {
239
+ }, Mt = (t, e) => {
236
240
  if (!(t.match(/^(\/[A-Za-z0-9-]+(\[[0-9]+])?)+$/) !== null))
237
241
  return console.error("Expression is not a simple XPath"), null;
238
242
  const o = t.split("/");
@@ -240,35 +244,35 @@ const Pt = (t) => {
240
244
  o.shift();
241
245
  for (const s of o) {
242
246
  let l, a;
243
- const m = s.indexOf("[");
244
- if (m !== -1) {
245
- l = s.slice(0, m);
246
- const p = s.slice(m + 1, s.indexOf("]"));
247
- if (a = Number.parseInt(p, 10) - 1, a < 0)
247
+ const f = s.indexOf("[");
248
+ if (f !== -1) {
249
+ l = s.slice(0, f);
250
+ const m = s.slice(f + 1, s.indexOf("]"));
251
+ if (a = Number.parseInt(m, 10) - 1, a < 0)
248
252
  return null;
249
253
  } else
250
254
  l = s, a = 0;
251
- const c = _t(r, l, a);
252
- if (!c)
255
+ const u = Ft(r, l, a);
256
+ if (!u)
253
257
  return null;
254
- r = c;
258
+ r = u;
255
259
  }
256
260
  return r;
257
261
  }, je = (t, e = document.body) => {
258
262
  if (t === "")
259
263
  return e;
260
264
  try {
261
- return Ft(t, e);
265
+ return Mt(t, e);
262
266
  } catch {
263
267
  return document.evaluate(`.${t}`, e, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
264
268
  }
265
269
  };
266
- class ae {
270
+ class ce {
267
271
  constructor(e, n) {
268
272
  this.root = e, this.range = n;
269
273
  }
270
274
  static fromRange(e, n) {
271
- return new ae(e, n);
275
+ return new ce(e, n);
272
276
  }
273
277
  static fromSelector(e, n) {
274
278
  if ((n == null ? void 0 : n.startContainer) == null || (n == null ? void 0 : n.endContainer) == null)
@@ -283,7 +287,7 @@ class ae {
283
287
  if (!s || !l)
284
288
  return null;
285
289
  const a = new oe(s, l).toRange();
286
- return a ? !e.contains(a.startContainer) || !e.contains(a.endContainer) ? (console.error("Resolved range escapes root"), null) : new ae(e, a) : null;
290
+ return a ? !e.contains(a.startContainer) || !e.contains(a.endContainer) ? (console.error("Resolved range escapes root"), null) : new ce(e, a) : null;
287
291
  }
288
292
  toRange() {
289
293
  return this.range;
@@ -299,17 +303,17 @@ class ae {
299
303
  };
300
304
  }
301
305
  }
302
- class ie {
306
+ class le {
303
307
  constructor(e, n, o) {
304
308
  this.root = e, this.start = n, this.end = o;
305
309
  }
306
310
  static fromRange(e, n) {
307
311
  var r;
308
312
  const o = (r = oe.fromRange(n)) == null ? void 0 : r.relativeTo(e);
309
- return o ? new ie(e, o.start.offset, o.end.offset) : null;
313
+ return o ? new le(e, o.start.offset, o.end.offset) : null;
310
314
  }
311
315
  static fromSelector(e, n) {
312
- return new ie(e, n.start, n.end);
316
+ return new le(e, n.start, n.end);
313
317
  }
314
318
  toSelector() {
315
319
  return {
@@ -344,65 +348,65 @@ const et = (t) => {
344
348
  for (; n !== void 0 && l && a === n; )
345
349
  r.push({ node: l, offset: l.data.length }), n = e.shift();
346
350
  return n !== void 0 && console.error("Offset exceeds text length"), r;
347
- }, Mt = (t, e, n, o) => {
351
+ }, Bt = (t, e, n, o) => {
348
352
  const r = n - e;
349
- return Math.abs(r - o) <= 5 ? ie.fromSelector(t, {
353
+ return Math.abs(r - o) <= 5 ? le.fromSelector(t, {
350
354
  start: e,
351
355
  end: n
352
356
  }) : null;
353
- }, Bt = (t, e, n, o) => {
354
- const r = new pt();
357
+ }, Ut = (t, e, n, o) => {
358
+ const r = new yt();
355
359
  r.Match_Distance = 5e3;
356
360
  const s = t.textContent;
357
361
  if (!s)
358
362
  return null;
359
363
  if (e.length > 32) {
360
- const l = e.slice(0, 32), a = e.slice(-32), m = o - n;
361
- let c = r.match_main(s, l, n);
362
- const p = r.match_main(s, a, o), d = p + a.length;
363
- if (c === -1 || p === -1)
364
+ const l = e.slice(0, 32), a = e.slice(-32), f = o - n;
365
+ let u = r.match_main(s, l, n);
366
+ const m = r.match_main(s, a, o), c = m + a.length;
367
+ if (u === -1 || m === -1)
364
368
  return null;
365
- const h = d - c, E = Math.abs(h - m);
366
- if ((c > d || E > 5) && (r.Match_Distance = e.length + 100, c = r.match_main(s, l, d), c !== -1 && c < d))
367
- return Mt(t, c, d, m);
368
- if (c < d && E <= 5)
369
- return ie.fromSelector(t, {
370
- start: c,
371
- end: d
369
+ const y = c - u, N = Math.abs(y - f);
370
+ if ((u > c || N > 5) && (r.Match_Distance = e.length + 100, u = r.match_main(s, l, c), u !== -1 && u < c))
371
+ return Bt(t, u, c, f);
372
+ if (u < c && N <= 5)
373
+ return le.fromSelector(t, {
374
+ start: u,
375
+ end: c
372
376
  });
373
377
  } else {
374
378
  const l = r.match_main(s, e, n);
375
379
  if (l !== -1)
376
- return ie.fromSelector(t, {
380
+ return le.fromSelector(t, {
377
381
  start: l,
378
382
  end: l + e.length
379
383
  });
380
384
  }
381
385
  return null;
382
- }, $t = (t, e) => {
386
+ }, Ht = (t, e) => {
383
387
  if (!e) return null;
384
388
  const { highlightData: n } = t, { textPosition: o, selectedText: r } = n;
385
- return Bt(
389
+ return Ut(
386
390
  e,
387
391
  r,
388
392
  (o == null ? void 0 : o.start) ?? 0,
389
393
  (o == null ? void 0 : o.end) ?? 0
390
394
  );
391
- }, Ht = (t, e, n) => {
395
+ }, $t = (t, e, n) => {
392
396
  const o = [], r = [];
393
397
  for (const s of e) {
394
- const l = $t(s, t);
398
+ const l = Ht(s, t);
395
399
  if (l) {
396
- const a = l.toRange(), m = a && ae.fromRange(t, a), c = (a == null ? void 0 : a.toString().trim()) || s.highlightData.selectedText;
400
+ const a = l.toRange(), f = a && ce.fromRange(t, a), u = (a == null ? void 0 : a.toString().trim()) || s.highlightData.selectedText;
397
401
  o.push({
398
402
  id: s.id,
399
403
  reaction: s.reaction,
400
404
  userText: s.userText,
401
405
  highlightData: {
402
406
  ...s.highlightData,
403
- selectedText: c,
407
+ selectedText: u,
404
408
  hasNoHighlightAnymore: !1,
405
- range: (m == null ? void 0 : m.toSelector()) ?? null,
409
+ range: (f == null ? void 0 : f.toSelector()) ?? null,
406
410
  textPosition: l.toSelector(),
407
411
  pageLastModifiedAt: n
408
412
  }
@@ -424,59 +428,59 @@ const et = (t) => {
424
428
  var l;
425
429
  if (!e) return;
426
430
  const { highlightData: n, id: o } = t, { range: r } = n ?? {};
427
- r && ((l = ae.fromSelector(e, r)) == null ? void 0 : l.toRange()) && Jt({ id: o });
428
- }, Ut = (t) => {
431
+ r && ((l = ce.fromSelector(e, r)) == null ? void 0 : l.toRange()) && en({ id: o });
432
+ }, Gt = (t) => {
429
433
  const n = document.querySelector(
430
434
  `[data-highlight-id="${CSS.escape(t)}"].highlight-content`
431
- ) ?? document.getElementById(ve(t));
435
+ ) ?? document.getElementById(Ie(t));
432
436
  if (n) {
433
437
  const o = n.getBoundingClientRect();
434
438
  o.top >= 0 && o.bottom <= (window.innerHeight || document.documentElement.clientHeight) || n.scrollIntoView({ behavior: "smooth", block: "center" });
435
439
  }
436
- }, ye = 90, Ne = 172, Gt = (t) => {
440
+ }, Ne = 90, be = 172, jt = (t) => {
437
441
  const e = t.getClientRects();
438
442
  if (!e.length)
439
443
  return null;
440
- const n = e[0], o = e[e.length - 1], r = 4, s = 16, l = window.innerWidth || document.documentElement.clientWidth, a = window.innerHeight || document.documentElement.clientHeight, m = (y) => {
441
- const b = y + Ne;
442
- return y >= s && b <= l - s;
443
- }, c = (y) => {
444
- const b = y + ye;
445
- return y >= s && b <= a - s;
444
+ const n = e[0], o = e[e.length - 1], r = 4, s = 16, l = window.innerWidth || document.documentElement.clientWidth, a = window.innerHeight || document.documentElement.clientHeight, f = (h) => {
445
+ const x = h + be;
446
+ return h >= s && x <= l - s;
447
+ }, u = (h) => {
448
+ const x = h + Ne;
449
+ return h >= s && x <= a - s;
446
450
  };
447
- let p;
448
- const d = n.right - Ne;
449
- if (m(d))
450
- p = d;
451
+ let m;
452
+ const c = n.right - be;
453
+ if (f(c))
454
+ m = c;
451
455
  else {
452
- const y = n.left;
453
- if (m(y))
454
- p = y;
456
+ const h = n.left;
457
+ if (f(h))
458
+ m = h;
455
459
  else {
456
- const g = (n.left + n.right) / 2 - Ne / 2;
457
- m(g) ? p = g : d < s ? p = s : p = l - Ne - s;
460
+ const p = (n.left + n.right) / 2 - be / 2;
461
+ f(p) ? m = p : c < s ? m = s : m = l - be - s;
458
462
  }
459
463
  }
460
- let h;
461
- const E = o.bottom + r;
462
- if (c(E))
463
- h = E;
464
+ let y;
465
+ const N = o.bottom + r;
466
+ if (u(N))
467
+ y = N;
464
468
  else {
465
- const y = n.top - ye - r;
466
- c(y) ? h = y : E + ye > a - s ? h = a - ye - s : h = s;
469
+ const h = n.top - Ne - r;
470
+ u(h) ? y = h : N + Ne > a - s ? y = a - Ne - s : y = s;
467
471
  }
468
- return { top: h, left: p };
469
- }, jt = (t, e) => {
472
+ return { top: y, left: m };
473
+ }, Wt = (t, e) => {
470
474
  for (const n of e)
471
475
  if (t.start < n.end && t.end > n.start)
472
476
  return !0;
473
477
  return !1;
474
- }, _e = (t) => `highlight-wrapper-${t}`, ve = (t) => `${_e(t)}-start`, nt = (t) => `${_e(t)}-end`, ge = (t) => `[data-highlight-id="${CSS.escape(t)}"]`, Wt = "2px", zt = "3px", qt = "1px", ot = "3px", Kt = "1px", rt = "Notebook note", Fe = (t, e) => {
478
+ }, Fe = (t) => `highlight-wrapper-${t}`, Ie = (t) => `${Fe(t)}-start`, nt = (t) => `${Fe(t)}-end`, he = (t) => `[data-highlight-id="${CSS.escape(t)}"]`, zt = "2px", qt = "3px", Kt = "1px", ot = "3px", Xt = "1px", rt = "Notebook note", Me = (t, e) => {
475
479
  const n = Number.parseInt(t.slice(1, 3), 16), o = Number.parseInt(t.slice(3, 5), 16), r = Number.parseInt(t.slice(5, 7), 16);
476
480
  return `rgba(${n}, ${o}, ${r}, ${e})`;
477
481
  }, st = (t, e, n, o, r) => {
478
- t.style.backgroundColor = n, t.style.textDecorationColor = o, t.style.textDecorationStyle = r, e ? (t.dataset.selected = "true", t.style.outline = `${qt} ${r} ${o}`, t.style.outlineOffset = Kt, t.style.borderRadius = ot, t.style.fontWeight = "bold") : (t.removeAttribute("data-selected"), t.style.outline = "", t.style.outlineOffset = "", t.style.borderRadius = "", t.style.fontWeight = "");
479
- }, Xt = /* @__PURE__ */ new Set([
482
+ t.style.backgroundColor = n, t.style.textDecorationColor = o, t.style.textDecorationStyle = r, e ? (t.dataset.selected = "true", t.style.outline = `${Kt} ${r} ${o}`, t.style.outlineOffset = Xt, t.style.borderRadius = ot, t.style.fontWeight = "bold") : (t.removeAttribute("data-selected"), t.style.outline = "", t.style.outlineOffset = "", t.style.borderRadius = "", t.style.fontWeight = "");
483
+ }, Vt = /* @__PURE__ */ new Set([
480
484
  "AREA",
481
485
  "BASE",
482
486
  "BR",
@@ -495,11 +499,11 @@ const et = (t) => {
495
499
  const n = t.cloneRange();
496
500
  n.collapse(e);
497
501
  const o = n.startContainer;
498
- if (!(o.nodeType === Node.ELEMENT_NODE && Xt.has(o.tagName)) || !o.parentNode)
502
+ if (!(o.nodeType === Node.ELEMENT_NODE && Vt.has(o.tagName)) || !o.parentNode)
499
503
  return n;
500
504
  const s = o.parentNode, l = Array.from(s.childNodes).indexOf(o), a = document.createRange();
501
505
  return a.setStart(s, l), a.collapse(!0), a;
502
- }, Vt = (t, e) => {
506
+ }, Qt = (t, e) => {
503
507
  var n;
504
508
  try {
505
509
  const o = ((n = e.nodeValue) == null ? void 0 : n.length) ?? e.childNodes.length;
@@ -507,7 +511,7 @@ const et = (t) => {
507
511
  } catch {
508
512
  return !1;
509
513
  }
510
- }, Qt = (t) => {
514
+ }, Yt = (t) => {
511
515
  var s;
512
516
  if (t.collapsed)
513
517
  return [];
@@ -517,7 +521,7 @@ const et = (t) => {
517
521
  const n = [], o = (s = e == null ? void 0 : e.ownerDocument) == null ? void 0 : s.createNodeIterator(e, NodeFilter.SHOW_TEXT);
518
522
  let r = (o == null ? void 0 : o.nextNode()) || null;
519
523
  for (; r; ) {
520
- if (!Vt(t, r)) {
524
+ if (!Qt(t, r)) {
521
525
  r = (o == null ? void 0 : o.nextNode()) || null;
522
526
  continue;
523
527
  }
@@ -529,106 +533,106 @@ const et = (t) => {
529
533
  l === t.endContainer && t.endOffset < l.data.length && l.splitText(t.endOffset), n.push(l), r = (o == null ? void 0 : o.nextNode()) || null;
530
534
  }
531
535
  return n;
532
- }, Yt = (t, e, n) => {
536
+ }, Zt = (t, e, n) => {
533
537
  if (t.collapsed) return;
534
- const o = e.id ?? "", r = _e(o);
535
- if (document.getElementById(ve(o))) {
536
- Zt(e, n);
538
+ const o = e.id ?? "", r = Fe(o);
539
+ if (document.getElementById(Ie(o))) {
540
+ Jt(e, n);
537
541
  return;
538
542
  }
539
- const l = e.type === k.IMPORTANT ? n.colors.importantBackground : n.colors.confusingBackground, a = e.id === e.selectedNoteId, m = a ? l : Fe(l, 0.5), c = e.type === k.IMPORTANT ? n.colors.importantUnderline : n.colors.confusingUnderline, p = e.type === k.IMPORTANT ? "solid" : "dashed", d = document.createElement("span");
540
- d.id = `${r}-start`, d.className = "highlight-marker-start", d.dataset.highlightId = o || "";
541
- const h = e.labelPrefix ?? rt;
542
- d.setAttribute("role", "button"), d.setAttribute("tabindex", "0"), d.setAttribute("aria-label", h), d.setAttribute("aria-haspopup", "dialog"), d.setAttribute("aria-expanded", String(a && !!e.isTrayOpen)), a && d.setAttribute("aria-current", "true"), e.popupId && d.setAttribute("aria-controls", e.popupId), d.style.position = "relative", d.style.fontSize = "0", d.style.lineHeight = "0", d.style.width = "0", d.style.height = "0", d.style.margin = "0", d.style.padding = "0", d.style.border = "0", d.style.outline = "none";
543
- const E = document.createElement("span");
544
- E.id = nt(o), E.className = "highlight-marker-end", E.dataset.highlightId = o || "", qe(t, !1).insertNode(E), qe(t, !0).insertNode(d);
545
- const g = document.createRange();
546
- g.setStartAfter(d), g.setEndBefore(E);
547
- const j = Qt(g).filter((N) => N.textContent && N.textContent.length > 0);
548
- j.forEach((N, I) => {
549
- var $;
550
- const B = N.parentElement;
551
- if ((B == null ? void 0 : B.dataset.highlightId) === o) return;
552
- const D = I === 0, P = I === j.length - 1, S = j.length === 1;
543
+ const l = e.type === L.IMPORTANT ? n.colors.importantBackground : n.colors.confusingBackground, a = e.id === e.selectedNoteId, f = a ? l : Me(l, 0.5), u = e.type === L.IMPORTANT ? n.colors.importantUnderline : n.colors.confusingUnderline, m = e.type === L.IMPORTANT ? "solid" : "dashed", c = document.createElement("span");
544
+ c.id = `${r}-start`, c.className = "highlight-marker-start", c.dataset.highlightId = o || "";
545
+ const y = e.labelPrefix ?? rt;
546
+ c.setAttribute("role", "button"), c.setAttribute("tabindex", "0"), c.setAttribute("aria-label", y), c.setAttribute("aria-haspopup", "dialog"), c.setAttribute("aria-expanded", String(a && !!e.isTrayOpen)), a && c.setAttribute("aria-current", "true"), e.popupId && c.setAttribute("aria-controls", e.popupId), c.style.position = "relative", c.style.fontSize = "0", c.style.lineHeight = "0", c.style.width = "0", c.style.height = "0", c.style.margin = "0", c.style.padding = "0", c.style.border = "0", c.style.outline = "none";
547
+ const N = document.createElement("span");
548
+ N.id = nt(o), N.className = "highlight-marker-end", N.dataset.highlightId = o || "", qe(t, !1).insertNode(N), qe(t, !0).insertNode(c);
549
+ const p = document.createRange();
550
+ p.setStartAfter(c), p.setEndBefore(N);
551
+ const z = Yt(p).filter((b) => b.textContent && b.textContent.length > 0);
552
+ z.forEach((b, S) => {
553
+ var j;
554
+ const P = b.parentElement;
555
+ if ((P == null ? void 0 : P.dataset.highlightId) === o) return;
556
+ const D = S === 0, G = S === z.length - 1, E = z.length === 1;
553
557
  let w;
554
- S ? w = "single" : D ? w = "first" : P ? w = "last" : w = "middle";
555
- const C = document.createElement("span");
556
- C.className = "highlight-content", C.dataset.highlightId = o || "", C.dataset.position = w, C.style.textDecorationLine = "underline", C.style.textDecorationThickness = n.borderWidthSmall, C.style.textUnderlineOffset = n.underlineOffset, C.style.cursor = "pointer", st(C, a, m, c, p), C.addEventListener("click", (re) => {
557
- var z;
558
- re.target.tagName !== "A" && ((z = e.onClick) == null || z.call(e));
559
- }), ($ = N.parentNode) == null || $.insertBefore(C, N), C.appendChild(N);
560
- }), d.addEventListener("click", (N) => {
561
- var I;
562
- N.target.tagName !== "A" && ((I = e.onClick) == null || I.call(e));
563
- }), d.addEventListener("keydown", (N) => {
564
- var I;
565
- if (N.key === "Enter" || N.key === " ")
566
- N.preventDefault(), (I = e.onClick) == null || I.call(e);
567
- else if (N.key === "Tab" && !N.shiftKey) {
568
- const B = document.querySelectorAll(ge(o));
569
- for (const D of B) {
570
- const P = D.querySelector("a");
571
- if (P) {
572
- N.preventDefault(), P.focus();
558
+ E ? w = "single" : D ? w = "first" : G ? w = "last" : w = "middle";
559
+ const v = document.createElement("span");
560
+ v.className = "highlight-content", v.dataset.highlightId = o || "", v.dataset.position = w, v.style.textDecorationLine = "underline", v.style.textDecorationThickness = n.borderWidthSmall, v.style.textUnderlineOffset = n.underlineOffset, v.style.cursor = "pointer", st(v, a, f, u, m), v.addEventListener("click", (ee) => {
561
+ var Q;
562
+ ee.target.tagName !== "A" && ((Q = e.onClick) == null || Q.call(e));
563
+ }), (j = b.parentNode) == null || j.insertBefore(v, b), v.appendChild(b);
564
+ }), c.addEventListener("click", (b) => {
565
+ var S;
566
+ b.target.tagName !== "A" && ((S = e.onClick) == null || S.call(e));
567
+ }), c.addEventListener("keydown", (b) => {
568
+ var S;
569
+ if (b.key === "Enter" || b.key === " ")
570
+ b.preventDefault(), (S = e.onClick) == null || S.call(e);
571
+ else if (b.key === "Tab" && !b.shiftKey) {
572
+ const P = document.querySelectorAll(he(o));
573
+ for (const D of P) {
574
+ const G = D.querySelector("a");
575
+ if (G) {
576
+ b.preventDefault(), G.focus();
573
577
  break;
574
578
  }
575
579
  }
576
580
  }
577
- }), d.addEventListener("focus", () => {
581
+ }), c.addEventListener("focus", () => {
578
582
  document.querySelectorAll(
579
- `.highlight-content${ge(o)}`
580
- ).forEach((I) => {
581
- I.style.boxShadow = `0 0 0 ${Wt} ${n.colors.focusOutline}`, I.style.borderRadius = zt;
583
+ `.highlight-content${he(o)}`
584
+ ).forEach((S) => {
585
+ S.style.boxShadow = `0 0 0 ${zt} ${n.colors.focusOutline}`, S.style.borderRadius = qt;
582
586
  });
583
- }), d.addEventListener("blur", () => {
587
+ }), c.addEventListener("blur", () => {
584
588
  document.querySelectorAll(
585
- `.highlight-content${ge(o)}`
586
- ).forEach((I) => {
587
- I.style.boxShadow = "", I.style.borderRadius = I.dataset.selected ? ot : "";
589
+ `.highlight-content${he(o)}`
590
+ ).forEach((S) => {
591
+ S.style.boxShadow = "", S.style.borderRadius = S.dataset.selected ? ot : "";
588
592
  });
589
593
  });
590
594
  };
591
- function Zt(t, e) {
592
- const n = t.type === k.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, o = t.id === t.selectedNoteId, r = o ? n : Fe(n, 0.5), s = t.type === k.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline, l = t.type === k.IMPORTANT ? "solid" : "dashed";
595
+ function Jt(t, e) {
596
+ const n = t.type === L.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, o = t.id === t.selectedNoteId, r = o ? n : Me(n, 0.5), s = t.type === L.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline, l = t.type === L.IMPORTANT ? "solid" : "dashed";
593
597
  document.querySelectorAll(
594
- `.highlight-content${ge(t.id ?? "")}`
595
- ).forEach((c) => {
596
- st(c, o, r, s, l);
598
+ `.highlight-content${he(t.id ?? "")}`
599
+ ).forEach((u) => {
600
+ st(u, o, r, s, l);
597
601
  });
598
- const m = document.getElementById(
599
- ve(t.id ?? "")
602
+ const f = document.getElementById(
603
+ Ie(t.id ?? "")
600
604
  );
601
- m && (m.setAttribute("aria-label", t.labelPrefix ?? rt), m.setAttribute("aria-expanded", String(o && !!t.isTrayOpen)), o ? m.setAttribute("aria-current", "true") : m.removeAttribute("aria-current"));
605
+ f && (f.setAttribute("aria-label", t.labelPrefix ?? rt), f.setAttribute("aria-expanded", String(o && !!t.isTrayOpen)), o ? f.setAttribute("aria-current", "true") : f.removeAttribute("aria-current"));
602
606
  }
603
- const Jt = (t) => {
604
- const e = t.id ?? "", n = document.getElementById(ve(e)), o = document.getElementById(nt(e));
607
+ const en = (t) => {
608
+ const e = t.id ?? "", n = document.getElementById(Ie(e)), o = document.getElementById(nt(e));
605
609
  document.querySelectorAll(
606
- ge(e)
610
+ he(e)
607
611
  ).forEach((s) => {
608
612
  var l;
609
613
  for (; s.firstChild; )
610
614
  (l = s.parentNode) == null || l.insertBefore(s.firstChild, s);
611
615
  s.remove();
612
616
  }), n == null || n.remove(), o == null || o.remove();
613
- }, fe = {
617
+ }, me = {
614
618
  all: ["notebook"],
615
619
  notes: (t) => ["notebook", "notes", t]
616
620
  };
617
- function en(t) {
621
+ function tn(t) {
618
622
  const e = ke();
619
- return Oe({
623
+ return Le({
620
624
  mutationFn: (n) => t.createNote(n),
621
625
  onSuccess: () => {
622
- e.invalidateQueries({ queryKey: fe.all });
626
+ e.invalidateQueries({ queryKey: me.all });
623
627
  }
624
628
  });
625
629
  }
626
- function tn(t) {
630
+ function nn(t) {
627
631
  const e = ke();
628
- return Oe({
632
+ return Le({
629
633
  mutationFn: (n) => t.deleteNote(n),
630
634
  onSuccess: () => {
631
- e.invalidateQueries({ queryKey: fe.all });
635
+ e.invalidateQueries({ queryKey: me.all });
632
636
  }
633
637
  });
634
638
  }
@@ -637,13 +641,13 @@ function it({
637
641
  enabled: e = !0,
638
642
  ...n
639
643
  }) {
640
- return yt({
641
- queryKey: fe.notes(n),
644
+ return Nt({
645
+ queryKey: me.notes(n),
642
646
  queryFn: () => t.getNotes(n),
643
647
  enabled: e
644
648
  });
645
649
  }
646
- const nn = 100;
650
+ const on = 100;
647
651
  function lt({
648
652
  api: t,
649
653
  courseId: e,
@@ -659,23 +663,23 @@ function lt({
659
663
  ...o != null && o.length ? { reactions: o } : {}
660
664
  },
661
665
  offset: 0,
662
- pageSize: nn,
666
+ pageSize: on,
663
667
  enabled: r
664
668
  });
665
669
  }
666
- function on(t) {
670
+ function rn(t) {
667
671
  const e = ke();
668
- return Oe({
672
+ return Le({
669
673
  mutationFn: ({ id: n, input: o }) => t.updateNote(n, o),
670
674
  onMutate: async ({ id: n, input: o }) => {
671
- await e.cancelQueries({ queryKey: fe.all });
672
- const s = e.getQueryCache().findAll({ queryKey: fe.all }), l = /* @__PURE__ */ new Map();
675
+ await e.cancelQueries({ queryKey: me.all });
676
+ const s = e.getQueryCache().findAll({ queryKey: me.all }), l = /* @__PURE__ */ new Map();
673
677
  for (const a of s) {
674
- const m = a.state.data;
675
- m && (l.set(a.queryKey, m), e.setQueryData(a.queryKey, {
676
- ...m,
677
- notes: m.notes.map(
678
- (c) => c.id === n ? { ...c, ...o, updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : c
678
+ const f = a.state.data;
679
+ f && (l.set(a.queryKey, f), e.setQueryData(a.queryKey, {
680
+ ...f,
681
+ notes: f.notes.map(
682
+ (u) => u.id === n ? { ...u, ...o, updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : u
679
683
  )
680
684
  }));
681
685
  }
@@ -687,61 +691,63 @@ function on(t) {
687
691
  e.setQueryData(s, l);
688
692
  },
689
693
  onSettled: () => {
690
- e.invalidateQueries({ queryKey: fe.all });
694
+ e.invalidateQueries({ queryKey: me.all });
691
695
  }
692
696
  });
693
697
  }
694
- const rn = "Notebook", sn = "Notes", ln = "Important", an = "Unclear", cn = "Back", dn = "Edit note", un = "Save", fn = "Cancel", mn = "Delete note", gn = "Delete note confirmation", hn = "note", pn = "Add note (optional)", yn = "Remove from Notebook", Nn = "Add a note (optional)", En = "Mark important", bn = "Mark unclear", Tn = "Saved to Notebook.", Sn = "Note updated", Cn = "Note deleted", vn = "Error saving to Notebook.", In = "Error updating note", xn = "Note deletion failed", Rn = "Loading notes", wn = "Failed to load notes", kn = "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.", Ln = "Nothing here yet", An = "Adjust your filters or create a new note to get started.", Dn = "You have no notes for the selected filter", Pn = "Filter", _n = "Previous page", Fn = "Next page", Mn = "All courses", Bn = "All notes", $n = "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.", Un = "The content you highlighted is no longer available.", Gn = "Notebook note", Me = {
695
- notebook: rn,
696
- notes: sn,
697
- important: ln,
698
- unclear: an,
699
- back: cn,
700
- editNote: dn,
701
- save: un,
702
- cancel: fn,
703
- deleteNote: mn,
704
- deleteNoteConfirmation: gn,
705
- note: hn,
706
- addNotePrompt: pn,
707
- removeFromNotebook: yn,
708
- addNoteOptional: Nn,
698
+ const sn = "Notebook", ln = "Notes", an = "Important", cn = "Unclear", dn = "Back", un = "Edit note", fn = "Save", mn = "Cancel", gn = "Delete note", hn = "Delete note confirmation", pn = "note", yn = "Add note (optional)", Nn = "Remove from Notebook", bn = "Add a note (optional)", En = "Mark important", Tn = "Mark unclear", Sn = "Saved to Notebook.", vn = "Note updated", Cn = "Note deleted", In = "Error saving to Notebook.", xn = "Error updating note", Rn = "Note deletion failed", On = "Loading notes", wn = "Failed to load notes", kn = "Start capturing your notes", Ln = "To use the Notebook feature, select text on a page to mark it as Important or Unclear, and add an optional note.", An = "Only you can see your Notebook. Instructors and classmates don't see your notes.", Dn = "Nothing here yet", Pn = "Adjust your filters or create a new note to get started.", _n = "You have no notes for the selected filter", Fn = "Filter", Mn = "Previous page", Bn = "Next page", Un = "All courses", Hn = "All notes", $n = "Close Notebook panel", Gn = "To use the Notebook feature, highlight an excerpt from your learning material to flag it as 'confusing' or 'important' and leave an optional note.", jn = "The content you highlighted is no longer available.", Wn = "This source is no longer available.", zn = "Notebook note", Be = {
699
+ notebook: sn,
700
+ notes: ln,
701
+ important: an,
702
+ unclear: cn,
703
+ back: dn,
704
+ editNote: un,
705
+ save: fn,
706
+ cancel: mn,
707
+ deleteNote: gn,
708
+ deleteNoteConfirmation: hn,
709
+ note: pn,
710
+ addNotePrompt: yn,
711
+ removeFromNotebook: Nn,
712
+ addNoteOptional: bn,
709
713
  markImportant: En,
710
- markUnclear: bn,
711
- savedToNotebook: Tn,
712
- noteUpdated: Sn,
714
+ markUnclear: Tn,
715
+ savedToNotebook: Sn,
716
+ noteUpdated: vn,
713
717
  noteDeleted: Cn,
714
- errorSavingNote: vn,
715
- errorUpdatingNote: In,
716
- noteDeletionFailed: xn,
717
- loadingNotes: Rn,
718
+ errorSavingNote: In,
719
+ errorUpdatingNote: xn,
720
+ noteDeletionFailed: Rn,
721
+ loadingNotes: On,
718
722
  failedToLoadNotes: wn,
719
723
  emptyStateHeading: kn,
720
- emptyStateDescription: On,
721
- nothingHereYet: Ln,
722
- adjustFiltersOrCreate: An,
723
- noNotesForFilter: Dn,
724
- filter: Pn,
725
- previousPage: _n,
726
- nextPage: Fn,
727
- allCourses: Mn,
728
- allNotes: Bn,
724
+ emptyStateDescription: Ln,
725
+ emptyStatePrecision: An,
726
+ nothingHereYet: Dn,
727
+ adjustFiltersOrCreate: Pn,
728
+ noNotesForFilter: _n,
729
+ filter: Fn,
730
+ previousPage: Mn,
731
+ nextPage: Bn,
732
+ allCourses: Un,
733
+ allNotes: Hn,
729
734
  closeNotebookPanel: $n,
730
- featureDescription: Hn,
731
- highlightUnavailable: Un,
732
- notebookNote: Gn
735
+ featureDescription: Gn,
736
+ highlightUnavailable: jn,
737
+ highlightSourceUnavailable: Wn,
738
+ notebookNote: zn
733
739
  }, at = Ve(null);
734
740
  function ct(t, e) {
735
- const n = Me[t] ?? t;
741
+ const n = Be[t] ?? t;
736
742
  return e ? n.replace(/%\{([^}]+)}/g, (o, r) => String(e[r] ?? `%{${r}}`)) : n;
737
743
  }
738
- function jn({
744
+ function qn({
739
745
  translations: t,
740
746
  translate: e,
741
747
  children: n
742
748
  }) {
743
- const o = he(() => ({
744
- translations: new Proxy(Me, {
749
+ const o = pe(() => ({
750
+ translations: new Proxy(Be, {
745
751
  get(s, l) {
746
752
  return (t == null ? void 0 : t[l]) ?? s[l];
747
753
  }
@@ -750,16 +756,16 @@ function jn({
750
756
  }), [t, e]);
751
757
  return /* @__PURE__ */ i(at.Provider, { value: o, children: n });
752
758
  }
753
- function Z() {
759
+ function J() {
754
760
  const t = Qe(at);
755
- return t || { translations: Me, translate: ct };
761
+ return t || { translations: Be, translate: ct };
756
762
  }
757
- const Wn = (t) => ({
763
+ const Kn = (t) => ({
758
764
  selectedNoteId: t ?? null,
759
765
  isNoteEditing: !1,
760
766
  isTrayOpen: t != null
761
767
  });
762
- function zn(t, e) {
768
+ function Xn(t, e) {
763
769
  switch (e.type) {
764
770
  case "SELECT_NOTE":
765
771
  return {
@@ -780,7 +786,7 @@ function zn(t, e) {
780
786
  }
781
787
  }
782
788
  const dt = Ve(null);
783
- function Co({
789
+ function Ro({
784
790
  api: t,
785
791
  currentUserId: e,
786
792
  objectId: n,
@@ -789,11 +795,11 @@ function Co({
789
795
  pageLastModifiedAt: s,
790
796
  onOpen: l,
791
797
  initialNoteId: a,
792
- translations: m,
793
- translate: c,
794
- children: p
798
+ translations: f,
799
+ translate: u,
800
+ children: m
795
801
  }) {
796
- const [d, h] = Ye(zn, Wn(a)), E = F(a != null), y = he(
802
+ const [c, y] = Ye(Xn, Kn(a)), N = F(a != null), h = pe(
797
803
  () => ({
798
804
  api: t,
799
805
  currentUserId: e,
@@ -801,20 +807,20 @@ function Co({
801
807
  objectType: o,
802
808
  courseId: r,
803
809
  pageLastModifiedAt: s,
804
- ...d,
805
- selectNote: (b, g = !1) => h({ type: "SELECT_NOTE", payload: { id: b, isEditing: g } }),
806
- clearSelectedNote: () => h({ type: "CLEAR_SELECTED_NOTE" }),
807
- setEditing: (b) => h({ type: "SET_EDITING", payload: b }),
810
+ ...c,
811
+ selectNote: (x, p = !1) => y({ type: "SELECT_NOTE", payload: { id: x, isEditing: p } }),
812
+ clearSelectedNote: () => y({ type: "CLEAR_SELECTED_NOTE" }),
813
+ setEditing: (x) => y({ type: "SET_EDITING", payload: x }),
808
814
  openTray: () => {
809
- E.current || (E.current = !0, l == null || l()), h({ type: "OPEN_TRAY" });
815
+ N.current || (N.current = !0, l == null || l()), y({ type: "OPEN_TRAY" });
810
816
  },
811
817
  closeTray: () => {
812
- E.current = !1, h({ type: "CLOSE_TRAY" });
818
+ N.current = !1, y({ type: "CLOSE_TRAY" });
813
819
  }
814
820
  }),
815
- [t, e, n, o, r, s, l, d]
821
+ [t, e, n, o, r, s, l, c]
816
822
  );
817
- return /* @__PURE__ */ i(dt.Provider, { value: y, children: /* @__PURE__ */ i(jn, { translations: m, translate: c, children: p }) });
823
+ return /* @__PURE__ */ i(dt.Provider, { value: h, children: /* @__PURE__ */ i(qn, { translations: f, translate: u, children: m }) });
818
824
  }
819
825
  function ut() {
820
826
  const t = Qe(dt);
@@ -822,8 +828,8 @@ function ut() {
822
828
  throw new Error("useNotebook must be used within a NotebookProvider");
823
829
  return t;
824
830
  }
825
- const ft = "notebook-tray-content", vo = ({ children: t }) => {
826
- const { isTrayOpen: e, closeTray: n } = ut(), { translations: o } = Z();
831
+ const ft = "notebook-tray-content", Oo = ({ children: t }) => {
832
+ const { isTrayOpen: e, closeTray: n } = ut(), { translations: o } = J();
827
833
  return /* @__PURE__ */ i(
828
834
  Et,
829
835
  {
@@ -832,11 +838,11 @@ const ft = "notebook-tray-content", vo = ({ children: t }) => {
832
838
  onDismiss: n,
833
839
  placement: "end",
834
840
  size: "regular",
835
- children: /* @__PURE__ */ T(x, { direction: "column", height: "100vh", id: ft, children: [
836
- /* @__PURE__ */ i(x.Item, { children: /* @__PURE__ */ i(V, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ T(x, { justifyItems: "space-between", alignItems: "center", children: [
837
- /* @__PURE__ */ i(Se, { level: "h3", children: o.notebook }),
841
+ children: /* @__PURE__ */ T(I, { direction: "column", height: "100vh", id: ft, children: [
842
+ /* @__PURE__ */ i(I.Item, { children: /* @__PURE__ */ i(V, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ T(I, { justifyItems: "space-between", alignItems: "center", children: [
843
+ /* @__PURE__ */ i(ve, { level: "h3", children: o.notebook }),
838
844
  /* @__PURE__ */ i(
839
- Nt,
845
+ bt,
840
846
  {
841
847
  screenReaderLabel: o.closeNotebookPanel,
842
848
  onClick: n,
@@ -845,18 +851,18 @@ const ft = "notebook-tray-content", vo = ({ children: t }) => {
845
851
  }
846
852
  )
847
853
  ] }) }) }),
848
- /* @__PURE__ */ i(x.Item, { shouldGrow: !0, shouldShrink: !0, overflowY: "auto", overflowX: "hidden", children: t })
854
+ /* @__PURE__ */ i(I.Item, { shouldGrow: !0, shouldShrink: !0, overflowY: "auto", overflowX: "hidden", children: t })
849
855
  ] })
850
856
  }
851
857
  );
852
- }, qn = ({
858
+ }, Vn = ({
853
859
  currentType: t,
854
860
  disabled: e = !1,
855
861
  onSelectReaction: n
856
862
  }) => {
857
- const { translations: o } = Z(), r = F(null), s = F(null);
858
- return W(() => {
859
- t === k.CONFUSING && r.current ? r.current.focus() : t === k.IMPORTANT && s.current ? s.current.focus() : r.current && r.current.focus();
863
+ const { translations: o } = J(), r = F(null), s = F(null);
864
+ return q(() => {
865
+ t === L.CONFUSING && r.current ? r.current.focus() : t === L.IMPORTANT && s.current ? s.current.focus() : r.current && r.current.focus();
860
866
  }, [t]), /* @__PURE__ */ i(
861
867
  V,
862
868
  {
@@ -866,27 +872,27 @@ const ft = "notebook-tray-content", vo = ({ children: t }) => {
866
872
  borderColor: "secondary",
867
873
  borderRadius: "medium",
868
874
  shadow: "resting",
869
- children: /* @__PURE__ */ T(ue, { children: [
875
+ children: /* @__PURE__ */ T(fe, { children: [
870
876
  /* @__PURE__ */ T(
871
- ue.Item,
877
+ fe.Item,
872
878
  {
873
879
  ref: r,
874
880
  disabled: e,
875
- onClick: () => n(k.CONFUSING),
881
+ onClick: () => n(L.CONFUSING),
876
882
  children: [
877
- /* @__PURE__ */ i(Le, { size: "x-small" }),
883
+ /* @__PURE__ */ i(Ae, { size: "x-small" }),
878
884
  ` ${o.markUnclear}`
879
885
  ]
880
886
  }
881
887
  ),
882
888
  /* @__PURE__ */ T(
883
- ue.Item,
889
+ fe.Item,
884
890
  {
885
891
  ref: s,
886
892
  disabled: e,
887
- onClick: () => n(k.IMPORTANT),
893
+ onClick: () => n(L.IMPORTANT),
888
894
  children: [
889
- /* @__PURE__ */ i(Ae, { size: "x-small" }),
895
+ /* @__PURE__ */ i(De, { size: "x-small" }),
890
896
  ` ${o.markImportant}`
891
897
  ]
892
898
  }
@@ -894,8 +900,8 @@ const ft = "notebook-tray-content", vo = ({ children: t }) => {
894
900
  ] })
895
901
  }
896
902
  );
897
- }, Ie = "notebook-inline-reaction-menu";
898
- function Io({
903
+ }, xe = "notebook-inline-reaction-menu";
904
+ function wo({
899
905
  containerRef: t,
900
906
  highlightTheme: e,
901
907
  debounceTime: n = 500,
@@ -906,202 +912,202 @@ function Io({
906
912
  }) {
907
913
  const {
908
914
  api: a,
909
- objectId: m,
910
- objectType: c,
911
- courseId: p,
912
- pageLastModifiedAt: d,
913
- selectedNoteId: h,
914
- isTrayOpen: E,
915
- selectNote: y,
916
- openTray: b
917
- } = ut(), { translations: g } = Z(), { data: Q } = lt({
915
+ objectId: f,
916
+ objectType: u,
917
+ courseId: m,
918
+ pageLastModifiedAt: c,
919
+ selectedNoteId: y,
920
+ isTrayOpen: N,
921
+ selectNote: h,
922
+ openTray: x
923
+ } = ut(), { translations: p } = J(), { data: R } = lt({
918
924
  api: a,
919
- courseId: p,
920
- learningObject: { type: c, id: m }
921
- }), { mutate: j, isPending: N } = en(a), { mutateAsync: I } = on(a), { mutate: B } = tn(a), D = F([]), [P, S] = G([]), [w, C] = G(null), [$, re] = G(""), [z, ce] = G(null), se = F(null);
922
- se.current = z;
923
- const le = F(!1), [J, ee] = G(!1);
924
- W(() => {
925
- const _ = t.current;
926
- if (!_) return;
927
- const v = _.closest(".user_content") ?? _;
928
- if (v.classList.contains("enhanced")) {
929
- ee(!0);
925
+ courseId: m,
926
+ learningObject: { type: u, id: f }
927
+ }), { mutate: z, isPending: b } = tn(a), { mutateAsync: S } = rn(a), { mutate: P } = nn(a), D = F([]), [G, E] = W([]), [w, v] = W(null), [j, ee] = W(""), [Q, ae] = W(null), de = F(null);
928
+ de.current = Q;
929
+ const te = F(!1), [re, se] = W(!1);
930
+ q(() => {
931
+ const M = t.current;
932
+ if (!M) return;
933
+ const C = M.closest(".user_content") ?? M;
934
+ if (C.classList.contains("enhanced")) {
935
+ se(!0);
930
936
  return;
931
937
  }
932
- const U = new MutationObserver((M) => {
933
- for (const L of M)
934
- if (L.type === "attributes" && L.attributeName === "class" && L.target.classList.contains("enhanced")) {
935
- ee(!0), U.disconnect();
938
+ const _ = new MutationObserver((B) => {
939
+ for (const H of B)
940
+ if (H.type === "attributes" && H.attributeName === "class" && H.target.classList.contains("enhanced")) {
941
+ se(!0), _.disconnect();
936
942
  return;
937
943
  }
938
944
  });
939
- return U.observe(v, { attributes: !0, attributeFilter: ["class"] }), () => U.disconnect();
945
+ return _.observe(C, { attributes: !0, attributeFilter: ["class"] }), () => _.disconnect();
940
946
  }, [t]);
941
- const O = K(() => {
942
- ce(null), C(null), re("");
947
+ const A = K(() => {
948
+ ae(null), v(null), ee("");
943
949
  }, []);
944
- W(() => {
945
- if (!J || !t.current) return;
946
- let v = null;
947
- const U = () => {
948
- v && clearTimeout(v), v = setTimeout(() => {
949
- var $e;
950
- const R = window.getSelection(), u = t.current;
951
- if (!(R != null && R.rangeCount) || !u) return;
952
- const H = R.toString().trim();
953
- if (H === "") return;
954
- const q = R.getRangeAt(0);
955
- if (!u.contains(q.commonAncestorContainer)) return;
956
- const Be = ($e = ie.fromRange(u, q)) == null ? void 0 : $e.toSelector();
957
- Be && !jt(Be, P) && (C(q.cloneRange()), re(H), ce(Gt(q)));
950
+ q(() => {
951
+ if (!re || !t.current) return;
952
+ let C = null;
953
+ const _ = () => {
954
+ C && clearTimeout(C), C = setTimeout(() => {
955
+ var Ue;
956
+ const O = window.getSelection(), U = t.current;
957
+ if (!(O != null && O.rangeCount) || !U) return;
958
+ const g = O.toString().trim();
959
+ if (g === "") return;
960
+ const $ = O.getRangeAt(0);
961
+ if (!U.contains($.commonAncestorContainer)) return;
962
+ const ie = (Ue = le.fromRange(U, $)) == null ? void 0 : Ue.toSelector();
963
+ ie && !Wt(ie, G) && (v($.cloneRange()), ee(g), ae(jt($)));
958
964
  }, n);
959
- }, M = (R) => {
960
- if (!(R.target instanceof Node)) return;
961
- const u = document.getElementById(Ie);
962
- u != null && u.contains(R.target) ? (R.preventDefault(), R.stopImmediatePropagation()) : O();
963
- }, L = () => {
964
- O();
965
- }, A = (R) => {
966
- R.key === "Escape" && se.current !== null && (O(), R.stopImmediatePropagation());
965
+ }, B = (O) => {
966
+ if (!(O.target instanceof Node)) return;
967
+ const U = document.getElementById(xe);
968
+ U != null && U.contains(O.target) ? (O.preventDefault(), O.stopImmediatePropagation()) : A();
969
+ }, H = () => {
970
+ A();
971
+ }, k = (O) => {
972
+ O.key === "Escape" && de.current !== null && (A(), O.stopImmediatePropagation());
967
973
  };
968
- return document.addEventListener("selectionchange", U), document.addEventListener("mousedown", M), document.addEventListener("touchstart", M), document.addEventListener("keydown", A), window.addEventListener("scroll", L, !0), () => {
969
- v && clearTimeout(v), document.removeEventListener("selectionchange", U), document.removeEventListener("mousedown", M), document.removeEventListener("touchstart", M), document.removeEventListener("keydown", A), window.removeEventListener("scroll", L, !0);
974
+ return document.addEventListener("selectionchange", _), document.addEventListener("mousedown", B), document.addEventListener("touchstart", B), document.addEventListener("keydown", k), window.addEventListener("scroll", H, !0), () => {
975
+ C && clearTimeout(C), document.removeEventListener("selectionchange", _), document.removeEventListener("mousedown", B), document.removeEventListener("touchstart", B), document.removeEventListener("keydown", k), window.removeEventListener("scroll", H, !0);
970
976
  };
971
- }, [J, P, n, t, O]);
977
+ }, [re, G, n, t, A]);
972
978
  const Y = K(
973
- (_) => {
974
- var u;
975
- const v = t.current;
976
- if (!v || !_.highlightData) return null;
977
- const { highlightData: U, reaction: M, id: L } = _, { range: A } = U, R = A && ((u = ae.fromSelector(v, A)) == null ? void 0 : u.toRange());
978
- if (R) {
979
- const H = M[0] === k.IMPORTANT ? g.important : g.unclear, q = {
980
- id: L,
981
- selectedNoteId: h,
982
- type: M[0],
983
- isTrayOpen: E,
984
- labelPrefix: `${g.notebookNote} (${H})`,
979
+ (M) => {
980
+ var U;
981
+ const C = t.current;
982
+ if (!C || !M.highlightData) return null;
983
+ const { highlightData: _, reaction: B, id: H } = M, { range: k } = _, O = k && ((U = ce.fromSelector(C, k)) == null ? void 0 : U.toRange());
984
+ if (O) {
985
+ const g = B[0] === L.IMPORTANT ? p.important : p.unclear, $ = {
986
+ id: H,
987
+ selectedNoteId: y,
988
+ type: B[0],
989
+ isTrayOpen: N,
990
+ labelPrefix: `${p.notebookNote} (${g})`,
985
991
  popupId: ft,
986
992
  onClick: () => {
987
- y(L), b();
993
+ h(H), x();
988
994
  }
989
995
  };
990
- return Yt(R, q, e), U.textPosition;
996
+ return Zt(O, $, e), _.textPosition;
991
997
  }
992
998
  return null;
993
999
  },
994
- [t, h, E, e, g, y, b]
1000
+ [t, y, N, e, p, h, x]
995
1001
  );
996
- W(() => {
997
- if (!J || !Q || !t.current) return;
998
- const _ = t.current, v = Q.notes, U = /* @__PURE__ */ new Set(), M = [], L = [];
999
- if (v.length === 0) {
1002
+ q(() => {
1003
+ if (!re || !R || !t.current) return;
1004
+ const M = t.current, C = R.notes, _ = /* @__PURE__ */ new Set(), B = [], H = [];
1005
+ if (C.length === 0) {
1000
1006
  if (D.current.length > 0) {
1001
- for (const A of D.current)
1002
- ze(A, _);
1003
- D.current = [], S([]);
1007
+ for (const k of D.current)
1008
+ ze(k, M);
1009
+ D.current = [], E([]);
1004
1010
  }
1005
1011
  return;
1006
1012
  }
1007
- if (d && v[0].highlightData.pageLastModifiedAt !== d) {
1008
- const { notesForUpdate: A, noteIdsForDelete: R } = Ht(
1009
- _,
1010
- v,
1011
- d
1013
+ if (c && C[0].highlightData.pageLastModifiedAt !== c) {
1014
+ const { notesForUpdate: k, noteIdsForDelete: O } = $t(
1015
+ M,
1016
+ C,
1017
+ c
1012
1018
  );
1013
- for (const u of A)
1014
- I({ id: u.id, input: u }).catch((H) => r == null ? void 0 : r(H));
1015
- for (const u of R)
1016
- B(u, { onError: s });
1019
+ for (const U of k)
1020
+ S({ id: U.id, input: U }).catch((g) => r == null ? void 0 : r(g));
1021
+ for (const U of O)
1022
+ P(U, { onError: s });
1017
1023
  } else {
1018
- for (const A of v) {
1019
- const R = Y(A);
1020
- U.add(A.id), R && (M.push(A), L.push(R));
1024
+ for (const k of C) {
1025
+ const O = Y(k);
1026
+ _.add(k.id), O && (B.push(k), H.push(O));
1021
1027
  }
1022
- for (const A of D.current)
1023
- U.has(A.id) || ze(A, _);
1024
- S(L), D.current = M, h && Ut(h);
1028
+ for (const k of D.current)
1029
+ _.has(k.id) || ze(k, M);
1030
+ E(H), D.current = B, y && Gt(y);
1025
1031
  }
1026
1032
  }, [
1027
- J,
1028
- Q,
1033
+ re,
1034
+ R,
1029
1035
  Y,
1030
- d,
1036
+ c,
1031
1037
  t,
1032
- I,
1033
- B,
1034
- h
1038
+ S,
1039
+ P,
1040
+ y
1035
1041
  ]);
1036
- const de = (_) => {
1037
- const v = t.current;
1038
- if (!w || !v || le.current) return;
1039
- le.current = !0;
1040
- const U = ae.fromRange(v, w), M = ie.fromRange(v, w);
1041
- j(
1042
+ const ue = (M) => {
1043
+ const C = t.current;
1044
+ if (!w || !C || te.current) return;
1045
+ te.current = !0;
1046
+ const _ = ce.fromRange(C, w), B = le.fromRange(C, w);
1047
+ z(
1042
1048
  {
1043
- courseId: p,
1044
- objectId: m,
1045
- objectType: c,
1049
+ courseId: m,
1050
+ objectId: f,
1051
+ objectType: u,
1046
1052
  userText: "",
1047
- reaction: [_],
1053
+ reaction: [M],
1048
1054
  highlightData: {
1049
- selectedText: $,
1050
- textPosition: (M == null ? void 0 : M.toSelector()) ?? null,
1051
- range: U.toSelector(),
1052
- pageLastModifiedAt: d ?? ""
1055
+ selectedText: j,
1056
+ textPosition: (B == null ? void 0 : B.toSelector()) ?? null,
1057
+ range: _.toSelector(),
1058
+ pageLastModifiedAt: c ?? ""
1053
1059
  }
1054
1060
  },
1055
1061
  {
1056
- onSuccess: (L) => {
1057
- var R;
1058
- const A = L.id;
1059
- O(), (R = window.getSelection()) == null || R.removeAllRanges(), y(A), b(), l == null || l(L);
1062
+ onSuccess: (H) => {
1063
+ var O;
1064
+ const k = H.id;
1065
+ A(), (O = window.getSelection()) == null || O.removeAllRanges(), h(k), x(), l == null || l(H);
1060
1066
  },
1061
1067
  onError: o,
1062
1068
  // Unlock on failure too, so the user can retry from the still-open menu
1063
1069
  onSettled: () => {
1064
- le.current = !1;
1070
+ te.current = !1;
1065
1071
  }
1066
1072
  }
1067
1073
  );
1068
1074
  };
1069
- return !w || !z ? null : ht(
1075
+ return !w || !Q ? null : pt(
1070
1076
  /* @__PURE__ */ i(
1071
1077
  "div",
1072
1078
  {
1073
- id: Ie,
1079
+ id: xe,
1074
1080
  role: "toolbar",
1075
1081
  style: {
1076
1082
  position: "fixed",
1077
1083
  zIndex: 100,
1078
- top: z.top,
1079
- left: z.left,
1084
+ top: Q.top,
1085
+ left: Q.left,
1080
1086
  whiteSpace: "nowrap"
1081
1087
  },
1082
- onBlur: (_) => {
1083
- const v = document.getElementById(Ie);
1084
- v != null && v.contains(_.relatedTarget) || O();
1088
+ onBlur: (M) => {
1089
+ const C = document.getElementById(xe);
1090
+ C != null && C.contains(M.relatedTarget) || A();
1085
1091
  },
1086
- children: /* @__PURE__ */ i(qn, { onSelectReaction: de, disabled: N })
1092
+ children: /* @__PURE__ */ i(Vn, { onSelectReaction: ue, disabled: b })
1087
1093
  }
1088
1094
  ),
1089
1095
  document.body
1090
1096
  );
1091
1097
  }
1092
- const Kn = (t, e) => ({
1093
- backgroundColor: t === k.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
1094
- underlineColor: t === k.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
1095
- underlineStyle: t === k.IMPORTANT ? "solid" : "dashed"
1098
+ const Qn = (t, e) => ({
1099
+ backgroundColor: t === L.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
1100
+ underlineColor: t === L.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
1101
+ underlineStyle: t === L.IMPORTANT ? "solid" : "dashed"
1096
1102
  }), we = ({
1097
1103
  children: t,
1098
- type: e = k.IMPORTANT,
1104
+ type: e = L.IMPORTANT,
1099
1105
  isCardActive: n = !0,
1100
1106
  theme: o
1101
1107
  }) => {
1102
- const r = Kn(e, o), l = {
1108
+ const r = Qn(e, o), l = {
1103
1109
  position: "relative",
1104
- backgroundColor: n ? r.backgroundColor : Fe(r.backgroundColor, 0.5),
1110
+ backgroundColor: n ? r.backgroundColor : Me(r.backgroundColor, 0.5),
1105
1111
  textDecorationLine: "underline",
1106
1112
  textDecorationStyle: r.underlineStyle,
1107
1113
  textDecorationColor: r.underlineColor,
@@ -1110,13 +1116,17 @@ const Kn = (t, e) => ({
1110
1116
  lineHeight: "normal"
1111
1117
  };
1112
1118
  return /* @__PURE__ */ i("span", { "data-note-highlight": "true", style: l, children: t });
1113
- }, mt = () => {
1114
- const { translations: t } = Z();
1115
- return /* @__PURE__ */ T(x, { gap: "xx-small", alignItems: "start", as: "div", children: [
1116
- /* @__PURE__ */ i(x.Item, { as: "div", children: /* @__PURE__ */ i(bt, { color: "error" }) }),
1117
- /* @__PURE__ */ i(x.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ i(be, { maxLines: 3, children: t.highlightUnavailable }) })
1119
+ };
1120
+ function mt(t, e = "noHighlight") {
1121
+ return e === "sourceUnavailable" ? t.highlightSourceUnavailable : t.highlightUnavailable;
1122
+ }
1123
+ const gt = ({ reason: t } = {}) => {
1124
+ const { translations: e } = J();
1125
+ return /* @__PURE__ */ T(I, { gap: "xx-small", alignItems: "start", as: "div", children: [
1126
+ /* @__PURE__ */ i(I.Item, { as: "div", children: /* @__PURE__ */ i(Tt, { color: "error" }) }),
1127
+ /* @__PURE__ */ i(I.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ i(Te, { maxLines: 3, children: mt(e, t) }) })
1118
1128
  ] });
1119
- }, Xn = {
1129
+ }, Yn = {
1120
1130
  filter: null,
1121
1131
  courseFilter: null,
1122
1132
  currentPage: 1,
@@ -1126,7 +1136,7 @@ function Ee(t, e) {
1126
1136
  const n = typeof e == "number" ? Math.min(e, t) : t;
1127
1137
  return Math.max(1, n);
1128
1138
  }
1129
- function Vn(t, e) {
1139
+ function Zn(t, e) {
1130
1140
  switch (e.type) {
1131
1141
  case "SET_FILTER":
1132
1142
  return { ...t, filter: e.payload, currentPage: 1 };
@@ -1150,7 +1160,7 @@ function Vn(t, e) {
1150
1160
  return t;
1151
1161
  }
1152
1162
  }
1153
- function xo({
1163
+ function ko({
1154
1164
  api: t,
1155
1165
  courseId: e,
1156
1166
  enableCourseFilter: n = !1,
@@ -1158,109 +1168,109 @@ function xo({
1158
1168
  pageSize: r = 16,
1159
1169
  focusNoteId: s
1160
1170
  }) {
1161
- var ee;
1162
- const [l, a] = Ye(Vn, Xn), { filter: m, courseFilter: c, currentPage: p, totalPages: d } = l;
1163
- W(() => {
1171
+ var se;
1172
+ const [l, a] = Ye(Zn, Yn), { filter: f, courseFilter: u, currentPage: m, totalPages: c } = l;
1173
+ q(() => {
1164
1174
  a({ type: "SET_PAGE", payload: 1 });
1165
1175
  }, [r]);
1166
- const h = n ? c : e, E = (p - 1) * r, y = !!o, b = {
1167
- ...h ? { courseId: h } : {},
1168
- ...m ? { reactions: [m] } : {},
1176
+ const y = n ? u : e, N = (m - 1) * r, h = !!o, x = {
1177
+ ...y ? { courseId: y } : {},
1178
+ ...f ? { reactions: [f] } : {},
1169
1179
  ...o ? { learningObject: o } : {}
1170
1180
  }, {
1171
- data: g,
1172
- isLoading: Q,
1173
- isError: j
1181
+ data: p,
1182
+ isLoading: R,
1183
+ isError: z
1174
1184
  } = it({
1175
1185
  api: t,
1176
- filter: b,
1177
- offset: E,
1186
+ filter: x,
1187
+ offset: N,
1178
1188
  pageSize: r,
1179
- enabled: !y
1189
+ enabled: !h
1180
1190
  }), {
1181
- data: N,
1182
- isLoading: I,
1183
- isError: B
1191
+ data: b,
1192
+ isLoading: S,
1193
+ isError: P
1184
1194
  } = lt({
1185
1195
  api: t,
1186
- courseId: h ?? void 0,
1196
+ courseId: y ?? void 0,
1187
1197
  learningObject: o,
1188
- enabled: y
1189
- }), D = he(() => {
1190
- const O = (N == null ? void 0 : N.notes) ?? [];
1191
- return m ? O.filter((Y) => Y.reaction.includes(m)) : O;
1192
- }, [N, m]), P = F(null);
1193
- W(() => {
1198
+ enabled: h
1199
+ }), D = pe(() => {
1200
+ const A = (b == null ? void 0 : b.notes) ?? [];
1201
+ return f ? A.filter((Y) => Y.reaction.includes(f)) : A;
1202
+ }, [b, f]), G = F(null);
1203
+ q(() => {
1194
1204
  if (!s) {
1195
- P.current = null;
1205
+ G.current = null;
1196
1206
  return;
1197
1207
  }
1198
- if (P.current === s) return;
1199
- const O = D.findIndex((de) => de.id === s);
1200
- if (O === -1) return;
1201
- P.current = s;
1202
- const Y = Math.floor(O / r) + 1;
1203
- Y !== p && a({ type: "FOCUS_PAGE", payload: Y });
1204
- }, [s, D, r, p]);
1205
- const S = y ? D.slice(E, E + r) : (g == null ? void 0 : g.notes) ?? [], w = y ? I : Q, C = y ? B : j, $ = y ? Math.max(1, Math.ceil(D.length / r)) : ((ee = g == null ? void 0 : g.pageInfo) == null ? void 0 : ee.totalNrOfPages) ?? void 0, re = y ? { totalCount: D.length, totalNrOfPages: $ } : g == null ? void 0 : g.pageInfo;
1206
- W(() => {
1207
- a({ type: "SET_TOTAL_PAGES", payload: $ });
1208
- }, [$]);
1209
- const z = K((O) => {
1210
- a({ type: "SET_PAGE", payload: O });
1211
- }, []), ce = K(() => {
1208
+ if (G.current === s) return;
1209
+ const A = D.findIndex((ue) => ue.id === s);
1210
+ if (A === -1) return;
1211
+ G.current = s;
1212
+ const Y = Math.floor(A / r) + 1;
1213
+ Y !== m && a({ type: "FOCUS_PAGE", payload: Y });
1214
+ }, [s, D, r, m]);
1215
+ const E = h ? D.slice(N, N + r) : (p == null ? void 0 : p.notes) ?? [], w = h ? S : R, v = h ? P : z, j = h ? Math.max(1, Math.ceil(D.length / r)) : ((se = p == null ? void 0 : p.pageInfo) == null ? void 0 : se.totalNrOfPages) ?? void 0, ee = h ? { totalCount: D.length, totalNrOfPages: j } : p == null ? void 0 : p.pageInfo;
1216
+ q(() => {
1217
+ a({ type: "SET_TOTAL_PAGES", payload: j });
1218
+ }, [j]);
1219
+ const Q = K((A) => {
1220
+ a({ type: "SET_PAGE", payload: A });
1221
+ }, []), ae = K(() => {
1212
1222
  a({
1213
1223
  type: "INCREMENT_PAGE"
1214
1224
  /* IncrementPage */
1215
1225
  });
1216
- }, []), se = K(() => {
1226
+ }, []), de = K(() => {
1217
1227
  a({
1218
1228
  type: "DECREMENT_PAGE"
1219
1229
  /* DecrementPage */
1220
1230
  });
1221
- }, []), le = K((O) => {
1222
- a({ type: "SET_FILTER", payload: O });
1223
- }, []), J = K((O) => {
1224
- a({ type: "SET_COURSE_FILTER", payload: O });
1231
+ }, []), te = K((A) => {
1232
+ a({ type: "SET_FILTER", payload: A });
1233
+ }, []), re = K((A) => {
1234
+ a({ type: "SET_COURSE_FILTER", payload: A });
1225
1235
  }, []);
1226
1236
  return {
1227
- notes: S,
1228
- pageInfo: re,
1237
+ notes: E,
1238
+ pageInfo: ee,
1229
1239
  isLoading: w,
1230
- isError: C,
1231
- filter: m,
1232
- courseFilter: c,
1233
- currentPage: p,
1234
- totalPages: d,
1235
- setFilter: le,
1236
- setCourseFilter: J,
1237
- setPage: z,
1238
- fetchNextPage: ce,
1239
- fetchPreviousPage: se
1240
+ isError: v,
1241
+ filter: f,
1242
+ courseFilter: u,
1243
+ currentPage: m,
1244
+ totalPages: c,
1245
+ setFilter: te,
1246
+ setCourseFilter: re,
1247
+ setPage: Q,
1248
+ fetchNextPage: ae,
1249
+ fetchPreviousPage: de
1240
1250
  };
1241
1251
  }
1242
- const xe = "all";
1243
- function Ro({ filter: t, setFilter: e }) {
1244
- const { translations: n } = Z(), o = he(
1252
+ const Re = "all";
1253
+ function Lo({ filter: t, setFilter: e }) {
1254
+ const { translations: n } = J(), o = pe(
1245
1255
  () => [
1246
- { label: n.allNotes, value: xe },
1247
- { label: n.important, value: k.IMPORTANT },
1248
- { label: n.unclear, value: k.CONFUSING }
1256
+ { label: n.allNotes, value: Re },
1257
+ { label: n.important, value: L.IMPORTANT },
1258
+ { label: n.unclear, value: L.CONFUSING }
1249
1259
  ],
1250
1260
  [n]
1251
1261
  ), r = K(
1252
1262
  (l, { value: a }) => {
1253
- e(!a || a === xe ? null : a);
1263
+ e(!a || a === Re ? null : a);
1254
1264
  },
1255
1265
  [e]
1256
1266
  );
1257
1267
  return {
1258
- filterElement: he(
1268
+ filterElement: pe(
1259
1269
  () => /* @__PURE__ */ i(
1260
1270
  He,
1261
1271
  {
1262
1272
  renderLabel: n.filter,
1263
- value: t ?? xe,
1273
+ value: t ?? Re,
1264
1274
  onChange: r,
1265
1275
  children: o.map((l) => /* @__PURE__ */ i(He.Option, { id: l.value, value: l.value, children: l.label }, l.value))
1266
1276
  }
@@ -1271,73 +1281,85 @@ function Ro({ filter: t, setFilter: e }) {
1271
1281
  handleReactionFilterChange: r
1272
1282
  };
1273
1283
  }
1274
- const Qn = ({ hasActiveFilter: t = !1 }) => {
1275
- const { translations: e } = Z(), n = t ? e.nothingHereYet : e.emptyStateHeading, o = t ? e.adjustFiltersOrCreate : e.emptyStateDescription;
1276
- return /* @__PURE__ */ i(V, { as: "div", textAlign: "center", children: /* @__PURE__ */ T(x, { direction: "column", alignItems: "center", gap: "small", children: [
1277
- !t && /* @__PURE__ */ i(Tt, { size: "medium" }),
1278
- /* @__PURE__ */ i(Se, { level: "h3", children: n }),
1279
- /* @__PURE__ */ i(te, { color: "secondary", children: o })
1284
+ const Jn = ({ hasActiveFilter: t = !1 }) => {
1285
+ const { translations: e } = J(), n = t ? e.nothingHereYet : e.emptyStateHeading, o = t ? e.adjustFiltersOrCreate : e.emptyStateDescription;
1286
+ return /* @__PURE__ */ i(V, { as: "div", textAlign: "center", children: /* @__PURE__ */ T(I, { direction: "column", alignItems: "center", gap: "small", children: [
1287
+ !t && /* @__PURE__ */ i(St, { size: "medium" }),
1288
+ /* @__PURE__ */ i(ve, { level: "h3", children: n }),
1289
+ /* @__PURE__ */ i(Z, { color: "secondary", children: o }),
1290
+ !t && /* @__PURE__ */ i(Z, { color: "secondary", children: e.emptyStatePrecision })
1280
1291
  ] }) });
1281
- }, Yn = {
1282
- [k.IMPORTANT]: {
1292
+ }, eo = "#2871AF", to = (t) => ({
1293
+ [L.IMPORTANT]: {
1283
1294
  color: "success",
1295
+ themeOverride: {
1296
+ successTextColor: t,
1297
+ successBorderColor: t
1298
+ },
1284
1299
  translationKey: "important",
1285
- icon: /* @__PURE__ */ i(Ae, { size: "x-small" })
1300
+ icon: /* @__PURE__ */ i(De, { size: "x-small" })
1286
1301
  },
1287
- [k.CONFUSING]: {
1302
+ [L.CONFUSING]: {
1288
1303
  color: "error",
1304
+ themeOverride: void 0,
1289
1305
  translationKey: "unclear",
1290
- icon: /* @__PURE__ */ i(Le, { size: "x-small" })
1306
+ icon: /* @__PURE__ */ i(Ae, { size: "x-small" })
1291
1307
  }
1292
- }, gt = ({ type: t, onTypeChange: e, renderAsMenuTrigger: n = !1 }) => {
1293
- const { translations: o } = Z(), r = Yn[t], s = o[r.translationKey], [l, a] = G(!1), m = F(null), c = F(null), p = F(null), d = K(
1308
+ }), ht = ({
1309
+ type: t,
1310
+ onTypeChange: e,
1311
+ renderAsMenuTrigger: n = !1,
1312
+ theme: o
1313
+ }) => {
1314
+ const { translations: r } = J(), l = to((o == null ? void 0 : o.importantPill) ?? eo)[t], a = r[l.translationKey], [f, u] = W(!1), m = F(null), c = F(null), y = F(null), N = K(
1294
1315
  (h) => {
1295
- e == null || e(h), a(!1);
1316
+ e == null || e(h), u(!1);
1296
1317
  },
1297
1318
  [e]
1298
1319
  );
1299
- return W(() => {
1300
- if (!l) return;
1301
- const h = (y) => {
1302
- y.key === "Escape" && y.stopPropagation();
1303
- }, E = (y) => {
1304
- var b;
1305
- y.key === "Escape" && (y.stopPropagation(), a(!1), (b = p.current) == null || b.focus());
1320
+ return q(() => {
1321
+ if (!f) return;
1322
+ const h = (p) => {
1323
+ p.key === "Escape" && p.stopPropagation();
1324
+ }, x = (p) => {
1325
+ var R;
1326
+ p.key === "Escape" && (p.stopPropagation(), u(!1), (R = y.current) == null || R.focus());
1306
1327
  };
1307
- return document.addEventListener("keydown", h, !0), document.addEventListener("keyup", E, !0), () => {
1308
- document.removeEventListener("keydown", h, !0), document.removeEventListener("keyup", E, !0);
1328
+ return document.addEventListener("keydown", h, !0), document.addEventListener("keyup", x, !0), () => {
1329
+ document.removeEventListener("keydown", h, !0), document.removeEventListener("keyup", x, !0);
1309
1330
  };
1310
- }, [l]), n && e ? /* @__PURE__ */ T(
1311
- ue,
1331
+ }, [f]), n && e ? /* @__PURE__ */ T(
1332
+ fe,
1312
1333
  {
1313
1334
  placement: "bottom start",
1314
- show: l,
1315
- onToggle: (h) => a(h),
1335
+ show: f,
1336
+ onToggle: (h) => u(h),
1316
1337
  shouldHideOnSelect: !0,
1317
1338
  shouldFocusTriggerOnClose: !0,
1318
1339
  trigger: /* @__PURE__ */ i(
1319
- Ue,
1340
+ $e,
1320
1341
  {
1321
- color: r.color,
1322
- renderIcon: r.icon,
1342
+ color: l.color,
1343
+ themeOverride: l.themeOverride,
1344
+ renderIcon: l.icon,
1323
1345
  elementRef: (h) => {
1324
- p.current = h;
1346
+ y.current = h;
1325
1347
  },
1326
- children: s
1348
+ children: a
1327
1349
  }
1328
1350
  ),
1329
1351
  children: [
1330
- /* @__PURE__ */ T(ue.Item, { ref: m, onClick: () => d(k.CONFUSING), children: [
1331
- /* @__PURE__ */ i(Le, { size: "x-small" }),
1332
- ` ${o.markUnclear}`
1333
- ] }),
1334
- /* @__PURE__ */ T(ue.Item, { ref: c, onClick: () => d(k.IMPORTANT), children: [
1352
+ /* @__PURE__ */ T(fe.Item, { ref: m, onClick: () => N(L.CONFUSING), children: [
1335
1353
  /* @__PURE__ */ i(Ae, { size: "x-small" }),
1336
- ` ${o.markImportant}`
1354
+ ` ${r.markUnclear}`
1355
+ ] }),
1356
+ /* @__PURE__ */ T(fe.Item, { ref: c, onClick: () => N(L.IMPORTANT), children: [
1357
+ /* @__PURE__ */ i(De, { size: "x-small" }),
1358
+ ` ${r.markImportant}`
1337
1359
  ] })
1338
1360
  ]
1339
1361
  }
1340
- ) : /* @__PURE__ */ i(V, { display: "inline-flex", children: /* @__PURE__ */ i(Ue, { color: r.color, renderIcon: r.icon, children: s }) });
1362
+ ) : /* @__PURE__ */ i(V, { display: "inline-flex", children: /* @__PURE__ */ i($e, { color: l.color, themeOverride: l.themeOverride, renderIcon: l.icon, children: a }) });
1341
1363
  };
1342
1364
  function Ke(t, e) {
1343
1365
  return (t instanceof Date ? t : new Date(t)).toLocaleString(e, {
@@ -1346,59 +1368,62 @@ function Ke(t, e) {
1346
1368
  day: "numeric"
1347
1369
  });
1348
1370
  }
1349
- const Zn = ({
1371
+ const no = ({
1350
1372
  noteId: t,
1351
1373
  date: e,
1352
1374
  highlight: n,
1353
- note: o,
1354
- type: r,
1355
- onClick: s,
1356
- onDelete: l,
1357
- onSaveNote: a,
1358
- onTypeChange: m,
1359
- isActive: c,
1360
- isPanelView: p = !1,
1361
- courseName: d,
1362
- locale: h,
1363
- highlightTheme: E,
1364
- renderLink: y,
1365
- href: b
1375
+ highlightUnavailableReason: o,
1376
+ note: r,
1377
+ type: s,
1378
+ onClick: l,
1379
+ onDelete: a,
1380
+ onSaveNote: f,
1381
+ onTypeChange: u,
1382
+ isActive: m,
1383
+ isPanelView: c = !1,
1384
+ courseName: y,
1385
+ locale: N,
1386
+ highlightTheme: h,
1387
+ renderLink: x,
1388
+ href: p
1366
1389
  }) => {
1367
- const { translations: g } = Z(), [Q, j] = G(!1), [N, I] = G(!1), [B, D] = G(o || ""), [P, S] = G(!1), [w, C] = G(!1), [$, re] = G(!1), [z, ce] = G(!1), se = F(null), le = K((u) => {
1368
- se.current = u;
1369
- }, []), J = F(null), ee = F(null), O = F(!1), Y = F(null), de = F(null), _ = F(!1);
1370
- W(() => {
1371
- var u, H;
1372
- c ? ((u = se.current) == null || u.scrollIntoView({ behavior: "smooth", block: "nearest" }), (H = se.current) == null || H.focus()) : S(!1);
1373
- }, [c]), W(() => {
1374
- var u, H;
1375
- N ? (O.current = !0, (u = J.current) == null || u.focus()) : O.current && (O.current = !1, (H = ee.current) == null || H.focus());
1376
- }, [N]), W(() => {
1377
- if (!P && _.current) {
1378
- _.current = !1;
1379
- const u = Y.current;
1380
- u != null && u.isConnected && u.focus();
1390
+ const { translations: R } = J(), [z, b] = W(!1), [S, P] = W(!1), [D, G] = W(r || ""), [E, w] = W(!1), [v, j] = W(!1), [ee, Q] = W(!1), [ae, de] = W(!1), te = F(null), re = K((g) => {
1391
+ te.current = g;
1392
+ }, []), se = F(null), A = F(null), Y = F(!1), ue = F(null), M = F(null), C = F(!1);
1393
+ q(() => {
1394
+ var g, $;
1395
+ m ? ((g = te.current) == null || g.scrollIntoView({ behavior: "smooth", block: "nearest" }), ($ = te.current) == null || $.focus()) : w(!1);
1396
+ }, [m]), q(() => {
1397
+ var g, $;
1398
+ S ? (Y.current = !0, (g = se.current) == null || g.focus()) : Y.current && (Y.current = !1, ($ = A.current) == null || $.focus());
1399
+ }, [S]), q(() => {
1400
+ if (!E && C.current) {
1401
+ C.current = !1;
1402
+ const g = ue.current;
1403
+ g != null && g.isConnected && g.focus();
1381
1404
  }
1382
- }, [P]);
1383
- const v = K((u, H) => {
1384
- _.current = !H, S(!1);
1405
+ }, [E]);
1406
+ const _ = K((g, $) => {
1407
+ C.current = !$, w(!1);
1385
1408
  }, []);
1386
- W(() => {
1387
- if (!P) return;
1388
- const u = (q) => {
1389
- q.key === "Escape" && q.stopPropagation();
1390
- }, H = (q) => {
1391
- q.key === "Escape" && (q.stopPropagation(), v());
1409
+ q(() => {
1410
+ if (!E) return;
1411
+ const g = (ie) => {
1412
+ ie.key === "Escape" && ie.stopPropagation();
1413
+ }, $ = (ie) => {
1414
+ ie.key === "Escape" && (ie.stopPropagation(), _());
1392
1415
  };
1393
- return window.addEventListener("keydown", u, !0), window.addEventListener("keyup", H, !0), () => {
1394
- window.removeEventListener("keydown", u, !0), window.removeEventListener("keyup", H, !0);
1416
+ return window.addEventListener("keydown", g, !0), window.addEventListener("keyup", $, !0), () => {
1417
+ window.removeEventListener("keydown", g, !0), window.removeEventListener("keyup", $, !0);
1395
1418
  };
1396
- }, [P, v]);
1397
- const U = r === k.IMPORTANT ? g.important : g.unclear, M = (u) => {
1398
- u.key === "Enter" && (u.preventDefault(), s == null || s());
1399
- }, L = [g.note, U];
1400
- L.push(n || g.highlightUnavailable), o && L.push(o), e && L.push(Ke(e, h)), d && L.push(d);
1401
- const A = L.join(", "), R = /* @__PURE__ */ T(
1419
+ }, [E, _]);
1420
+ const B = s === L.IMPORTANT ? R.important : R.unclear, H = (g) => {
1421
+ g.key === "Enter" && (g.preventDefault(), l == null || l());
1422
+ }, k = [R.note, B];
1423
+ k.push(
1424
+ n || mt(R, o)
1425
+ ), r && k.push(r), e && k.push(Ke(e, N)), y && k.push(y);
1426
+ const O = k.join(", "), U = /* @__PURE__ */ T(
1402
1427
  V,
1403
1428
  {
1404
1429
  as: "div",
@@ -1407,17 +1432,17 @@ const Zn = ({
1407
1432
  borderRadius: "medium",
1408
1433
  padding: "small",
1409
1434
  position: "relative",
1410
- role: b ? void 0 : c || N ? "group" : "button",
1411
- "aria-label": b ? void 0 : A,
1412
- "aria-pressed": b || c || N ? void 0 : c,
1413
- tabIndex: b || c ? -1 : 0,
1435
+ role: p ? void 0 : m || S ? "group" : "button",
1436
+ "aria-label": p ? void 0 : O,
1437
+ "aria-pressed": p || m || S ? void 0 : m,
1438
+ tabIndex: p || m ? -1 : 0,
1414
1439
  "data-testid": `note-card-${t}`,
1415
- elementRef: le,
1416
- onClick: c ? void 0 : s,
1417
- onMouseEnter: () => j(!0),
1418
- onMouseLeave: () => j(!1),
1419
- onKeyDown: c ? void 0 : M,
1420
- cursor: N ? "default" : "pointer",
1440
+ elementRef: re,
1441
+ onClick: m ? void 0 : l,
1442
+ onMouseEnter: () => b(!0),
1443
+ onMouseLeave: () => b(!1),
1444
+ onKeyDown: m ? void 0 : H,
1445
+ cursor: S ? "default" : "pointer",
1421
1446
  children: [
1422
1447
  /* @__PURE__ */ i(
1423
1448
  "div",
@@ -1425,15 +1450,16 @@ const Zn = ({
1425
1450
  "data-testid": `note-card-${t}-content`,
1426
1451
  style: {
1427
1452
  height: "100%",
1428
- opacity: c && P && l ? 0.25 : void 0
1453
+ opacity: m && E && a ? 0.25 : void 0
1429
1454
  },
1430
- children: /* @__PURE__ */ T(x, { direction: "column", gap: "small", height: "100%", children: [
1455
+ children: /* @__PURE__ */ T(I, { direction: "column", gap: "small", height: "100%", children: [
1431
1456
  /* @__PURE__ */ i(
1432
- gt,
1457
+ ht,
1433
1458
  {
1434
- type: r,
1435
- onTypeChange: p && m ? (u) => m(t, u) : void 0,
1436
- renderAsMenuTrigger: p && !!m && !!c
1459
+ type: s,
1460
+ onTypeChange: c && u ? (g) => u(t, g) : void 0,
1461
+ renderAsMenuTrigger: c && !!u && !!m,
1462
+ theme: h.colors
1437
1463
  }
1438
1464
  ),
1439
1465
  n ? /* @__PURE__ */ i(
@@ -1444,56 +1470,56 @@ const Zn = ({
1444
1470
  overflowWrap: "break-word",
1445
1471
  whiteSpace: "pre-wrap"
1446
1472
  },
1447
- children: /* @__PURE__ */ i(te, { children: c && p ? /* @__PURE__ */ i(
1473
+ children: /* @__PURE__ */ i(Z, { children: m && c ? /* @__PURE__ */ i(
1448
1474
  we,
1449
1475
  {
1450
- type: r,
1451
- isCardActive: !!c || Q,
1452
- theme: E,
1476
+ type: s,
1477
+ isCardActive: !!m || z,
1478
+ theme: h,
1453
1479
  children: n
1454
1480
  }
1455
1481
  ) : /* @__PURE__ */ T(Xe, { children: [
1456
- w && /* @__PURE__ */ i(pe, { children: n }),
1457
- /* @__PURE__ */ i("span", { "aria-hidden": w, style: { display: "block" }, children: /* @__PURE__ */ i(be, { maxLines: 3, truncate: "word", onUpdate: C, children: /* @__PURE__ */ i(
1482
+ v && /* @__PURE__ */ i(ye, { children: n }),
1483
+ /* @__PURE__ */ i("span", { "aria-hidden": v, style: { display: "block" }, children: /* @__PURE__ */ i(Te, { maxLines: 3, truncate: "word", onUpdate: j, children: /* @__PURE__ */ i(
1458
1484
  we,
1459
1485
  {
1460
- type: r,
1461
- isCardActive: !!c || Q,
1462
- theme: E,
1486
+ type: s,
1487
+ isCardActive: !!m || z,
1488
+ theme: h,
1463
1489
  children: n
1464
1490
  }
1465
1491
  ) }) })
1466
1492
  ] }) })
1467
1493
  }
1468
- ) : /* @__PURE__ */ i(mt, {}),
1469
- /* @__PURE__ */ i(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ T(x, { direction: "column", gap: "small", height: "100%", children: [
1470
- N && p ? /* @__PURE__ */ T(x, { direction: "column", gap: "x-small", margin: "xx-small", children: [
1494
+ ) : /* @__PURE__ */ i(gt, { reason: o }),
1495
+ /* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ T(I, { direction: "column", gap: "small", height: "100%", children: [
1496
+ S && c ? /* @__PURE__ */ T(I, { direction: "column", gap: "x-small", margin: "xx-small", children: [
1471
1497
  /* @__PURE__ */ i(
1472
1498
  Ze,
1473
1499
  {
1474
- label: /* @__PURE__ */ i(pe, { children: g.editNote }),
1475
- value: B,
1476
- onChange: (u) => D(u.target.value),
1477
- placeholder: g.addNoteOptional,
1478
- textareaRef: (u) => {
1479
- J.current = u;
1500
+ label: /* @__PURE__ */ i(ye, { children: R.editNote }),
1501
+ value: D,
1502
+ onChange: (g) => G(g.target.value),
1503
+ placeholder: R.addNoteOptional,
1504
+ textareaRef: (g) => {
1505
+ se.current = g;
1480
1506
  }
1481
1507
  }
1482
1508
  ),
1483
- /* @__PURE__ */ T(x, { gap: "xx-small", children: [
1484
- /* @__PURE__ */ i(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1509
+ /* @__PURE__ */ T(I, { gap: "xx-small", children: [
1510
+ /* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1485
1511
  ne,
1486
1512
  {
1487
1513
  display: "block",
1488
1514
  size: "small",
1489
1515
  "data-testid": `note-card-${t}-cancel`,
1490
1516
  onClick: () => {
1491
- D(o || ""), I(!1);
1517
+ G(r || ""), P(!1);
1492
1518
  },
1493
- children: g.cancel
1519
+ children: R.cancel
1494
1520
  }
1495
1521
  ) }),
1496
- /* @__PURE__ */ i(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1522
+ /* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1497
1523
  ne,
1498
1524
  {
1499
1525
  display: "block",
@@ -1501,13 +1527,13 @@ const Zn = ({
1501
1527
  size: "small",
1502
1528
  "data-testid": `note-card-${t}-save`,
1503
1529
  onClick: () => {
1504
- a == null || a(t, B.trim()), I(!1);
1530
+ f == null || f(t, D.trim()), P(!1);
1505
1531
  },
1506
- children: g.save
1532
+ children: R.save
1507
1533
  }
1508
1534
  ) })
1509
1535
  ] })
1510
- ] }) : o ? /* @__PURE__ */ i(
1536
+ ] }) : r ? /* @__PURE__ */ i(
1511
1537
  "div",
1512
1538
  {
1513
1539
  style: {
@@ -1515,86 +1541,86 @@ const Zn = ({
1515
1541
  overflowWrap: "break-word",
1516
1542
  whiteSpace: "pre-wrap"
1517
1543
  },
1518
- children: c && p ? /* @__PURE__ */ T(te, { children: [
1519
- o,
1544
+ children: m && c ? /* @__PURE__ */ T(Z, { children: [
1545
+ r,
1520
1546
  " ",
1521
1547
  /* @__PURE__ */ i(
1522
- me,
1548
+ ge,
1523
1549
  {
1524
1550
  size: "small",
1525
1551
  withBackground: !1,
1526
1552
  withBorder: !1,
1527
1553
  margin: "xx-small 0 0 xxx-small",
1528
- screenReaderLabel: g.editNote,
1554
+ screenReaderLabel: R.editNote,
1529
1555
  "data-testid": `note-card-${t}-edit`,
1530
- elementRef: (u) => {
1531
- ee.current = u;
1556
+ elementRef: (g) => {
1557
+ A.current = g;
1532
1558
  },
1533
- onClick: (u) => {
1534
- u.stopPropagation(), I(!0);
1559
+ onClick: (g) => {
1560
+ g.stopPropagation(), P(!0);
1535
1561
  },
1536
- children: /* @__PURE__ */ i(Re, {})
1562
+ children: /* @__PURE__ */ i(Oe, {})
1537
1563
  }
1538
1564
  )
1539
- ] }) : /* @__PURE__ */ T(te, { children: [
1540
- $ && /* @__PURE__ */ i(pe, { children: o }),
1541
- /* @__PURE__ */ i("span", { "aria-hidden": $, style: { display: "block" }, children: /* @__PURE__ */ i(be, { maxLines: 3, truncate: "word", onUpdate: re, children: o }) })
1565
+ ] }) : /* @__PURE__ */ T(Z, { children: [
1566
+ ee && /* @__PURE__ */ i(ye, { children: r }),
1567
+ /* @__PURE__ */ i("span", { "aria-hidden": ee, style: { display: "block" }, children: /* @__PURE__ */ i(Te, { maxLines: 3, truncate: "word", onUpdate: Q, children: r }) })
1542
1568
  ] })
1543
1569
  }
1544
- ) : p && c ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ T(te, { color: "secondary", children: [
1545
- g.addNotePrompt,
1570
+ ) : c && m ? /* @__PURE__ */ i("div", { children: /* @__PURE__ */ T(Z, { color: "secondary", children: [
1571
+ R.addNotePrompt,
1546
1572
  " ",
1547
1573
  /* @__PURE__ */ i(
1548
- me,
1574
+ ge,
1549
1575
  {
1550
1576
  size: "small",
1551
1577
  withBackground: !1,
1552
1578
  withBorder: !1,
1553
1579
  margin: "xx-small 0 0 xxx-small",
1554
- screenReaderLabel: g.editNote,
1580
+ screenReaderLabel: R.editNote,
1555
1581
  "data-testid": `note-card-${t}-edit`,
1556
- elementRef: (u) => {
1557
- ee.current = u;
1582
+ elementRef: (g) => {
1583
+ A.current = g;
1558
1584
  },
1559
- onClick: (u) => {
1560
- u.stopPropagation(), I(!0);
1585
+ onClick: (g) => {
1586
+ g.stopPropagation(), P(!0);
1561
1587
  },
1562
- children: /* @__PURE__ */ i(Re, {})
1588
+ children: /* @__PURE__ */ i(Oe, {})
1563
1589
  }
1564
1590
  )
1565
1591
  ] }) }) : null,
1566
- /* @__PURE__ */ T(x, { justifyItems: "space-between", alignItems: "center", margin: "auto 0 0 0", children: [
1567
- /* @__PURE__ */ i(te, { as: "div", size: "small", color: "secondary", children: Ke(e, h) }),
1568
- c && l && /* @__PURE__ */ i(
1569
- me,
1592
+ /* @__PURE__ */ T(I, { justifyItems: "space-between", alignItems: "center", margin: "auto 0 0 0", children: [
1593
+ /* @__PURE__ */ i(Z, { as: "div", size: "small", color: "secondary", children: Ke(e, N) }),
1594
+ m && a && /* @__PURE__ */ i(
1595
+ ge,
1570
1596
  {
1571
1597
  size: "small",
1572
1598
  withBackground: !1,
1573
1599
  withBorder: !1,
1574
1600
  color: "danger",
1575
1601
  margin: "xx-small",
1576
- screenReaderLabel: g.deleteNote,
1602
+ screenReaderLabel: R.deleteNote,
1577
1603
  "data-testid": `note-card-${t}-delete`,
1578
- elementRef: (u) => {
1579
- Y.current = u;
1604
+ elementRef: (g) => {
1605
+ ue.current = g;
1580
1606
  },
1581
- onClick: (u) => {
1582
- u.stopPropagation(), _.current = !1, S(!0);
1607
+ onClick: (g) => {
1608
+ g.stopPropagation(), C.current = !1, w(!0);
1583
1609
  },
1584
- children: /* @__PURE__ */ i(Te, {})
1610
+ children: /* @__PURE__ */ i(Se, {})
1585
1611
  }
1586
1612
  )
1587
1613
  ] }),
1588
- d && /* @__PURE__ */ T(
1589
- te,
1614
+ y && /* @__PURE__ */ T(
1615
+ Z,
1590
1616
  {
1591
1617
  as: "div",
1592
1618
  size: "small",
1593
1619
  color: "secondary",
1594
1620
  "data-testid": `note-card-${t}-course`,
1595
1621
  children: [
1596
- z && /* @__PURE__ */ i(pe, { children: d }),
1597
- /* @__PURE__ */ i("span", { "aria-hidden": z, style: { display: "block" }, children: /* @__PURE__ */ i(be, { maxLines: 1, onUpdate: ce, children: d }) })
1622
+ ae && /* @__PURE__ */ i(ye, { children: y }),
1623
+ /* @__PURE__ */ i("span", { "aria-hidden": ae, style: { display: "block" }, children: /* @__PURE__ */ i(Te, { maxLines: 1, onUpdate: de, children: y }) })
1598
1624
  ]
1599
1625
  }
1600
1626
  )
@@ -1602,19 +1628,19 @@ const Zn = ({
1602
1628
  ] })
1603
1629
  }
1604
1630
  ),
1605
- c && P && l && /* @__PURE__ */ i(
1631
+ m && E && a && /* @__PURE__ */ i(
1606
1632
  Ct,
1607
1633
  {
1608
1634
  open: !0,
1609
1635
  as: "div",
1610
- label: g.deleteNoteConfirmation,
1636
+ label: R.deleteNoteConfirmation,
1611
1637
  shouldContainFocus: !0,
1612
1638
  shouldFocusOnOpen: !0,
1613
- defaultFocusElement: () => de.current,
1639
+ defaultFocusElement: () => M.current,
1614
1640
  shouldCloseOnDocumentClick: !0,
1615
1641
  shouldCloseOnEscape: !1,
1616
1642
  shouldReturnFocus: !1,
1617
- onDismiss: v,
1643
+ onDismiss: _,
1618
1644
  children: /* @__PURE__ */ i(
1619
1645
  V,
1620
1646
  {
@@ -1629,7 +1655,7 @@ const Zn = ({
1629
1655
  insetInlineEnd: "0",
1630
1656
  stacking: "above",
1631
1657
  children: /* @__PURE__ */ T(
1632
- x,
1658
+ I,
1633
1659
  {
1634
1660
  direction: "column",
1635
1661
  justifyItems: "center",
@@ -1643,12 +1669,12 @@ const Zn = ({
1643
1669
  display: "block",
1644
1670
  color: "danger",
1645
1671
  withBackground: !1,
1646
- renderIcon: /* @__PURE__ */ i(Te, {}),
1672
+ renderIcon: /* @__PURE__ */ i(Se, {}),
1647
1673
  "data-testid": `note-card-${t}-confirm-delete`,
1648
- onClick: (u) => {
1649
- u.stopPropagation(), l(t), S(!1);
1674
+ onClick: (g) => {
1675
+ g.stopPropagation(), a(t), w(!1);
1650
1676
  },
1651
- children: g.deleteNote
1677
+ children: R.deleteNote
1652
1678
  }
1653
1679
  ),
1654
1680
  /* @__PURE__ */ i(
@@ -1657,13 +1683,13 @@ const Zn = ({
1657
1683
  display: "block",
1658
1684
  withBackground: !1,
1659
1685
  "data-testid": `note-card-${t}-cancel-delete`,
1660
- elementRef: (u) => {
1661
- de.current = u;
1686
+ elementRef: (g) => {
1687
+ M.current = g;
1662
1688
  },
1663
- onClick: (u) => {
1664
- u.stopPropagation(), v();
1689
+ onClick: (g) => {
1690
+ g.stopPropagation(), _();
1665
1691
  },
1666
- children: g.cancel
1692
+ children: R.cancel
1667
1693
  }
1668
1694
  )
1669
1695
  ]
@@ -1676,8 +1702,8 @@ const Zn = ({
1676
1702
  ]
1677
1703
  }
1678
1704
  );
1679
- return b && y ? y({ href: b, children: R, ariaLabel: A }) : R;
1680
- }, Jn = {
1705
+ return p && x ? x({ href: p, children: U, ariaLabel: O }) : U;
1706
+ }, oo = {
1681
1707
  display: "grid",
1682
1708
  gap: "1rem",
1683
1709
  boxSizing: "border-box",
@@ -1685,7 +1711,7 @@ const Zn = ({
1685
1711
  margin: 0,
1686
1712
  padding: 0,
1687
1713
  listStyle: "none"
1688
- }, wo = ({
1714
+ }, Ao = ({
1689
1715
  notes: t,
1690
1716
  isLoading: e,
1691
1717
  isError: n,
@@ -1694,93 +1720,94 @@ const Zn = ({
1694
1720
  onPageChange: s,
1695
1721
  onNoteSelect: l,
1696
1722
  onNoteDelete: a,
1697
- onNoteSave: m,
1698
- onNoteTypeChange: c,
1699
- onNotesEmptied: p,
1700
- selectedNoteId: d,
1701
- hasActiveFilter: h = !1,
1702
- columnCount: E = 1,
1703
- highlightTheme: y,
1704
- locale: b,
1705
- courseNames: g,
1706
- renderNoteLink: Q,
1707
- noteHref: j
1723
+ onNoteSave: f,
1724
+ onNoteTypeChange: u,
1725
+ onNotesEmptied: m,
1726
+ selectedNoteId: c,
1727
+ hasActiveFilter: y = !1,
1728
+ columnCount: N = 1,
1729
+ highlightTheme: h,
1730
+ locale: x,
1731
+ courseNames: p,
1732
+ renderNoteLink: R,
1733
+ noteHref: z
1708
1734
  }) => {
1709
- const { translations: N } = Z(), I = F(null), B = F(null), D = K(
1710
- (S) => {
1711
- const w = t.findIndex(($) => $.id === S);
1712
- let C = null;
1713
- t.length > 1 && (C = w > 0 ? t[w - 1].id : t[1].id), B.current = { targetId: C }, a == null || a(S);
1735
+ const { translations: b } = J(), S = F(null), P = F(null), D = K(
1736
+ (E) => {
1737
+ const w = t.findIndex((j) => j.id === E);
1738
+ let v = null;
1739
+ t.length > 1 && (v = w > 0 ? t[w - 1].id : t[1].id), P.current = { targetId: v }, a == null || a(E);
1714
1740
  },
1715
1741
  [t, a]
1716
1742
  );
1717
- if (W(() => {
1743
+ if (q(() => {
1718
1744
  var w;
1719
- const S = B.current;
1720
- if (S)
1721
- if (B.current = null, S.targetId === null)
1722
- p == null || p();
1745
+ const E = P.current;
1746
+ if (E)
1747
+ if (P.current = null, E.targetId === null)
1748
+ m == null || m();
1723
1749
  else {
1724
- const C = (w = I.current) == null ? void 0 : w.querySelector(
1725
- `[data-testid="note-card-${S.targetId}"]`
1750
+ const v = (w = S.current) == null ? void 0 : w.querySelector(
1751
+ `[data-testid="note-card-${E.targetId}"]`
1726
1752
  );
1727
- C == null || C.focus();
1753
+ v == null || v.focus();
1728
1754
  }
1729
- }, [t, p]), e)
1730
- return /* @__PURE__ */ i(V, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ i(It, { renderTitle: N.loadingNotes }) });
1755
+ }, [t, m]), e)
1756
+ return /* @__PURE__ */ i(V, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ i(xt, { renderTitle: b.loadingNotes }) });
1731
1757
  if (n)
1732
- return /* @__PURE__ */ i(V, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ i(Se, { level: "h4", children: N.failedToLoadNotes }) });
1758
+ return /* @__PURE__ */ i(V, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ i(ve, { level: "h4", children: b.failedToLoadNotes }) });
1733
1759
  if (t.length === 0)
1734
- return /* @__PURE__ */ i(V, { as: "div", padding: "large", "data-testid": "empty-notes", children: /* @__PURE__ */ i(Qn, { hasActiveFilter: h }) });
1735
- const P = typeof o == "number" && typeof r == "number" && r > 1 && s !== void 0;
1760
+ return /* @__PURE__ */ i(V, { as: "div", padding: "large", "data-testid": "empty-notes", children: /* @__PURE__ */ i(Jn, { hasActiveFilter: y }) });
1761
+ const G = typeof o == "number" && typeof r == "number" && r > 1 && s !== void 0;
1736
1762
  return /* @__PURE__ */ T(Xe, { children: [
1737
1763
  /* @__PURE__ */ i(
1738
1764
  "ul",
1739
1765
  {
1740
- ref: I,
1741
- style: { ...Jn, gridTemplateColumns: `repeat(${E}, minmax(0, 1fr))` },
1766
+ ref: S,
1767
+ style: { ...oo, gridTemplateColumns: `repeat(${N}, minmax(0, 1fr))` },
1742
1768
  role: "list",
1743
1769
  "data-testid": "notes-grid",
1744
- children: t.map((S) => {
1770
+ children: t.map((E) => {
1745
1771
  var w;
1746
1772
  return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
1747
- Zn,
1773
+ no,
1748
1774
  {
1749
- noteId: S.id,
1750
- date: S.createdAt,
1751
- type: S.reaction[0] ?? k.IMPORTANT,
1752
- highlight: (w = S.highlightData) == null ? void 0 : w.selectedText,
1753
- note: S.userText,
1754
- isActive: d === S.id,
1755
- isPanelView: !!d,
1756
- onClick: l ? () => l(S.id) : void 0,
1775
+ noteId: E.id,
1776
+ date: E.createdAt,
1777
+ type: E.reaction[0] ?? L.IMPORTANT,
1778
+ highlight: (w = E.highlightData) == null ? void 0 : w.selectedText,
1779
+ highlightUnavailableReason: E.highlightSourceUnavailable ? "sourceUnavailable" : void 0,
1780
+ note: E.userText,
1781
+ isActive: c === E.id,
1782
+ isPanelView: !!c,
1783
+ onClick: l ? () => l(E.id) : void 0,
1757
1784
  onDelete: a ? D : void 0,
1758
- onSaveNote: m ? (C, $) => m(C, $) : void 0,
1759
- onTypeChange: c ? (C, $) => c(C, $) : void 0,
1760
- highlightTheme: y,
1761
- locale: b,
1762
- courseName: g == null ? void 0 : g.get(S.courseId),
1763
- renderLink: Q,
1764
- href: j ? j(S.id, S) : void 0
1785
+ onSaveNote: f ? (v, j) => f(v, j) : void 0,
1786
+ onTypeChange: u ? (v, j) => u(v, j) : void 0,
1787
+ highlightTheme: h,
1788
+ locale: x,
1789
+ courseName: p == null ? void 0 : p.get(E.courseId),
1790
+ renderLink: R,
1791
+ href: z ? z(E.id, E) : void 0
1765
1792
  }
1766
- ) }, S.id);
1793
+ ) }, E.id);
1767
1794
  })
1768
1795
  }
1769
1796
  ),
1770
- P && /* @__PURE__ */ i(x, { justifyItems: "center", padding: "small", "data-testid": "notes-pagination", children: /* @__PURE__ */ i(x.Item, { children: /* @__PURE__ */ i(
1771
- vt,
1797
+ G && /* @__PURE__ */ i(I, { justifyItems: "center", padding: "small", "data-testid": "notes-pagination", children: /* @__PURE__ */ i(I.Item, { children: /* @__PURE__ */ i(
1798
+ It,
1772
1799
  {
1773
1800
  as: "nav",
1774
1801
  variant: "input",
1775
- labelNext: N.nextPage,
1776
- labelPrev: N.previousPage,
1802
+ labelNext: b.nextPage,
1803
+ labelPrev: b.previousPage,
1777
1804
  currentPage: o,
1778
1805
  totalPageNumber: r,
1779
1806
  onPageChange: s
1780
1807
  }
1781
1808
  ) }) })
1782
1809
  ] });
1783
- }, ko = ({
1810
+ }, Do = ({
1784
1811
  noteText: t,
1785
1812
  reaction: e,
1786
1813
  highlightText: n,
@@ -1789,36 +1816,44 @@ const Zn = ({
1789
1816
  onDelete: s,
1790
1817
  onTypeChange: l,
1791
1818
  onBack: a,
1792
- editing: m = !1
1819
+ editing: f = !1
1793
1820
  }) => {
1794
- const { translations: c } = Z(), [p, d] = G(m), [h, E] = G(t || ""), [y, b] = G(!1);
1795
- return /* @__PURE__ */ T(x, { direction: "column", gap: "small", "data-testid": "single-note", children: [
1796
- n != null ? /* @__PURE__ */ i(V, { as: "div", children: /* @__PURE__ */ i(te, { children: /* @__PURE__ */ i(we, { type: e, isCardActive: !0, theme: o, children: n }) }) }) : /* @__PURE__ */ i(mt, {}),
1797
- /* @__PURE__ */ i(gt, { type: e, onTypeChange: l, renderAsMenuTrigger: !!l }),
1798
- p ? /* @__PURE__ */ T(x, { direction: "column", gap: "x-small", children: [
1821
+ const { translations: u } = J(), [m, c] = W(f), [y, N] = W(t || ""), [h, x] = W(!1);
1822
+ return /* @__PURE__ */ T(I, { direction: "column", gap: "small", "data-testid": "single-note", children: [
1823
+ n != null ? /* @__PURE__ */ i(V, { as: "div", children: /* @__PURE__ */ i(Z, { children: /* @__PURE__ */ i(we, { type: e, isCardActive: !0, theme: o, children: n }) }) }) : /* @__PURE__ */ i(gt, {}),
1824
+ /* @__PURE__ */ i(
1825
+ ht,
1826
+ {
1827
+ type: e,
1828
+ onTypeChange: l,
1829
+ renderAsMenuTrigger: !!l,
1830
+ theme: o.colors
1831
+ }
1832
+ ),
1833
+ m ? /* @__PURE__ */ T(I, { direction: "column", gap: "x-small", children: [
1799
1834
  /* @__PURE__ */ i(
1800
1835
  Ze,
1801
1836
  {
1802
- label: c.addNoteOptional,
1803
- value: h,
1804
- onChange: (g) => E(g.target.value),
1837
+ label: u.addNoteOptional,
1838
+ value: y,
1839
+ onChange: (p) => N(p.target.value),
1805
1840
  resize: "vertical"
1806
1841
  }
1807
1842
  ),
1808
- /* @__PURE__ */ T(x, { gap: "xx-small", children: [
1809
- /* @__PURE__ */ i(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1843
+ /* @__PURE__ */ T(I, { gap: "xx-small", children: [
1844
+ /* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1810
1845
  ne,
1811
1846
  {
1812
1847
  display: "block",
1813
1848
  size: "small",
1814
1849
  "data-testid": "single-note-cancel",
1815
1850
  onClick: () => {
1816
- E(t || ""), d(!1);
1851
+ N(t || ""), c(!1);
1817
1852
  },
1818
- children: c.cancel
1853
+ children: u.cancel
1819
1854
  }
1820
1855
  ) }),
1821
- /* @__PURE__ */ i(x.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1856
+ /* @__PURE__ */ i(I.Item, { shouldGrow: !0, children: /* @__PURE__ */ i(
1822
1857
  ne,
1823
1858
  {
1824
1859
  display: "block",
@@ -1826,69 +1861,69 @@ const Zn = ({
1826
1861
  size: "small",
1827
1862
  "data-testid": "single-note-save",
1828
1863
  onClick: () => {
1829
- r(h), d(!1);
1864
+ r(y), c(!1);
1830
1865
  },
1831
- children: c.save
1866
+ children: u.save
1832
1867
  }
1833
1868
  ) })
1834
1869
  ] })
1835
- ] }) : /* @__PURE__ */ T(x, { direction: "column", gap: "small", children: [
1870
+ ] }) : /* @__PURE__ */ T(I, { direction: "column", gap: "small", children: [
1836
1871
  t && /* @__PURE__ */ T(V, { as: "div", children: [
1837
- /* @__PURE__ */ i(Se, { level: "h4", margin: "0 0 xx-small 0", children: c.note }),
1838
- /* @__PURE__ */ i(te, { children: t })
1872
+ /* @__PURE__ */ i(ve, { level: "h4", margin: "0 0 xx-small 0", children: u.note }),
1873
+ /* @__PURE__ */ i(Z, { children: t })
1839
1874
  ] }),
1840
- /* @__PURE__ */ T(x, { justifyItems: "space-between", children: [
1875
+ /* @__PURE__ */ T(I, { justifyItems: "space-between", children: [
1841
1876
  /* @__PURE__ */ i(
1842
1877
  ne,
1843
1878
  {
1844
1879
  size: "small",
1845
- renderIcon: /* @__PURE__ */ i(St, {}),
1880
+ renderIcon: /* @__PURE__ */ i(vt, {}),
1846
1881
  "data-testid": "single-note-back",
1847
1882
  onClick: () => a == null ? void 0 : a(),
1848
- children: c.back
1883
+ children: u.back
1849
1884
  }
1850
1885
  ),
1851
- /* @__PURE__ */ T(x, { gap: "xx-small", children: [
1886
+ /* @__PURE__ */ T(I, { gap: "xx-small", children: [
1852
1887
  s && /* @__PURE__ */ i(
1853
- me,
1888
+ ge,
1854
1889
  {
1855
1890
  size: "small",
1856
1891
  withBackground: !1,
1857
1892
  withBorder: !1,
1858
1893
  color: "danger",
1859
- screenReaderLabel: c.deleteNote,
1894
+ screenReaderLabel: u.deleteNote,
1860
1895
  "data-testid": "single-note-delete",
1861
- onClick: () => b(!0),
1862
- children: /* @__PURE__ */ i(Te, {})
1896
+ onClick: () => x(!0),
1897
+ children: /* @__PURE__ */ i(Se, {})
1863
1898
  }
1864
1899
  ),
1865
1900
  /* @__PURE__ */ i(
1866
- me,
1901
+ ge,
1867
1902
  {
1868
1903
  size: "small",
1869
1904
  withBackground: !1,
1870
1905
  withBorder: !1,
1871
- screenReaderLabel: c.editNote,
1906
+ screenReaderLabel: u.editNote,
1872
1907
  "data-testid": "single-note-edit",
1873
- onClick: () => d(!0),
1874
- children: /* @__PURE__ */ i(Re, {})
1908
+ onClick: () => c(!0),
1909
+ children: /* @__PURE__ */ i(Oe, {})
1875
1910
  }
1876
1911
  )
1877
1912
  ] })
1878
1913
  ] }),
1879
- y && s && /* @__PURE__ */ i(V, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ T(x, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
1914
+ h && s && /* @__PURE__ */ i(V, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ T(I, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
1880
1915
  /* @__PURE__ */ i(
1881
1916
  ne,
1882
1917
  {
1883
1918
  display: "block",
1884
1919
  color: "danger",
1885
1920
  size: "small",
1886
- renderIcon: /* @__PURE__ */ i(Te, {}),
1921
+ renderIcon: /* @__PURE__ */ i(Se, {}),
1887
1922
  "data-testid": "single-note-confirm-delete",
1888
1923
  onClick: () => {
1889
- s(), b(!1);
1924
+ s(), x(!1);
1890
1925
  },
1891
- children: c.deleteNote
1926
+ children: u.deleteNote
1892
1927
  }
1893
1928
  ),
1894
1929
  /* @__PURE__ */ i(
@@ -1897,8 +1932,8 @@ const Zn = ({
1897
1932
  display: "block",
1898
1933
  size: "small",
1899
1934
  "data-testid": "single-note-cancel-delete",
1900
- onClick: () => b(!1),
1901
- children: c.cancel
1935
+ onClick: () => x(!1),
1936
+ children: u.cancel
1902
1937
  }
1903
1938
  )
1904
1939
  ] }) })
@@ -1906,26 +1941,27 @@ const Zn = ({
1906
1941
  ] });
1907
1942
  };
1908
1943
  export {
1909
- Io as ContentWithNoteWrapper,
1944
+ wo as ContentWithNoteWrapper,
1910
1945
  we as Highlight,
1911
- mt as HighlightError,
1912
- Zn as NoteCard,
1913
- gt as NoteChip,
1914
- qn as NoteReactionMenu,
1915
- Qn as NotebookEmptyState,
1916
- Co as NotebookProvider,
1917
- jn as NotebookTranslationsProvider,
1918
- vo as NotebookTray,
1919
- wo as NotesListView,
1920
- k as REACTION_TYPE,
1921
- ko as SingleNote,
1922
- Fe as createTransparentColor,
1923
- en as useCreateNote,
1924
- tn as useDeleteNote,
1946
+ gt as HighlightError,
1947
+ no as NoteCard,
1948
+ ht as NoteChip,
1949
+ Vn as NoteReactionMenu,
1950
+ Jn as NotebookEmptyState,
1951
+ Ro as NotebookProvider,
1952
+ qn as NotebookTranslationsProvider,
1953
+ Oo as NotebookTray,
1954
+ Ao as NotesListView,
1955
+ L as REACTION_TYPE,
1956
+ Do as SingleNote,
1957
+ Me as createTransparentColor,
1958
+ mt as getHighlightUnavailableMessage,
1959
+ tn as useCreateNote,
1960
+ nn as useDeleteNote,
1925
1961
  it as useGetNotes,
1926
1962
  ut as useNotebook,
1927
- Z as useNotebookTranslations,
1928
- xo as useNotesData,
1929
- Ro as useReactionFilter,
1930
- on as useUpdateNote
1963
+ J as useNotebookTranslations,
1964
+ ko as useNotesData,
1965
+ Lo as useReactionFilter,
1966
+ rn as useUpdateNote
1931
1967
  };