@instructure/platform-notebook 1.9.3 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,46 +1,46 @@
1
- import { jsx as s, jsxs as S, Fragment as qe } from "react/jsx-runtime";
2
- import { createContext as Ke, useMemo as he, useContext as Xe, useReducer as Qe, useRef as $, useEffect as z, useState as j, useCallback as q } from "react";
3
- import { createPortal as mt } from "react-dom";
1
+ import { jsx as s, jsxs as S, Fragment as ze } from "react/jsx-runtime";
2
+ import { createContext as qe, useMemo as he, useContext as Ke, useReducer as Xe, useRef as B, useEffect as z, useState as j, useCallback as q } from "react";
3
+ import { createPortal as ft } from "react-dom";
4
4
  import { z as u } from "zod";
5
- import gt from "diff-match-patch";
6
- import { useQueryClient as we, useMutation as Oe, useQuery as ht } from "@tanstack/react-query";
7
- import { CloseButton as pt, Button as re, IconButton as me } from "@instructure/ui-buttons";
8
- import { Flex as k } from "@instructure/ui-flex";
9
- import { Heading as Se } from "@instructure/ui-heading";
10
- import { Tray as yt } from "@instructure/ui-tray";
11
- import { View as X } from "@instructure/ui-view";
12
- import { IconQuestionLine as Le, IconPinLine as Ae, IconWarningLine as Nt, IconNoteLine as bt, IconEditLine as ke, IconTrashLine as Te, IconArrowStartLine as Et } from "@instructure/ui-icons";
13
- import { Menu as ue } from "@instructure/ui-menu";
14
- import { TruncateText as Ee } from "@instructure/ui-truncate-text";
15
- import { SimpleSelect as Be } from "@instructure/ui-simple-select";
16
- import { Text as oe } from "@instructure/ui-text";
5
+ import mt from "diff-match-patch";
6
+ import { useQueryClient as we, useMutation as Oe, useQuery as gt } from "@tanstack/react-query";
7
+ import { CloseButton as ht, Button as re, IconButton as me } from "@instructure/ui-buttons/v11_7";
8
+ import { Flex as R } from "@instructure/ui-flex/v11_7";
9
+ import { Heading as Se } from "@instructure/ui-heading/v11_7";
10
+ import { Tray as pt } from "@instructure/ui-tray/v11_7";
11
+ import { View as X } from "@instructure/ui-view/v11_7";
12
+ import { IconQuestionLine as Le, IconPinLine as Ae, IconWarningLine as yt, IconNoteLine as bt, IconEditLine as Re, IconTrashLine as Te, IconArrowStartLine as Nt } from "@instructure/ui-icons";
13
+ import { Menu as ue } from "@instructure/ui-menu/v11_7";
14
+ import { TruncateText as Ee } from "@instructure/ui-truncate-text/v11_7";
15
+ import { SimpleSelect as Be } from "@instructure/ui-simple-select/v11_7";
16
+ import { Text as oe } from "@instructure/ui-text/v11_7";
17
17
  import { ScreenReaderContent as pe } from "@instructure/ui-a11y-content";
