@instructure/platform-notebook 0.4.0 → 0.4.2

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