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