18
- import { Dialog as Tt } from "@instructure/ui-dialog";
19
- import { TextArea as Ye } from "@instructure/ui-text-area";
20
- import { Pill as $e } from "@instructure/ui-pill";
21
- import { Pagination as St } from "@instructure/ui-pagination";
22
- import { Spinner as vt } from "@instructure/ui-spinner";
23
- const It = u.object({
18
+ import { Dialog as Et } from "@instructure/ui-dialog";
19
+ import { TextArea as Qe } from "@instructure/ui-text-area/v11_7";
20
+ import { Pill as $e } from "@instructure/ui-pill/v11_7";
21
+ import { Pagination as Tt } from "@instructure/ui-pagination/v11_7";
22
+ import { Spinner as St } from "@instructure/ui-spinner/v11_7";
23
+ const vt = u.object({
24
24
  startContainer: u.string(),
25
25
  endContainer: u.string(),
26
26
  startOffset: u.number(),
27
27
  endOffset: u.number()
28
- }), Ct = u.object({
28
+ }), It = u.object({
29
29
  start: u.number(),
30
30
  end: u.number()
31
31
  }), De = u.object({
32
32
  selectedText: u.string(),
33
33
  hasNoHighlightAnymore: u.boolean().optional(),
34
- textPosition: Ct.nullable(),
35
- range: It.nullable(),
34
+ textPosition: It.nullable(),
35
+ range: vt.nullable(),
36
36
  pageLastModifiedAt: u.string()
37
37
  });
38
- var R = /* @__PURE__ */ ((t) => (t.IMPORTANT = "Important", t.CONFUSING = "Confusing", t))(R || {});
38
+ var k = /* @__PURE__ */ ((t) => (t.IMPORTANT = "Important", t.CONFUSING = "Confusing", t))(k || {});
39
39
  const Pe = u.enum([
40
40
  "Important",
41
41
  "Confusing"
42
42
  /* CONFUSING */
43
- ]), xt = u.object({
43
+ ]), Ct = u.object({
44
44
  totalCount: u.number().nullish(),
45
45
  totalNrOfPages: u.number().nullish()
46
46
  }), ve = u.object({
@@ -55,28 +55,28 @@ const Pe = u.enum([
55
55
  highlightData: De,
56
56
  createdAt: u.string(),
57
57
  updatedAt: u.string()
58
- }), kt = u.object({
58
+ }), xt = u.object({
59
59
  cursor: u.string(),
60
60
  node: ve
61
61
  });
62
62
  u.object({
63
63
  notes: u.object({
64
- edges: u.array(kt),
64
+ edges: u.array(xt),
65
65
  nodes: u.array(ve),
66
- pageInfo: xt
66
+ pageInfo: Ct
67
67
  })
68
68
  });
69
69
  const Rt = u.object({
70
70
  type: u.string(),
71
71
  id: u.string()
72
- }), wt = u.object({
72
+ }), kt = u.object({
73
73
  courseId: u.string().optional(),
74
74
  learningObject: Rt.optional(),
75
75
  reactions: u.array(u.string()).optional()
76
76
  }).optional();
77
77
  u.object({
78
78
  courseId: u.string().optional(),
79
- filter: wt,
79
+ filter: kt,
80
80
  offset: u.number().optional(),
81
81
  pageSize: u.number().optional()
82
82
  });
@@ -103,14 +103,14 @@ u.object({
103
103
  u.object({
104
104
  deleteNote: u.string()
105
105
  });
106
- var Ve = /* @__PURE__ */ ((t) => (t[t.FORWARDS = 1] = "FORWARDS", t[t.BACKWARDS = 2] = "BACKWARDS", t))(Ve || {});
106
+ var Ye = /* @__PURE__ */ ((t) => (t[t.FORWARDS = 1] = "FORWARDS", t[t.BACKWARDS = 2] = "BACKWARDS", t))(Ye || {});
107
107
  class se {
108
108
  constructor(e, n) {
109
109
  this.start = e, this.end = n;
110
110
  }
111
111
  toRange() {
112
112
  let e, n;
113
- if (this.start.element === this.end.element && this.start.offset <= this.end.offset ? [e, n] = Je(this.start.element, this.start.offset, this.end.offset) : (e = this.start.resolve({
113
+ if (this.start.element === this.end.element && this.start.offset <= this.end.offset ? [e, n] = Ze(this.start.element, this.start.offset, this.end.offset) : (e = this.start.resolve({
114
114
  direction: 1
115
115
  /* FORWARDS */
116
116
  }), n = this.end.resolve({
@@ -138,12 +138,12 @@ class K {
138
138
  }
139
139
  resolve(e = {}) {
140
140
  try {
141
- return Je(this.element, this.offset)[0];
141
+ return Ze(this.element, this.offset)[0];
142
142
  } catch (n) {
143
143
  if (this.offset === 0 && e.direction !== void 0) {
144
144
  const o = document.createTreeWalker(this.element.getRootNode(), NodeFilter.SHOW_TEXT);
145
145
  o.currentNode = this.element;
146
- const r = e.direction === Ve.FORWARDS, i = r ? o.nextNode() : o.previousNode();
146
+ const r = e.direction === Ye.FORWARDS, i = r ? o.nextNode() : o.previousNode();
147
147
  if (!i)
148
148
  throw n;
149
149
  return { node: i, offset: r ? 0 : i.data.length };
@@ -168,7 +168,7 @@ class K {
168
168
  return console.error("Text node offset is out of range"), null;
169
169
  if (!e.parentElement)
170
170
  return console.error("Text node has no parent"), null;
171
- const o = Ge(e) + n;
171
+ const o = je(e) + n;
172
172
  return new K(e.parentElement, o);
173
173
  }
174
174
  case Node.ELEMENT_NODE: {
@@ -176,7 +176,7 @@ class K {
176
176
  return console.error("Child node offset is out of range"), null;
177
177
  let o = 0;
178
178
  for (let r = 0; r < n; r++)
179
- o += Ze(e.childNodes[r]);
179
+ o += Ve(e.childNodes[r]);
180
180
  return new K(e, o);
181
181
  }
182
182
  default:
@@ -188,22 +188,22 @@ class K {
188
188
  throw new Error("Parent is not an ancestor of current element");
189
189
  let n = this.element, o = this.offset;
190
190
  for (; n !== e; )
191
- o += Ge(n), n.parentElement && (n = n.parentElement);
191
+ o += je(n), n.parentElement && (n = n.parentElement);
192
192
  return new K(n, o);
193
193
  }
194
194
  }
195
- const Ot = (t) => {
195
+ const wt = (t) => {
196
196
  const e = t.nodeName.toLowerCase();
197
197
  return e === "#text" ? "text()" : e;
198
198
  };
199
- function Lt(t) {
199
+ function Ot(t) {
200
200
  let e = 0, n = t;
201
201
  for (; n; )
202
202
  n.nodeName === t.nodeName && (e += 1), n = n.previousSibling;
203
203
  return e;
204
204
  }
205
- const At = (t) => {
206
- const e = Ot(t), n = Lt(t);
205
+ const Lt = (t) => {
206
+ const e = wt(t), n = Ot(t);
207
207
  return `${e}[${n}]`;
208
208
  }, He = (t, e) => {
209
209
  let n = "", o = t;
@@ -212,10 +212,10 @@ const At = (t) => {
212
212
  console.error("Node is not a descendant of root");
213
213
  return;
214
214
  }
215
- n = `${At(o)}/${n}`, o = o.parentNode;
215
+ n = `${Lt(o)}/${n}`, o = o.parentNode;
216
216
  }
217
217
  return n = `/${n}`, n = n.replace(/\/$/, ""), n;
218
- }, Dt = (t, e, n) => {
218
+ }, At = (t, e, n) => {
219
219
  const o = e.toUpperCase();
220
220
  let r = -1;
221
221
  for (let i = 0; i < t.children.length; i++) {
@@ -224,7 +224,7 @@ const At = (t) => {
224
224
  return l;
225
225
  }
226
226
  return null;
227
- }, Pt = (t, e) => {
227
+ }, Dt = (t, e) => {
228
228
  if (!(t.match(/^(\/[A-Za-z0-9-]+(\[[0-9]+])?)+$/) !== null))
229
229
  return console.error("Expression is not a simple XPath"), null;
230
230
  const o = t.split("/");
@@ -232,15 +232,15 @@ const At = (t) => {
232
232
  o.shift();
233
233
  for (const i of o) {
234
234
  let l, a;
235
- const m = i.indexOf("[");
236
- if (m !== -1) {
237
- l = i.slice(0, m);
238
- const y = i.slice(m + 1, i.indexOf("]"));
235
+ const f = i.indexOf("[");
236
+ if (f !== -1) {
237
+ l = i.slice(0, f);
238
+ const y = i.slice(f + 1, i.indexOf("]"));
239
239
  if (a = Number.parseInt(y, 10) - 1, a < 0)
240
240
  return null;
241
241
  } else
242
242
  l = i, a = 0;
243
- const c = Dt(r, l, a);
243
+ const c = At(r, l, a);
244
244
  if (!c)
245
245
  return null;
246
246
  r = c;
@@ -248,7 +248,7 @@ const At = (t) => {
248
248
  return r;
249
249
  }, Ue = (t, e = document.body) => {
250
250
  try {
251
- return Pt(t, e);
251
+ return Dt(t, e);
252
252
  } catch {
253
253
  return document.evaluate(`.${t}`, e, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
254
254
  }
@@ -311,7 +311,7 @@ class le {
311
311
  return se.fromOffsets(this.root, this.start, this.end).toRange();
312
312
  }
313
313
  }
314
- const Ze = (t) => {
314
+ const Ve = (t) => {
315
315
  var e;
316
316
  switch (t.nodeType) {
317
317
  case Node.ELEMENT_NODE:
@@ -320,12 +320,12 @@ const Ze = (t) => {
320
320
  default:
321
321
  return 0;
322
322
  }
323
- }, Ge = (t) => {
323
+ }, je = (t) => {
324
324
  let e = t.previousSibling, n = 0;
325
325
  for (; e; )
326
- n += Ze(e), e = e.previousSibling;
326
+ n += Ve(e), e = e.previousSibling;
327
327
  return n;
328
- }, Je = (t, ...e) => {
328
+ }, Ze = (t, ...e) => {
329
329
  let n = e.shift();
330
330
  const o = t.ownerDocument.createNodeIterator(t, NodeFilter.SHOW_TEXT), r = [];
331
331
  let i = o.nextNode(), l = null, a = 0;
@@ -334,28 +334,28 @@ const Ze = (t) => {
334
334
  for (; n !== void 0 && l && a === n; )
335
335
  r.push({ node: l, offset: l.data.length }), n = e.shift();
336
336
  return n !== void 0 && console.error("Offset exceeds text length"), r;
337
- }, _t = (t, e, n, o) => {
337
+ }, Pt = (t, e, n, o) => {
338
338
  const r = n - e;
339
339
  return Math.abs(r - o) <= 5 ? le.fromSelector(t, {
340
340
  start: e,
341
341
  end: n
342
342
  }) : null;
343
- }, Ft = (t, e, n, o) => {
344
- const r = new gt();
343
+ }, _t = (t, e, n, o) => {
344
+ const r = new mt();
345
345
  r.Match_Distance = 5e3;
346
346
  const i = t.textContent;
347
347
  if (!i)
348
348
  return null;
349
349
  if (e.length > 32) {
350
- const l = e.slice(0, 32), a = e.slice(-32), m = o - n;
350
+ const l = e.slice(0, 32), a = e.slice(-32), f = o - n;
351
351
  let c = r.match_main(i, l, n);
352
352
  const y = r.match_main(i, a, o), d = y + a.length;
353
353
  if (c === -1 || y === -1)
354
354
  return null;
355
- const h = d - c, b = Math.abs(h - m);
356
- if ((c > d || b > 5) && (r.Match_Distance = e.length + 100, c = r.match_main(i, l, d), c !== -1 && c < d))
357
- return _t(t, c, d, m);
358
- if (c < d && b <= 5)
355
+ const h = d - c, N = Math.abs(h - f);
356
+ if ((c > d || N > 5) && (r.Match_Distance = e.length + 100, c = r.match_main(i, l, d), c !== -1 && c < d))
357
+ return Pt(t, c, d, f);
358
+ if (c < d && N <= 5)
359
359
  return le.fromSelector(t, {
360
360
  start: c,
361
361
  end: d
@@ -369,21 +369,21 @@ const Ze = (t) => {
369
369
  });
370
370
  }
371
371
  return null;
372
- }, Mt = (t, e) => {
372
+ }, Ft = (t, e) => {
373
373
  if (!e) return null;
374
374
  const { highlightData: n } = t, { textPosition: o, selectedText: r } = n;
375
- return Ft(
375
+ return _t(
376
376
  e,
377
377
  r,
378
378
  (o == null ? void 0 : o.start) ?? 0,
379
379
  (o == null ? void 0 : o.end) ?? 0
380
380
  );
381
- }, Bt = (t, e, n) => {
381
+ }, Mt = (t, e, n) => {
382
382
  const o = [], r = [];
383
383
  for (const i of e) {
384
- const l = Mt(i, t);
384
+ const l = Ft(i, t);
385
385
  if (l) {
386
- const a = l.toRange(), m = a && ae.fromRange(t, a), c = (a == null ? void 0 : a.toString().trim()) || i.highlightData.selectedText;
386
+ const a = l.toRange(), f = a && ae.fromRange(t, a), c = (a == null ? void 0 : a.toString().trim()) || i.highlightData.selectedText;
387
387
  o.push({
388
388
  id: i.id,
389
389
  reaction: i.reaction,
@@ -392,7 +392,7 @@ const Ze = (t) => {
392
392
  ...i.highlightData,
393
393
  selectedText: c,
394
394
  hasNoHighlightAnymore: !1,
395
- range: (m == null ? void 0 : m.toSelector()) ?? null,
395
+ range: (f == null ? void 0 : f.toSelector()) ?? null,
396
396
  textPosition: l.toSelector(),
397
397
  pageLastModifiedAt: n
398
398
  }
@@ -410,12 +410,12 @@ const Ze = (t) => {
410
410
  }) : r.push(i.id);
411
411
  }
412
412
  return { notesForUpdate: o, noteIdsForDelete: r };
413
- }, je = (t, e) => {
413
+ }, Ge = (t, e) => {
414
414
  var l;
415
415
  if (!e) return;
416
416
  const { highlightData: n, id: o } = t, { range: r } = n ?? {};
417
- r && ((l = ae.fromSelector(e, r)) == null ? void 0 : l.toRange()) && Yt({ id: o });
418
- }, $t = (t) => {
417
+ r && ((l = ae.fromSelector(e, r)) == null ? void 0 : l.toRange()) && Qt({ id: o });
418
+ }, Bt = (t) => {
419
419
  const n = document.querySelector(
420
420
  `[data-highlight-id="${CSS.escape(t)}"].highlight-content`
421
421
  ) ?? document.getElementById(Ie(t));
@@ -423,50 +423,50 @@ const Ze = (t) => {
423
423
  const o = n.getBoundingClientRect();
424
424
  o.top >= 0 && o.bottom <= (window.innerHeight || document.documentElement.clientHeight) || n.scrollIntoView({ behavior: "smooth", block: "center" });
425
425
  }
426
- }, ye = 90, Ne = 172, Ht = (t) => {
426
+ }, ye = 90, be = 172, $t = (t) => {
427
427
  const e = t.getClientRects();
428
428
  if (!e.length)
429
429
  return null;
430
- const n = e[0], o = e[e.length - 1], r = 4, i = 16, l = window.innerWidth || document.documentElement.clientWidth, a = window.innerHeight || document.documentElement.clientHeight, m = (p) => {
431
- const E = p + Ne;
430
+ const n = e[0], o = e[e.length - 1], r = 4, i = 16, l = window.innerWidth || document.documentElement.clientWidth, a = window.innerHeight || document.documentElement.clientHeight, f = (p) => {
431
+ const E = p + be;
432
432
  return p >= i && E <= l - i;
433
433
  }, c = (p) => {
434
434
  const E = p + ye;
435
435
  return p >= i && E <= a - i;
436
436
  };
437
437
  let y;
438
- const d = n.right - Ne;
439
- if (m(d))
438
+ const d = n.right - be;
439
+ if (f(d))
440
440
  y = d;
441
441
  else {
442
442
  const p = n.left;
443
- if (m(p))
443
+ if (f(p))
444
444
  y = p;
445
445
  else {
446
- const g = (n.left + n.right) / 2 - Ne / 2;
447
- m(g) ? y = g : d < i ? y = i : y = l - Ne - i;
446
+ const g = (n.left + n.right) / 2 - be / 2;
447
+ f(g) ? y = g : d < i ? y = i : y = l - be - i;
448
448
  }
449
449
  }
450
450
  let h;
451
- const b = o.bottom + r;
452
- if (c(b))
453
- h = b;
451
+ const N = o.bottom + r;
452
+ if (c(N))
453
+ h = N;
454
454
  else {
455
455
  const p = n.top - ye - r;
456
- c(p) ? h = p : b + ye > a - i ? h = a - ye - i : h = i;
456
+ c(p) ? h = p : N + ye > a - i ? h = a - ye - i : h = i;
457
457
  }
458
458
  return { top: h, left: y };
459
- }, Ut = (t, e) => {
459
+ }, Ht = (t, e) => {
460
460
  for (const n of e)
461
461
  if (t.start < n.end && t.end > n.start)
462
462
  return !0;
463
463
  return !1;
464
- }, _e = (t) => `highlight-wrapper-${t}`, Ie = (t) => `${_e(t)}-start`, et = (t) => `${_e(t)}-end`, ge = (t) => `[data-highlight-id="${CSS.escape(t)}"]`, Gt = "2px", jt = "3px", Wt = "1px", tt = "3px", zt = "1px", nt = "Notebook note", Fe = (t, e) => {
464
+ }, _e = (t) => `highlight-wrapper-${t}`, Ie = (t) => `${_e(t)}-start`, Je = (t) => `${_e(t)}-end`, ge = (t) => `[data-highlight-id="${CSS.escape(t)}"]`, Ut = "2px", jt = "3px", Gt = "1px", et = "3px", Wt = "1px", tt = "Notebook note", Fe = (t, e) => {
465
465
  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);
466
466
  return `rgba(${n}, ${o}, ${r}, ${e})`;
467
- }, ot = (t, e, n, o, r) => {
468
- t.style.backgroundColor = n, t.style.textDecorationColor = o, t.style.textDecorationStyle = r, e ? (t.dataset.selected = "true", t.style.outline = `${Wt} ${r} ${o}`, t.style.outlineOffset = zt, t.style.borderRadius = tt, t.style.fontWeight = "bold") : (t.removeAttribute("data-selected"), t.style.outline = "", t.style.outlineOffset = "", t.style.borderRadius = "", t.style.fontWeight = "");
469
- }, qt = (t, e) => {
467
+ }, nt = (t, e, n, o, r) => {
468
+ t.style.backgroundColor = n, t.style.textDecorationColor = o, t.style.textDecorationStyle = r, e ? (t.dataset.selected = "true", t.style.outline = `${Gt} ${r} ${o}`, t.style.outlineOffset = Wt, t.style.borderRadius = et, t.style.fontWeight = "bold") : (t.removeAttribute("data-selected"), t.style.outline = "", t.style.outlineOffset = "", t.style.borderRadius = "", t.style.fontWeight = "");
469
+ }, zt = (t, e) => {
470
470
  var n;
471
471
  try {
472
472
  const o = ((n = e.nodeValue) == null ? void 0 : n.length) ?? e.childNodes.length;
@@ -474,7 +474,7 @@ const Ze = (t) => {
474
474
  } catch {
475
475
  return !1;
476
476
  }
477
- }, Kt = (t) => {
477
+ }, qt = (t) => {
478
478
  var i;
479
479
  if (t.collapsed)
480
480
  return [];
@@ -484,7 +484,7 @@ const Ze = (t) => {
484
484
  const n = [], o = (i = e == null ? void 0 : e.ownerDocument) == null ? void 0 : i.createNodeIterator(e, NodeFilter.SHOW_TEXT);
485
485
  let r = (o == null ? void 0 : o.nextNode()) || null;
486
486
  for (; r; ) {
487
- if (!qt(t, r)) {
487
+ if (!zt(t, r)) {
488
488
  r = (o == null ? void 0 : o.nextNode()) || null;
489
489
  continue;
490
490
  }
@@ -496,51 +496,51 @@ const Ze = (t) => {
496
496
  l === t.endContainer && t.endOffset < l.data.length && l.splitText(t.endOffset), n.push(l), r = (o == null ? void 0 : o.nextNode()) || null;
497
497
  }
498
498
  return n;
499
- }, Xt = (t, e, n) => {
499
+ }, Kt = (t, e, n) => {
500
500
  if (t.collapsed) return;
501
501
  const o = e.id ?? "", r = _e(o);
502
502
  if (document.getElementById(Ie(o))) {
503
- Qt(e, n);
503
+ Xt(e, n);
504
504
  return;
505
505
  }
506
- const l = e.type === R.IMPORTANT ? n.colors.importantBackground : n.colors.confusingBackground, a = e.id === e.selectedNoteId, m = a ? l : Fe(l, 0.5), c = e.type === R.IMPORTANT ? n.colors.importantUnderline : n.colors.confusingUnderline, y = e.type === R.IMPORTANT ? "solid" : "dashed", d = document.createElement("span");
506
+ const l = e.type === k.IMPORTANT ? n.colors.importantBackground : n.colors.confusingBackground, a = e.id === e.selectedNoteId, f = a ? l : Fe(l, 0.5), c = e.type === k.IMPORTANT ? n.colors.importantUnderline : n.colors.confusingUnderline, y = e.type === k.IMPORTANT ? "solid" : "dashed", d = document.createElement("span");
507
507
  d.id = `${r}-start`, d.className = "highlight-marker-start", d.dataset.highlightId = o || "";
508
- const h = e.labelPrefix ?? nt;
508
+ const h = e.labelPrefix ?? tt;
509
509
  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";
510
- const b = document.createElement("span");
511
- b.id = et(o), b.className = "highlight-marker-end", b.dataset.highlightId = o || "";
510
+ const N = document.createElement("span");
511
+ N.id = Je(o), N.className = "highlight-marker-end", N.dataset.highlightId = o || "";
512
512
  const p = t.cloneRange();
513
- p.collapse(!1), p.insertNode(b);
513
+ p.collapse(!1), p.insertNode(N);
514
514
  const E = t.cloneRange();
515
515
  E.collapse(!0), E.insertNode(d);
516
516
  const g = document.createRange();
517
- g.setStartAfter(d), g.setEndBefore(b);
518
- const W = Kt(g).filter((N) => N.textContent && N.textContent.length > 0);
519
- W.forEach((N, C) => {
520
- var M;
521
- const D = N.parentElement;
522
- if ((D == null ? void 0 : D.dataset.highlightId) === o) return;
523
- const H = C === 0, P = C === W.length - 1, T = W.length === 1;
517
+ g.setStartAfter(d), g.setEndBefore(N);
518
+ const G = qt(g).filter((b) => b.textContent && b.textContent.length > 0);
519
+ G.forEach((b, C) => {
520
+ var F;
521
+ const A = b.parentElement;
522
+ if ((A == null ? void 0 : A.dataset.highlightId) === o) return;
523
+ const $ = C === 0, D = C === G.length - 1, T = G.length === 1;
524
524
  let O;
525
- T ? O = "single" : H ? O = "first" : P ? O = "last" : O = "middle";
525
+ T ? O = "single" : $ ? O = "first" : D ? O = "last" : O = "middle";
526
526
  const x = document.createElement("span");
527
- x.className = "highlight-content", x.dataset.highlightId = o || "", x.dataset.position = O, x.style.textDecorationLine = "underline", x.style.textDecorationThickness = n.borderWidthSmall, x.style.textUnderlineOffset = n.underlineOffset, x.style.cursor = "pointer", ot(x, a, m, c, y), x.addEventListener("click", (V) => {
527
+ x.className = "highlight-content", x.dataset.highlightId = o || "", x.dataset.position = O, x.style.textDecorationLine = "underline", x.style.textDecorationThickness = n.borderWidthSmall, x.style.textUnderlineOffset = n.underlineOffset, x.style.cursor = "pointer", nt(x, a, f, c, y), x.addEventListener("click", (V) => {
528
528
  var Z;
529
529
  V.target.tagName !== "A" && ((Z = e.onClick) == null || Z.call(e));
530
- }), (M = N.parentNode) == null || M.insertBefore(x, N), x.appendChild(N);
531
- }), d.addEventListener("click", (N) => {
530
+ }), (F = b.parentNode) == null || F.insertBefore(x, b), x.appendChild(b);
531
+ }), d.addEventListener("click", (b) => {
532
532
  var C;
533
- N.target.tagName !== "A" && ((C = e.onClick) == null || C.call(e));
534
- }), d.addEventListener("keydown", (N) => {
533
+ b.target.tagName !== "A" && ((C = e.onClick) == null || C.call(e));
534
+ }), d.addEventListener("keydown", (b) => {
535
535
  var C;
536
- if (N.key === "Enter" || N.key === " ")
537
- N.preventDefault(), (C = e.onClick) == null || C.call(e);
538
- else if (N.key === "Tab" && !N.shiftKey) {
539
- const D = document.querySelectorAll(ge(o));
540
- for (const H of D) {
541
- const P = H.querySelector("a");
542
- if (P) {
543
- N.preventDefault(), P.focus();
536
+ if (b.key === "Enter" || b.key === " ")
537
+ b.preventDefault(), (C = e.onClick) == null || C.call(e);
538
+ else if (b.key === "Tab" && !b.shiftKey) {
539
+ const A = document.querySelectorAll(ge(o));
540
+ for (const $ of A) {
541
+ const D = $.querySelector("a");
542
+ if (D) {
543
+ b.preventDefault(), D.focus();
544
544
  break;
545
545
  }
546
546
  }
@@ -549,30 +549,30 @@ const Ze = (t) => {
549
549
  document.querySelectorAll(
550
550
  `.highlight-content${ge(o)}`
551
551
  ).forEach((C) => {
552
- C.style.boxShadow = `0 0 0 ${Gt} ${n.colors.focusOutline}`, C.style.borderRadius = jt;
552
+ C.style.boxShadow = `0 0 0 ${Ut} ${n.colors.focusOutline}`, C.style.borderRadius = jt;
553
553
  });
554
554
  }), d.addEventListener("blur", () => {
555
555
  document.querySelectorAll(
556
556
  `.highlight-content${ge(o)}`
557
557
  ).forEach((C) => {
558
- C.style.boxShadow = "", C.style.borderRadius = C.dataset.selected ? tt : "";
558
+ C.style.boxShadow = "", C.style.borderRadius = C.dataset.selected ? et : "";
559
559
  });
560
560
  });
561
561
  };
562
- function Qt(t, e) {
563
- const n = t.type === R.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, o = t.id === t.selectedNoteId, r = o ? n : Fe(n, 0.5), i = t.type === R.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline, l = t.type === R.IMPORTANT ? "solid" : "dashed";
562
+ function Xt(t, e) {
563
+ const n = t.type === k.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, o = t.id === t.selectedNoteId, r = o ? n : Fe(n, 0.5), i = t.type === k.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline, l = t.type === k.IMPORTANT ? "solid" : "dashed";
564
564
  document.querySelectorAll(
565
565
  `.highlight-content${ge(t.id ?? "")}`
566
566
  ).forEach((c) => {
567
- ot(c, o, r, i, l);
567
+ nt(c, o, r, i, l);
568
568
  });
569
- const m = document.getElementById(
569
+ const f = document.getElementById(
570
570
  Ie(t.id ?? "")
571
571
  );
572
- m && (m.setAttribute("aria-label", t.labelPrefix ?? nt), m.setAttribute("aria-expanded", String(o && !!t.isTrayOpen)), o ? m.setAttribute("aria-current", "true") : m.removeAttribute("aria-current"));
572
+ f && (f.setAttribute("aria-label", t.labelPrefix ?? tt), f.setAttribute("aria-expanded", String(o && !!t.isTrayOpen)), o ? f.setAttribute("aria-current", "true") : f.removeAttribute("aria-current"));
573
573
  }
574
- const Yt = (t) => {
575
- const e = t.id ?? "", n = document.getElementById(Ie(e)), o = document.getElementById(et(e));
574
+ const Qt = (t) => {
575
+ const e = t.id ?? "", n = document.getElementById(Ie(e)), o = document.getElementById(Je(e));
576
576
  document.querySelectorAll(
577
577
  ge(e)
578
578
  ).forEach((i) => {
@@ -585,7 +585,7 @@ const Yt = (t) => {
585
585
  all: ["notebook"],
586
586
  notes: (t) => ["notebook", "notes", t]
587
587
  };
588
- function Vt(t) {
588
+ function Yt(t) {
589
589
  const e = we();
590
590
  return Oe({
591
591
  mutationFn: (n) => t.createNote(n),
@@ -594,7 +594,7 @@ function Vt(t) {
594
594
  }
595
595
  });
596
596
  }
597
- function Zt(t) {
597
+ function Vt(t) {
598
598
  const e = we();
599
599
  return Oe({
600
600
  mutationFn: (n) => t.deleteNote(n),
@@ -603,26 +603,26 @@ function Zt(t) {
603
603
  }
604
604
  });
605
605
  }
606
- function rt({
606
+ function ot({
607
607
  api: t,
608
608
  enabled: e = !0,
609
609
  ...n
610
610
  }) {
611
- return ht({
611
+ return gt({
612
612
  queryKey: fe.notes(n),
613
613
  queryFn: () => t.getNotes(n),
614
614
  enabled: e
615
615
  });
616
616
  }
617
- const Jt = 100;
618
- function st({
617
+ const Zt = 100;
618
+ function rt({
619
619
  api: t,
620
620
  courseId: e,
621
621
  learningObject: n,
622
622
  reactions: o,
623
623
  enabled: r = !0
624
624
  }) {
625
- return rt({
625
+ return ot({
626
626
  api: t,
627
627
  filter: {
628
628
  ...e ? { courseId: e } : {},
@@ -630,11 +630,11 @@ function st({
630
630
  ...o != null && o.length ? { reactions: o } : {}
631
631
  },
632
632
  offset: 0,
633
- pageSize: Jt,
633
+ pageSize: Zt,
634
634
  enabled: r
635
635
  });
636
636
  }
637
- function en(t) {
637
+ function Jt(t) {
638
638
  const e = we();
639
639
  return Oe({
640
640
  mutationFn: ({ id: n, input: o }) => t.updateNote(n, o),
@@ -642,10 +642,10 @@ function en(t) {
642
642
  await e.cancelQueries({ queryKey: fe.all });
643
643
  const i = e.getQueryCache().findAll({ queryKey: fe.all }), l = /* @__PURE__ */ new Map();
644
644
  for (const a of i) {
645
- const m = a.state.data;
646
- m && (l.set(a.queryKey, m), e.setQueryData(a.queryKey, {
647
- ...m,
648
- notes: m.notes.map(
645
+ const f = a.state.data;
646
+ f && (l.set(a.queryKey, f), e.setQueryData(a.queryKey, {
647
+ ...f,
648
+ notes: f.notes.map(
649
649
  (c) => c.id === n ? { ...c, ...o, updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : c
650
650
  )
651
651
  }));
@@ -662,74 +662,75 @@ function en(t) {
662
662
  }
663
663
  });
664
664
  }
665
- const tn = "Notebook", nn = "Notes", on = "Important", rn = "Unclear", sn = "Back", ln = "Edit note", an = "Save", cn = "Cancel", dn = "Delete note", un = "Delete note confirmation", fn = "note", mn = "Add note (optional)", gn = "Remove from Notebook", hn = "Add a note (optional)", pn = "Mark important", yn = "Mark unclear", Nn = "Saved to Notebook.", bn = "Note updated", En = "Note deleted", Tn = "Error saving to Notebook.", Sn = "Error updating note", vn = "Note deletion failed", In = "Loading notes", Cn = "Failed to load notes", xn = "Start capturing your notes", kn = "Your notes from learning materials will appear here. Highlight key ideas, reflections, or questions as you learn—they'll all be saved in your Notebook for easy review later.", Rn = "Nothing here yet", wn = "Adjust your filters or create a new note to get started.", On = "You have no notes for the selected filter", Ln = "Filter", An = "Previous page", Dn = "Next page", Pn = "All courses", _n = "All notes", Fn = "Close Notebook panel", Mn = "To use the Notebook feature, highlight an excerpt from your learning material to flag it as 'confusing' or 'important' and leave an optional note.", Bn = "The content you highlighted is no longer available.", $n = "Notebook note", Me = {
666
- notebook: tn,
667
- notes: nn,
668
- important: on,
669
- unclear: rn,
670
- back: sn,
671
- editNote: ln,
672
- save: an,
673
- cancel: cn,
674
- deleteNote: dn,
675
- deleteNoteConfirmation: un,
676
- note: fn,
677
- addNotePrompt: mn,
678
- removeFromNotebook: gn,
679
- addNoteOptional: hn,
680
- markImportant: pn,
681
- markUnclear: yn,
682
- savedToNotebook: Nn,
665
+ const en = "Notebook", tn = "Notes", nn = "Important", on = "Unclear", rn = "Back", sn = "Edit note", ln = "Save", an = "Cancel", cn = "Delete note", dn = "Delete note confirmation", un = "note", fn = "Add note (optional)", mn = "Remove from Notebook", gn = "Add a note (optional)", hn = "Mark important", pn = "Mark unclear", yn = "Saved to Notebook.", bn = "Note updated", Nn = "Note deleted", En = "Error saving to Notebook.", Tn = "Error updating note", Sn = "Note deletion failed", vn = "Loading notes", In = "Failed to load notes", Cn = "Start capturing your notes", xn = "Your notes from learning materials will appear here. Highlight key ideas, reflections, or questions as you learn—they'll all be saved in your Notebook for easy review later.", Rn = "Nothing here yet", kn = "Adjust your filters or create a new note to get started.", wn = "You have no notes for the selected filter", On = "Filter", Ln = "Previous page", An = "Next page", Dn = "All courses", Pn = "All notes", _n = "Close Notebook panel", Fn = "To use the Notebook feature, highlight an excerpt from your learning material to flag it as 'confusing' or 'important' and leave an optional note.", Mn = "The content you highlighted is no longer available.", Bn = "Notebook note", Me = {
666
+ notebook: en,
667
+ notes: tn,
668
+ important: nn,
669
+ unclear: on,
670
+ back: rn,
671
+ editNote: sn,
672
+ save: ln,
673
+ cancel: an,
674
+ deleteNote: cn,
675
+ deleteNoteConfirmation: dn,
676
+ note: un,
677
+ addNotePrompt: fn,
678
+ removeFromNotebook: mn,
679
+ addNoteOptional: gn,
680
+ markImportant: hn,
681
+ markUnclear: pn,
682
+ savedToNotebook: yn,
683
683
  noteUpdated: bn,
684
- noteDeleted: En,
685
- errorSavingNote: Tn,
686
- errorUpdatingNote: Sn,
687
- noteDeletionFailed: vn,
688
- loadingNotes: In,
689
- failedToLoadNotes: Cn,
690
- emptyStateHeading: xn,
691
- emptyStateDescription: kn,
684
+ noteDeleted: Nn,
685
+ errorSavingNote: En,
686
+ errorUpdatingNote: Tn,
687
+ noteDeletionFailed: Sn,
688
+ loadingNotes: vn,
689
+ failedToLoadNotes: In,
690
+ emptyStateHeading: Cn,
691
+ emptyStateDescription: xn,
692
692
  nothingHereYet: Rn,
693
- adjustFiltersOrCreate: wn,
694
- noNotesForFilter: On,
695
- filter: Ln,
696
- previousPage: An,
697
- nextPage: Dn,
698
- allCourses: Pn,
699
- allNotes: _n,
700
- closeNotebookPanel: Fn,
701
- featureDescription: Mn,
702
- highlightUnavailable: Bn,
703
- notebookNote: $n
704
- }, it = Ke(null);
705
- function lt(t, e) {
693
+ adjustFiltersOrCreate: kn,
694
+ noNotesForFilter: wn,
695
+ filter: On,
696
+ previousPage: Ln,
697
+ nextPage: An,
698
+ allCourses: Dn,
699
+ allNotes: Pn,
700
+ closeNotebookPanel: _n,
701
+ featureDescription: Fn,
702
+ highlightUnavailable: Mn,
703
+ notebookNote: Bn
704
+ }, st = qe(null);
705
+ function it(t, e) {
706
706
  const n = Me[t] ?? t;
707
707
  return e ? n.replace(/%\{([^}]+)}/g, (o, r) => String(e[r] ?? `%{${r}}`)) : n;
708
708
  }
709
- function Hn({
709
+ function $n({
710
710
  translations: t,
711
711
  translate: e,
712
712
  children: n
713
713
  }) {
714
- const o = he(
715
- () => ({
716
- translations: { ...Me, ...t },
717
- translate: e ?? lt
714
+ const o = he(() => ({
715
+ translations: new Proxy(Me, {
716
+ get(i, l) {
717
+ return (t == null ? void 0 : t[l]) ?? i[l];
718
+ }
718
719
  }),
719
- [t, e]
720
- );
721
- return /* @__PURE__ */ s(it.Provider, { value: o, children: n });
720
+ translate: e ?? it
721
+ }), [t, e]);
722
+ return /* @__PURE__ */ s(st.Provider, { value: o, children: n });
722
723
  }
723
724
  function ee() {
724
- const t = Xe(it);
725
- return t || { translations: Me, translate: lt };
725
+ const t = Ke(st);
726
+ return t || { translations: Me, translate: it };
726
727
  }
727
- const Un = (t) => ({
728
+ const Hn = (t) => ({
728
729
  selectedNoteId: t ?? null,
729
730
  isNoteEditing: !1,
730
731
  isTrayOpen: t != null
731
732
  });
732
- function Gn(t, e) {
733
+ function Un(t, e) {
733
734
  switch (e.type) {
734
735
  case "SELECT_NOTE":
735
736
  return {
@@ -749,8 +750,8 @@ function Gn(t, e) {
749
750
  return t;
750
751
  }
751
752
  }
752
- const at = Ke(null);
753
- function Eo({
753
+ const lt = qe(null);
754
+ function No({
754
755
  api: t,
755
756
  currentUserId: e,
756
757
  objectId: n,
@@ -759,11 +760,11 @@ function Eo({
759
760
  pageLastModifiedAt: i,
760
761
  onOpen: l,
761
762
  initialNoteId: a,
762
- translations: m,
763
+ translations: f,
763
764
  translate: c,
764
765
  children: y
765
766
  }) {
766
- const [d, h] = Qe(Gn, Un(a)), b = $(a != null), p = he(
767
+ const [d, h] = Xe(Un, Hn(a)), N = B(a != null), p = he(
767
768
  () => ({
768
769
  api: t,
769
770
  currentUserId: e,
@@ -776,37 +777,37 @@ function Eo({
776
777
  clearSelectedNote: () => h({ type: "CLEAR_SELECTED_NOTE" }),
777
778
  setEditing: (E) => h({ type: "SET_EDITING", payload: E }),
778
779
  openTray: () => {
779
- b.current || (b.current = !0, l == null || l()), h({ type: "OPEN_TRAY" });
780
+ N.current || (N.current = !0, l == null || l()), h({ type: "OPEN_TRAY" });
780
781
  },
781
782
  closeTray: () => {
782
- b.current = !1, h({ type: "CLOSE_TRAY" });
783
+ N.current = !1, h({ type: "CLOSE_TRAY" });
783
784
  }
784
785
  }),
785
786
  [t, e, n, o, r, i, l, d]
786
787
  );
787
- return /* @__PURE__ */ s(at.Provider, { value: p, children: /* @__PURE__ */ s(Hn, { translations: m, translate: c, children: y }) });
788
+ return /* @__PURE__ */ s(lt.Provider, { value: p, children: /* @__PURE__ */ s($n, { translations: f, translate: c, children: y }) });
788
789
  }
789
- function ct() {
790
- const t = Xe(at);
790
+ function at() {
791
+ const t = Ke(lt);
791
792
  if (!t)
792
793
  throw new Error("useNotebook must be used within a NotebookProvider");
793
794
  return t;
794
795
  }
795
- const dt = "notebook-tray-content", To = ({ children: t }) => {
796
- const { isTrayOpen: e, closeTray: n } = ct(), { translations: o } = ee();
796
+ const ct = "notebook-tray-content", Eo = ({ children: t }) => {
797
+ const { isTrayOpen: e, closeTray: n } = at(), { translations: o } = ee();
797
798
  return /* @__PURE__ */ s(
798
- yt,
799
+ pt,
799
800
  {
800
801
  label: o.notebook,
801
802
  open: e,
802
803
  onDismiss: n,
803
804
  placement: "end",
804
805
  size: "regular",
805
- children: /* @__PURE__ */ S(k, { direction: "column", height: "100vh", id: dt, children: [
806
- /* @__PURE__ */ s(k.Item, { children: /* @__PURE__ */ s(X, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ S(k, { justifyItems: "space-between", alignItems: "center", children: [
806
+ children: /* @__PURE__ */ S(R, { direction: "column", height: "100vh", id: ct, children: [
807
+ /* @__PURE__ */ s(R.Item, { children: /* @__PURE__ */ s(X, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ S(R, { justifyItems: "space-between", alignItems: "center", children: [
807
808
  /* @__PURE__ */ s(Se, { level: "h3", children: o.notebook }),
808
809
  /* @__PURE__ */ s(
809
- pt,
810
+ ht,
810
811
  {
811
812
  screenReaderLabel: o.closeNotebookPanel,
812
813
  onClick: n,
@@ -815,14 +816,14 @@ const dt = "notebook-tray-content", To = ({ children: t }) => {
815
816
  }
816
817
  )
817
818
  ] }) }) }),
818
- /* @__PURE__ */ s(k.Item, { shouldGrow: !0, shouldShrink: !0, overflowY: "auto", overflowX: "hidden", children: t })
819
+ /* @__PURE__ */ s(R.Item, { shouldGrow: !0, shouldShrink: !0, overflowY: "auto", overflowX: "hidden", children: t })
819
820
  ] })
820
821
  }
821
822
  );
822
823
  }, jn = ({ currentType: t, onSelectReaction: e }) => {
823
- const { translations: n } = ee(), o = $(null), r = $(null);
824
+ const { translations: n } = ee(), o = B(null), r = B(null);
824
825
  return z(() => {
825
- t === R.CONFUSING && o.current ? o.current.focus() : t === R.IMPORTANT && r.current ? r.current.focus() : o.current && o.current.focus();
826
+ t === k.CONFUSING && o.current ? o.current.focus() : t === k.IMPORTANT && r.current ? r.current.focus() : o.current && o.current.focus();
826
827
  }, [t]), /* @__PURE__ */ s(
827
828
  X,
828
829
  {
@@ -837,7 +838,7 @@ const dt = "notebook-tray-content", To = ({ children: t }) => {
837
838
  ue.Item,
838
839
  {
839
840
  ref: o,
840
- onClick: () => e(R.CONFUSING),
841
+ onClick: () => e(k.CONFUSING),
841
842
  children: [
842
843
  /* @__PURE__ */ s(Le, { size: "x-small" }),
843
844
  ` ${n.markUnclear}`
@@ -848,7 +849,7 @@ const dt = "notebook-tray-content", To = ({ children: t }) => {
848
849
  ue.Item,
849
850
  {
850
851
  ref: r,
851
- onClick: () => e(R.IMPORTANT),
852
+ onClick: () => e(k.IMPORTANT),
852
853
  children: [
853
854
  /* @__PURE__ */ s(Ae, { size: "x-small" }),
854
855
  ` ${n.markImportant}`
@@ -859,7 +860,7 @@ const dt = "notebook-tray-content", To = ({ children: t }) => {
859
860
  }
860
861
  );
861
862
  }, Ce = "notebook-inline-reaction-menu";
862
- function So({
863
+ function To({
863
864
  containerRef: t,
864
865
  highlightTheme: e,
865
866
  debounceTime: n = 500,
@@ -870,19 +871,19 @@ function So({
870
871
  }) {
871
872
  const {
872
873
  api: a,
873
- objectId: m,
874
+ objectId: f,
874
875
  objectType: c,
875
876
  courseId: y,
876
877
  pageLastModifiedAt: d,
877
878
  selectedNoteId: h,
878
- isTrayOpen: b,
879
+ isTrayOpen: N,
879
880
  selectNote: p,
880
881
  openTray: E
881
- } = ct(), { translations: g } = ee(), { data: Q } = st({
882
+ } = at(), { translations: g } = ee(), { data: Q } = rt({
882
883
  api: a,
883
884
  courseId: y,
884
- learningObject: { type: c, id: m }
885
- }), { mutate: W } = Vt(a), { mutateAsync: N } = en(a), { mutate: C } = Zt(a), D = $([]), [H, P] = j([]), [T, O] = j(null), [x, M] = j(""), [V, Z] = j(null), ce = $(null);
885
+ learningObject: { type: c, id: f }
886
+ }), { mutate: G } = Yt(a), { mutateAsync: b } = Jt(a), { mutate: C } = Vt(a), A = B([]), [$, D] = j([]), [T, O] = j(null), [x, F] = j(""), [V, Z] = j(null), ce = B(null);
886
887
  ce.current = V;
887
888
  const [J, de] = j(!1);
888
889
  z(() => {
@@ -893,99 +894,99 @@ function So({
893
894
  de(!0);
894
895
  return;
895
896
  }
896
- const F = new MutationObserver((A) => {
897
- for (const G of A)
898
- if (G.type === "attributes" && G.attributeName === "class" && G.target.classList.contains("enhanced")) {
899
- de(!0), F.disconnect();
897
+ const _ = new MutationObserver((L) => {
898
+ for (const U of L)
899
+ if (U.type === "attributes" && U.attributeName === "class" && U.target.classList.contains("enhanced")) {
900
+ de(!0), _.disconnect();
900
901
  return;
901
902
  }
902
903
  });
903
- return F.observe(I, { attributes: !0, attributeFilter: ["class"] }), () => F.disconnect();
904
+ return _.observe(I, { attributes: !0, attributeFilter: ["class"] }), () => _.disconnect();
904
905
  }, [t]);
905
906
  const Y = q(() => {
906
- Z(null), O(null), M("");
907
+ Z(null), O(null), F("");
907
908
  }, []);
908
909
  z(() => {
909
910
  if (!J || !t.current) return;
910
911
  let I = null;
911
- const F = () => {
912
+ const _ = () => {
912
913
  I && clearTimeout(I), I = setTimeout(() => {
913
914
  var ie;
914
- const v = window.getSelection(), B = t.current;
915
- if (!(v != null && v.rangeCount) || !B) return;
915
+ const v = window.getSelection(), M = t.current;
916
+ if (!(v != null && v.rangeCount) || !M) return;
916
917
  const ne = v.toString().trim();
917
918
  if (ne === "") return;
918
- const f = v.getRangeAt(0);
919
- if (!B.contains(f.commonAncestorContainer)) return;
920
- const L = (ie = le.fromRange(B, f)) == null ? void 0 : ie.toSelector();
921
- L && !Ut(L, H) && (O(f.cloneRange()), M(ne), Z(Ht(f)));
919
+ const m = v.getRangeAt(0);
920
+ if (!M.contains(m.commonAncestorContainer)) return;
921
+ const W = (ie = le.fromRange(M, m)) == null ? void 0 : ie.toSelector();
922
+ W && !Ht(W, $) && (O(m.cloneRange()), F(ne), Z($t(m)));
922
923
  }, n);
923
- }, A = (v) => {
924
+ }, L = (v) => {
924
925
  if (!(v.target instanceof Node)) return;
925
- const B = document.getElementById(Ce);
926
- B != null && B.contains(v.target) ? (v.preventDefault(), v.stopImmediatePropagation()) : Y();
927
- }, G = () => {
926
+ const M = document.getElementById(Ce);
927
+ M != null && M.contains(v.target) ? (v.preventDefault(), v.stopImmediatePropagation()) : Y();
928
+ }, U = () => {
928
929
  Y();
929
- }, _ = (v) => {
930
+ }, P = (v) => {
930
931
  v.key === "Escape" && ce.current !== null && (Y(), v.stopImmediatePropagation());
931
932
  };
932
- return document.addEventListener("selectionchange", F), document.addEventListener("mousedown", A), document.addEventListener("touchstart", A), document.addEventListener("keydown", _), window.addEventListener("scroll", G, !0), () => {
933
- I && clearTimeout(I), document.removeEventListener("selectionchange", F), document.removeEventListener("mousedown", A), document.removeEventListener("touchstart", A), document.removeEventListener("keydown", _), window.removeEventListener("scroll", G, !0);
933
+ return document.addEventListener("selectionchange", _), document.addEventListener("mousedown", L), document.addEventListener("touchstart", L), document.addEventListener("keydown", P), window.addEventListener("scroll", U, !0), () => {
934
+ I && clearTimeout(I), document.removeEventListener("selectionchange", _), document.removeEventListener("mousedown", L), document.removeEventListener("touchstart", L), document.removeEventListener("keydown", P), window.removeEventListener("scroll", U, !0);
934
935
  };
935
- }, [J, H, n, t, Y]);
936
+ }, [J, $, n, t, Y]);
936
937
  const te = q(
937
938
  (w) => {
938
- var B;
939
+ var M;
939
940
  const I = t.current;
940
941
  if (!I || !w.highlightData) return null;
941
- const { highlightData: F, reaction: A, id: G } = w, { range: _ } = F, v = _ && ((B = ae.fromSelector(I, _)) == null ? void 0 : B.toRange());
942
+ const { highlightData: _, reaction: L, id: U } = w, { range: P } = _, v = P && ((M = ae.fromSelector(I, P)) == null ? void 0 : M.toRange());
942
943
  if (v) {
943
- const ne = A[0] === R.IMPORTANT ? g.important : g.unclear, f = {
944
- id: G,
944
+ const ne = L[0] === k.IMPORTANT ? g.important : g.unclear, m = {
945
+ id: U,
945
946
  selectedNoteId: h,
946
- type: A[0],
947
- isTrayOpen: b,
947
+ type: L[0],
948
+ isTrayOpen: N,
948
949
  labelPrefix: `${g.notebookNote} (${ne})`,
949
- popupId: dt,
950
+ popupId: ct,
950
951
  onClick: () => {
951
- p(G), E();
952
+ p(U), E();
952
953
  }
953
954
  };
954
- return Xt(v, f, e), F.textPosition;
955
+ return Kt(v, m, e), _.textPosition;
955
956
  }
956
957
  return null;
957
958
  },
958
- [t, h, b, e, g, p, E]
959
+ [t, h, N, e, g, p, E]
959
960
  );
960
961
  z(() => {
961
962
  if (!J || !Q || !t.current) return;
962
- const w = t.current, I = Q.notes, F = /* @__PURE__ */ new Set(), A = [], G = [];
963
+ const w = t.current, I = Q.notes, _ = /* @__PURE__ */ new Set(), L = [], U = [];
963
964
  if (I.length === 0) {
964
- if (D.current.length > 0) {
965
- for (const _ of D.current)
966
- je(_, w);
967
- D.current = [], P([]);
965
+ if (A.current.length > 0) {
966
+ for (const P of A.current)
967
+ Ge(P, w);
968
+ A.current = [], D([]);
968
969
  }
969
970
  return;
970
971
  }
971
972
  if (d && I[0].highlightData.pageLastModifiedAt !== d) {
972
- const { notesForUpdate: _, noteIdsForDelete: v } = Bt(
973
+ const { notesForUpdate: P, noteIdsForDelete: v } = Mt(
973
974
  w,
974
975
  I,
975
976
  d
976
977
  );
977
- for (const B of _)
978
- N({ id: B.id, input: B }).catch((ne) => r == null ? void 0 : r(ne));
979
- for (const B of v)
980
- C(B, { onError: i });
978
+ for (const M of P)
979
+ b({ id: M.id, input: M }).catch((ne) => r == null ? void 0 : r(ne));
980
+ for (const M of v)
981
+ C(M, { onError: i });
981
982
  } else {
982
- for (const _ of I) {
983
- const v = te(_);
984
- F.add(_.id), v && (A.push(_), G.push(v));
983
+ for (const P of I) {
984
+ const v = te(P);
985
+ _.add(P.id), v && (L.push(P), U.push(v));
985
986
  }
986
- for (const _ of D.current)
987
- F.has(_.id) || je(_, w);
988
- P(G), D.current = A, h && $t(h);
987
+ for (const P of A.current)
988
+ _.has(P.id) || Ge(P, w);
989
+ D(U), A.current = L, h && Bt(h);
989
990
  }
990
991
  }, [
991
992
  J,
@@ -993,39 +994,39 @@ function So({
993
994
  te,
994
995
  d,
995
996
  t,
996
- N,
997
+ b,
997
998
  C,
998
999
  h
999
1000
  ]);
1000
- const U = (w) => {
1001
+ const H = (w) => {
1001
1002
  const I = t.current;
1002
1003
  if (!T || !I) return;
1003
- const F = ae.fromRange(I, T), A = le.fromRange(I, T);
1004
- W(
1004
+ const _ = ae.fromRange(I, T), L = le.fromRange(I, T);
1005
+ G(
1005
1006
  {
1006
1007
  courseId: y,
1007
- objectId: m,
1008
+ objectId: f,
1008
1009
  objectType: c,
1009
1010
  userText: "",
1010
1011
  reaction: [w],
1011
1012
  highlightData: {
1012
1013
  selectedText: x,
1013
- textPosition: (A == null ? void 0 : A.toSelector()) ?? null,
1014
- range: F.toSelector(),
1014
+ textPosition: (L == null ? void 0 : L.toSelector()) ?? null,
1015
+ range: _.toSelector(),
1015
1016
  pageLastModifiedAt: d ?? ""
1016
1017
  }
1017
1018
  },
1018
1019
  {
1019
- onSuccess: (G) => {
1020
+ onSuccess: (U) => {
1020
1021
  var v;
1021
- const _ = G.id;
1022
- Y(), (v = window.getSelection()) == null || v.removeAllRanges(), p(_), E(), l == null || l(G);
1022
+ const P = U.id;
1023
+ Y(), (v = window.getSelection()) == null || v.removeAllRanges(), p(P), E(), l == null || l(U);
1023
1024
  },
1024
1025
  onError: o
1025
1026
  }
1026
1027
  );
1027
1028
  };
1028
- return !T || !V ? null : mt(
1029
+ return !T || !V ? null : ft(
1029
1030
  /* @__PURE__ */ s(
1030
1031
  "div",
1031
1032
  {
@@ -1042,23 +1043,23 @@ function So({
1042
1043
  const I = document.getElementById(Ce);
1043
1044
  I != null && I.contains(w.relatedTarget) || Y();
1044
1045
  },
1045
- children: /* @__PURE__ */ s(jn, { onSelectReaction: U })
1046
+ children: /* @__PURE__ */ s(jn, { onSelectReaction: H })
1046
1047
  }
1047
1048
  ),
1048
1049
  document.body
1049
1050
  );
1050
1051
  }
1051
- const Wn = (t, e) => ({
1052
- backgroundColor: t === R.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
1053
- underlineColor: t === R.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
1054
- underlineStyle: t === R.IMPORTANT ? "solid" : "dashed"
1055
- }), Re = ({
1052
+ const Gn = (t, e) => ({
1053
+ backgroundColor: t === k.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
1054
+ underlineColor: t === k.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
1055
+ underlineStyle: t === k.IMPORTANT ? "solid" : "dashed"
1056
+ }), ke = ({
1056
1057
  children: t,
1057
- type: e = R.IMPORTANT,
1058
+ type: e = k.IMPORTANT,
1058
1059
  isCardActive: n = !0,
1059
1060
  theme: o
1060
1061
  }) => {
1061
- const r = Wn(e, o), l = {
1062
+ const r = Gn(e, o), l = {
1062
1063
  position: "relative",
1063
1064
  backgroundColor: n ? r.backgroundColor : Fe(r.backgroundColor, 0.5),
1064
1065
  textDecorationLine: "underline",
@@ -1069,47 +1070,47 @@ const Wn = (t, e) => ({
1069
1070
  lineHeight: "normal"
1070
1071
  };
1071
1072
  return /* @__PURE__ */ s("span", { "data-note-highlight": "true", style: l, children: t });
1072
- }, ut = () => {
1073
+ }, dt = () => {
1073
1074
  const { translations: t } = ee();
1074
- return /* @__PURE__ */ S(k, { gap: "xx-small", alignItems: "start", as: "div", children: [
1075
- /* @__PURE__ */ s(k.Item, { as: "div", children: /* @__PURE__ */ s(Nt, { color: "error" }) }),
1076
- /* @__PURE__ */ s(k.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ s(Ee, { maxLines: 3, children: t.highlightUnavailable }) })
1075
+ return /* @__PURE__ */ S(R, { gap: "xx-small", alignItems: "start", as: "div", children: [
1076
+ /* @__PURE__ */ s(R.Item, { as: "div", children: /* @__PURE__ */ s(yt, { color: "error" }) }),
1077
+ /* @__PURE__ */ s(R.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ s(Ee, { maxLines: 3, children: t.highlightUnavailable }) })
1077
1078
  ] });
1078
- }, zn = {
1079
+ }, Wn = {
1079
1080
  filter: null,
1080
1081
  courseFilter: null,
1081
1082
  currentPage: 1,
1082
1083
  totalPages: void 0
1083
1084
  };
1084
- function be(t, e) {
1085
+ function Ne(t, e) {
1085
1086
  const n = typeof e == "number" ? Math.min(e, t) : t;
1086
1087
  return Math.max(1, n);
1087
1088
  }
1088
- function qn(t, e) {
1089
+ function zn(t, e) {
1089
1090
  switch (e.type) {
1090
1091
  case "SET_FILTER":
1091
1092
  return { ...t, filter: e.payload, currentPage: 1 };
1092
1093
  case "SET_COURSE_FILTER":
1093
1094
  return { ...t, courseFilter: e.payload, currentPage: 1 };
1094
1095
  case "SET_PAGE":
1095
- return { ...t, currentPage: be(e.payload, t.totalPages) };
1096
+ return { ...t, currentPage: Ne(e.payload, t.totalPages) };
1096
1097
  case "FOCUS_PAGE":
1097
1098
  return { ...t, currentPage: Math.max(1, e.payload) };
1098
1099
  case "INCREMENT_PAGE":
1099
- return { ...t, currentPage: be(t.currentPage + 1, t.totalPages) };
1100
+ return { ...t, currentPage: Ne(t.currentPage + 1, t.totalPages) };
1100
1101
  case "DECREMENT_PAGE":
1101
- return { ...t, currentPage: be(t.currentPage - 1, t.totalPages) };
1102
+ return { ...t, currentPage: Ne(t.currentPage - 1, t.totalPages) };
1102
1103
  case "SET_TOTAL_PAGES":
1103
1104
  return t.totalPages === e.payload ? t : {
1104
1105
  ...t,
1105
1106
  totalPages: e.payload,
1106
- currentPage: be(t.currentPage, e.payload)
1107
+ currentPage: Ne(t.currentPage, e.payload)
1107
1108
  };
1108
1109
  default:
1109
1110
  return t;
1110
1111
  }
1111
1112
  }
1112
- function vo({
1113
+ function So({
1113
1114
  api: t,
1114
1115
  courseId: e,
1115
1116
  enableCourseFilter: n = !1,
@@ -1118,55 +1119,55 @@ function vo({
1118
1119
  focusNoteId: i
1119
1120
  }) {
1120
1121
  var te;
1121
- const [l, a] = Qe(qn, zn), { filter: m, courseFilter: c, currentPage: y, totalPages: d } = l;
1122
+ const [l, a] = Xe(zn, Wn), { filter: f, courseFilter: c, currentPage: y, totalPages: d } = l;
1122
1123
  z(() => {
1123
1124
  a({ type: "SET_PAGE", payload: 1 });
1124
1125
  }, [r]);
1125
- const h = n ? c : e, b = (y - 1) * r, p = !!o, E = {
1126
+ const h = n ? c : e, N = (y - 1) * r, p = !!o, E = {
1126
1127
  ...h ? { courseId: h } : {},
1127
- ...m ? { reactions: [m] } : {},
1128
+ ...f ? { reactions: [f] } : {},
1128
1129
  ...o ? { learningObject: o } : {}
1129
1130
  }, {
1130
1131
  data: g,
1131
1132
  isLoading: Q,
1132
- isError: W
1133
- } = rt({
1133
+ isError: G
1134
+ } = ot({
1134
1135
  api: t,
1135
1136
  filter: E,
1136
- offset: b,
1137
+ offset: N,
1137
1138
  pageSize: r,
1138
1139
  enabled: !p
1139
1140
  }), {
1140
- data: N,
1141
+ data: b,
1141
1142
  isLoading: C,
1142
- isError: D
1143
- } = st({
1143
+ isError: A
1144
+ } = rt({
1144
1145
  api: t,
1145
1146
  courseId: h ?? void 0,
1146
1147
  learningObject: o,
1147
1148
  enabled: p
1148
- }), H = he(() => {
1149
- const U = (N == null ? void 0 : N.notes) ?? [];
1150
- return m ? U.filter((w) => w.reaction.includes(m)) : U;
1151
- }, [N, m]), P = $(null);
1149
+ }), $ = he(() => {
1150
+ const H = (b == null ? void 0 : b.notes) ?? [];
1151
+ return f ? H.filter((w) => w.reaction.includes(f)) : H;
1152
+ }, [b, f]), D = B(null);
1152
1153
  z(() => {
1153
1154
  if (!i) {
1154
- P.current = null;
1155
+ D.current = null;
1155
1156
  return;
1156
1157
  }
1157
- if (P.current === i) return;
1158
- const U = H.findIndex((I) => I.id === i);
1159
- if (U === -1) return;
1160
- P.current = i;
1161
- const w = Math.floor(U / r) + 1;
1158
+ if (D.current === i) return;
1159
+ const H = $.findIndex((I) => I.id === i);
1160
+ if (H === -1) return;
1161
+ D.current = i;
1162
+ const w = Math.floor(H / r) + 1;
1162
1163
  w !== y && a({ type: "FOCUS_PAGE", payload: w });
1163
- }, [i, H, r, y]);
1164
- const T = p ? H.slice(b, b + r) : (g == null ? void 0 : g.notes) ?? [], O = p ? C : Q, x = p ? D : W, M = p ? Math.max(1, Math.ceil(H.length / r)) : ((te = g == null ? void 0 : g.pageInfo) == null ? void 0 : te.totalNrOfPages) ?? void 0, V = p ? { totalCount: H.length, totalNrOfPages: M } : g == null ? void 0 : g.pageInfo;
1164
+ }, [i, $, r, y]);
1165
+ const T = p ? $.slice(N, N + r) : (g == null ? void 0 : g.notes) ?? [], O = p ? C : Q, x = p ? A : G, F = p ? Math.max(1, Math.ceil($.length / r)) : ((te = g == null ? void 0 : g.pageInfo) == null ? void 0 : te.totalNrOfPages) ?? void 0, V = p ? { totalCount: $.length, totalNrOfPages: F } : g == null ? void 0 : g.pageInfo;
1165
1166
  z(() => {
1166
- a({ type: "SET_TOTAL_PAGES", payload: M });
1167
- }, [M]);
1168
- const Z = q((U) => {
1169
- a({ type: "SET_PAGE", payload: U });
1167
+ a({ type: "SET_TOTAL_PAGES", payload: F });
1168
+ }, [F]);
1169
+ const Z = q((H) => {
1170
+ a({ type: "SET_PAGE", payload: H });
1170
1171
  }, []), ce = q(() => {
1171
1172
  a({
1172
1173
  type: "INCREMENT_PAGE"
@@ -1177,17 +1178,17 @@ function vo({
1177
1178
  type: "DECREMENT_PAGE"
1178
1179
  /* DecrementPage */
1179
1180
  });
1180
- }, []), de = q((U) => {
1181
- a({ type: "SET_FILTER", payload: U });
1182
- }, []), Y = q((U) => {
1183
- a({ type: "SET_COURSE_FILTER", payload: U });
1181
+ }, []), de = q((H) => {
1182
+ a({ type: "SET_FILTER", payload: H });
1183
+ }, []), Y = q((H) => {
1184
+ a({ type: "SET_COURSE_FILTER", payload: H });
1184
1185
  }, []);
1185
1186
  return {
1186
1187
  notes: T,
1187
1188
  pageInfo: V,
1188
1189
  isLoading: O,
1189
1190
  isError: x,
1190
- filter: m,
1191
+ filter: f,
1191
1192
  courseFilter: c,
1192
1193
  currentPage: y,
1193
1194
  totalPages: d,
@@ -1199,12 +1200,12 @@ function vo({
1199
1200
  };
1200
1201
  }
1201
1202
  const xe = "all";
1202
- function Io({ filter: t, setFilter: e }) {
1203
+ function vo({ filter: t, setFilter: e }) {
1203
1204
  const { translations: n } = ee(), o = he(
1204
1205
  () => [
1205
1206
  { label: n.allNotes, value: xe },
1206
- { label: n.important, value: R.IMPORTANT },
1207
- { label: n.unclear, value: R.CONFUSING }
1207
+ { label: n.important, value: k.IMPORTANT },
1208
+ { label: n.unclear, value: k.CONFUSING }
1208
1209
  ],
1209
1210
  [n]
1210
1211
  ), r = q(
@@ -1230,26 +1231,26 @@ function Io({ filter: t, setFilter: e }) {
1230
1231
  handleReactionFilterChange: r
1231
1232
  };
1232
1233
  }
1233
- const Kn = ({ hasActiveFilter: t = !1 }) => {
1234
+ const qn = ({ hasActiveFilter: t = !1 }) => {
1234
1235
  const { translations: e } = ee(), n = t ? e.nothingHereYet : e.emptyStateHeading, o = t ? e.adjustFiltersOrCreate : e.emptyStateDescription;
1235
- return /* @__PURE__ */ s(X, { as: "div", textAlign: "center", children: /* @__PURE__ */ S(k, { direction: "column", alignItems: "center", gap: "small", children: [
1236
+ return /* @__PURE__ */ s(X, { as: "div", textAlign: "center", children: /* @__PURE__ */ S(R, { direction: "column", alignItems: "center", gap: "small", children: [
1236
1237
  !t && /* @__PURE__ */ s(bt, { size: "medium" }),
1237
1238
  /* @__PURE__ */ s(Se, { level: "h3", children: n }),
1238
1239
  /* @__PURE__ */ s(oe, { color: "secondary", children: o })
1239
1240
  ] }) });
1240
- }, Xn = {
1241
- [R.IMPORTANT]: {
1241
+ }, Kn = {
1242
+ [k.IMPORTANT]: {
1242
1243
  color: "success",
1243
1244
  translationKey: "important",
1244
1245
  icon: /* @__PURE__ */ s(Ae, { size: "x-small" })
1245
1246
  },
1246
- [R.CONFUSING]: {
1247
- color: "danger",
1247
+ [k.CONFUSING]: {
1248
+ color: "error",
1248
1249
  translationKey: "unclear",
1249
1250
  icon: /* @__PURE__ */ s(Le, { size: "x-small" })
1250
1251
  }
1251
- }, ft = ({ type: t, onTypeChange: e, renderAsMenuTrigger: n = !1 }) => {
1252
- const { translations: o } = ee(), r = Xn[t], i = o[r.translationKey], [l, a] = j(!1), m = $(null), c = $(null), y = $(null), d = q(
1252
+ }, ut = ({ type: t, onTypeChange: e, renderAsMenuTrigger: n = !1 }) => {
1253
+ const { translations: o } = ee(), r = Kn[t], i = o[r.translationKey], [l, a] = j(!1), f = B(null), c = B(null), y = B(null), d = q(
1253
1254
  (h) => {
1254
1255
  e == null || e(h), a(!1);
1255
1256
  },
@@ -1259,12 +1260,12 @@ const Kn = ({ hasActiveFilter: t = !1 }) => {
1259
1260
  if (!l) return;
1260
1261
  const h = (p) => {
1261
1262
  p.key === "Escape" && p.stopPropagation();
1262
- }, b = (p) => {
1263
+ }, N = (p) => {
1263
1264
  var E;
1264
1265
  p.key === "Escape" && (p.stopPropagation(), a(!1), (E = y.current) == null || E.focus());
1265
1266
  };
1266
- return document.addEventListener("keydown", h, !0), document.addEventListener("keyup", b, !0), () => {
1267
- document.removeEventListener("keydown", h, !0), document.removeEventListener("keyup", b, !0);
1267
+ return document.addEventListener("keydown", h, !0), document.addEventListener("keyup", N, !0), () => {
1268
+ document.removeEventListener("keydown", h, !0), document.removeEventListener("keyup", N, !0);
1268
1269
  };
1269
1270
  }, [l]), n && e ? /* @__PURE__ */ S(
1270
1271
  ue,
@@ -1286,26 +1287,26 @@ const Kn = ({ hasActiveFilter: t = !1 }) => {
1286
1287
  }
1287
1288
  ),
1288
1289
  children: [
1289
- /* @__PURE__ */ S(ue.Item, { ref: m, onClick: () => d(R.CONFUSING), children: [
1290
+ /* @__PURE__ */ S(ue.Item, { ref: f, onClick: () => d(k.CONFUSING), children: [
1290
1291
  /* @__PURE__ */ s(Le, { size: "x-small" }),
1291
1292
  ` ${o.markUnclear}`
1292
1293
  ] }),
1293
- /* @__PURE__ */ S(ue.Item, { ref: c, onClick: () => d(R.IMPORTANT), children: [
1294
+ /* @__PURE__ */ S(ue.Item, { ref: c, onClick: () => d(k.IMPORTANT), children: [
1294
1295
  /* @__PURE__ */ s(Ae, { size: "x-small" }),
1295
1296
  ` ${o.markImportant}`
1296
1297
  ] })
1297
1298
  ]
1298
1299
  }
1299
1300
  ) : /* @__PURE__ */ s(X, { display: "inline-flex", children: /* @__PURE__ */ s($e, { color: r.color, renderIcon: r.icon, children: i }) });
1300
- }, We = "0.75rem";
1301
- function ze(t, e) {
1301
+ };
1302
+ function We(t, e) {
1302
1303
  return (t instanceof Date ? t : new Date(t)).toLocaleString(e, {
1303
1304
  year: "numeric",
1304
1305
  month: "short",
1305
1306
  day: "numeric"
1306
1307
  });
1307
1308
  }
1308
- const Qn = ({
1309
+ const Xn = ({
1309
1310
  noteId: t,
1310
1311
  date: e,
1311
1312
  highlight: n,
@@ -1314,50 +1315,50 @@ const Qn = ({
1314
1315
  onClick: i,
1315
1316
  onDelete: l,
1316
1317
  onSaveNote: a,
1317
- onTypeChange: m,
1318
+ onTypeChange: f,
1318
1319
  isActive: c,
1319
1320
  isPanelView: y = !1,
1320
1321
  courseName: d,
1321
1322
  locale: h,
1322
- highlightTheme: b,
1323
+ highlightTheme: N,
1323
1324
  renderLink: p,
1324
1325
  href: E
1325
1326
  }) => {
1326
- const { translations: g } = ee(), [Q, W] = j(!1), [N, C] = j(!1), [D, H] = j(o || ""), [P, T] = j(!1), [O, x] = j(!1), [M, V] = j(!1), [Z, ce] = j(!1), J = $(null), de = q((f) => {
1327
- J.current = f;
1328
- }, []), Y = $(null), te = $(null), U = $(!1), w = $(null), I = $(null), F = $(!1);
1327
+ const { translations: g } = ee(), [Q, G] = j(!1), [b, C] = j(!1), [A, $] = j(o || ""), [D, T] = j(!1), [O, x] = j(!1), [F, V] = j(!1), [Z, ce] = j(!1), J = B(null), de = q((m) => {
1328
+ J.current = m;
1329
+ }, []), Y = B(null), te = B(null), H = B(!1), w = B(null), I = B(null), _ = B(!1);
1329
1330
  z(() => {
1330
- var f, L;
1331
- c ? ((f = J.current) == null || f.scrollIntoView({ behavior: "smooth", block: "nearest" }), (L = J.current) == null || L.focus()) : T(!1);
1331
+ var m, W;
1332
+ c ? ((m = J.current) == null || m.scrollIntoView({ behavior: "smooth", block: "nearest" }), (W = J.current) == null || W.focus()) : T(!1);
1332
1333
  }, [c]), z(() => {
1333
- var f, L;
1334
- N ? (U.current = !0, (f = Y.current) == null || f.focus()) : U.current && (U.current = !1, (L = te.current) == null || L.focus());
1335
- }, [N]), z(() => {
1336
- if (!P && F.current) {
1337
- F.current = !1;
1338
- const f = w.current;
1339
- f != null && f.isConnected && f.focus();
1334
+ var m, W;
1335
+ b ? (H.current = !0, (m = Y.current) == null || m.focus()) : H.current && (H.current = !1, (W = te.current) == null || W.focus());
1336
+ }, [b]), z(() => {
1337
+ if (!D && _.current) {
1338
+ _.current = !1;
1339
+ const m = w.current;
1340
+ m != null && m.isConnected && m.focus();
1340
1341
  }
1341
- }, [P]);
1342
- const A = q((f, L) => {
1343
- F.current = !L, T(!1);
1342
+ }, [D]);
1343
+ const L = q((m, W) => {
1344
+ _.current = !W, T(!1);
1344
1345
  }, []);
1345
1346
  z(() => {
1346
- if (!P) return;
1347
- const f = (ie) => {
1347
+ if (!D) return;
1348
+ const m = (ie) => {
1348
1349
  ie.key === "Escape" && ie.stopPropagation();
1349
- }, L = (ie) => {
1350
- ie.key === "Escape" && (ie.stopPropagation(), A());
1350
+ }, W = (ie) => {
1351
+ ie.key === "Escape" && (ie.stopPropagation(), L());
1351
1352
  };
1352
- return window.addEventListener("keydown", f, !0), window.addEventListener("keyup", L, !0), () => {
1353
- window.removeEventListener("keydown", f, !0), window.removeEventListener("keyup", L, !0);
1353
+ return window.addEventListener("keydown", m, !0), window.addEventListener("keyup", W, !0), () => {
1354
+ window.removeEventListener("keydown", m, !0), window.removeEventListener("keyup", W, !0);
1354
1355
  };
1355
- }, [P, A]);
1356
- const G = r === R.IMPORTANT ? g.important : g.unclear, _ = (f) => {
1357
- f.key === "Enter" && (f.preventDefault(), i == null || i());
1358
- }, v = [g.note, G];
1359
- v.push(n || g.highlightUnavailable), o && v.push(o), e && v.push(ze(e, h)), d && v.push(d);
1360
- const B = v.join(", "), ne = /* @__PURE__ */ S(
1356
+ }, [D, L]);
1357
+ const U = r === k.IMPORTANT ? g.important : g.unclear, P = (m) => {
1358
+ m.key === "Enter" && (m.preventDefault(), i == null || i());
1359
+ }, v = [g.note, U];
1360
+ v.push(n || g.highlightUnavailable), o && v.push(o), e && v.push(We(e, h)), d && v.push(d);
1361
+ const M = v.join(", "), ne = /* @__PURE__ */ S(
1361
1362
  X,
1362
1363
  {
1363
1364
  as: "div",
@@ -1366,17 +1367,17 @@ const Qn = ({
1366
1367
  borderRadius: "medium",
1367
1368
  padding: "small",
1368
1369
  position: "relative",
1369
- role: E ? void 0 : c || N ? "group" : "button",
1370
- "aria-label": E ? void 0 : B,
1371
- "aria-pressed": E || c || N ? void 0 : c,
1370
+ role: E ? void 0 : c || b ? "group" : "button",
1371
+ "aria-label": E ? void 0 : M,
1372
+ "aria-pressed": E || c || b ? void 0 : c,
1372
1373
  tabIndex: E || c ? -1 : 0,
1373
1374
  "data-testid": `note-card-${t}`,
1374
1375
  elementRef: de,
1375
1376
  onClick: c ? void 0 : i,
1376
- onMouseEnter: () => W(!0),
1377
- onMouseLeave: () => W(!1),
1378
- onKeyDown: c ? void 0 : _,
1379
- cursor: N ? "default" : "pointer",
1377
+ onMouseEnter: () => G(!0),
1378
+ onMouseLeave: () => G(!1),
1379
+ onKeyDown: c ? void 0 : P,
1380
+ cursor: b ? "default" : "pointer",
1380
1381
  children: [
1381
1382
  /* @__PURE__ */ s(
1382
1383
  "div",
@@ -1384,65 +1385,65 @@ const Qn = ({
1384
1385
  "data-testid": `note-card-${t}-content`,
1385
1386
  style: {
1386
1387
  height: "100%",
1387
- opacity: c && P && l ? 0.25 : void 0
1388
+ opacity: c && D && l ? 0.25 : void 0
1388
1389
  },
1389
- children: /* @__PURE__ */ S(k, { direction: "column", gap: "small", height: "100%", children: [
1390
+ children: /* @__PURE__ */ S(R, { direction: "column", gap: "small", height: "100%", children: [
1390
1391
  /* @__PURE__ */ s(
1391
- ft,
1392
+ ut,
1392
1393
  {
1393
1394
  type: r,
1394
- onTypeChange: y && m ? (f) => m(t, f) : void 0,
1395
- renderAsMenuTrigger: y && !!m && !!c
1395
+ onTypeChange: y && f ? (m) => f(t, m) : void 0,
1396
+ renderAsMenuTrigger: y && !!f && !!c
1396
1397
  }
1397
1398
  ),
1398
1399
  n ? /* @__PURE__ */ s("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: /* @__PURE__ */ s(oe, { children: c && y ? /* @__PURE__ */ s(
1399
- Re,
1400
+ ke,
1400
1401
  {
1401
1402
  type: r,
1402
1403
  isCardActive: !!c || Q,
1403
- theme: b,
1404
+ theme: N,
1404
1405
  children: n
1405
1406
  }
1406
- ) : /* @__PURE__ */ S(qe, { children: [
1407
+ ) : /* @__PURE__ */ S(ze, { children: [
1407
1408
  O && /* @__PURE__ */ s(pe, { children: n }),
1408
1409
  /* @__PURE__ */ s("span", { "aria-hidden": O, style: { display: "block" }, children: /* @__PURE__ */ s(Ee, { maxLines: 3, truncate: "word", onUpdate: x, children: /* @__PURE__ */ s(
1409
- Re,
1410
+ ke,
1410
1411
  {
1411
1412
  type: r,
1412
1413
  isCardActive: !!c || Q,
1413
- theme: b,
1414
+ theme: N,
1414
1415
  children: n
1415
1416
  }
1416
1417
  ) }) })
1417
- ] }) }) }) : /* @__PURE__ */ s(ut, {}),
1418
- /* @__PURE__ */ s(k.Item, { shouldGrow: !0, children: /* @__PURE__ */ S(k, { direction: "column", gap: "small", height: "100%", children: [
1419
- N && y ? /* @__PURE__ */ S(k, { direction: "column", gap: "x-small", margin: "xx-small", children: [
1418
+ ] }) }) }) : /* @__PURE__ */ s(dt, {}),
1419
+ /* @__PURE__ */ s(R.Item, { shouldGrow: !0, children: /* @__PURE__ */ S(R, { direction: "column", gap: "small", height: "100%", children: [
1420
+ b && y ? /* @__PURE__ */ S(R, { direction: "column", gap: "x-small", margin: "xx-small", children: [
1420
1421
  /* @__PURE__ */ s(
1421
- Ye,
1422
+ Qe,
1422
1423
  {
1423
1424
  label: /* @__PURE__ */ s(pe, { children: g.editNote }),
1424
- value: D,
1425
- onChange: (f) => H(f.target.value),
1425
+ value: A,
1426
+ onChange: (m) => $(m.target.value),
1426
1427
  placeholder: g.addNoteOptional,
1427
- textareaRef: (f) => {
1428
- Y.current = f;
1428
+ textareaRef: (m) => {
1429
+ Y.current = m;
1429
1430
  }
1430
1431
  }
1431
1432
  ),
1432
- /* @__PURE__ */ S(k, { gap: "xx-small", children: [
1433
- /* @__PURE__ */ s(k.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1433
+ /* @__PURE__ */ S(R, { gap: "xx-small", children: [
1434
+ /* @__PURE__ */ s(R.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1434
1435
  re,
1435
1436
  {
1436
1437
  display: "block",
1437
1438
  size: "small",
1438
1439
  "data-testid": `note-card-${t}-cancel`,
1439
1440
  onClick: () => {
1440
- H(o || ""), C(!1);
1441
+ $(o || ""), C(!1);
1441
1442
  },
1442
1443
  children: g.cancel
1443
1444
  }
1444
1445
  ) }),
1445
- /* @__PURE__ */ s(k.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1446
+ /* @__PURE__ */ s(R.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1446
1447
  re,
1447
1448
  {
1448
1449
  display: "block",
@@ -1450,7 +1451,7 @@ const Qn = ({
1450
1451
  size: "small",
1451
1452
  "data-testid": `note-card-${t}-save`,
1452
1453
  onClick: () => {
1453
- a == null || a(t, D.trim()), C(!1);
1454
+ a == null || a(t, A.trim()), C(!1);
1454
1455
  },
1455
1456
  children: g.save
1456
1457
  }
@@ -1468,18 +1469,18 @@ const Qn = ({
1468
1469
  margin: "xx-small 0 0 xxx-small",
1469
1470
  screenReaderLabel: g.editNote,
1470
1471
  "data-testid": `note-card-${t}-edit`,
1471
- elementRef: (f) => {
1472
- te.current = f;
1472
+ elementRef: (m) => {
1473
+ te.current = m;
1473
1474
  },
1474
- onClick: (f) => {
1475
- f.stopPropagation(), C(!0);
1475
+ onClick: (m) => {
1476
+ m.stopPropagation(), C(!0);
1476
1477
  },
1477
- children: /* @__PURE__ */ s(ke, {})
1478
+ children: /* @__PURE__ */ s(Re, {})
1478
1479
  }
1479
1480
  )
1480
1481
  ] }) : /* @__PURE__ */ S(oe, { children: [
1481
- M && /* @__PURE__ */ s(pe, { children: o }),
1482
- /* @__PURE__ */ s("span", { "aria-hidden": M, style: { display: "block" }, children: /* @__PURE__ */ s(Ee, { maxLines: 3, truncate: "word", onUpdate: V, children: o }) })
1482
+ F && /* @__PURE__ */ s(pe, { children: o }),
1483
+ /* @__PURE__ */ s("span", { "aria-hidden": F, style: { display: "block" }, children: /* @__PURE__ */ s(Ee, { maxLines: 3, truncate: "word", onUpdate: V, children: o }) })
1483
1484
  ] }) }) : y && c ? /* @__PURE__ */ s("div", { children: /* @__PURE__ */ S(oe, { color: "secondary", children: [
1484
1485
  g.addNotePrompt,
1485
1486
  " ",
@@ -1492,18 +1493,18 @@ const Qn = ({
1492
1493
  margin: "xx-small 0 0 xxx-small",
1493
1494
  screenReaderLabel: g.editNote,
1494
1495
  "data-testid": `note-card-${t}-edit`,
1495
- elementRef: (f) => {
1496
- te.current = f;
1496
+ elementRef: (m) => {
1497
+ te.current = m;
1497
1498
  },
1498
- onClick: (f) => {
1499
- f.stopPropagation(), C(!0);
1499
+ onClick: (m) => {
1500
+ m.stopPropagation(), C(!0);
1500
1501
  },
1501
- children: /* @__PURE__ */ s(ke, {})
1502
+ children: /* @__PURE__ */ s(Re, {})
1502
1503
  }
1503
1504
  )
1504
1505
  ] }) }) : null,
1505
- /* @__PURE__ */ S(k, { justifyItems: "space-between", alignItems: "center", margin: "auto 0 0 0", children: [
1506
- /* @__PURE__ */ s(oe, { as: "div", size: "small", color: "secondary", children: ze(e, h) }),
1506
+ /* @__PURE__ */ S(R, { justifyItems: "space-between", alignItems: "center", margin: "auto 0 0 0", children: [
1507
+ /* @__PURE__ */ s(oe, { as: "div", size: "small", color: "secondary", children: We(e, h) }),
1507
1508
  c && l && /* @__PURE__ */ s(
1508
1509
  me,
1509
1510
  {
@@ -1514,11 +1515,11 @@ const Qn = ({
1514
1515
  margin: "xx-small",
1515
1516
  screenReaderLabel: g.deleteNote,
1516
1517
  "data-testid": `note-card-${t}-delete`,
1517
- elementRef: (f) => {
1518
- w.current = f;
1518
+ elementRef: (m) => {
1519
+ w.current = m;
1519
1520
  },
1520
- onClick: (f) => {
1521
- f.stopPropagation(), F.current = !1, T(!0);
1521
+ onClick: (m) => {
1522
+ m.stopPropagation(), _.current = !1, T(!0);
1522
1523
  },
1523
1524
  children: /* @__PURE__ */ s(Te, {})
1524
1525
  }
@@ -1541,8 +1542,8 @@ const Qn = ({
1541
1542
  ] })
1542
1543
  }
1543
1544
  ),
1544
- c && P && l && /* @__PURE__ */ s(
1545
- Tt,
1545
+ c && D && l && /* @__PURE__ */ s(
1546
+ Et,
1546
1547
  {
1547
1548
  open: !0,
1548
1549
  as: "div",
@@ -1553,11 +1554,13 @@ const Qn = ({
1553
1554
  shouldCloseOnDocumentClick: !0,
1554
1555
  shouldCloseOnEscape: !1,
1555
1556
  shouldReturnFocus: !1,
1556
- onDismiss: A,
1557
+ onDismiss: L,
1557
1558
  children: /* @__PURE__ */ s(
1558
1559
  X,
1559
1560
  {
1560
1561
  as: "div",
1562
+ background: "primary",
1563
+ borderRadius: "medium",
1561
1564
  padding: "medium",
1562
1565
  position: "absolute",
1563
1566
  insetBlockStart: "0",
@@ -1566,7 +1569,7 @@ const Qn = ({
1566
1569
  insetInlineEnd: "0",
1567
1570
  stacking: "above",
1568
1571
  children: /* @__PURE__ */ S(
1569
- k,
1572
+ R,
1570
1573
  {
1571
1574
  direction: "column",
1572
1575
  justifyItems: "center",
@@ -1580,20 +1583,10 @@ const Qn = ({
1580
1583
  display: "block",
1581
1584
  color: "danger",
1582
1585
  withBackground: !1,
1583
- themeOverride: (f, L) => ({
1584
- borderRadius: We,
1585
- // Ghost states default to translucent fills; the faded card would show through.
1586
- dangerGhostBackground: L.colors.contrasts.white1010,
1587
- dangerGhostHoverBackground: L.colors.contrasts.red1212,
1588
- dangerGhostActiveBackground: L.colors.contrasts.red1212,
1589
- // red45 on the hover tint is 3.74:1; red57 clears AA in every state.
1590
- dangerGhostColor: L.colors.contrasts.red5782,
1591
- dangerGhostBorderColor: L.colors.contrasts.red5782
1592
- }),
1593
1586
  renderIcon: /* @__PURE__ */ s(Te, {}),
1594
1587
  "data-testid": `note-card-${t}-confirm-delete`,
1595
- onClick: (f) => {
1596
- f.stopPropagation(), l(t), T(!1);
1588
+ onClick: (m) => {
1589
+ m.stopPropagation(), l(t), T(!1);
1597
1590
  },
1598
1591
  children: g.deleteNote
1599
1592
  }
@@ -1603,17 +1596,12 @@ const Qn = ({
1603
1596
  {
1604
1597
  display: "block",
1605
1598
  withBackground: !1,
1606
- themeOverride: (f, L) => ({
1607
- borderRadius: We,
1608
- secondaryGhostBackground: L.colors.contrasts.white1010,
1609
- secondaryGhostActiveBackground: L.colors.contrasts.grey1111
1610
- }),
1611
1599
  "data-testid": `note-card-${t}-cancel-delete`,
1612
- elementRef: (f) => {
1613
- I.current = f;
1600
+ elementRef: (m) => {
1601
+ I.current = m;
1614
1602
  },
1615
- onClick: (f) => {
1616
- f.stopPropagation(), A();
1603
+ onClick: (m) => {
1604
+ m.stopPropagation(), L();
1617
1605
  },
1618
1606
  children: g.cancel
1619
1607
  }
@@ -1628,8 +1616,8 @@ const Qn = ({
1628
1616
  ]
1629
1617
  }
1630
1618
  );
1631
- return E && p ? p({ href: E, children: ne, ariaLabel: B }) : ne;
1632
- }, Yn = {
1619
+ return E && p ? p({ href: E, children: ne, ariaLabel: M }) : ne;
1620
+ }, Qn = {
1633
1621
  display: "grid",
1634
1622
  gap: "1rem",
1635
1623
  boxSizing: "border-box",
@@ -1637,7 +1625,7 @@ const Qn = ({
1637
1625
  margin: 0,
1638
1626
  padding: 0,
1639
1627
  listStyle: "none"
1640
- }, Co = ({
1628
+ }, Io = ({
1641
1629
  notes: t,
1642
1630
  isLoading: e,
1643
1631
  isError: n,
@@ -1646,31 +1634,31 @@ const Qn = ({
1646
1634
  onPageChange: i,
1647
1635
  onNoteSelect: l,
1648
1636
  onNoteDelete: a,
1649
- onNoteSave: m,
1637
+ onNoteSave: f,
1650
1638
  onNoteTypeChange: c,
1651
1639
  onNotesEmptied: y,
1652
1640
  selectedNoteId: d,
1653
1641
  hasActiveFilter: h = !1,
1654
- columnCount: b = 1,
1642
+ columnCount: N = 1,
1655
1643
  highlightTheme: p,
1656
1644
  locale: E,
1657
1645
  courseNames: g,
1658
1646
  renderNoteLink: Q,
1659
- noteHref: W
1647
+ noteHref: G
1660
1648
  }) => {
1661
- const { translations: N } = ee(), C = $(null), D = $(null), H = q(
1649
+ const { translations: b } = ee(), C = B(null), A = B(null), $ = q(
1662
1650
  (T) => {
1663
- const O = t.findIndex((M) => M.id === T);
1651
+ const O = t.findIndex((F) => F.id === T);
1664
1652
  let x = null;
1665
- t.length > 1 && (x = O > 0 ? t[O - 1].id : t[1].id), D.current = { targetId: x }, a == null || a(T);
1653
+ t.length > 1 && (x = O > 0 ? t[O - 1].id : t[1].id), A.current = { targetId: x }, a == null || a(T);
1666
1654
  },
1667
1655
  [t, a]
1668
1656
  );
1669
1657
  if (z(() => {
1670
1658
  var O;
1671
- const T = D.current;
1659
+ const T = A.current;
1672
1660
  if (T)
1673
- if (D.current = null, T.targetId === null)
1661
+ if (A.current = null, T.targetId === null)
1674
1662
  y == null || y();
1675
1663
  else {
1676
1664
  const x = (O = C.current) == null ? void 0 : O.querySelector(
@@ -1679,60 +1667,60 @@ const Qn = ({
1679
1667
  x == null || x.focus();
1680
1668
  }
1681
1669
  }, [t, y]), e)
1682
- return /* @__PURE__ */ s(X, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ s(vt, { renderTitle: N.loadingNotes }) });
1670
+ return /* @__PURE__ */ s(X, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ s(St, { renderTitle: b.loadingNotes }) });
1683
1671
  if (n)
1684
- return /* @__PURE__ */ s(X, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ s(Se, { level: "h4", children: N.failedToLoadNotes }) });
1672
+ return /* @__PURE__ */ s(X, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ s(Se, { level: "h4", children: b.failedToLoadNotes }) });
1685
1673
  if (t.length === 0)
1686
- return /* @__PURE__ */ s(X, { as: "div", padding: "large", "data-testid": "empty-notes", children: /* @__PURE__ */ s(Kn, { hasActiveFilter: h }) });
1687
- const P = typeof o == "number" && typeof r == "number" && r > 1 && i !== void 0;
1688
- return /* @__PURE__ */ S(qe, { children: [
1674
+ return /* @__PURE__ */ s(X, { as: "div", padding: "large", "data-testid": "empty-notes", children: /* @__PURE__ */ s(qn, { hasActiveFilter: h }) });
1675
+ const D = typeof o == "number" && typeof r == "number" && r > 1 && i !== void 0;
1676
+ return /* @__PURE__ */ S(ze, { children: [
1689
1677
  /* @__PURE__ */ s(
1690
1678
  "ul",
1691
1679
  {
1692
1680
  ref: C,
1693
- style: { ...Yn, gridTemplateColumns: `repeat(${b}, minmax(0, 1fr))` },
1681
+ style: { ...Qn, gridTemplateColumns: `repeat(${N}, minmax(0, 1fr))` },
1694
1682
  role: "list",
1695
1683
  "data-testid": "notes-grid",
1696
1684
  children: t.map((T) => {
1697
1685
  var O;
1698
1686
  return /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
1699
- Qn,
1687
+ Xn,
1700
1688
  {
1701
1689
  noteId: T.id,
1702
1690
  date: T.createdAt,
1703
- type: T.reaction[0] ?? R.IMPORTANT,
1691
+ type: T.reaction[0] ?? k.IMPORTANT,
1704
1692
  highlight: (O = T.highlightData) == null ? void 0 : O.selectedText,
1705
1693
  note: T.userText,
1706
1694
  isActive: d === T.id,
1707
1695
  isPanelView: !!d,
1708
1696
  onClick: l ? () => l(T.id) : void 0,
1709
- onDelete: a ? H : void 0,
1710
- onSaveNote: m ? (x, M) => m(x, M) : void 0,
1711
- onTypeChange: c ? (x, M) => c(x, M) : void 0,
1697
+ onDelete: a ? $ : void 0,
1698
+ onSaveNote: f ? (x, F) => f(x, F) : void 0,
1699
+ onTypeChange: c ? (x, F) => c(x, F) : void 0,
1712
1700
  highlightTheme: p,
1713
1701
  locale: E,
1714
1702
  courseName: g == null ? void 0 : g.get(T.courseId),
1715
1703
  renderLink: Q,
1716
- href: W ? W(T.id, T) : void 0
1704
+ href: G ? G(T.id, T) : void 0
1717
1705
  }
1718
1706
  ) }, T.id);
1719
1707
  })
1720
1708
  }
1721
1709
  ),
1722
- P && /* @__PURE__ */ s(k, { justifyItems: "center", padding: "small", "data-testid": "notes-pagination", children: /* @__PURE__ */ s(k.Item, { children: /* @__PURE__ */ s(
1723
- St,
1710
+ D && /* @__PURE__ */ s(R, { justifyItems: "center", padding: "small", "data-testid": "notes-pagination", children: /* @__PURE__ */ s(R.Item, { children: /* @__PURE__ */ s(
1711
+ Tt,
1724
1712
  {
1725
1713
  as: "nav",
1726
1714
  variant: "input",
1727
- labelNext: N.nextPage,
1728
- labelPrev: N.previousPage,
1715
+ labelNext: b.nextPage,
1716
+ labelPrev: b.previousPage,
1729
1717
  currentPage: o,
1730
1718
  totalPageNumber: r,
1731
1719
  onPageChange: i
1732
1720
  }
1733
1721
  ) }) })
1734
1722
  ] });
1735
- }, xo = ({
1723
+ }, Co = ({
1736
1724
  noteText: t,
1737
1725
  reaction: e,
1738
1726
  highlightText: n,
@@ -1741,36 +1729,36 @@ const Qn = ({
1741
1729
  onDelete: i,
1742
1730
  onTypeChange: l,
1743
1731
  onBack: a,
1744
- editing: m = !1
1732
+ editing: f = !1
1745
1733
  }) => {
1746
- const { translations: c } = ee(), [y, d] = j(m), [h, b] = j(t || ""), [p, E] = j(!1);
1747
- return /* @__PURE__ */ S(k, { direction: "column", gap: "small", "data-testid": "single-note", children: [
1748
- n != null ? /* @__PURE__ */ s(X, { as: "div", children: /* @__PURE__ */ s(oe, { children: /* @__PURE__ */ s(Re, { type: e, isCardActive: !0, theme: o, children: n }) }) }) : /* @__PURE__ */ s(ut, {}),
1749
- /* @__PURE__ */ s(ft, { type: e, onTypeChange: l, renderAsMenuTrigger: !!l }),
1750
- y ? /* @__PURE__ */ S(k, { direction: "column", gap: "x-small", children: [
1734
+ const { translations: c } = ee(), [y, d] = j(f), [h, N] = j(t || ""), [p, E] = j(!1);
1735
+ return /* @__PURE__ */ S(R, { direction: "column", gap: "small", "data-testid": "single-note", children: [
1736
+ n != null ? /* @__PURE__ */ s(X, { as: "div", children: /* @__PURE__ */ s(oe, { children: /* @__PURE__ */ s(ke, { type: e, isCardActive: !0, theme: o, children: n }) }) }) : /* @__PURE__ */ s(dt, {}),
1737
+ /* @__PURE__ */ s(ut, { type: e, onTypeChange: l, renderAsMenuTrigger: !!l }),
1738
+ y ? /* @__PURE__ */ S(R, { direction: "column", gap: "x-small", children: [
1751
1739
  /* @__PURE__ */ s(
1752
- Ye,
1740
+ Qe,
1753
1741
  {
1754
1742
  label: c.addNoteOptional,
1755
1743
  value: h,
1756
- onChange: (g) => b(g.target.value),
1744
+ onChange: (g) => N(g.target.value),
1757
1745
  resize: "vertical"
1758
1746
  }
1759
1747
  ),
1760
- /* @__PURE__ */ S(k, { gap: "xx-small", children: [
1761
- /* @__PURE__ */ s(k.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1748
+ /* @__PURE__ */ S(R, { gap: "xx-small", children: [
1749
+ /* @__PURE__ */ s(R.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1762
1750
  re,
1763
1751
  {
1764
1752
  display: "block",
1765
1753
  size: "small",
1766
1754
  "data-testid": "single-note-cancel",
1767
1755
  onClick: () => {
1768
- b(t || ""), d(!1);
1756
+ N(t || ""), d(!1);
1769
1757
  },
1770
1758
  children: c.cancel
1771
1759
  }
1772
1760
  ) }),
1773
- /* @__PURE__ */ s(k.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1761
+ /* @__PURE__ */ s(R.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1774
1762
  re,
1775
1763
  {
1776
1764
  display: "block",
@@ -1784,23 +1772,23 @@ const Qn = ({
1784
1772
  }
1785
1773
  ) })
1786
1774
  ] })
1787
- ] }) : /* @__PURE__ */ S(k, { direction: "column", gap: "small", children: [
1775
+ ] }) : /* @__PURE__ */ S(R, { direction: "column", gap: "small", children: [
1788
1776
  t && /* @__PURE__ */ S(X, { as: "div", children: [
1789
1777
  /* @__PURE__ */ s(Se, { level: "h4", margin: "0 0 xx-small 0", children: c.note }),
1790
1778
  /* @__PURE__ */ s(oe, { children: t })
1791
1779
  ] }),
1792
- /* @__PURE__ */ S(k, { justifyItems: "space-between", children: [
1780
+ /* @__PURE__ */ S(R, { justifyItems: "space-between", children: [
1793
1781
  /* @__PURE__ */ s(
1794
1782
  re,
1795
1783
  {
1796
1784
  size: "small",
1797
- renderIcon: /* @__PURE__ */ s(Et, {}),
1785
+ renderIcon: /* @__PURE__ */ s(Nt, {}),
1798
1786
  "data-testid": "single-note-back",
1799
1787
  onClick: () => a == null ? void 0 : a(),
1800
1788
  children: c.back
1801
1789
  }
1802
1790
  ),
1803
- /* @__PURE__ */ S(k, { gap: "xx-small", children: [
1791
+ /* @__PURE__ */ S(R, { gap: "xx-small", children: [
1804
1792
  i && /* @__PURE__ */ s(
1805
1793
  me,
1806
1794
  {
@@ -1823,12 +1811,12 @@ const Qn = ({
1823
1811
  screenReaderLabel: c.editNote,
1824
1812
  "data-testid": "single-note-edit",
1825
1813
  onClick: () => d(!0),
1826
- children: /* @__PURE__ */ s(ke, {})
1814
+ children: /* @__PURE__ */ s(Re, {})
1827
1815
  }
1828
1816
  )
1829
1817
  ] })
1830
1818
  ] }),
1831
- p && i && /* @__PURE__ */ s(X, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ S(k, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
1819
+ p && i && /* @__PURE__ */ s(X, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ S(R, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
1832
1820
  /* @__PURE__ */ s(
1833
1821
  re,
1834
1822
  {
@@ -1858,26 +1846,26 @@ const Qn = ({
1858
1846
  ] });
1859
1847
  };
1860
1848
  export {
1861
- So as ContentWithNoteWrapper,
1862
- Re as Highlight,
1863
- ut as HighlightError,
1864
- Qn as NoteCard,
1865
- ft as NoteChip,
1849
+ To as ContentWithNoteWrapper,
1850
+ ke as Highlight,
1851
+ dt as HighlightError,
1852
+ Xn as NoteCard,
1853
+ ut as NoteChip,
1866
1854
  jn as NoteReactionMenu,
1867
- Kn as NotebookEmptyState,
1868
- Eo as NotebookProvider,
1869
- Hn as NotebookTranslationsProvider,
1870
- To as NotebookTray,
1871
- Co as NotesListView,
1872
- R as REACTION_TYPE,
1873
- xo as SingleNote,
1855
+ qn as NotebookEmptyState,
1856
+ No as NotebookProvider,
1857
+ $n as NotebookTranslationsProvider,
1858
+ Eo as NotebookTray,
1859
+ Io as NotesListView,
1860
+ k as REACTION_TYPE,
1861
+ Co as SingleNote,
1874
1862
  Fe as createTransparentColor,
1875
- Vt as useCreateNote,
1876
- Zt as useDeleteNote,
1877
- rt as useGetNotes,
1878
- ct as useNotebook,
1863
+ Yt as useCreateNote,
1864
+ Vt as useDeleteNote,
1865
+ ot as useGetNotes,
1866
+ at as useNotebook,
1879
1867
  ee as useNotebookTranslations,
1880
- vo as useNotesData,
1881
- Io as useReactionFilter,
1882
- en as useUpdateNote
1868
+ So as useNotesData,
1869
+ vo as useReactionFilter,
1870
+ Jt as useUpdateNote
1883
1871
  };