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