@makefully/notefully 0.2.2 → 0.2.3

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/notefully.js CHANGED
@@ -1,4 +1,4 @@
1
- const me = {
1
+ const he = {
2
2
  "launcher.open": "Leave a note…",
3
3
  "tool.crop": "Crop",
4
4
  "tool.resetCrop": "Reset crop",
@@ -33,6 +33,8 @@ const me = {
33
33
  "status.screenshotFailed": "Screenshot failed; you can still send text.",
34
34
  "status.recaptureFailed": "Recapture failed.",
35
35
  "status.submitFailed": "Submit failed.",
36
+ "status.submitTooLarge": "Screenshot too large; retrying smaller…",
37
+ "status.submitWithoutImage": "Submitted without screenshot.",
36
38
  "status.emptyReport": "Add a note, screenshot, or video first.",
37
39
  "status.missingConfig": "Notefully is missing endpoint or projectKey.",
38
40
  "status.speechUnsupported": "Speech recognition is not supported in this browser.",
@@ -55,15 +57,15 @@ const me = {
55
57
  "diag.timezone": "Timezone",
56
58
  "diag.viewport": "Viewport",
57
59
  "diag.user": "User"
58
- }, he = {
59
- "en-US": me
60
- }, Te = {
60
+ }, fe = {
61
+ "en-US": he
62
+ }, Fe = {
61
63
  en: "en-US",
62
64
  no: "nb",
63
65
  tl: "fil",
64
66
  "zh-Hans": "zh-CN",
65
67
  "zh-Hant": "zh-TW"
66
- }, va = {
68
+ }, fa = {
67
69
  "es-MX": ["es-419", "es"],
68
70
  "es-AR": ["es-419", "es"],
69
71
  "es-CL": ["es-419", "es"],
@@ -83,34 +85,34 @@ const me = {
83
85
  "es-DO": ["es-419", "es"],
84
86
  "es-PR": ["es-419", "es"],
85
87
  "es-CU": ["es-419", "es"]
86
- }, ka = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
87
- let le = "en-US", Pt = {};
88
+ }, ya = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
89
+ let ue = "en-US", Rt = {};
88
90
  function h(e, t) {
89
- !e || !t || typeof t != "object" || (he[String(e)] = t);
91
+ !e || !t || typeof t != "object" || (fe[String(e)] = t);
90
92
  }
91
93
  function oe(e) {
92
94
  return String(e || "").trim().replace(/_/g, "-");
93
95
  }
94
- function ba(e) {
96
+ function va(e) {
95
97
  const t = oe(e);
96
98
  if (!t)
97
99
  return ["en-US"];
98
- const a = t, o = Te[a] || Te[a.toLowerCase()] || a, s = [], i = (n) => {
99
- n && !s.includes(n) && s.push(n);
100
+ const a = t, o = Fe[a] || Fe[a.toLowerCase()] || a, s = [], i = (l) => {
101
+ l && !s.includes(l) && s.push(l);
100
102
  };
101
103
  i(o);
102
- for (const [n, u] of Object.entries(va))
103
- n.toLowerCase() === o.toLowerCase() && u.forEach(i);
104
+ for (const [l, u] of Object.entries(fa))
105
+ l.toLowerCase() === o.toLowerCase() && u.forEach(i);
104
106
  const r = o.split("-");
105
- for (let n = r.length - 1; n >= 1; n -= 1)
106
- i(r.slice(0, n).join("-"));
107
- return i(Te[r[0]] || r[0]), i("en-US"), s;
107
+ for (let l = r.length - 1; l >= 1; l -= 1)
108
+ i(r.slice(0, l).join("-"));
109
+ return i(Fe[r[0]] || r[0]), i("en-US"), s;
108
110
  }
109
- function wa(e) {
110
- for (const t of ba(e)) {
111
- if (he[t])
111
+ function ka(e) {
112
+ for (const t of va(e)) {
113
+ if (fe[t])
112
114
  return t;
113
- const a = Object.keys(he).find(
115
+ const a = Object.keys(fe).find(
114
116
  (o) => o.toLowerCase() === t.toLowerCase()
115
117
  );
116
118
  if (a)
@@ -118,7 +120,7 @@ function wa(e) {
118
120
  }
119
121
  return "en-US";
120
122
  }
121
- function Sa(e = {}) {
123
+ function ba(e = {}) {
122
124
  var t;
123
125
  if (e.locale != null && String(e.locale).trim())
124
126
  return oe(e.locale);
@@ -129,25 +131,25 @@ function Sa(e = {}) {
129
131
  }
130
132
  return typeof navigator < "u" && navigator.language ? oe(navigator.language) : "en-US";
131
133
  }
132
- function Aa(e, t) {
133
- return e != null && (le = oe(e) || "en-US"), le;
134
+ function wa(e, t) {
135
+ return e != null && (ue = oe(e) || "en-US"), ue;
134
136
  }
135
- function Ca(e) {
136
- Pt = e && typeof e == "object" ? { ...e } : {};
137
+ function Sa(e) {
138
+ Rt = e && typeof e == "object" ? { ...e } : {};
137
139
  }
138
- function fe() {
139
- return le;
140
+ function ye() {
141
+ return ue;
140
142
  }
141
- function za(e = le) {
143
+ function Aa(e = ue) {
142
144
  const t = oe(e).split("-")[0].toLowerCase();
143
- return ka.has(t) ? "rtl" : "ltr";
145
+ return ya.has(t) ? "rtl" : "ltr";
144
146
  }
145
- function m(e, t) {
146
- const a = String(e || ""), o = wa(le), s = he[o] || me;
147
- let i = Pt[a] ?? s[a] ?? me[a] ?? a;
147
+ function p(e, t) {
148
+ const a = String(e || ""), o = ka(ue), s = fe[o] || he;
149
+ let i = Rt[a] ?? s[a] ?? he[a] ?? a;
148
150
  return String(i);
149
151
  }
150
- const ja = {
152
+ const Ca = {
151
153
  "launcher.open": "Оставете бележка...",
152
154
  "tool.crop": "Реколта",
153
155
  "tool.resetCrop": "Нулиране на изрязването",
@@ -204,7 +206,7 @@ const ja = {
204
206
  "diag.timezone": "Часова зона",
205
207
  "diag.viewport": "Изгледна плоча",
206
208
  "diag.user": "Потребител"
207
- }, Ea = {
209
+ }, za = {
208
210
  "launcher.open": "Deixa una nota...",
209
211
  "tool.crop": "Cultiu",
210
212
  "tool.resetCrop": "Restablir el cultiu",
@@ -261,7 +263,7 @@ const ja = {
261
263
  "diag.timezone": "Zona horària",
262
264
  "diag.viewport": "Porta de vista",
263
265
  "diag.user": "Usuari"
264
- }, Ra = {
266
+ }, Ea = {
265
267
  "launcher.open": "Zanechte poznámku...",
266
268
  "tool.crop": "Oříznout",
267
269
  "tool.resetCrop": "Obnovit oříznutí",
@@ -318,7 +320,7 @@ const ja = {
318
320
  "diag.timezone": "Časové pásmo",
319
321
  "diag.viewport": "Výřez",
320
322
  "diag.user": "Uživatel"
321
- }, Pa = {
323
+ }, ja = {
322
324
  "launcher.open": "Efterlad en note...",
323
325
  "tool.crop": "Afgrøde",
324
326
  "tool.resetCrop": "Nulstil afgrøde",
@@ -375,7 +377,7 @@ const ja = {
375
377
  "diag.timezone": "Tidszone",
376
378
  "diag.viewport": "Viewport",
377
379
  "diag.user": "Bruger"
378
- }, La = {
380
+ }, Ra = {
379
381
  "launcher.open": "Hinterlassen Sie eine Notiz...",
380
382
  "tool.crop": "Ernte",
381
383
  "tool.resetCrop": "Zuschnitt zurücksetzen",
@@ -432,7 +434,7 @@ const ja = {
432
434
  "diag.timezone": "Zeitzone",
433
435
  "diag.viewport": "Sichtfenster",
434
436
  "diag.user": "Nutzer"
435
- }, xa = {
437
+ }, Pa = {
436
438
  "launcher.open": "Αφήστε ένα σημείωμα...",
437
439
  "tool.crop": "Καλλιέργεια",
438
440
  "tool.resetCrop": "Επαναφορά της καλλιέργειας",
@@ -489,7 +491,7 @@ const ja = {
489
491
  "diag.timezone": "Ζώνη ώρας",
490
492
  "diag.viewport": "Θύρα προβολής",
491
493
  "diag.user": "Χρήστης"
492
- }, Ua = {
494
+ }, xa = {
493
495
  "launcher.open": "Leave a note…",
494
496
  "tool.crop": "Crop",
495
497
  "tool.resetCrop": "Reset crop",
@@ -524,6 +526,8 @@ const ja = {
524
526
  "status.screenshotFailed": "Screenshot failed; you can still send text.",
525
527
  "status.recaptureFailed": "Recapture failed.",
526
528
  "status.submitFailed": "Submit failed.",
529
+ "status.submitTooLarge": "Screenshot too large; retrying smaller…",
530
+ "status.submitWithoutImage": "Submitted without screenshot.",
527
531
  "status.emptyReport": "Add a note, screenshot, or video first.",
528
532
  "status.missingConfig": "Notefully is missing endpoint or projectKey.",
529
533
  "status.speechUnsupported": "Speech recognition is not supported in this browser.",
@@ -546,7 +550,7 @@ const ja = {
546
550
  "diag.timezone": "Timezone",
547
551
  "diag.viewport": "Viewport",
548
552
  "diag.user": "User"
549
- }, Ta = {
553
+ }, La = {
550
554
  "launcher.open": "Deja una nota...",
551
555
  "tool.crop": "Cultivo",
552
556
  "tool.resetCrop": "Restablecer cultivo",
@@ -603,7 +607,7 @@ const ja = {
603
607
  "diag.timezone": "Zona horaria",
604
608
  "diag.viewport": "Ventana",
605
609
  "diag.user": "Usuario"
606
- }, Fa = {
610
+ }, Ua = {
607
611
  "launcher.open": "Deja una nota...",
608
612
  "tool.crop": "Cultivo",
609
613
  "tool.resetCrop": "Restablecer recorte",
@@ -660,7 +664,7 @@ const ja = {
660
664
  "diag.timezone": "Zona horaria",
661
665
  "diag.viewport": "ViEWPORT",
662
666
  "diag.user": "Usuario"
663
- }, Oa = {
667
+ }, Ta = {
664
668
  "launcher.open": "Jäta märkus...",
665
669
  "tool.crop": "Põllukultuur",
666
670
  "tool.resetCrop": "Lähtesta põllukultuur",
@@ -717,7 +721,7 @@ const ja = {
717
721
  "diag.timezone": "Ajavöönd",
718
722
  "diag.viewport": "Vaatenurk",
719
723
  "diag.user": "Kasutaja"
720
- }, Da = {
724
+ }, Fa = {
721
725
  "launcher.open": "Jätä muistiinpano...",
722
726
  "tool.crop": "Viljely",
723
727
  "tool.resetCrop": "Nollaa rajaus",
@@ -774,7 +778,7 @@ const ja = {
774
778
  "diag.timezone": "Aikavyöhyke",
775
779
  "diag.viewport": "Näyttöikkuna",
776
780
  "diag.user": "Käyttäjä"
777
- }, Ma = {
781
+ }, Oa = {
778
782
  "launcher.open": "Laissez un message...",
779
783
  "tool.crop": "Récolte",
780
784
  "tool.resetCrop": "Réinitialiser la récolte",
@@ -831,7 +835,7 @@ const ja = {
831
835
  "diag.timezone": "Fuseau horaire",
832
836
  "diag.viewport": "Viewport",
833
837
  "diag.user": "Utilisateur"
834
- }, Ia = {
838
+ }, Da = {
835
839
  "launcher.open": "एक नोट छोड़ें...",
836
840
  "tool.crop": "क्रॉप",
837
841
  "tool.resetCrop": "क्रॉप रीसेट करें",
@@ -888,7 +892,7 @@ const ja = {
888
892
  "diag.timezone": "टाइमज़ोन",
889
893
  "diag.viewport": "व्यूपोर्ट",
890
894
  "diag.user": "यूज़र"
891
- }, Va = {
895
+ }, Ma = {
892
896
  "launcher.open": "Ostavite poruku...",
893
897
  "tool.crop": "Usjev",
894
898
  "tool.resetCrop": "Resetirajte obrezivanje",
@@ -945,7 +949,7 @@ const ja = {
945
949
  "diag.timezone": "Vremenska zona",
946
950
  "diag.viewport": "Prikaznica",
947
951
  "diag.user": "Korisnik"
948
- }, $a = {
952
+ }, Ia = {
949
953
  "launcher.open": "Hagyjon egy jegyzetet...",
950
954
  "tool.crop": "Termés",
951
955
  "tool.resetCrop": "Vágás visszaállítása",
@@ -1002,7 +1006,7 @@ const ja = {
1002
1006
  "diag.timezone": "Időzóna",
1003
1007
  "diag.viewport": "Nézetablak",
1004
1008
  "diag.user": "Felhasználó"
1005
- }, Ba = {
1009
+ }, Va = {
1006
1010
  "launcher.open": "Tinggalkan catatan...",
1007
1011
  "tool.crop": "Panas",
1008
1012
  "tool.resetCrop": "Setel ulang tanaman",
@@ -1059,7 +1063,7 @@ const ja = {
1059
1063
  "diag.timezone": "Zona Waktu",
1060
1064
  "diag.viewport": "Pintu pandang",
1061
1065
  "diag.user": "Pengguna"
1062
- }, Na = {
1066
+ }, $a = {
1063
1067
  "launcher.open": "Lascia una nota...",
1064
1068
  "tool.crop": "Ritaglia",
1065
1069
  "tool.resetCrop": "Reimposta il ritaglio",
@@ -1116,7 +1120,7 @@ const ja = {
1116
1120
  "diag.timezone": "Fuso orario",
1117
1121
  "diag.viewport": "Viewport",
1118
1122
  "diag.user": "Utente"
1119
- }, Ka = {
1123
+ }, Ba = {
1120
1124
  "launcher.open": "メモを残してください...",
1121
1125
  "tool.crop": "クロップ",
1122
1126
  "tool.resetCrop": "トリミングをリセット",
@@ -1173,7 +1177,7 @@ const ja = {
1173
1177
  "diag.timezone": "タイムゾーン",
1174
1178
  "diag.viewport": "ビューポート",
1175
1179
  "diag.user": "ユーザ"
1176
- }, Ha = {
1180
+ }, Na = {
1177
1181
  "launcher.open": "메모 남기기...",
1178
1182
  "tool.crop": "크롭",
1179
1183
  "tool.resetCrop": "크롭 재설정",
@@ -1230,7 +1234,7 @@ const ja = {
1230
1234
  "diag.timezone": "타임존",
1231
1235
  "diag.viewport": "뷰포트",
1232
1236
  "diag.user": "사용자"
1233
- }, Ga = {
1237
+ }, Ka = {
1234
1238
  "launcher.open": "Palikite pastabą...",
1235
1239
  "tool.crop": "Apkarpyti",
1236
1240
  "tool.resetCrop": "Iš naujo nustatyti apkarpymą",
@@ -1287,7 +1291,7 @@ const ja = {
1287
1291
  "diag.timezone": "Laiko juosta",
1288
1292
  "diag.viewport": "Peržiūros sritis",
1289
1293
  "diag.user": "Vartotojas"
1290
- }, qa = {
1294
+ }, Ha = {
1291
1295
  "launcher.open": "Atstājiet piezīmi...",
1292
1296
  "tool.crop": "Kultūraugs",
1293
1297
  "tool.resetCrop": "Atiestatīt apgriešanu",
@@ -1344,7 +1348,7 @@ const ja = {
1344
1348
  "diag.timezone": "Laika josla",
1345
1349
  "diag.viewport": "Skatu laukums",
1346
1350
  "diag.user": "Lietotājs"
1347
- }, _a = {
1351
+ }, Ga = {
1348
1352
  "launcher.open": "Legg igjen et notat...",
1349
1353
  "tool.crop": "Beskjæring",
1350
1354
  "tool.resetCrop": "Tilbakestill beskjæring",
@@ -1401,7 +1405,7 @@ const ja = {
1401
1405
  "diag.timezone": "Tidssone",
1402
1406
  "diag.viewport": "Visningsport",
1403
1407
  "diag.user": "Bruker"
1404
- }, Wa = {
1408
+ }, qa = {
1405
1409
  "launcher.open": "Laat een briefje achter...",
1406
1410
  "tool.crop": "Gewas",
1407
1411
  "tool.resetCrop": "Bijsnijden opnieuw instellen",
@@ -1458,7 +1462,7 @@ const ja = {
1458
1462
  "diag.timezone": "Tijdzone",
1459
1463
  "diag.viewport": "Viewport",
1460
1464
  "diag.user": "Gebruiker"
1461
- }, Za = {
1465
+ }, _a = {
1462
1466
  "launcher.open": "Zostaw notatkę...",
1463
1467
  "tool.crop": "Uprawa",
1464
1468
  "tool.resetCrop": "Resetuj kadrowanie",
@@ -1515,7 +1519,7 @@ const ja = {
1515
1519
  "diag.timezone": "Strefa czasowa",
1516
1520
  "diag.viewport": "rzutnia",
1517
1521
  "diag.user": "Użytkownik"
1518
- }, Ja = {
1522
+ }, Wa = {
1519
1523
  "launcher.open": "Deixe uma nota...",
1520
1524
  "tool.crop": "Colheita",
1521
1525
  "tool.resetCrop": "Redefinir o corte",
@@ -1572,7 +1576,7 @@ const ja = {
1572
1576
  "diag.timezone": "Fuso horário",
1573
1577
  "diag.viewport": "Janela de visualização",
1574
1578
  "diag.user": "Usuário"
1575
- }, Ya = {
1579
+ }, Za = {
1576
1580
  "launcher.open": "Deixe uma nota...",
1577
1581
  "tool.crop": "Colheita",
1578
1582
  "tool.resetCrop": "Redefinir o recorte",
@@ -1629,7 +1633,7 @@ const ja = {
1629
1633
  "diag.timezone": "Fuso horário",
1630
1634
  "diag.viewport": "Viewport",
1631
1635
  "diag.user": "Utilizador"
1632
- }, Xa = {
1636
+ }, Ja = {
1633
1637
  "launcher.open": "Lăsați o notă...",
1634
1638
  "tool.crop": "Cultură",
1635
1639
  "tool.resetCrop": "Resetați recolta",
@@ -1686,7 +1690,7 @@ const ja = {
1686
1690
  "diag.timezone": "Fus orar",
1687
1691
  "diag.viewport": "Portul de vizualizare",
1688
1692
  "diag.user": "Utilizator"
1689
- }, Qa = {
1693
+ }, Ya = {
1690
1694
  "launcher.open": "Оставьте заметку...",
1691
1695
  "tool.crop": "урожай",
1692
1696
  "tool.resetCrop": "Сбросить урожай",
@@ -1743,7 +1747,7 @@ const ja = {
1743
1747
  "diag.timezone": "Часовой пояс",
1744
1748
  "diag.viewport": "окно просмотра",
1745
1749
  "diag.user": "Пользователь"
1746
- }, eo = {
1750
+ }, Xa = {
1747
1751
  "launcher.open": "Zanechať poznámku...",
1748
1752
  "tool.crop": "Oplodina",
1749
1753
  "tool.resetCrop": "Obnoviť orezanie",
@@ -1800,7 +1804,7 @@ const ja = {
1800
1804
  "diag.timezone": "Časové pásmo",
1801
1805
  "diag.viewport": "Zobrazenie",
1802
1806
  "diag.user": "Používateľ"
1803
- }, to = {
1807
+ }, Qa = {
1804
1808
  "launcher.open": "Pustite opombo...",
1805
1809
  "tool.crop": "Pridelek",
1806
1810
  "tool.resetCrop": "Ponastavi obrezovanje",
@@ -1857,7 +1861,7 @@ const ja = {
1857
1861
  "diag.timezone": "Časovni pas",
1858
1862
  "diag.viewport": "Razgledna plošča",
1859
1863
  "diag.user": "Uporabnik"
1860
- }, ao = {
1864
+ }, eo = {
1861
1865
  "launcher.open": "Ostavite belešku...",
1862
1866
  "tool.crop": "Usjev",
1863
1867
  "tool.resetCrop": "Resetujte usev",
@@ -1914,7 +1918,7 @@ const ja = {
1914
1918
  "diag.timezone": "Vremenska zona",
1915
1919
  "diag.viewport": "Viedport",
1916
1920
  "diag.user": "Korisnik"
1917
- }, oo = {
1921
+ }, to = {
1918
1922
  "launcher.open": "Lämna en anteckning...",
1919
1923
  "tool.crop": "Skörda",
1920
1924
  "tool.resetCrop": "Återställ beskärning",
@@ -1971,7 +1975,7 @@ const ja = {
1971
1975
  "diag.timezone": "Tidszon",
1972
1976
  "diag.viewport": "Viewport",
1973
1977
  "diag.user": "Användare"
1974
- }, io = {
1978
+ }, ao = {
1975
1979
  "launcher.open": "Mag-iwan ng tala...",
1976
1980
  "tool.crop": "Pag-ani",
1977
1981
  "tool.resetCrop": "I-reset ang panani",
@@ -2028,7 +2032,7 @@ const ja = {
2028
2032
  "diag.timezone": "Timesone",
2029
2033
  "diag.viewport": "Viewport",
2030
2034
  "diag.user": "Gumagamit"
2031
- }, so = {
2035
+ }, oo = {
2032
2036
  "launcher.open": "ทิ้งหมายเหตุ...",
2033
2037
  "tool.crop": "พืชผล",
2034
2038
  "tool.resetCrop": "รีเซ็ตการตัดพืช",
@@ -2085,7 +2089,7 @@ const ja = {
2085
2089
  "diag.timezone": "เขตเวลา",
2086
2090
  "diag.viewport": "พอร์ตมุมมอง",
2087
2091
  "diag.user": "ผู้ใช้"
2088
- }, ro = {
2092
+ }, io = {
2089
2093
  "launcher.open": "Bir not bırakın...",
2090
2094
  "tool.crop": "Mahsul",
2091
2095
  "tool.resetCrop": "Kırpmayı sıfırla",
@@ -2142,7 +2146,7 @@ const ja = {
2142
2146
  "diag.timezone": "Saat dilimi",
2143
2147
  "diag.viewport": "Görünüm noktası",
2144
2148
  "diag.user": "Kullanıcı"
2145
- }, no = {
2149
+ }, so = {
2146
2150
  "launcher.open": "Залиште записку...",
2147
2151
  "tool.crop": "Урожай",
2148
2152
  "tool.resetCrop": "Скинути обрізку",
@@ -2199,7 +2203,7 @@ const ja = {
2199
2203
  "diag.timezone": "Часовий пояс",
2200
2204
  "diag.viewport": "Вигляд",
2201
2205
  "diag.user": "Користувач"
2202
- }, lo = {
2206
+ }, ro = {
2203
2207
  "launcher.open": "Để lại một ghi chú...",
2204
2208
  "tool.crop": "Cây trồng",
2205
2209
  "tool.resetCrop": "Đặt lại cây trồng",
@@ -2256,7 +2260,7 @@ const ja = {
2256
2260
  "diag.timezone": "Múi giờ",
2257
2261
  "diag.viewport": "Cổng quan sát",
2258
2262
  "diag.user": "Người dùng"
2259
- }, uo = {
2263
+ }, no = {
2260
2264
  "launcher.open": "留个笔记...",
2261
2265
  "tool.crop": "作物",
2262
2266
  "tool.resetCrop": "重置裁剪",
@@ -2313,7 +2317,7 @@ const ja = {
2313
2317
  "diag.timezone": "时区",
2314
2318
  "diag.viewport": "视口",
2315
2319
  "diag.user": "用户"
2316
- }, co = {
2320
+ }, lo = {
2317
2321
  "launcher.open": "留下筆記...",
2318
2322
  "tool.crop": "作物",
2319
2323
  "tool.resetCrop": "重設裁切",
@@ -2371,47 +2375,47 @@ const ja = {
2371
2375
  "diag.viewport": "視埠",
2372
2376
  "diag.user": "使用者"
2373
2377
  };
2374
- h("en-US", me);
2375
- h("bg", ja);
2376
- h("ca", Ea);
2377
- h("cs", Ra);
2378
- h("da", Pa);
2379
- h("de", La);
2380
- h("el", xa);
2381
- h("en-GB", Ua);
2382
- h("es", Ta);
2383
- h("es-419", Fa);
2384
- h("et", Oa);
2385
- h("fi", Da);
2386
- h("fr", Ma);
2387
- h("hi", Ia);
2388
- h("hr", Va);
2389
- h("hu", $a);
2390
- h("id", Ba);
2391
- h("it", Na);
2392
- h("ja", Ka);
2393
- h("ko", Ha);
2394
- h("lt", Ga);
2395
- h("lv", qa);
2396
- h("nb", _a);
2397
- h("nl", Wa);
2398
- h("pl", Za);
2399
- h("pt-BR", Ja);
2400
- h("pt-PT", Ya);
2401
- h("ro", Xa);
2402
- h("ru", Qa);
2403
- h("sk", eo);
2404
- h("sl", to);
2405
- h("sr", ao);
2406
- h("sv", oo);
2407
- h("fil", io);
2408
- h("th", so);
2409
- h("tr", ro);
2410
- h("uk", no);
2411
- h("vi", lo);
2412
- h("zh-CN", uo);
2413
- h("zh-TW", co);
2414
- function po(e, t) {
2378
+ h("en-US", he);
2379
+ h("bg", Ca);
2380
+ h("ca", za);
2381
+ h("cs", Ea);
2382
+ h("da", ja);
2383
+ h("de", Ra);
2384
+ h("el", Pa);
2385
+ h("en-GB", xa);
2386
+ h("es", La);
2387
+ h("es-419", Ua);
2388
+ h("et", Ta);
2389
+ h("fi", Fa);
2390
+ h("fr", Oa);
2391
+ h("hi", Da);
2392
+ h("hr", Ma);
2393
+ h("hu", Ia);
2394
+ h("id", Va);
2395
+ h("it", $a);
2396
+ h("ja", Ba);
2397
+ h("ko", Na);
2398
+ h("lt", Ka);
2399
+ h("lv", Ha);
2400
+ h("nb", Ga);
2401
+ h("nl", qa);
2402
+ h("pl", _a);
2403
+ h("pt-BR", Wa);
2404
+ h("pt-PT", Za);
2405
+ h("ro", Ja);
2406
+ h("ru", Ya);
2407
+ h("sk", Xa);
2408
+ h("sl", Qa);
2409
+ h("sr", eo);
2410
+ h("sv", to);
2411
+ h("fil", ao);
2412
+ h("th", oo);
2413
+ h("tr", io);
2414
+ h("uk", so);
2415
+ h("vi", ro);
2416
+ h("zh-CN", no);
2417
+ h("zh-TW", lo);
2418
+ function uo(e, t) {
2415
2419
  if (e.match(/^[a-z]+:\/\//i))
2416
2420
  return e;
2417
2421
  if (e.match(/^\/\//))
@@ -2421,7 +2425,7 @@ function po(e, t) {
2421
2425
  const a = document.implementation.createHTMLDocument(), o = a.createElement("base"), s = a.createElement("a");
2422
2426
  return a.head.appendChild(o), a.body.appendChild(s), t && (o.href = t), s.href = e, s.href;
2423
2427
  }
2424
- const go = /* @__PURE__ */ (() => {
2428
+ const co = /* @__PURE__ */ (() => {
2425
2429
  let e = 0;
2426
2430
  const t = () => (
2427
2431
  // eslint-disable-next-line no-bitwise
@@ -2429,33 +2433,33 @@ const go = /* @__PURE__ */ (() => {
2429
2433
  );
2430
2434
  return () => (e += 1, `u${t()}${e}`);
2431
2435
  })();
2432
- function G(e) {
2436
+ function W(e) {
2433
2437
  const t = [];
2434
2438
  for (let a = 0, o = e.length; a < o; a++)
2435
2439
  t.push(e[a]);
2436
2440
  return t;
2437
2441
  }
2438
2442
  let te = null;
2439
- function Lt(e = {}) {
2440
- return te || (e.includeStyleProperties ? (te = e.includeStyleProperties, te) : (te = G(window.getComputedStyle(document.documentElement)), te));
2443
+ function Pt(e = {}) {
2444
+ return te || (e.includeStyleProperties ? (te = e.includeStyleProperties, te) : (te = W(window.getComputedStyle(document.documentElement)), te));
2441
2445
  }
2442
- function ye(e, t) {
2446
+ function ve(e, t) {
2443
2447
  const o = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
2444
2448
  return o ? parseFloat(o.replace("px", "")) : 0;
2445
2449
  }
2446
- function mo(e) {
2447
- const t = ye(e, "border-left-width"), a = ye(e, "border-right-width");
2450
+ function po(e) {
2451
+ const t = ve(e, "border-left-width"), a = ve(e, "border-right-width");
2448
2452
  return e.clientWidth + t + a;
2449
2453
  }
2450
- function ho(e) {
2451
- const t = ye(e, "border-top-width"), a = ye(e, "border-bottom-width");
2454
+ function go(e) {
2455
+ const t = ve(e, "border-top-width"), a = ve(e, "border-bottom-width");
2452
2456
  return e.clientHeight + t + a;
2453
2457
  }
2454
2458
  function xt(e, t = {}) {
2455
- const a = t.width || mo(e), o = t.height || ho(e);
2459
+ const a = t.width || po(e), o = t.height || go(e);
2456
2460
  return { width: a, height: o };
2457
2461
  }
2458
- function fo() {
2462
+ function mo() {
2459
2463
  let e, t;
2460
2464
  try {
2461
2465
  t = process;
@@ -2464,11 +2468,11 @@ function fo() {
2464
2468
  const a = t && t.env ? t.env.devicePixelRatio : null;
2465
2469
  return a && (e = parseInt(a, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
2466
2470
  }
2467
- const R = 16384;
2468
- function yo(e) {
2469
- (e.width > R || e.height > R) && (e.width > R && e.height > R ? e.width > e.height ? (e.height *= R / e.width, e.width = R) : (e.width *= R / e.height, e.height = R) : e.width > R ? (e.height *= R / e.width, e.width = R) : (e.width *= R / e.height, e.height = R));
2471
+ const U = 16384;
2472
+ function ho(e) {
2473
+ (e.width > U || e.height > U) && (e.width > U && e.height > U ? e.width > e.height ? (e.height *= U / e.width, e.width = U) : (e.width *= U / e.height, e.height = U) : e.width > U ? (e.height *= U / e.width, e.width = U) : (e.width *= U / e.height, e.height = U));
2470
2474
  }
2471
- function ve(e) {
2475
+ function ke(e) {
2472
2476
  return new Promise((t, a) => {
2473
2477
  const o = new Image();
2474
2478
  o.onload = () => {
@@ -2478,131 +2482,131 @@ function ve(e) {
2478
2482
  }, o.onerror = a, o.crossOrigin = "anonymous", o.decoding = "async", o.src = e;
2479
2483
  });
2480
2484
  }
2481
- async function vo(e) {
2485
+ async function fo(e) {
2482
2486
  return Promise.resolve().then(() => new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then((t) => `data:image/svg+xml;charset=utf-8,${t}`);
2483
2487
  }
2484
- async function ko(e, t, a) {
2488
+ async function yo(e, t, a) {
2485
2489
  const o = "http://www.w3.org/2000/svg", s = document.createElementNS(o, "svg"), i = document.createElementNS(o, "foreignObject");
2486
- return s.setAttribute("width", `${t}`), s.setAttribute("height", `${a}`), s.setAttribute("viewBox", `0 0 ${t} ${a}`), i.setAttribute("width", "100%"), i.setAttribute("height", "100%"), i.setAttribute("x", "0"), i.setAttribute("y", "0"), i.setAttribute("externalResourcesRequired", "true"), s.appendChild(i), i.appendChild(e), vo(s);
2490
+ return s.setAttribute("width", `${t}`), s.setAttribute("height", `${a}`), s.setAttribute("viewBox", `0 0 ${t} ${a}`), i.setAttribute("width", "100%"), i.setAttribute("height", "100%"), i.setAttribute("x", "0"), i.setAttribute("y", "0"), i.setAttribute("externalResourcesRequired", "true"), s.appendChild(i), i.appendChild(e), fo(s);
2487
2491
  }
2488
- const j = (e, t) => {
2492
+ const L = (e, t) => {
2489
2493
  if (e instanceof t)
2490
2494
  return !0;
2491
2495
  const a = Object.getPrototypeOf(e);
2492
- return a === null ? !1 : a.constructor.name === t.name || j(a, t);
2496
+ return a === null ? !1 : a.constructor.name === t.name || L(a, t);
2493
2497
  };
2494
- function bo(e) {
2498
+ function vo(e) {
2495
2499
  const t = e.getPropertyValue("content");
2496
2500
  return `${e.cssText} content: '${t.replace(/'|"/g, "")}';`;
2497
2501
  }
2498
- function wo(e, t) {
2499
- return Lt(t).map((a) => {
2502
+ function ko(e, t) {
2503
+ return Pt(t).map((a) => {
2500
2504
  const o = e.getPropertyValue(a), s = e.getPropertyPriority(a);
2501
2505
  return `${a}: ${o}${s ? " !important" : ""};`;
2502
2506
  }).join(" ");
2503
2507
  }
2504
- function So(e, t, a, o) {
2505
- const s = `.${e}:${t}`, i = a.cssText ? bo(a) : wo(a, o);
2508
+ function bo(e, t, a, o) {
2509
+ const s = `.${e}:${t}`, i = a.cssText ? vo(a) : ko(a, o);
2506
2510
  return document.createTextNode(`${s}{${i}}`);
2507
2511
  }
2508
- function st(e, t, a, o) {
2512
+ function ot(e, t, a, o) {
2509
2513
  const s = window.getComputedStyle(e, a), i = s.getPropertyValue("content");
2510
2514
  if (i === "" || i === "none")
2511
2515
  return;
2512
- const r = go();
2516
+ const r = co();
2513
2517
  try {
2514
2518
  t.className = `${t.className} ${r}`;
2515
2519
  } catch {
2516
2520
  return;
2517
2521
  }
2518
- const n = document.createElement("style");
2519
- n.appendChild(So(r, a, s, o)), t.appendChild(n);
2522
+ const l = document.createElement("style");
2523
+ l.appendChild(bo(r, a, s, o)), t.appendChild(l);
2520
2524
  }
2521
- function Ao(e, t, a) {
2522
- st(e, t, ":before", a), st(e, t, ":after", a);
2525
+ function wo(e, t, a) {
2526
+ ot(e, t, ":before", a), ot(e, t, ":after", a);
2523
2527
  }
2524
- const rt = "application/font-woff", nt = "image/jpeg", Co = {
2525
- woff: rt,
2526
- woff2: rt,
2528
+ const it = "application/font-woff", st = "image/jpeg", So = {
2529
+ woff: it,
2530
+ woff2: it,
2527
2531
  ttf: "application/font-truetype",
2528
2532
  eot: "application/vnd.ms-fontobject",
2529
2533
  png: "image/png",
2530
- jpg: nt,
2531
- jpeg: nt,
2534
+ jpg: st,
2535
+ jpeg: st,
2532
2536
  gif: "image/gif",
2533
2537
  tiff: "image/tiff",
2534
2538
  svg: "image/svg+xml",
2535
2539
  webp: "image/webp"
2536
2540
  };
2537
- function zo(e) {
2541
+ function Ao(e) {
2538
2542
  const t = /\.([^./]*?)$/g.exec(e);
2539
2543
  return t ? t[1] : "";
2540
2544
  }
2541
- function We(e) {
2542
- const t = zo(e).toLowerCase();
2543
- return Co[t] || "";
2545
+ function _e(e) {
2546
+ const t = Ao(e).toLowerCase();
2547
+ return So[t] || "";
2544
2548
  }
2545
- function jo(e) {
2549
+ function Co(e) {
2546
2550
  return e.split(/,/)[1];
2547
2551
  }
2548
- function $e(e) {
2552
+ function Be(e) {
2549
2553
  return e.search(/^(data:)/) !== -1;
2550
2554
  }
2551
- function Eo(e, t) {
2555
+ function zo(e, t) {
2552
2556
  return `data:${t};base64,${e}`;
2553
2557
  }
2554
- async function Ut(e, t, a) {
2558
+ async function Lt(e, t, a) {
2555
2559
  const o = await fetch(e, t);
2556
2560
  if (o.status === 404)
2557
2561
  throw new Error(`Resource "${o.url}" not found`);
2558
2562
  const s = await o.blob();
2559
2563
  return new Promise((i, r) => {
2560
- const n = new FileReader();
2561
- n.onerror = r, n.onloadend = () => {
2564
+ const l = new FileReader();
2565
+ l.onerror = r, l.onloadend = () => {
2562
2566
  try {
2563
- i(a({ res: o, result: n.result }));
2567
+ i(a({ res: o, result: l.result }));
2564
2568
  } catch (u) {
2565
2569
  r(u);
2566
2570
  }
2567
- }, n.readAsDataURL(s);
2571
+ }, l.readAsDataURL(s);
2568
2572
  });
2569
2573
  }
2570
- const Fe = {};
2571
- function Ro(e, t, a) {
2574
+ const Oe = {};
2575
+ function Eo(e, t, a) {
2572
2576
  let o = e.replace(/\?.*/, "");
2573
2577
  return a && (o = e), /ttf|otf|eot|woff2?/i.test(o) && (o = o.replace(/.*\//, "")), t ? `[${t}]${o}` : o;
2574
2578
  }
2575
- async function Ze(e, t, a) {
2576
- const o = Ro(e, t, a.includeQueryParams);
2577
- if (Fe[o] != null)
2578
- return Fe[o];
2579
+ async function We(e, t, a) {
2580
+ const o = Eo(e, t, a.includeQueryParams);
2581
+ if (Oe[o] != null)
2582
+ return Oe[o];
2579
2583
  a.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
2580
2584
  let s;
2581
2585
  try {
2582
- const i = await Ut(e, a.fetchRequestInit, ({ res: r, result: n }) => (t || (t = r.headers.get("Content-Type") || ""), jo(n)));
2583
- s = Eo(i, t);
2586
+ const i = await Lt(e, a.fetchRequestInit, ({ res: r, result: l }) => (t || (t = r.headers.get("Content-Type") || ""), Co(l)));
2587
+ s = zo(i, t);
2584
2588
  } catch (i) {
2585
2589
  s = a.imagePlaceholder || "";
2586
2590
  let r = `Failed to fetch resource: ${e}`;
2587
2591
  i && (r = typeof i == "string" ? i : i.message), r && console.warn(r);
2588
2592
  }
2589
- return Fe[o] = s, s;
2593
+ return Oe[o] = s, s;
2590
2594
  }
2591
- async function Po(e) {
2595
+ async function jo(e) {
2592
2596
  const t = e.toDataURL();
2593
- return t === "data:," ? e.cloneNode(!1) : ve(t);
2597
+ return t === "data:," ? e.cloneNode(!1) : ke(t);
2594
2598
  }
2595
- async function Lo(e, t) {
2599
+ async function Ro(e, t) {
2596
2600
  if (e.currentSrc) {
2597
2601
  const i = document.createElement("canvas"), r = i.getContext("2d");
2598
2602
  i.width = e.clientWidth, i.height = e.clientHeight, r == null || r.drawImage(e, 0, 0, i.width, i.height);
2599
- const n = i.toDataURL();
2600
- return ve(n);
2603
+ const l = i.toDataURL();
2604
+ return ke(l);
2601
2605
  }
2602
- const a = e.poster, o = We(a), s = await Ze(a, o, t);
2603
- return ve(s);
2606
+ const a = e.poster, o = _e(a), s = await We(a, o, t);
2607
+ return ke(s);
2604
2608
  }
2605
- async function xo(e, t) {
2609
+ async function Po(e, t) {
2606
2610
  var a;
2607
2611
  try {
2608
2612
  if (!((a = e == null ? void 0 : e.contentDocument) === null || a === void 0) && a.body)
@@ -2611,90 +2615,90 @@ async function xo(e, t) {
2611
2615
  }
2612
2616
  return e.cloneNode(!1);
2613
2617
  }
2614
- async function Uo(e, t) {
2615
- return j(e, HTMLCanvasElement) ? Po(e) : j(e, HTMLVideoElement) ? Lo(e, t) : j(e, HTMLIFrameElement) ? xo(e, t) : e.cloneNode(Tt(e));
2618
+ async function xo(e, t) {
2619
+ return L(e, HTMLCanvasElement) ? jo(e) : L(e, HTMLVideoElement) ? Ro(e, t) : L(e, HTMLIFrameElement) ? Po(e, t) : e.cloneNode(Ut(e));
2616
2620
  }
2617
- const To = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Tt = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
2618
- async function Fo(e, t, a) {
2621
+ const Lo = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Ut = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
2622
+ async function Uo(e, t, a) {
2619
2623
  var o, s;
2620
- if (Tt(t))
2624
+ if (Ut(t))
2621
2625
  return t;
2622
2626
  let i = [];
2623
- return To(e) && e.assignedNodes ? i = G(e.assignedNodes()) : j(e, HTMLIFrameElement) && (!((o = e.contentDocument) === null || o === void 0) && o.body) ? i = G(e.contentDocument.body.childNodes) : i = G(((s = e.shadowRoot) !== null && s !== void 0 ? s : e).childNodes), i.length === 0 || j(e, HTMLVideoElement) || await i.reduce((r, n) => r.then(() => je(n, a)).then((u) => {
2627
+ return Lo(e) && e.assignedNodes ? i = W(e.assignedNodes()) : L(e, HTMLIFrameElement) && (!((o = e.contentDocument) === null || o === void 0) && o.body) ? i = W(e.contentDocument.body.childNodes) : i = W(((s = e.shadowRoot) !== null && s !== void 0 ? s : e).childNodes), i.length === 0 || L(e, HTMLVideoElement) || await i.reduce((r, l) => r.then(() => je(l, a)).then((u) => {
2624
2628
  u && t.appendChild(u);
2625
2629
  }), Promise.resolve()), t;
2626
2630
  }
2627
- function Oo(e, t, a) {
2631
+ function To(e, t, a) {
2628
2632
  const o = t.style;
2629
2633
  if (!o)
2630
2634
  return;
2631
2635
  const s = window.getComputedStyle(e);
2632
- s.cssText ? (o.cssText = s.cssText, o.transformOrigin = s.transformOrigin) : Lt(a).forEach((i) => {
2636
+ s.cssText ? (o.cssText = s.cssText, o.transformOrigin = s.transformOrigin) : Pt(a).forEach((i) => {
2633
2637
  let r = s.getPropertyValue(i);
2634
- i === "font-size" && r.endsWith("px") && (r = `${Math.floor(parseFloat(r.substring(0, r.length - 2))) - 0.1}px`), j(e, HTMLIFrameElement) && i === "display" && r === "inline" && (r = "block"), i === "d" && t.getAttribute("d") && (r = `path(${t.getAttribute("d")})`), o.setProperty(i, r, s.getPropertyPriority(i));
2638
+ i === "font-size" && r.endsWith("px") && (r = `${Math.floor(parseFloat(r.substring(0, r.length - 2))) - 0.1}px`), L(e, HTMLIFrameElement) && i === "display" && r === "inline" && (r = "block"), i === "d" && t.getAttribute("d") && (r = `path(${t.getAttribute("d")})`), o.setProperty(i, r, s.getPropertyPriority(i));
2635
2639
  });
2636
2640
  }
2637
- function Do(e, t) {
2638
- j(e, HTMLTextAreaElement) && (t.innerHTML = e.value), j(e, HTMLInputElement) && t.setAttribute("value", e.value);
2641
+ function Fo(e, t) {
2642
+ L(e, HTMLTextAreaElement) && (t.innerHTML = e.value), L(e, HTMLInputElement) && t.setAttribute("value", e.value);
2639
2643
  }
2640
- function Mo(e, t) {
2641
- if (j(e, HTMLSelectElement)) {
2644
+ function Oo(e, t) {
2645
+ if (L(e, HTMLSelectElement)) {
2642
2646
  const o = Array.from(t.children).find((s) => e.value === s.getAttribute("value"));
2643
2647
  o && o.setAttribute("selected", "");
2644
2648
  }
2645
2649
  }
2646
- function Io(e, t, a) {
2647
- return j(t, Element) && (Oo(e, t, a), Ao(e, t, a), Do(e, t), Mo(e, t)), t;
2650
+ function Do(e, t, a) {
2651
+ return L(t, Element) && (To(e, t, a), wo(e, t, a), Fo(e, t), Oo(e, t)), t;
2648
2652
  }
2649
- async function Vo(e, t) {
2653
+ async function Mo(e, t) {
2650
2654
  const a = e.querySelectorAll ? e.querySelectorAll("use") : [];
2651
2655
  if (a.length === 0)
2652
2656
  return e;
2653
2657
  const o = {};
2654
2658
  for (let i = 0; i < a.length; i++) {
2655
- const n = a[i].getAttribute("xlink:href");
2656
- if (n) {
2657
- const u = e.querySelector(n), d = document.querySelector(n);
2658
- !u && d && !o[n] && (o[n] = await je(d, t, !0));
2659
+ const l = a[i].getAttribute("xlink:href");
2660
+ if (l) {
2661
+ const u = e.querySelector(l), c = document.querySelector(l);
2662
+ !u && c && !o[l] && (o[l] = await je(c, t, !0));
2659
2663
  }
2660
2664
  }
2661
2665
  const s = Object.values(o);
2662
2666
  if (s.length) {
2663
2667
  const i = "http://www.w3.org/1999/xhtml", r = document.createElementNS(i, "svg");
2664
2668
  r.setAttribute("xmlns", i), r.style.position = "absolute", r.style.width = "0", r.style.height = "0", r.style.overflow = "hidden", r.style.display = "none";
2665
- const n = document.createElementNS(i, "defs");
2666
- r.appendChild(n);
2669
+ const l = document.createElementNS(i, "defs");
2670
+ r.appendChild(l);
2667
2671
  for (let u = 0; u < s.length; u++)
2668
- n.appendChild(s[u]);
2672
+ l.appendChild(s[u]);
2669
2673
  e.appendChild(r);
2670
2674
  }
2671
2675
  return e;
2672
2676
  }
2673
2677
  async function je(e, t, a) {
2674
- return !a && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((o) => Uo(o, t)).then((o) => Fo(e, o, t)).then((o) => Io(e, o, t)).then((o) => Vo(o, t));
2678
+ return !a && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((o) => xo(o, t)).then((o) => Uo(e, o, t)).then((o) => Do(e, o, t)).then((o) => Mo(o, t));
2675
2679
  }
2676
- const Ft = /url\((['"]?)([^'"]+?)\1\)/g, $o = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Bo = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
2677
- function No(e) {
2680
+ const Tt = /url\((['"]?)([^'"]+?)\1\)/g, Io = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Vo = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
2681
+ function $o(e) {
2678
2682
  const t = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
2679
2683
  return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
2680
2684
  }
2681
- function Ko(e) {
2685
+ function Bo(e) {
2682
2686
  const t = [];
2683
- return e.replace(Ft, (a, o, s) => (t.push(s), a)), t.filter((a) => !$e(a));
2687
+ return e.replace(Tt, (a, o, s) => (t.push(s), a)), t.filter((a) => !Be(a));
2684
2688
  }
2685
- async function Ho(e, t, a, o, s) {
2689
+ async function No(e, t, a, o, s) {
2686
2690
  try {
2687
- const i = a ? po(t, a) : t, r = We(t);
2688
- let n;
2689
- return s || (n = await Ze(i, r, o)), e.replace(No(t), `$1${n}$3`);
2691
+ const i = a ? uo(t, a) : t, r = _e(t);
2692
+ let l;
2693
+ return s || (l = await We(i, r, o)), e.replace($o(t), `$1${l}$3`);
2690
2694
  } catch {
2691
2695
  }
2692
2696
  return e;
2693
2697
  }
2694
- function Go(e, { preferredFontFormat: t }) {
2695
- return t ? e.replace(Bo, (a) => {
2698
+ function Ko(e, { preferredFontFormat: t }) {
2699
+ return t ? e.replace(Vo, (a) => {
2696
2700
  for (; ; ) {
2697
- const [o, , s] = $o.exec(a) || [];
2701
+ const [o, , s] = Io.exec(a) || [];
2698
2702
  if (!s)
2699
2703
  return "";
2700
2704
  if (s === t)
@@ -2702,52 +2706,52 @@ function Go(e, { preferredFontFormat: t }) {
2702
2706
  }
2703
2707
  }) : e;
2704
2708
  }
2705
- function Ot(e) {
2706
- return e.search(Ft) !== -1;
2709
+ function Ft(e) {
2710
+ return e.search(Tt) !== -1;
2707
2711
  }
2708
- async function Dt(e, t, a) {
2709
- if (!Ot(e))
2712
+ async function Ot(e, t, a) {
2713
+ if (!Ft(e))
2710
2714
  return e;
2711
- const o = Go(e, a);
2712
- return Ko(o).reduce((i, r) => i.then((n) => Ho(n, r, t, a)), Promise.resolve(o));
2715
+ const o = Ko(e, a);
2716
+ return Bo(o).reduce((i, r) => i.then((l) => No(l, r, t, a)), Promise.resolve(o));
2713
2717
  }
2714
2718
  async function ae(e, t, a) {
2715
2719
  var o;
2716
2720
  const s = (o = t.style) === null || o === void 0 ? void 0 : o.getPropertyValue(e);
2717
2721
  if (s) {
2718
- const i = await Dt(s, null, a);
2722
+ const i = await Ot(s, null, a);
2719
2723
  return t.style.setProperty(e, i, t.style.getPropertyPriority(e)), !0;
2720
2724
  }
2721
2725
  return !1;
2722
2726
  }
2723
- async function qo(e, t) {
2727
+ async function Ho(e, t) {
2724
2728
  await ae("background", e, t) || await ae("background-image", e, t), await ae("mask", e, t) || await ae("-webkit-mask", e, t) || await ae("mask-image", e, t) || await ae("-webkit-mask-image", e, t);
2725
2729
  }
2726
- async function _o(e, t) {
2727
- const a = j(e, HTMLImageElement);
2728
- if (!(a && !$e(e.src)) && !(j(e, SVGImageElement) && !$e(e.href.baseVal)))
2730
+ async function Go(e, t) {
2731
+ const a = L(e, HTMLImageElement);
2732
+ if (!(a && !Be(e.src)) && !(L(e, SVGImageElement) && !Be(e.href.baseVal)))
2729
2733
  return;
2730
- const o = a ? e.src : e.href.baseVal, s = await Ze(o, We(o), t);
2734
+ const o = a ? e.src : e.href.baseVal, s = await We(o, _e(o), t);
2731
2735
  await new Promise((i, r) => {
2732
2736
  e.onload = i, e.onerror = t.onImageErrorHandler ? (...u) => {
2733
2737
  try {
2734
2738
  i(t.onImageErrorHandler(...u));
2735
- } catch (d) {
2736
- r(d);
2739
+ } catch (c) {
2740
+ r(c);
2737
2741
  }
2738
2742
  } : r;
2739
- const n = e;
2740
- n.decode && (n.decode = i), n.loading === "lazy" && (n.loading = "eager"), a ? (e.srcset = "", e.src = s) : e.href.baseVal = s;
2743
+ const l = e;
2744
+ l.decode && (l.decode = i), l.loading === "lazy" && (l.loading = "eager"), a ? (e.srcset = "", e.src = s) : e.href.baseVal = s;
2741
2745
  });
2742
2746
  }
2743
- async function Wo(e, t) {
2744
- const o = G(e.childNodes).map((s) => Mt(s, t));
2747
+ async function qo(e, t) {
2748
+ const o = W(e.childNodes).map((s) => Dt(s, t));
2745
2749
  await Promise.all(o).then(() => e);
2746
2750
  }
2747
- async function Mt(e, t) {
2748
- j(e, Element) && (await qo(e, t), await _o(e, t), await Wo(e, t));
2751
+ async function Dt(e, t) {
2752
+ L(e, Element) && (await Ho(e, t), await Go(e, t), await qo(e, t));
2749
2753
  }
2750
- function Zo(e, t) {
2754
+ function _o(e, t) {
2751
2755
  const { style: a } = e;
2752
2756
  t.backgroundColor && (a.backgroundColor = t.backgroundColor), t.width && (a.width = `${t.width}px`), t.height && (a.height = `${t.height}px`);
2753
2757
  const o = t.style;
@@ -2755,23 +2759,23 @@ function Zo(e, t) {
2755
2759
  a[s] = o[s];
2756
2760
  }), e;
2757
2761
  }
2758
- const lt = {};
2759
- async function ut(e) {
2760
- let t = lt[e];
2762
+ const rt = {};
2763
+ async function nt(e) {
2764
+ let t = rt[e];
2761
2765
  if (t != null)
2762
2766
  return t;
2763
2767
  const o = await (await fetch(e)).text();
2764
- return t = { url: e, cssText: o }, lt[e] = t, t;
2768
+ return t = { url: e, cssText: o }, rt[e] = t, t;
2765
2769
  }
2766
- async function dt(e, t) {
2770
+ async function lt(e, t) {
2767
2771
  let a = e.cssText;
2768
2772
  const o = /url\(["']?([^"')]+)["']?\)/g, i = (a.match(/url\([^)]+\)/g) || []).map(async (r) => {
2769
- let n = r.replace(o, "$1");
2770
- return n.startsWith("https://") || (n = new URL(n, e.url).href), Ut(n, t.fetchRequestInit, ({ result: u }) => (a = a.replace(r, `url(${u})`), [r, u]));
2773
+ let l = r.replace(o, "$1");
2774
+ return l.startsWith("https://") || (l = new URL(l, e.url).href), Lt(l, t.fetchRequestInit, ({ result: u }) => (a = a.replace(r, `url(${u})`), [r, u]));
2771
2775
  });
2772
2776
  return Promise.all(i).then(() => a);
2773
2777
  }
2774
- function ct(e) {
2778
+ function ut(e) {
2775
2779
  if (e == null)
2776
2780
  return [];
2777
2781
  const t = [], a = /(\/\*[\s\S]*?\*\/)/gi;
@@ -2784,54 +2788,54 @@ function ct(e) {
2784
2788
  t.push(u[0]);
2785
2789
  }
2786
2790
  o = o.replace(s, "");
2787
- const i = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, r = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", n = new RegExp(r, "gi");
2791
+ const i = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, r = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", l = new RegExp(r, "gi");
2788
2792
  for (; ; ) {
2789
2793
  let u = i.exec(o);
2790
2794
  if (u === null) {
2791
- if (u = n.exec(o), u === null)
2795
+ if (u = l.exec(o), u === null)
2792
2796
  break;
2793
- i.lastIndex = n.lastIndex;
2797
+ i.lastIndex = l.lastIndex;
2794
2798
  } else
2795
- n.lastIndex = i.lastIndex;
2799
+ l.lastIndex = i.lastIndex;
2796
2800
  t.push(u[0]);
2797
2801
  }
2798
2802
  return t;
2799
2803
  }
2800
- async function Jo(e, t) {
2804
+ async function Wo(e, t) {
2801
2805
  const a = [], o = [];
2802
2806
  return e.forEach((s) => {
2803
2807
  if ("cssRules" in s)
2804
2808
  try {
2805
- G(s.cssRules || []).forEach((i, r) => {
2809
+ W(s.cssRules || []).forEach((i, r) => {
2806
2810
  if (i.type === CSSRule.IMPORT_RULE) {
2807
- let n = r + 1;
2808
- const u = i.href, d = ut(u).then((p) => dt(p, t)).then((p) => ct(p).forEach((y) => {
2811
+ let l = r + 1;
2812
+ const u = i.href, c = nt(u).then((g) => lt(g, t)).then((g) => ut(g).forEach((v) => {
2809
2813
  try {
2810
- s.insertRule(y, y.startsWith("@import") ? n += 1 : s.cssRules.length);
2811
- } catch (v) {
2814
+ s.insertRule(v, v.startsWith("@import") ? l += 1 : s.cssRules.length);
2815
+ } catch (k) {
2812
2816
  console.error("Error inserting rule from remote css", {
2813
- rule: y,
2814
- error: v
2817
+ rule: v,
2818
+ error: k
2815
2819
  });
2816
2820
  }
2817
- })).catch((p) => {
2818
- console.error("Error loading remote css", p.toString());
2821
+ })).catch((g) => {
2822
+ console.error("Error loading remote css", g.toString());
2819
2823
  });
2820
- o.push(d);
2824
+ o.push(c);
2821
2825
  }
2822
2826
  });
2823
2827
  } catch (i) {
2824
- const r = e.find((n) => n.href == null) || document.styleSheets[0];
2825
- s.href != null && o.push(ut(s.href).then((n) => dt(n, t)).then((n) => ct(n).forEach((u) => {
2828
+ const r = e.find((l) => l.href == null) || document.styleSheets[0];
2829
+ s.href != null && o.push(nt(s.href).then((l) => lt(l, t)).then((l) => ut(l).forEach((u) => {
2826
2830
  r.insertRule(u, r.cssRules.length);
2827
- })).catch((n) => {
2828
- console.error("Error loading remote stylesheet", n);
2831
+ })).catch((l) => {
2832
+ console.error("Error loading remote stylesheet", l);
2829
2833
  })), console.error("Error inlining remote css file", i);
2830
2834
  }
2831
2835
  }), Promise.all(o).then(() => (e.forEach((s) => {
2832
2836
  if ("cssRules" in s)
2833
2837
  try {
2834
- G(s.cssRules || []).forEach((i) => {
2838
+ W(s.cssRules || []).forEach((i) => {
2835
2839
  a.push(i);
2836
2840
  });
2837
2841
  } catch (i) {
@@ -2839,60 +2843,60 @@ async function Jo(e, t) {
2839
2843
  }
2840
2844
  }), a));
2841
2845
  }
2842
- function Yo(e) {
2843
- return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => Ot(t.style.getPropertyValue("src")));
2846
+ function Zo(e) {
2847
+ return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => Ft(t.style.getPropertyValue("src")));
2844
2848
  }
2845
- async function Xo(e, t) {
2849
+ async function Jo(e, t) {
2846
2850
  if (e.ownerDocument == null)
2847
2851
  throw new Error("Provided element is not within a Document");
2848
- const a = G(e.ownerDocument.styleSheets), o = await Jo(a, t);
2849
- return Yo(o);
2852
+ const a = W(e.ownerDocument.styleSheets), o = await Wo(a, t);
2853
+ return Zo(o);
2850
2854
  }
2851
- function It(e) {
2855
+ function Mt(e) {
2852
2856
  return e.trim().replace(/["']/g, "");
2853
2857
  }
2854
- function Qo(e) {
2858
+ function Yo(e) {
2855
2859
  const t = /* @__PURE__ */ new Set();
2856
2860
  function a(o) {
2857
2861
  (o.style.fontFamily || getComputedStyle(o).fontFamily).split(",").forEach((i) => {
2858
- t.add(It(i));
2862
+ t.add(Mt(i));
2859
2863
  }), Array.from(o.children).forEach((i) => {
2860
2864
  i instanceof HTMLElement && a(i);
2861
2865
  });
2862
2866
  }
2863
2867
  return a(e), t;
2864
2868
  }
2865
- async function ei(e, t) {
2866
- const a = await Xo(e, t), o = Qo(e);
2867
- return (await Promise.all(a.filter((i) => o.has(It(i.style.fontFamily))).map((i) => {
2869
+ async function Xo(e, t) {
2870
+ const a = await Jo(e, t), o = Yo(e);
2871
+ return (await Promise.all(a.filter((i) => o.has(Mt(i.style.fontFamily))).map((i) => {
2868
2872
  const r = i.parentStyleSheet ? i.parentStyleSheet.href : null;
2869
- return Dt(i.cssText, r, t);
2873
+ return Ot(i.cssText, r, t);
2870
2874
  }))).join(`
2871
2875
  `);
2872
2876
  }
2873
- async function ti(e, t) {
2874
- const a = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await ei(e, t);
2877
+ async function Qo(e, t) {
2878
+ const a = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await Xo(e, t);
2875
2879
  if (a) {
2876
2880
  const o = document.createElement("style"), s = document.createTextNode(a);
2877
2881
  o.appendChild(s), e.firstChild ? e.insertBefore(o, e.firstChild) : e.appendChild(o);
2878
2882
  }
2879
2883
  }
2880
- async function ai(e, t = {}) {
2884
+ async function ei(e, t = {}) {
2881
2885
  const { width: a, height: o } = xt(e, t), s = await je(e, t, !0);
2882
- return await ti(s, t), await Mt(s, t), Zo(s, t), await ko(s, a, o);
2886
+ return await Qo(s, t), await Dt(s, t), _o(s, t), await yo(s, a, o);
2883
2887
  }
2884
- async function oi(e, t = {}) {
2885
- const { width: a, height: o } = xt(e, t), s = await ai(e, t), i = await ve(s), r = document.createElement("canvas"), n = r.getContext("2d"), u = t.pixelRatio || fo(), d = t.canvasWidth || a, p = t.canvasHeight || o;
2886
- return r.width = d * u, r.height = p * u, t.skipAutoScale || yo(r), r.style.width = `${d}`, r.style.height = `${p}`, t.backgroundColor && (n.fillStyle = t.backgroundColor, n.fillRect(0, 0, r.width, r.height)), n.drawImage(i, 0, 0, r.width, r.height), r;
2888
+ async function ti(e, t = {}) {
2889
+ const { width: a, height: o } = xt(e, t), s = await ei(e, t), i = await ke(s), r = document.createElement("canvas"), l = r.getContext("2d"), u = t.pixelRatio || mo(), c = t.canvasWidth || a, g = t.canvasHeight || o;
2890
+ return r.width = c * u, r.height = g * u, t.skipAutoScale || ho(r), r.style.width = `${c}`, r.style.height = `${g}`, t.backgroundColor && (l.fillStyle = t.backgroundColor, l.fillRect(0, 0, r.width, r.height)), l.drawImage(i, 0, 0, r.width, r.height), r;
2887
2891
  }
2888
- async function pt(e, t = {}) {
2889
- return (await oi(e, t)).toDataURL();
2892
+ async function ct(e, t = {}) {
2893
+ return (await ti(e, t)).toDataURL();
2890
2894
  }
2891
- const ke = "data-nf-capture-chrome", ii = "data-nf-canvas-snap", si = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
2892
- function Vt(e) {
2893
- return e instanceof Element && (e.hasAttribute(ke) || e.hasAttribute("data-nf-mask-cover") || e.id === "notefully");
2895
+ const be = "data-nf-capture-chrome", ai = "data-nf-canvas-snap", oi = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
2896
+ function It(e) {
2897
+ return e instanceof Element && (e.hasAttribute(be) || e.hasAttribute("data-nf-mask-cover") || e.id === "notefully");
2894
2898
  }
2895
- function ri() {
2899
+ function ii() {
2896
2900
  const e = [];
2897
2901
  return Array.from(document.styleSheets).forEach((t) => {
2898
2902
  try {
@@ -2916,7 +2920,7 @@ function ri() {
2916
2920
  });
2917
2921
  };
2918
2922
  }
2919
- function ni() {
2923
+ function si() {
2920
2924
  const e = [];
2921
2925
  return document.querySelectorAll('input[type="password"], [data-notefully-mask]').forEach((a) => {
2922
2926
  const o = a.getBoundingClientRect(), s = document.createElement("div");
@@ -2932,28 +2936,28 @@ function ni() {
2932
2936
  ].join(";"), document.body.appendChild(s), e.push(s);
2933
2937
  }), () => e.forEach((a) => a.remove());
2934
2938
  }
2935
- function li() {
2936
- const e = document.querySelector(`[${ke}]`);
2939
+ function ri() {
2940
+ const e = document.querySelector(`[${be}]`);
2937
2941
  if (e)
2938
2942
  return e;
2939
2943
  const t = document.createElement("div");
2940
- return t.setAttribute(ke, "1"), t.className = "nf-capture-chrome", t.setAttribute("role", "status"), t.setAttribute("aria-live", "polite"), t.innerHTML = `<span class="nf-capture-chrome-pill">${m("status.capturing")}</span>`, document.body.appendChild(t), t;
2944
+ return t.setAttribute(be, "1"), t.className = "nf-capture-chrome", t.setAttribute("role", "status"), t.setAttribute("aria-live", "polite"), t.innerHTML = `<span class="nf-capture-chrome-pill">${p("status.capturing")}</span>`, document.body.appendChild(t), t;
2941
2945
  }
2942
- function ui() {
2943
- document.querySelectorAll(`[${ke}]`).forEach((e) => e.remove());
2946
+ function ni() {
2947
+ document.querySelectorAll(`[${be}]`).forEach((e) => e.remove());
2944
2948
  }
2945
- function Be() {
2949
+ function Ne() {
2946
2950
  return new Promise((e) => {
2947
2951
  requestAnimationFrame(() => requestAnimationFrame(e));
2948
2952
  });
2949
2953
  }
2950
- function q(e) {
2954
+ function Z(e) {
2951
2955
  if (typeof e != "string" || !e.startsWith("data:image/"))
2952
2956
  return !1;
2953
2957
  const t = e.indexOf(",");
2954
2958
  return t > 0 && t < e.length - 1;
2955
2959
  }
2956
- function di() {
2960
+ function li() {
2957
2961
  const e = document.documentElement, t = document.body, a = Math.max(
2958
2962
  window.innerWidth || 0,
2959
2963
  (e == null ? void 0 : e.clientWidth) || 0,
@@ -2969,10 +2973,10 @@ function di() {
2969
2973
  );
2970
2974
  return { width: a, height: o };
2971
2975
  }
2972
- async function ci() {
2976
+ async function ui() {
2973
2977
  const e = [], t = Array.from(document.querySelectorAll("canvas"));
2974
2978
  for (const a of t) {
2975
- if (a.closest("#notefully") || Vt(a))
2979
+ if (a.closest("#notefully") || It(a))
2976
2980
  continue;
2977
2981
  let o = "";
2978
2982
  try {
@@ -2983,7 +2987,7 @@ async function ci() {
2983
2987
  if (!o || o === "data:,")
2984
2988
  continue;
2985
2989
  const s = document.createElement("img"), i = getComputedStyle(a);
2986
- s.setAttribute(ii, "1"), s.alt = "", s.src = o, s.className = a.className, s.style.cssText = a.style.cssText, s.style.width = i.width, s.style.height = i.height, s.style.maxWidth = i.maxWidth, s.style.maxHeight = i.maxHeight, s.style.objectFit = "fill", s.style.display = i.display === "inline" ? "inline-block" : i.display, a.replaceWith(s), e.push({ canvas: a, img: s });
2990
+ s.setAttribute(ai, "1"), s.alt = "", s.src = o, s.className = a.className, s.style.cssText = a.style.cssText, s.style.width = i.width, s.style.height = i.height, s.style.maxWidth = i.maxWidth, s.style.maxHeight = i.maxHeight, s.style.objectFit = "fill", s.style.display = i.display === "inline" ? "inline-block" : i.display, a.replaceWith(s), e.push({ canvas: a, img: s });
2987
2991
  }
2988
2992
  return await Promise.all(e.map(({ img: a }) => {
2989
2993
  if (!a.complete)
@@ -2999,25 +3003,25 @@ async function ci() {
2999
3003
  });
3000
3004
  };
3001
3005
  }
3002
- async function pi(e) {
3006
+ async function ci(e) {
3003
3007
  if (!e)
3004
3008
  return null;
3005
3009
  if (typeof e == "string")
3006
- return q(e) ? e : null;
3010
+ return Z(e) ? e : null;
3007
3011
  if (typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement)
3008
3012
  try {
3009
3013
  const t = e.toDataURL("image/png");
3010
- return q(t) ? t : null;
3014
+ return Z(t) ? t : null;
3011
3015
  } catch {
3012
3016
  return null;
3013
3017
  }
3014
3018
  if (typeof Blob < "u" && e instanceof Blob) {
3015
- const t = await gi(e);
3016
- return q(t) ? t : null;
3019
+ const t = await di(e);
3020
+ return Z(t) ? t : null;
3017
3021
  }
3018
3022
  return null;
3019
3023
  }
3020
- async function gi(e) {
3024
+ async function di(e) {
3021
3025
  if (typeof FileReader == "function")
3022
3026
  return new Promise((o, s) => {
3023
3027
  const i = new FileReader();
@@ -3026,10 +3030,10 @@ async function gi(e) {
3026
3030
  const t = Buffer.from(await e.arrayBuffer());
3027
3031
  return `data:${e.type || "application/octet-stream"};base64,${t.toString("base64")}`;
3028
3032
  }
3029
- async function mi() {
3033
+ async function pi() {
3030
3034
  var t;
3031
3035
  if (!((t = navigator.mediaDevices) != null && t.getDisplayMedia))
3032
- throw new Error(m("status.screenUnsupported"));
3036
+ throw new Error(p("status.screenUnsupported"));
3033
3037
  const e = await navigator.mediaDevices.getDisplayMedia({
3034
3038
  video: { displaySurface: "browser" },
3035
3039
  audio: !1,
@@ -3038,76 +3042,76 @@ async function mi() {
3038
3042
  });
3039
3043
  try {
3040
3044
  const a = document.createElement("video");
3041
- a.muted = !0, a.playsInline = !0, a.srcObject = e, await a.play(), a.videoWidth || await new Promise((n) => {
3042
- a.onloadedmetadata = () => n();
3043
- }), await Be();
3045
+ a.muted = !0, a.playsInline = !0, a.srcObject = e, await a.play(), a.videoWidth || await new Promise((l) => {
3046
+ a.onloadedmetadata = () => l();
3047
+ }), await Ne();
3044
3048
  const o = a.videoWidth || 1, s = a.videoHeight || 1, i = document.createElement("canvas");
3045
3049
  i.width = o, i.height = s, i.getContext("2d").drawImage(a, 0, 0, o, s);
3046
3050
  const r = i.toDataURL("image/png");
3047
- if (!q(r))
3048
- throw new Error(m("status.screenEmpty"));
3051
+ if (!Z(r))
3052
+ throw new Error(p("status.screenEmpty"));
3049
3053
  return r;
3050
3054
  } finally {
3051
3055
  e.getTracks().forEach((a) => a.stop());
3052
3056
  }
3053
3057
  }
3054
- async function $t(e = {}) {
3055
- const t = document.getElementById("notefully"), a = t ? t.style.display : "", o = li(), s = ri();
3058
+ async function Vt(e = {}) {
3059
+ const t = document.getElementById("notefully"), a = t ? t.style.display : "", o = ri(), s = ii();
3056
3060
  let i = () => {
3057
3061
  };
3058
3062
  t && (t.style.display = "none");
3059
- const r = ni();
3063
+ const r = si();
3060
3064
  try {
3061
- if (typeof e.onBeforeCapture == "function" && await e.onBeforeCapture(), await Be(), typeof e.capture == "function") {
3062
- const y = await pi(await e.capture());
3063
- if (y)
3064
- return y;
3065
+ if (typeof e.onBeforeCapture == "function" && await e.onBeforeCapture(), await Ne(), typeof e.capture == "function") {
3066
+ const v = await ci(await e.capture());
3067
+ if (v)
3068
+ return v;
3065
3069
  }
3066
- i = await ci(), await Be();
3067
- const { width: n, height: u } = di(), d = {
3070
+ i = await ui(), await Ne();
3071
+ const { width: l, height: u } = li(), c = {
3068
3072
  cacheBust: !0,
3069
- width: n,
3073
+ width: l,
3070
3074
  height: u,
3071
3075
  pixelRatio: Math.min(window.devicePixelRatio || 1, 2),
3072
- filter: (y) => !Vt(y),
3076
+ filter: (v) => !It(v),
3073
3077
  // 404 / CORS images must not abort the whole capture.
3074
- imagePlaceholder: si,
3078
+ imagePlaceholder: oi,
3075
3079
  onImageErrorHandler: () => {
3076
3080
  }
3077
3081
  };
3078
- let p = "";
3082
+ let g = "";
3079
3083
  try {
3080
- p = await pt(document.body, d);
3084
+ g = await ct(document.body, c);
3081
3085
  } catch {
3082
- p = await pt(document.body, { ...d, skipFonts: !0 });
3086
+ g = await ct(document.body, { ...c, skipFonts: !0 });
3083
3087
  }
3084
- if (!q(p))
3085
- throw new Error(m("status.captureEmpty"));
3086
- return p;
3088
+ if (!Z(g))
3089
+ throw new Error(p("status.captureEmpty"));
3090
+ return g;
3087
3091
  } finally {
3088
3092
  try {
3089
3093
  i();
3090
3094
  } catch {
3091
3095
  }
3092
- r(), s(), o.remove(), ui(), t && (t.style.display = a);
3096
+ r(), s(), o.remove(), ni(), t && (t.style.display = a);
3093
3097
  }
3094
3098
  }
3095
- function hi(e = "") {
3099
+ function gi(e = "") {
3096
3100
  const t = String(e || "");
3097
3101
  return t ? /Windows NT/i.test(t) ? "Windows" : /iPhone|iPad|iPod/i.test(t) ? "iOS" : /Mac OS X|Macintosh/i.test(t) ? "macOS" : /Android/i.test(t) ? "Android" : /CrOS/i.test(t) ? "ChromeOS" : /Linux/i.test(t) ? "Linux" : "Other" : "";
3098
3102
  }
3099
- function fi(e = "") {
3103
+ function mi(e = "") {
3100
3104
  const t = String(e || "");
3101
3105
  return t ? /Edg\//i.test(t) ? "Edge" : /OPR\/|Opera/i.test(t) ? "Opera" : /Firefox\//i.test(t) ? "Firefox" : /Chrome\//i.test(t) || /CriOS\//i.test(t) ? "Chrome" : /Safari\//i.test(t) ? "Safari" : "Other" : "";
3102
3106
  }
3103
- function yi(e = {}) {
3107
+ function hi(e = {}) {
3104
3108
  const t = navigator.userAgent;
3105
3109
  return {
3106
3110
  url: location.href,
3107
3111
  title: document.title,
3108
3112
  userAgent: t,
3109
- os: hi(t),
3110
- browser: fi(t),
3113
+ os: gi(t),
3114
+ browser: mi(t),
3111
3115
  language: navigator.language,
3112
3116
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
3113
3117
  viewport: {
@@ -3115,6 +3119,11 @@ function yi(e = {}) {
3115
3119
  height: window.innerHeight,
3116
3120
  dpr: window.devicePixelRatio || 1
3117
3121
  },
3122
+ screen: {
3123
+ width: typeof screen < "u" ? screen.width : null,
3124
+ height: typeof screen < "u" ? screen.height : null,
3125
+ dpr: window.devicePixelRatio || 1
3126
+ },
3118
3127
  user: {
3119
3128
  userId: e.userId || null,
3120
3129
  email: e.email || null,
@@ -3122,11 +3131,11 @@ function yi(e = {}) {
3122
3131
  }
3123
3132
  };
3124
3133
  }
3125
- const gt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), mt = {
3134
+ const dt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), pt = {
3126
3135
  id: "userId",
3127
3136
  username: "displayName",
3128
3137
  name: "displayName"
3129
- }, ht = /* @__PURE__ */ new Set([
3138
+ }, gt = /* @__PURE__ */ new Set([
3130
3139
  "endpoint",
3131
3140
  "projectKey",
3132
3141
  "version",
@@ -3144,7 +3153,7 @@ const gt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), mt = {
3144
3153
  "displayLink",
3145
3154
  "locale",
3146
3155
  "translations"
3147
- ]), ft = {
3156
+ ]), mt = {
3148
3157
  slug: "Use init({ name }) for a per-app report prefix (same idea as package.json name). slug is not a widget option.",
3149
3158
  projectSlug: "Use init({ name }) for a per-app report prefix. projectSlug is not a widget option.",
3150
3159
  project: "Pass projectKey (nfk_…) from Showfully Notefully settings — there is no project option on the widget.",
@@ -3153,40 +3162,40 @@ const gt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), mt = {
3153
3162
  email: "Pass people via Notefully.identify({ userId, email, displayName }), not init().",
3154
3163
  displayName: "Pass people via Notefully.identify({ userId, email, displayName }), not init()."
3155
3164
  };
3156
- function vi(e = {}, t = {}) {
3157
- const a = t.warn || Bt, o = e && typeof e == "object" ? e : {}, s = {}, i = [];
3158
- for (const r of gt)
3165
+ function fi(e = {}, t = {}) {
3166
+ const a = t.warn || $t, o = e && typeof e == "object" ? e : {}, s = {}, i = [];
3167
+ for (const r of dt)
3159
3168
  Object.prototype.hasOwnProperty.call(o, r) && (s[r] = o[r]);
3160
- for (const [r, n] of Object.entries(mt))
3161
- Object.prototype.hasOwnProperty.call(o, r) && (Object.prototype.hasOwnProperty.call(s, n) || (s[n] = o[r]));
3169
+ for (const [r, l] of Object.entries(pt))
3170
+ Object.prototype.hasOwnProperty.call(o, r) && (Object.prototype.hasOwnProperty.call(s, l) || (s[l] = o[r]));
3162
3171
  for (const r of Object.keys(o))
3163
- gt.has(r) || Object.prototype.hasOwnProperty.call(mt, r) || i.push(r);
3172
+ dt.has(r) || Object.prototype.hasOwnProperty.call(pt, r) || i.push(r);
3164
3173
  if (i.length) {
3165
- const r = i.some((n) => n === "name" || n === "slug" || n === "projectSlug") ? " Pass the package/report name via Notefully.init({ name }), not identify()." : "";
3174
+ const r = i.some((l) => l === "name" || l === "slug" || l === "projectSlug") ? " Pass the package/report name via Notefully.init({ name }), not identify()." : "";
3166
3175
  a(
3167
3176
  `Notefully.identify: ignoring unknown key(s): ${i.join(", ")}. Supported: userId, email, displayName (aliases: id → userId; username/name → displayName).` + r
3168
3177
  );
3169
3178
  }
3170
3179
  return s;
3171
3180
  }
3172
- function ki(e = {}, t = {}) {
3173
- const a = t.warn || Bt, o = e && typeof e == "object" ? e : {}, s = Object.keys(o).filter((i) => !ht.has(i));
3181
+ function yi(e = {}, t = {}) {
3182
+ const a = t.warn || $t, o = e && typeof e == "object" ? e : {}, s = Object.keys(o).filter((i) => !gt.has(i));
3174
3183
  if (s.length)
3175
3184
  for (const i of s) {
3176
- if (ft[i]) {
3177
- a(`Notefully.init: ignoring "${i}". ${ft[i]}`);
3185
+ if (mt[i]) {
3186
+ a(`Notefully.init: ignoring "${i}". ${mt[i]}`);
3178
3187
  continue;
3179
3188
  }
3180
3189
  a(
3181
- `Notefully.init: ignoring unknown key "${i}". Supported: ${[...ht].join(", ")}.`
3190
+ `Notefully.init: ignoring unknown key "${i}". Supported: ${[...gt].join(", ")}.`
3182
3191
  );
3183
3192
  }
3184
3193
  }
3185
- function Bt(e) {
3194
+ function $t(e) {
3186
3195
  typeof console < "u" && typeof console.warn == "function" && console.warn(e);
3187
3196
  }
3188
- const yt = /expression\s*\(|url\s*\(|@import|javascript:|behavior\s*:|-moz-binding|\bbinding\s*:/i, bi = /(?:^|\s)(?=[a-z-]+\s*:\s*[^;]+;)/i;
3189
- function vt(e) {
3197
+ const ht = /expression\s*\(|url\s*\(|@import|javascript:|behavior\s*:|-moz-binding|\bbinding\s*:/i, vi = /(?:^|\s)(?=[a-z-]+\s*:\s*[^;]+;)/i;
3198
+ function ft(e) {
3190
3199
  if (e instanceof Error)
3191
3200
  return e.stack || e.message || String(e);
3192
3201
  if (typeof e == "string")
@@ -3197,33 +3206,33 @@ function vt(e) {
3197
3206
  return String(e);
3198
3207
  }
3199
3208
  }
3200
- function Je(e) {
3209
+ function Ze(e) {
3201
3210
  if (!e || typeof e != "string")
3202
3211
  return "";
3203
3212
  let t = e.replace(/[\u0000-\u001F\u007F]/g, "").trim();
3204
- return t ? (yt.test(t) && (t = t.split(";").map((a) => a.trim()).filter((a) => a && !yt.test(a)).join("; "), t && !t.endsWith(";") && (t += ";")), t.slice(0, 500)) : "";
3213
+ return t ? (ht.test(t) && (t = t.split(";").map((a) => a.trim()).filter((a) => a && !ht.test(a)).join("; "), t && !t.endsWith(";") && (t += ";")), t.slice(0, 500)) : "";
3205
3214
  }
3206
- function wi(e = []) {
3215
+ function ki(e = []) {
3207
3216
  if (!e.length)
3208
3217
  return { text: "", segments: [{ text: "", style: null }] };
3209
3218
  const t = e[0];
3210
3219
  if (typeof t != "string" || !t.includes("%c")) {
3211
- const r = e.map(vt).join(" ");
3220
+ const r = e.map(ft).join(" ");
3212
3221
  return { text: r, segments: [{ text: r, style: null }] };
3213
3222
  }
3214
3223
  const a = t.split("%c"), o = [];
3215
3224
  let s = 1;
3216
3225
  for (let r = 0; r < a.length; r++) {
3217
- const n = a[r];
3226
+ const l = a[r];
3218
3227
  if (r === 0) {
3219
- n && o.push({ text: n, style: null });
3228
+ l && o.push({ text: l, style: null });
3220
3229
  continue;
3221
3230
  }
3222
- const u = s < e.length ? String(e[s++] ?? "") : "", d = Je(u) || null;
3223
- o.push({ text: n, style: d });
3231
+ const u = s < e.length ? String(e[s++] ?? "") : "", c = Ze(u) || null;
3232
+ o.push({ text: l, style: c });
3224
3233
  }
3225
3234
  if (s < e.length) {
3226
- const r = e.slice(s).map(vt).join(" ");
3235
+ const r = e.slice(s).map(ft).join(" ");
3227
3236
  r && o.push({
3228
3237
  text: (o.length ? " " : "") + r,
3229
3238
  style: null
@@ -3234,69 +3243,69 @@ function wi(e = []) {
3234
3243
  segments: o.length ? o : [{ text: "", style: null }]
3235
3244
  };
3236
3245
  }
3237
- function Si(e) {
3246
+ function bi(e) {
3238
3247
  const t = String(e ?? "");
3239
3248
  if (!t.includes("%c"))
3240
3249
  return [{ text: t, style: null }];
3241
- const a = t.split("%c"), o = a[a.length - 1], s = o.match(bi);
3250
+ const a = t.split("%c"), o = a[a.length - 1], s = o.match(vi);
3242
3251
  let i = "";
3243
3252
  if (s) {
3244
- const u = s.index, d = /\s/.test(o[u]) ? u + 1 : u;
3245
- /^[a-z-]+\s*:/i.test(o.slice(d)) && (a[a.length - 1] = o.slice(0, d).replace(/\s+$/, ""), i = o.slice(d).trim());
3253
+ const u = s.index, c = /\s/.test(o[u]) ? u + 1 : u;
3254
+ /^[a-z-]+\s*:/i.test(o.slice(c)) && (a[a.length - 1] = o.slice(0, c).replace(/\s+$/, ""), i = o.slice(c).trim());
3246
3255
  }
3247
- const r = Je(i) || null, n = [];
3256
+ const r = Ze(i) || null, l = [];
3248
3257
  for (let u = 0; u < a.length; u++) {
3249
- const d = a[u];
3258
+ const c = a[u];
3250
3259
  if (u === 0) {
3251
- d && n.push({ text: d, style: null });
3260
+ c && l.push({ text: c, style: null });
3252
3261
  continue;
3253
3262
  }
3254
- n.push({
3255
- text: d,
3263
+ l.push({
3264
+ text: c,
3256
3265
  style: u === 1 ? r : null
3257
3266
  });
3258
3267
  }
3259
- return n.length ? n : [{ text: t, style: null }];
3268
+ return l.length ? l : [{ text: t, style: null }];
3260
3269
  }
3261
- function Nt(e = {}) {
3270
+ function Bt(e = {}) {
3262
3271
  return Array.isArray(e.segments) && e.segments.length ? e.segments.map((t) => ({
3263
3272
  text: String((t == null ? void 0 : t.text) ?? ""),
3264
- style: Je(t == null ? void 0 : t.style) || null
3265
- })) : Si(e.text);
3273
+ style: Ze(t == null ? void 0 : t.style) || null
3274
+ })) : bi(e.text);
3266
3275
  }
3267
- function Ai(e = {}) {
3268
- return Nt(e).map((a) => a.text).join("");
3276
+ function wi(e = {}) {
3277
+ return Bt(e).map((a) => a.text).join("");
3269
3278
  }
3270
- function kt(e) {
3279
+ function yt(e) {
3271
3280
  return String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3272
3281
  }
3273
- function Ci(e = {}) {
3274
- return Nt(e).map((t) => {
3275
- const a = kt(t.text);
3276
- return t.style ? `<span class="nf-console-styled" style="${kt(t.style)}">${a}</span>` : a;
3282
+ function Si(e = {}) {
3283
+ return Bt(e).map((t) => {
3284
+ const a = yt(t.text);
3285
+ return t.style ? `<span class="nf-console-styled" style="${yt(t.style)}">${a}</span>` : a;
3277
3286
  }).join("");
3278
3287
  }
3279
- const zi = 80;
3280
- function ji() {
3288
+ const Ai = 80;
3289
+ function Ci() {
3281
3290
  const e = [], t = {};
3282
3291
  let a = !1;
3283
3292
  const o = (i, r) => {
3284
- let n = "", u = null;
3293
+ let l = "", u = null;
3285
3294
  try {
3286
- const p = wi(r);
3287
- n = p.text, u = p.segments;
3295
+ const g = ki(r);
3296
+ l = g.text, u = g.segments;
3288
3297
  } catch {
3289
- n = String(r[0]), u = [{ text: n, style: null }];
3298
+ l = String(r[0]), u = [{ text: l, style: null }];
3290
3299
  }
3291
- const d = {
3300
+ const c = {
3292
3301
  level: i,
3293
- text: n.slice(0, 2e3),
3302
+ text: l.slice(0, 2e3),
3294
3303
  at: Date.now()
3295
3304
  };
3296
- u && u.some((p) => p.style) && (d.segments = u.map((p) => ({
3297
- text: String(p.text || "").slice(0, 2e3),
3298
- style: p.style || null
3299
- }))), e.push(d), e.length > zi && e.shift();
3305
+ u && u.some((g) => g.style) && (c.segments = u.map((g) => ({
3306
+ text: String(g.text || "").slice(0, 2e3),
3307
+ style: g.style || null
3308
+ }))), e.push(c), e.length > Ai && e.shift();
3300
3309
  };
3301
3310
  return {
3302
3311
  hook: () => {
@@ -3315,7 +3324,7 @@ function ji() {
3315
3324
  }
3316
3325
  };
3317
3326
  }
3318
- function Ei(e) {
3327
+ function zi(e) {
3319
3328
  const t = window.SpeechRecognition || window.webkitSpeechRecognition;
3320
3329
  let a = null, o = !1;
3321
3330
  const s = () => {
@@ -3328,11 +3337,11 @@ function Ei(e) {
3328
3337
  return {
3329
3338
  start: (r = {}) => {
3330
3339
  if (!t)
3331
- throw new Error(m("status.speechUnsupported"));
3332
- return o ? (s(), !1) : (a = new t(), a.continuous = !0, a.interimResults = !0, a.lang = r.lang || navigator.language || "en-US", a.onresult = (n) => {
3340
+ throw new Error(p("status.speechUnsupported"));
3341
+ return o ? (s(), !1) : (a = new t(), a.continuous = !0, a.interimResults = !0, a.lang = r.lang || navigator.language || "en-US", a.onresult = (l) => {
3333
3342
  let u = "";
3334
- for (let d = n.resultIndex; d < n.results.length; d += 1)
3335
- n.results[d].isFinal && (u += n.results[d][0].transcript);
3343
+ for (let c = l.resultIndex; c < l.results.length; c += 1)
3344
+ l.results[c].isFinal && (u += l.results[c][0].transcript);
3336
3345
  u && e(u);
3337
3346
  }, a.onerror = () => {
3338
3347
  o = !1;
@@ -3345,26 +3354,26 @@ function Ei(e) {
3345
3354
  isActive: () => o
3346
3355
  };
3347
3356
  }
3348
- const Ri = 60 * 1e3;
3349
- function Pi({ onStart: e, onStop: t, onError: a }) {
3357
+ const Ei = 60 * 1e3;
3358
+ function ji({ onStart: e, onStop: t, onError: a }) {
3350
3359
  let o = null, s = null, i = [], r = null;
3351
- const n = () => {
3360
+ const l = () => {
3352
3361
  if (r && (clearTimeout(r), r = null), s && s.state !== "inactive")
3353
3362
  try {
3354
3363
  s.stop();
3355
3364
  } catch {
3356
3365
  }
3357
- o && (o.getTracks().forEach((p) => p.stop()), o = null);
3366
+ o && (o.getTracks().forEach((g) => g.stop()), o = null);
3358
3367
  }, u = () => {
3359
3368
  if (s && s.state === "recording") {
3360
3369
  s.stop();
3361
3370
  return;
3362
3371
  }
3363
- n(), t(null);
3372
+ l(), t(null);
3364
3373
  };
3365
3374
  return { start: async () => {
3366
- var p, y;
3367
- if (!((p = navigator.mediaDevices) != null && p.getDisplayMedia))
3375
+ var g, v;
3376
+ if (!((g = navigator.mediaDevices) != null && g.getDisplayMedia))
3368
3377
  throw new Error("Screen recording is not supported in this browser.");
3369
3378
  o = await navigator.mediaDevices.getDisplayMedia({
3370
3379
  video: { displaySurface: "browser" },
@@ -3373,15 +3382,15 @@ function Pi({ onStart: e, onStop: t, onError: a }) {
3373
3382
  selfBrowserSurface: "include"
3374
3383
  }), i = [], s = new MediaRecorder(o, {
3375
3384
  mimeType: MediaRecorder.isTypeSupported("video/webm;codecs=vp9") ? "video/webm;codecs=vp9" : "video/webm"
3376
- }), s.ondataavailable = (v) => {
3377
- v.data && v.data.size && i.push(v.data);
3385
+ }), s.ondataavailable = (k) => {
3386
+ k.data && k.data.size && i.push(k.data);
3378
3387
  }, s.onstop = () => {
3379
- const v = i.length ? new Blob(i, { type: s.mimeType || "video/webm" }) : null;
3380
- n(), t(v);
3381
- }, (y = o.getVideoTracks()[0]) == null || y.addEventListener("ended", () => u()), s.start(), r = setTimeout(u, Ri);
3388
+ const k = i.length ? new Blob(i, { type: s.mimeType || "video/webm" }) : null;
3389
+ l(), t(k);
3390
+ }, (v = o.getVideoTracks()[0]) == null || v.addEventListener("ended", () => u()), s.start(), r = setTimeout(u, Ei);
3382
3391
  }, stop: u };
3383
3392
  }
3384
- function Li() {
3393
+ function Ri() {
3385
3394
  const e = /* @__PURE__ */ new Set();
3386
3395
  return {
3387
3396
  alloc() {
@@ -3399,25 +3408,25 @@ function Li() {
3399
3408
  }
3400
3409
  };
3401
3410
  }
3402
- const Oe = { x: 0, y: 0, w: 1, h: 1 };
3403
- function Ye() {
3404
- const e = Li();
3405
- let t = [], a = { ...Oe }, o = 1;
3411
+ const De = { x: 0, y: 0, w: 1, h: 1 };
3412
+ function Je() {
3413
+ const e = Ri();
3414
+ let t = [], a = { ...De }, o = 1;
3406
3415
  return {
3407
- list: () => t.filter((i) => Ti(i, a)),
3416
+ list: () => t.filter((i) => Li(i, a)),
3408
3417
  all: () => t.slice(),
3409
3418
  crop: () => ({ ...a }),
3410
3419
  setCrop(i) {
3411
- return a = Ui(i), a;
3420
+ return a = xi(i), a;
3412
3421
  },
3413
3422
  resetCrop() {
3414
- return a = { ...Oe }, a;
3423
+ return a = { ...De }, a;
3415
3424
  },
3416
3425
  isCropped() {
3417
3426
  return a.x > 1e-6 || a.y > 1e-6 || a.w < 1 - 1e-6 || a.h < 1 - 1e-6;
3418
3427
  },
3419
3428
  add(i, r) {
3420
- const n = {
3429
+ const l = {
3421
3430
  id: `s${o++}`,
3422
3431
  type: i,
3423
3432
  number: e.alloc(),
@@ -3429,47 +3438,47 @@ function Ye() {
3429
3438
  y2: 0.28,
3430
3439
  ...r
3431
3440
  };
3432
- return t.push(n), n;
3441
+ return t.push(l), l;
3433
3442
  },
3434
3443
  update(i, r) {
3435
- const n = t.find((u) => u.id === i);
3436
- return n ? (Object.assign(n, r), n) : null;
3444
+ const l = t.find((u) => u.id === i);
3445
+ return l ? (Object.assign(l, r), l) : null;
3437
3446
  },
3438
3447
  remove(i) {
3439
3448
  const r = t.findIndex((u) => u.id === i);
3440
3449
  if (r < 0)
3441
3450
  return null;
3442
- const [n] = t.splice(r, 1);
3443
- return e.free(n.number), n;
3451
+ const [l] = t.splice(r, 1);
3452
+ return e.free(l.number), l;
3444
3453
  },
3445
3454
  reset() {
3446
- for (t = [], a = { ...Oe }, o = 1; e.peekUsed().length; )
3455
+ for (t = [], a = { ...De }, o = 1; e.peekUsed().length; )
3447
3456
  e.free(e.peekUsed()[0]);
3448
3457
  }
3449
3458
  };
3450
3459
  }
3451
- function xi(e, t) {
3460
+ function Pi(e, t) {
3452
3461
  const a = Number(t == null ? void 0 : t.w) || 1, o = Number(t == null ? void 0 : t.h) || 1, s = Number(t == null ? void 0 : t.x) || 0, i = Number(t == null ? void 0 : t.y) || 0;
3453
3462
  return (Array.isArray(e) ? e : []).map((r) => {
3454
- const n = {
3463
+ const l = {
3455
3464
  ...r,
3456
3465
  x: (r.x - s) / a,
3457
3466
  y: (r.y - i) / o,
3458
3467
  w: (r.w || 0) / a,
3459
3468
  h: (r.h || 0) / o
3460
3469
  };
3461
- return Number.isFinite(r.x2) && (n.x2 = (r.x2 - s) / a), Number.isFinite(r.y2) && (n.y2 = (r.y2 - i) / o), n;
3470
+ return Number.isFinite(r.x2) && (l.x2 = (r.x2 - s) / a), Number.isFinite(r.y2) && (l.y2 = (r.y2 - i) / o), l;
3462
3471
  });
3463
3472
  }
3464
- function Ui(e) {
3473
+ function xi(e) {
3465
3474
  const t = Math.min(Math.max(e.x, 0), 0.95), a = Math.min(Math.max(e.y, 0), 0.95), o = Math.min(Math.max(e.w, 0.05), 1 - t), s = Math.min(Math.max(e.h, 0.05), 1 - a);
3466
3475
  return { x: t, y: a, w: o, h: s };
3467
3476
  }
3468
- function Ti(e, t) {
3477
+ function Li(e, t) {
3469
3478
  const a = e.type === "arrow" ? (e.x + (e.x2 ?? e.x)) / 2 : e.x + (e.w || 0) / 2, o = e.type === "arrow" ? (e.y + (e.y2 ?? e.y)) / 2 : e.y + (e.h || 0) / 2;
3470
3479
  return a >= t.x && o >= t.y && a <= t.x + t.w && o <= t.y + t.h;
3471
3480
  }
3472
- function Xe(e) {
3481
+ function Nt(e) {
3473
3482
  const t = Math.max(1, Number(e) || 1);
3474
3483
  return {
3475
3484
  stroke: Math.max(2, t * 75e-4),
@@ -3479,106 +3488,64 @@ function Xe(e) {
3479
3488
  arrowHeadAngle: 0.4
3480
3489
  };
3481
3490
  }
3482
- function Fi(e, {
3483
- stickers: t = [],
3484
- crop: a = { x: 0, y: 0, w: 1, h: 1 },
3485
- width: o,
3486
- height: s,
3487
- colors: i = {}
3488
- }) {
3489
- const r = i.mark || "#fdd341", n = i.markText || "#2a2140", u = Xe(o);
3490
- e.save(), e.lineWidth = u.stroke, e.lineCap = "round", e.lineJoin = "round", e.strokeStyle = r, e.fillStyle = r, e.font = `700 ${Math.round(u.fontSize)}px ui-sans-serif, system-ui, sans-serif`, t.forEach((d) => {
3491
- const p = Ne(d.x, a, o), y = Ke(d.y, a, s), v = d.w / a.w * o, b = d.h / a.h * s, C = u.stroke / 2;
3492
- if (d.type === "rect")
3493
- e.strokeRect(
3494
- p + C,
3495
- y + C,
3496
- Math.max(0, v - u.stroke),
3497
- Math.max(0, b - u.stroke)
3498
- );
3499
- else if (d.type === "circle")
3500
- e.beginPath(), e.ellipse(
3501
- p + v / 2,
3502
- y + b / 2,
3503
- Math.max(0.5, v / 2 - C),
3504
- Math.max(0.5, b / 2 - C),
3505
- 0,
3506
- 0,
3507
- Math.PI * 2
3508
- ), e.stroke();
3509
- else if (d.type === "arrow") {
3510
- const P = Ne(d.x2 ?? d.x + d.w, a, o), $ = Ke(d.y2 ?? d.y, a, s);
3511
- Di(e, p, y, P, $, u);
3512
- }
3513
- if (d.number == null || d.number === "")
3514
- return;
3515
- const E = Oi(d, a, o, s, p, y, v), M = String(d.number);
3516
- e.beginPath(), e.arc(E.x, E.y, u.badgeRadius, 0, Math.PI * 2), e.fillStyle = r, e.fill(), e.fillStyle = n, e.textAlign = "center", e.textBaseline = "middle", e.fillText(M, E.x, E.y + 0.5), e.fillStyle = r;
3517
- }), e.restore();
3491
+ function Ui(e, t, a, o, s) {
3492
+ const i = Math.atan2(o - t, a - e), r = s.arrowHead, l = Math.min(s.stroke, r * 0.2), u = a, c = o, g = a - Math.cos(i) * r, v = o - Math.sin(i) * r, k = {
3493
+ x: u - r * Math.cos(i - s.arrowHeadAngle),
3494
+ y: c - r * Math.sin(i - s.arrowHeadAngle)
3495
+ }, w = {
3496
+ x: u - r * Math.cos(i + s.arrowHeadAngle),
3497
+ y: c - r * Math.sin(i + s.arrowHeadAngle)
3498
+ }, b = {
3499
+ x: a - Math.cos(i) * l,
3500
+ y: o - Math.sin(i) * l
3501
+ };
3502
+ return { angle: i, tipX: u, tipY: c, baseX: g, baseY: v, left: k, right: w, shaftEnd: b };
3503
+ }
3504
+ async function vt(e, t = {}) {
3505
+ const a = t.crop || { x: 0, y: 0, w: 1, h: 1 }, o = Math.max(1, Number(t.maxEdge) || 2048), s = t.webpQuality ?? 0.82, i = await Di(e), r = Math.round(a.x * i.width), l = Math.round(a.y * i.height), u = Math.max(1, Math.round(a.w * i.width)), c = Math.max(1, Math.round(a.h * i.height)), g = Ti(u, c, o), v = g.width, k = g.height, w = document.createElement("canvas");
3506
+ w.width = v, w.height = k, w.getContext("2d").drawImage(i, r, l, u, c, 0, 0, v, k);
3507
+ const z = await kt(w, "image/webp", s);
3508
+ if (z && z.size > 0 && z.type === "image/webp")
3509
+ return { blob: z, width: v, height: k, mime: "image/webp", ext: "webp" };
3510
+ const R = await kt(w, "image/png");
3511
+ if (!R || !R.size)
3512
+ throw new Error("Could not encode screenshot");
3513
+ return { blob: R, width: v, height: k, mime: "image/png", ext: "png" };
3514
+ }
3515
+ function Ti(e, t, a = 2048) {
3516
+ const o = Math.max(1, Number(e) || 1), s = Math.max(1, Number(t) || 1), i = Math.max(1, Number(a) || 2048), r = Math.min(1, i / Math.max(o, s));
3517
+ return {
3518
+ width: Math.max(1, Math.round(o * r)),
3519
+ height: Math.max(1, Math.round(s * r)),
3520
+ scale: r
3521
+ };
3518
3522
  }
3519
- function Ne(e, t, a) {
3520
- return (e - t.x) / t.w * a;
3523
+ function Fi(e = 2048) {
3524
+ const t = Math.floor(Number(e) / 2);
3525
+ return Math.max(1, Math.min(1024, t || 1024));
3521
3526
  }
3522
- function Ke(e, t, a) {
3523
- return (e - t.y) / t.h * a;
3527
+ function Oi(e, t = null) {
3528
+ if ((t == null ? void 0 : t.code) === "payload_too_large" || Number(t == null ? void 0 : t.status) === 413 || Number(e == null ? void 0 : e.status) === 413)
3529
+ return !0;
3530
+ const a = String((e == null ? void 0 : e.message) || e || (t == null ? void 0 : t.error) || "").toLowerCase();
3531
+ return a.includes("failed to fetch") || a.includes("networkerror") || a.includes("load failed") || a.includes("too large") || a.includes("payload") || a.includes("entity too large") ? !0 : Number(e == null ? void 0 : e.status) === 413;
3524
3532
  }
3525
- function Oi(e, t, a, o, s, i, r) {
3526
- if (e.type === "arrow") {
3527
- const n = Ne(e.x2 ?? e.x + e.w, t, a), u = Ke(e.y2 ?? e.y, t, o);
3528
- return {
3529
- x: (s + n) / 2,
3530
- y: (i + u) / 2
3531
- };
3532
- }
3533
- return { x: s + r / 2, y: i };
3533
+ function Di(e) {
3534
+ return new Promise((t, a) => {
3535
+ const o = new Image();
3536
+ o.onload = () => t(o), o.onerror = () => a(new Error("Could not load screenshot")), o.src = e;
3537
+ });
3534
3538
  }
3535
- function Kt(e, t, a, o, s) {
3536
- const i = Math.atan2(o - t, a - e), r = s.arrowHead, n = Math.min(s.stroke, r * 0.2), u = a, d = o, p = a - Math.cos(i) * r, y = o - Math.sin(i) * r, v = {
3537
- x: u - r * Math.cos(i - s.arrowHeadAngle),
3538
- y: d - r * Math.sin(i - s.arrowHeadAngle)
3539
- }, b = {
3540
- x: u - r * Math.cos(i + s.arrowHeadAngle),
3541
- y: d - r * Math.sin(i + s.arrowHeadAngle)
3542
- }, C = {
3543
- x: a - Math.cos(i) * n,
3544
- y: o - Math.sin(i) * n
3545
- };
3546
- return { angle: i, tipX: u, tipY: d, baseX: p, baseY: y, left: v, right: b, shaftEnd: C };
3547
- }
3548
- function Di(e, t, a, o, s, i) {
3549
- const r = Kt(t, a, o, s, i);
3550
- e.beginPath(), e.moveTo(t, a), e.lineTo(r.shaftEnd.x, r.shaftEnd.y), e.stroke(), e.beginPath(), e.moveTo(r.tipX, r.tipY), e.lineTo(r.left.x, r.left.y), e.lineTo(r.right.x, r.right.y), e.closePath(), e.fill();
3551
- }
3552
- function Mi(e, t) {
3553
- return Ht(e, t, [], {});
3554
- }
3555
- function Ii(e, t, a, o = {}) {
3556
- return Ht(e, t, a, o);
3557
- }
3558
- function Ht(e, t, a, o) {
3559
- return new Promise((s, i) => {
3560
- const r = new Image();
3561
- r.onload = () => {
3562
- const n = Math.round(t.x * r.width), u = Math.round(t.y * r.height), d = Math.max(1, Math.round(t.w * r.width)), p = Math.max(1, Math.round(t.h * r.height)), y = document.createElement("canvas");
3563
- y.width = d, y.height = p;
3564
- const v = y.getContext("2d");
3565
- v.drawImage(r, n, u, d, p, 0, 0, d, p), a != null && a.length && Fi(v, {
3566
- stickers: a,
3567
- crop: t,
3568
- width: d,
3569
- height: p,
3570
- colors: o
3571
- }), y.toBlob((b) => {
3572
- if (!b) {
3573
- i(new Error("Could not encode screenshot"));
3574
- return;
3575
- }
3576
- s(b);
3577
- }, "image/png");
3578
- }, r.onerror = () => i(new Error("Could not load screenshot")), r.src = e;
3539
+ function kt(e, t, a) {
3540
+ return new Promise((o) => {
3541
+ try {
3542
+ e.toBlob((s) => o(s), t, a);
3543
+ } catch {
3544
+ o(null);
3545
+ }
3579
3546
  });
3580
3547
  }
3581
- const Vi = [
3548
+ const Mi = [
3582
3549
  "url",
3583
3550
  "title",
3584
3551
  "userAgent",
@@ -3589,23 +3556,23 @@ const Vi = [
3589
3556
  "viewport",
3590
3557
  "user"
3591
3558
  ];
3592
- function $i(e) {
3559
+ function Ii(e) {
3593
3560
  return !e || typeof e != "object" ? !1 : !!(e.userId || e.email || e.displayName);
3594
3561
  }
3595
- function Bi(e = {}) {
3562
+ function Vi(e = {}) {
3596
3563
  const t = [];
3597
- for (const a of Vi) {
3564
+ for (const a of Mi) {
3598
3565
  const o = e[a];
3599
- o == null || o === "" || a === "user" && !$i(o) || t.push({
3566
+ o == null || o === "" || a === "user" && !Ii(o) || t.push({
3600
3567
  key: a,
3601
- label: m(`diag.${a}`),
3568
+ label: p(`diag.${a}`),
3602
3569
  value: o,
3603
3570
  redacted: !1
3604
3571
  });
3605
3572
  }
3606
3573
  return t;
3607
3574
  }
3608
- function Ni(e = []) {
3575
+ function $i(e = []) {
3609
3576
  return e.map((t, a) => {
3610
3577
  const o = {
3611
3578
  id: `log-${a}-${t.at || 0}`,
@@ -3617,22 +3584,22 @@ function Ni(e = []) {
3617
3584
  return Array.isArray(t.segments) && t.segments.length && (o.segments = t.segments), o;
3618
3585
  });
3619
3586
  }
3620
- function Ki(e = []) {
3587
+ function Bi(e = []) {
3621
3588
  if (!e.length)
3622
3589
  return { checked: !1, indeterminate: !1 };
3623
3590
  const t = e.filter((a) => a.redacted).length;
3624
3591
  return t === 0 ? { checked: !1, indeterminate: !1 } : t === e.length ? { checked: !0, indeterminate: !1 } : { checked: !1, indeterminate: !0 };
3625
3592
  }
3626
- function be(e, t) {
3593
+ function we(e, t) {
3627
3594
  e.forEach((a) => {
3628
3595
  a.redacted = !!t;
3629
3596
  });
3630
3597
  }
3631
- function Hi(e = {}) {
3598
+ function Ni(e = {}) {
3632
3599
  const t = e.diagnostics || [], a = e.logs || [], o = t.some((i) => !i.redacted), s = a.length > 0 && a.some((i) => !i.redacted);
3633
- return o && s ? m("privacy.disclosure.both") : o ? m("privacy.disclosure.diagnostics") : s ? m("privacy.disclosure.logs") : "";
3600
+ return o && s ? p("privacy.disclosure.both") : o ? p("privacy.disclosure.diagnostics") : s ? p("privacy.disclosure.logs") : "";
3634
3601
  }
3635
- function Gi(e) {
3602
+ function Ki(e) {
3636
3603
  if (e == null)
3637
3604
  return "";
3638
3605
  if (typeof e == "string" || typeof e == "number" || typeof e == "boolean")
@@ -3643,7 +3610,7 @@ function Gi(e) {
3643
3610
  return String(e);
3644
3611
  }
3645
3612
  }
3646
- function qi(e = {}) {
3613
+ function Hi(e = {}) {
3647
3614
  const t = {};
3648
3615
  e.author != null && e.author !== "" && (t.author = e.author);
3649
3616
  for (const o of e.diagnostics || [])
@@ -3658,7 +3625,7 @@ function qi(e = {}) {
3658
3625
  });
3659
3626
  return t.console = a, t;
3660
3627
  }
3661
- const W = [
3628
+ const Y = [
3662
3629
  { id: "bug", label: "Bug" },
3663
3630
  { id: "idea", label: "Idea" },
3664
3631
  { id: "other", label: "Other" }
@@ -3666,60 +3633,60 @@ const W = [
3666
3633
  function bt(e) {
3667
3634
  return String(e || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32);
3668
3635
  }
3669
- function De(e) {
3636
+ function Me(e) {
3670
3637
  const t = String(e || "").trim();
3671
3638
  return t ? t.split(/[-_\s]+/).filter(Boolean).map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join(" ") : "";
3672
3639
  }
3673
- function _i(e) {
3640
+ function Gi(e) {
3674
3641
  if (!Array.isArray(e) || !e.length)
3675
- return W.map((o) => ({ ...o }));
3642
+ return Y.map((o) => ({ ...o }));
3676
3643
  const t = /* @__PURE__ */ new Set(), a = [];
3677
3644
  for (const o of e) {
3678
3645
  let s = "", i = "";
3679
- typeof o == "string" || typeof o == "number" ? (s = bt(o), i = De(s)) : o && typeof o == "object" && (s = bt(o.id ?? o.value ?? o.kind), i = String(o.label || o.name || De(s)).trim() || De(s)), !(!s || t.has(s)) && (t.add(s), a.push({ id: s, label: i }));
3646
+ typeof o == "string" || typeof o == "number" ? (s = bt(o), i = Me(s)) : o && typeof o == "object" && (s = bt(o.id ?? o.value ?? o.kind), i = String(o.label || o.name || Me(s)).trim() || Me(s)), !(!s || t.has(s)) && (t.add(s), a.push({ id: s, label: i }));
3680
3647
  }
3681
- return a.length ? a : W.map((o) => ({ ...o }));
3648
+ return a.length ? a : Y.map((o) => ({ ...o }));
3682
3649
  }
3683
- function Ee(e) {
3650
+ function Re(e) {
3684
3651
  var a;
3685
- const t = Array.isArray(e) && e.length ? e : W;
3652
+ const t = Array.isArray(e) && e.length ? e : Y;
3686
3653
  return t.some((o) => o.id === "bug") ? "bug" : ((a = t[0]) == null ? void 0 : a.id) || "other";
3687
3654
  }
3688
- const Wi = ["maker", "all-business", "brighter-day", "quiet-night"], Gt = "maker", Zi = /* @__PURE__ */ new Set(["crop", "arrow", "rect", "circle"]), He = 0.02, wt = 0.05, Ji = `
3655
+ const qi = ["maker", "all-business", "brighter-day", "quiet-night"], Kt = "maker", _i = /* @__PURE__ */ new Set(["crop", "arrow", "rect", "circle"]), Ke = 0.02, wt = 0.05, Wi = `
3689
3656
  <svg class="nf-launcher-icon" viewBox="0 0 24 24" aria-hidden="true">
3690
3657
  <path fill="currentColor" d="M5.2 2.8h9.1A2.7 2.7 0 0 1 17 5.5v8.2c0 .4-.3.7-.7.7h-.1a.7.7 0 0 1-.7-.7V5.5c0-.7-.6-1.3-1.3-1.3H5.2c-.7 0-1.3.6-1.3 1.3v12.2c0 .7.6 1.3 1.3 1.3h6.4a.7.7 0 0 1 0 1.4H5.2A2.7 2.7 0 0 1 2.5 17.7V5.5A2.7 2.7 0 0 1 5.2 2.8zm1.6 4.2a.7.7 0 0 0 0 1.4h6.2a.7.7 0 0 0 0-1.4H6.8zm0 3.2a.7.7 0 0 0 0 1.4h6.2a.7.7 0 0 0 0-1.4H6.8zm0 3.2a.7.7 0 0 0 0 1.4h3.6a.7.7 0 0 0 0-1.4H6.8z"/>
3691
3658
  <path fill="currentColor" d="M14.7 13.05 20.2 7.55a1.55 1.55 0 0 1 2.2 2.2l-5.5 5.5-.45 1.9a.6.6 0 0 1-.72.45l-1.9-.45.87-1.9z"/>
3692
3659
  </svg>
3693
3660
  `;
3694
- function U(e) {
3661
+ function D(e) {
3695
3662
  return `<svg class="nf-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${e}</svg>`;
3696
3663
  }
3697
- const L = {
3698
- crop: U('<path d="M6 3v5H1M18 21v-5h5M8 5h8a2 2 0 0 1 2 2v8M16 19H8a2 2 0 0 1-2-2V8"/>'),
3699
- resetCrop: U('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),
3700
- arrow: U('<path d="M5 19 19 5"/><path d="M9 5h10v10"/>'),
3701
- rect: U('<rect x="4" y="6" width="16" height="12" rx="1.5"/>'),
3702
- circle: U('<circle cx="12" cy="12" r="8"/>'),
3703
- discard: U('<path d="M4 7h16"/><path d="M9 7V5h6v2"/><path d="M6 7l1 13h10l1-13"/>'),
3704
- recapture: U('<path d="M4 8h3l2-2h6l2 2h3v11H4z"/><circle cx="12" cy="13" r="3.5"/>'),
3705
- privacy: U('<path d="M8 6h13M8 12h13M8 18h13"/><path d="M3 6h.01M3 12h.01M3 18h.01"/>'),
3706
- audio: U('<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0"/><path d="M12 18v3"/>'),
3707
- video: U('<rect x="3" y="7" width="13" height="10" rx="2"/><path d="M16 10.5 21 8v8l-5-2.5z"/>'),
3708
- openArrow: U('<path d="M5 12h14"/><path d="m13 6 6 6-6 6"/>')
3709
- }, qt = ji();
3710
- qt.hook();
3711
- const _t = 10, Yi = 80, Wt = "notefully.author", Zt = "notefully.kind", Jt = "notefully.redactSections";
3712
- let c = {
3664
+ const F = {
3665
+ crop: D('<path d="M6 3v5H1M18 21v-5h5M8 5h8a2 2 0 0 1 2 2v8M16 19H8a2 2 0 0 1-2-2V8"/>'),
3666
+ resetCrop: D('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),
3667
+ arrow: D('<path d="M5 19 19 5"/><path d="M9 5h10v10"/>'),
3668
+ rect: D('<rect x="4" y="6" width="16" height="12" rx="1.5"/>'),
3669
+ circle: D('<circle cx="12" cy="12" r="8"/>'),
3670
+ discard: D('<path d="M4 7h16"/><path d="M9 7V5h6v2"/><path d="M6 7l1 13h10l1-13"/>'),
3671
+ recapture: D('<path d="M4 8h3l2-2h6l2 2h3v11H4z"/><circle cx="12" cy="13" r="3.5"/>'),
3672
+ privacy: D('<path d="M8 6h13M8 12h13M8 18h13"/><path d="M3 6h.01M3 12h.01M3 18h.01"/>'),
3673
+ audio: D('<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0"/><path d="M12 18v3"/>'),
3674
+ video: D('<rect x="3" y="7" width="13" height="10" rx="2"/><path d="M16 10.5 21 8v8l-5-2.5z"/>'),
3675
+ openArrow: D('<path d="M5 12h14"/><path d="m13 6 6 6-6 6"/>')
3676
+ }, Ht = Ci();
3677
+ Ht.hook();
3678
+ const Gt = 10, Zi = 80, qt = "notefully.author", _t = "notefully.kind", Wt = "notefully.redactSections";
3679
+ let d = {
3713
3680
  endpoint: "",
3714
3681
  projectKey: "",
3715
3682
  version: "0.0.0",
3716
3683
  name: "",
3717
3684
  targets: null,
3718
3685
  hideLauncher: !1,
3719
- theme: Gt,
3686
+ theme: Kt,
3720
3687
  video: !1,
3721
- consoleLogLimit: _t,
3722
- kinds: W.map((e) => ({ ...e })),
3688
+ consoleLogLimit: Gt,
3689
+ kinds: Y.map((e) => ({ ...e })),
3723
3690
  kindsCustom: !1,
3724
3691
  capture: null,
3725
3692
  onBeforeCapture: null,
@@ -3728,40 +3695,34 @@ let c = {
3728
3695
  displayLink: !1,
3729
3696
  locale: null,
3730
3697
  translations: null
3731
- }, ue = !1, Me = !1, I = {}, g = null, l = {}, k = Ye(), F = "", ie = "", V = null, _ = Ee(W), K = null, T = null, S = null, w = null, ge = null, J = null, ne = null, B = { w: 0, h: 0 }, Ie = !1, Re = !1, Pe = !1, D = [], O = [], H = !1;
3732
- function f(e) {
3733
- return g.querySelector(e);
3698
+ }, ce = !1, Ie = !1, N = {}, f = null, n = {}, A = Je(), H = "", ie = "", K = null, J = Re(Y), q = null, M = null, j = null, E = null, me = null, Q = null, le = null, G = { w: 0, h: 0 }, Ve = !1, Pe = !1, xe = !1, V = [], I = [], _ = !1;
3699
+ function y(e) {
3700
+ return f.querySelector(e);
3734
3701
  }
3735
- function Yt(e) {
3702
+ function Zt(e) {
3736
3703
  const t = String(e || "").trim().toLowerCase().replace(/\s+/g, "-");
3737
- return Wi.includes(t) ? t : Gt;
3738
- }
3739
- function St(e, t) {
3740
- return g && getComputedStyle(g).getPropertyValue(e).trim() || t;
3741
- }
3742
- async function Xi(e) {
3743
- return (await fetch(e)).blob();
3704
+ return qi.includes(t) ? t : Kt;
3744
3705
  }
3745
- function A(e, t = !1) {
3746
- l.status && (l.status.textContent = e || "", ge && (clearTimeout(ge), ge = null), e && !t && (ge = setTimeout(() => {
3747
- l.status.textContent = "";
3706
+ function S(e, t = !1) {
3707
+ n.status && (n.status.textContent = e || "", me && (clearTimeout(me), me = null), e && !t && (me = setTimeout(() => {
3708
+ n.status.textContent = "";
3748
3709
  }, 4e3)));
3749
3710
  }
3750
- function Qe() {
3751
- return g && document.body.contains(g) || (g = document.createElement("div"), g.id = "notefully", g.innerHTML = `
3752
- <button class="nf-launcher" type="button" data-i18n-title="launcher.open" data-i18n-aria="launcher.open">${Ji}</button>
3711
+ function Ye() {
3712
+ return f && document.body.contains(f) || (f = document.createElement("div"), f.id = "notefully", f.innerHTML = `
3713
+ <button class="nf-launcher" type="button" data-i18n-title="launcher.open" data-i18n-aria="launcher.open">${Wi}</button>
3753
3714
  <div class="nf-dialog" hidden>
3754
3715
  <div class="nf-panel">
3755
3716
  <div class="nf-panel-body">
3756
3717
  <div class="nf-stage" hidden>
3757
3718
  <div class="nf-palette">
3758
- <button class="nf-tool nf-icon-btn" type="button" data-tool="crop" data-i18n-title="tool.crop" data-i18n-aria="tool.crop">${L.crop}</button>
3759
- <button class="nf-reset-crop nf-icon-btn" type="button" data-i18n-title="tool.resetCrop" data-i18n-aria="tool.resetCrop" hidden>${L.resetCrop}</button>
3760
- <button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" data-i18n-title="tool.arrow" data-i18n-aria="tool.arrow">${L.arrow}</button>
3761
- <button class="nf-tool nf-icon-btn" type="button" data-tool="rect" data-i18n-title="tool.rect" data-i18n-aria="tool.rect">${L.rect}</button>
3762
- <button class="nf-tool nf-icon-btn" type="button" data-tool="circle" data-i18n-title="tool.circle" data-i18n-aria="tool.circle">${L.circle}</button>
3763
- <button class="nf-discard-shot nf-icon-btn" type="button" data-i18n-title="tool.discard" data-i18n-aria="tool.discard">${L.discard}</button>
3764
- <button class="nf-recapture nf-icon-btn" type="button" data-i18n-title="tool.recapture" data-i18n-aria="tool.recapture">${L.recapture}</button>
3719
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="crop" data-i18n-title="tool.crop" data-i18n-aria="tool.crop">${F.crop}</button>
3720
+ <button class="nf-reset-crop nf-icon-btn" type="button" data-i18n-title="tool.resetCrop" data-i18n-aria="tool.resetCrop" hidden>${F.resetCrop}</button>
3721
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" data-i18n-title="tool.arrow" data-i18n-aria="tool.arrow">${F.arrow}</button>
3722
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="rect" data-i18n-title="tool.rect" data-i18n-aria="tool.rect">${F.rect}</button>
3723
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="circle" data-i18n-title="tool.circle" data-i18n-aria="tool.circle">${F.circle}</button>
3724
+ <button class="nf-discard-shot nf-icon-btn" type="button" data-i18n-title="tool.discard" data-i18n-aria="tool.discard">${F.discard}</button>
3725
+ <button class="nf-recapture nf-icon-btn" type="button" data-i18n-title="tool.recapture" data-i18n-aria="tool.recapture">${F.recapture}</button>
3765
3726
  </div>
3766
3727
  <div class="nf-canvas"></div>
3767
3728
  </div>
@@ -3771,7 +3732,7 @@ function Qe() {
3771
3732
  <div class="nf-kind"></div>
3772
3733
  <div class="nf-privacy-summary">
3773
3734
  <span class="nf-privacy-text"></span>
3774
- <button class="nf-privacy-change nf-icon-btn" type="button" data-i18n-title="tool.privacy" data-i18n-aria="tool.privacy" aria-expanded="false">${L.privacy}</button>
3735
+ <button class="nf-privacy-change nf-icon-btn" type="button" data-i18n-title="tool.privacy" data-i18n-aria="tool.privacy" aria-expanded="false">${F.privacy}</button>
3775
3736
  </div>
3776
3737
  </div>
3777
3738
  <div class="nf-privacy">
@@ -3781,9 +3742,9 @@ function Qe() {
3781
3742
  </div>
3782
3743
  </div>
3783
3744
  <div class="nf-actions">
3784
- <button class="nf-restore nf-icon-btn" type="button" data-i18n-title="tool.restore" data-i18n-aria="tool.restore" hidden>${L.resetCrop}</button>
3785
- <button class="nf-audio nf-icon-btn" type="button" data-i18n-title="tool.audio" data-i18n-aria="tool.audio">${L.audio}</button>
3786
- <button class="nf-video nf-icon-btn" type="button" data-i18n-title="tool.video" data-i18n-aria="tool.video">${L.video}</button>
3745
+ <button class="nf-restore nf-icon-btn" type="button" data-i18n-title="tool.restore" data-i18n-aria="tool.restore" hidden>${F.resetCrop}</button>
3746
+ <button class="nf-audio nf-icon-btn" type="button" data-i18n-title="tool.audio" data-i18n-aria="tool.audio">${F.audio}</button>
3747
+ <button class="nf-video nf-icon-btn" type="button" data-i18n-title="tool.video" data-i18n-aria="tool.video">${F.video}</button>
3787
3748
  <button class="nf-submit" type="button" data-i18n-text="form.submit"></button>
3788
3749
  </div>
3789
3750
  <div class="nf-status"></div>
@@ -3791,156 +3752,156 @@ function Qe() {
3791
3752
  <p class="nf-success-msg" hidden aria-live="polite" data-i18n-text="form.success"></p>
3792
3753
  <a class="nf-success-link" hidden target="_blank" rel="noopener noreferrer" data-i18n-aria="form.viewReport">
3793
3754
  <span class="nf-success-link-label" data-i18n-text="form.viewReport"></span>
3794
- ${L.openArrow}
3755
+ ${F.openArrow}
3795
3756
  </a>
3796
3757
  </div>
3797
3758
  </div>
3798
3759
  <button class="nf-stop-video" type="button" hidden data-i18n-text="tool.stopVideo"></button>
3799
- `, document.body.appendChild(g), l = {
3800
- launcher: f(".nf-launcher"),
3801
- dialog: f(".nf-dialog"),
3802
- panel: f(".nf-panel"),
3803
- panelBody: f(".nf-panel-body"),
3804
- successMsg: f(".nf-success-msg"),
3805
- successLink: f(".nf-success-link"),
3806
- stage: f(".nf-stage"),
3807
- palette: f(".nf-palette"),
3808
- canvas: f(".nf-canvas"),
3809
- text: f(".nf-text"),
3810
- author: f(".nf-author"),
3811
- kindRow: f(".nf-kind-row"),
3812
- kind: f(".nf-kind"),
3813
- privacy: f(".nf-privacy"),
3814
- privacySummary: f(".nf-privacy-summary"),
3815
- privacyText: f(".nf-privacy-text"),
3816
- privacyChange: f(".nf-privacy-change"),
3817
- privacyPanel: f(".nf-privacy-panel"),
3818
- privacyScroll: f(".nf-privacy-scroll"),
3819
- privacyDone: f(".nf-privacy-done"),
3820
- actions: f(".nf-actions"),
3821
- restore: f(".nf-restore"),
3822
- status: f(".nf-status"),
3823
- audio: f(".nf-audio"),
3824
- video: f(".nf-video"),
3825
- discard: f(".nf-discard-shot"),
3826
- recapture: f(".nf-recapture"),
3827
- stop: f(".nf-stop-video"),
3828
- resetCrop: f(".nf-reset-crop"),
3829
- submit: f(".nf-submit"),
3760
+ `, document.body.appendChild(f), n = {
3761
+ launcher: y(".nf-launcher"),
3762
+ dialog: y(".nf-dialog"),
3763
+ panel: y(".nf-panel"),
3764
+ panelBody: y(".nf-panel-body"),
3765
+ successMsg: y(".nf-success-msg"),
3766
+ successLink: y(".nf-success-link"),
3767
+ stage: y(".nf-stage"),
3768
+ palette: y(".nf-palette"),
3769
+ canvas: y(".nf-canvas"),
3770
+ text: y(".nf-text"),
3771
+ author: y(".nf-author"),
3772
+ kindRow: y(".nf-kind-row"),
3773
+ kind: y(".nf-kind"),
3774
+ privacy: y(".nf-privacy"),
3775
+ privacySummary: y(".nf-privacy-summary"),
3776
+ privacyText: y(".nf-privacy-text"),
3777
+ privacyChange: y(".nf-privacy-change"),
3778
+ privacyPanel: y(".nf-privacy-panel"),
3779
+ privacyScroll: y(".nf-privacy-scroll"),
3780
+ privacyDone: y(".nf-privacy-done"),
3781
+ actions: y(".nf-actions"),
3782
+ restore: y(".nf-restore"),
3783
+ status: y(".nf-status"),
3784
+ audio: y(".nf-audio"),
3785
+ video: y(".nf-video"),
3786
+ discard: y(".nf-discard-shot"),
3787
+ recapture: y(".nf-recapture"),
3788
+ stop: y(".nf-stop-video"),
3789
+ resetCrop: y(".nf-reset-crop"),
3790
+ submit: y(".nf-submit"),
3830
3791
  shot: null
3831
- }, ts(), se()), g;
3792
+ }, Xi(), se()), f;
3832
3793
  }
3833
3794
  function se() {
3834
3795
  var e;
3835
- g && (Xt(), g.dataset.theme = Yt(c.theme), g.lang = fe(), g.dir = za(fe()), c.hideLauncher ? g.setAttribute("data-nf-hidden-launcher", "") : g.removeAttribute("data-nf-hidden-launcher"), l.video && (l.video.hidden = !c.video), Qi(), D.length && D.forEach((t) => {
3836
- t.label = m(`diag.${t.key}`);
3837
- }), Qt(), H ? it() : ot(), (e = l.dialog) != null && e.hidden && we());
3796
+ f && (Jt(), f.dataset.theme = Zt(d.theme), f.lang = ye(), f.dir = Aa(ye()), d.hideLauncher ? f.setAttribute("data-nf-hidden-launcher", "") : f.removeAttribute("data-nf-hidden-launcher"), n.video && (n.video.hidden = !d.video), Ji(), V.length && V.forEach((t) => {
3797
+ t.label = p(`diag.${t.key}`);
3798
+ }), Yt(), _ ? at() : tt(), (e = n.dialog) != null && e.hidden && Se());
3838
3799
  }
3839
- function Xt() {
3840
- const e = Sa({
3841
- locale: c.locale == null ? void 0 : c.locale
3800
+ function Jt() {
3801
+ const e = ba({
3802
+ locale: d.locale == null ? void 0 : d.locale
3842
3803
  });
3843
- Ca(c.translations), Aa(e);
3844
- }
3845
- function Qi() {
3846
- if (g && (g.querySelectorAll("[data-i18n-title]").forEach((e) => {
3847
- e.title = m(e.getAttribute("data-i18n-title"));
3848
- }), g.querySelectorAll("[data-i18n-aria]").forEach((e) => {
3849
- e.setAttribute("aria-label", m(e.getAttribute("data-i18n-aria")));
3850
- }), g.querySelectorAll("[data-i18n-placeholder]").forEach((e) => {
3851
- e.setAttribute("placeholder", m(e.getAttribute("data-i18n-placeholder")));
3852
- }), g.querySelectorAll("[data-i18n-text]").forEach((e) => {
3853
- e.textContent = m(e.getAttribute("data-i18n-text"));
3854
- }), l.audio)) {
3855
- const e = l.audio.dataset.active === "true";
3856
- xe(e);
3804
+ Sa(d.translations), wa(e);
3805
+ }
3806
+ function Ji() {
3807
+ if (f && (f.querySelectorAll("[data-i18n-title]").forEach((e) => {
3808
+ e.title = p(e.getAttribute("data-i18n-title"));
3809
+ }), f.querySelectorAll("[data-i18n-aria]").forEach((e) => {
3810
+ e.setAttribute("aria-label", p(e.getAttribute("data-i18n-aria")));
3811
+ }), f.querySelectorAll("[data-i18n-placeholder]").forEach((e) => {
3812
+ e.setAttribute("placeholder", p(e.getAttribute("data-i18n-placeholder")));
3813
+ }), f.querySelectorAll("[data-i18n-text]").forEach((e) => {
3814
+ e.textContent = p(e.getAttribute("data-i18n-text"));
3815
+ }), n.audio)) {
3816
+ const e = n.audio.dataset.active === "true";
3817
+ Ue(e);
3857
3818
  }
3858
3819
  }
3859
- function es(e) {
3860
- if (c.kindsCustom)
3820
+ function Yi(e) {
3821
+ if (d.kindsCustom)
3861
3822
  return e.label;
3862
- const t = `kind.${e.id}`, a = m(t);
3823
+ const t = `kind.${e.id}`, a = p(t);
3863
3824
  return a === t ? e.label : a;
3864
3825
  }
3865
- function we() {
3866
- l.launcher && (l.launcher.hidden = !!c.hideLauncher);
3826
+ function Se() {
3827
+ n.launcher && (n.launcher.hidden = !!d.hideLauncher);
3867
3828
  }
3868
- function ts() {
3869
- l.launcher.addEventListener("click", () => ha()), f(".nf-dialog").addEventListener("click", (t) => {
3870
- Re && !Pe || t.target === l.dialog && re();
3871
- }), document.addEventListener("keydown", ca), g.querySelectorAll(".nf-tool").forEach((t) => {
3829
+ function Xi() {
3830
+ n.launcher.addEventListener("click", () => ga()), y(".nf-dialog").addEventListener("click", (t) => {
3831
+ Pe && !xe || t.target === n.dialog && re();
3832
+ }), document.addEventListener("keydown", ua), f.querySelectorAll(".nf-tool").forEach((t) => {
3872
3833
  t.addEventListener("click", () => de(t.dataset.tool));
3873
- }), l.resetCrop.addEventListener("click", cs), l.canvas.addEventListener("pointerdown", rs), l.canvas.addEventListener("dragstart", (t) => t.preventDefault());
3874
- const e = f(".nf-kind");
3834
+ }), n.resetCrop.addEventListener("click", ls), n.canvas.addEventListener("pointerdown", os), n.canvas.addEventListener("dragstart", (t) => t.preventDefault());
3835
+ const e = y(".nf-kind");
3875
3836
  e && e.addEventListener("click", (t) => {
3876
3837
  const a = t.target.closest("[data-kind]");
3877
- a && et(a.dataset.kind);
3878
- }), l.discard.addEventListener("click", ps), l.recapture.addEventListener("click", () => {
3879
- ms().catch((t) => A(t.message || m("status.recaptureFailed")));
3880
- }), l.restore.addEventListener("click", gs), l.audio.addEventListener("click", hs), l.video.addEventListener("click", fs), l.stop.addEventListener("click", () => ne == null ? void 0 : ne.stop()), l.privacyChange.addEventListener("click", () => ze(!H)), l.privacyDone.addEventListener("click", () => ze(!1)), l.privacyScroll.addEventListener("change", Ps), f(".nf-submit").addEventListener("click", () => {
3881
- ya().catch((t) => A(t.message || m("status.submitFailed")));
3882
- }), Qt(), de(null);
3883
- }
3884
- function z(e) {
3838
+ a && Xe(a.dataset.kind);
3839
+ }), n.discard.addEventListener("click", us), n.recapture.addEventListener("click", () => {
3840
+ ds().catch((t) => S(t.message || p("status.recaptureFailed")));
3841
+ }), n.restore.addEventListener("click", cs), n.audio.addEventListener("click", ps), n.video.addEventListener("click", gs), n.stop.addEventListener("click", () => le == null ? void 0 : le.stop()), n.privacyChange.addEventListener("click", () => Ee(!_)), n.privacyDone.addEventListener("click", () => Ee(!1)), n.privacyScroll.addEventListener("change", Es), y(".nf-submit").addEventListener("click", () => {
3842
+ ha().catch((t) => S(t.message || p("status.submitFailed")));
3843
+ }), Yt(), de(null);
3844
+ }
3845
+ function x(e) {
3885
3846
  return String(e || "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3886
3847
  }
3887
- function Qt() {
3888
- const e = g == null ? void 0 : g.querySelector(".nf-kind");
3848
+ function Yt() {
3849
+ const e = f == null ? void 0 : f.querySelector(".nf-kind");
3889
3850
  if (!e)
3890
3851
  return;
3891
- const t = Array.isArray(c.kinds) && c.kinds.length ? c.kinds : W;
3892
- e.innerHTML = t.map((s) => `<button type="button" data-kind="${z(s.id)}">${z(es(s))}</button>`).join("");
3893
- const o = t.map((s) => s.id).includes(_) ? _ : Ee(t);
3894
- et(o);
3852
+ const t = Array.isArray(d.kinds) && d.kinds.length ? d.kinds : Y;
3853
+ e.innerHTML = t.map((s) => `<button type="button" data-kind="${x(s.id)}">${x(Yi(s))}</button>`).join("");
3854
+ const o = t.map((s) => s.id).includes(J) ? J : Re(t);
3855
+ Xe(o);
3895
3856
  }
3896
- function et(e) {
3897
- _ = (c.kinds || W).map((a) => a.id).includes(e) ? e : Ee(c.kinds), g == null || g.querySelectorAll("[data-kind]").forEach((a) => {
3898
- a.dataset.active = String(a.dataset.kind === _);
3899
- }), os(_);
3857
+ function Xe(e) {
3858
+ J = (d.kinds || Y).map((a) => a.id).includes(e) ? e : Re(d.kinds), f == null || f.querySelectorAll("[data-kind]").forEach((a) => {
3859
+ a.dataset.active = String(a.dataset.kind === J);
3860
+ }), es(J);
3900
3861
  }
3901
- function as() {
3862
+ function Qi() {
3902
3863
  try {
3903
- return String(localStorage.getItem(Zt) || "").trim().toLowerCase();
3864
+ return String(localStorage.getItem(_t) || "").trim().toLowerCase();
3904
3865
  } catch {
3905
3866
  return "";
3906
3867
  }
3907
3868
  }
3908
- function os(e) {
3869
+ function es(e) {
3909
3870
  const t = String(e || "").trim().toLowerCase();
3910
3871
  if (t)
3911
3872
  try {
3912
- localStorage.setItem(Zt, t);
3873
+ localStorage.setItem(_t, t);
3913
3874
  } catch {
3914
3875
  }
3915
3876
  }
3916
- function is() {
3917
- const e = (c.kinds || W).map((a) => a.id), t = as();
3918
- return t && e.includes(t) ? t : Ee(c.kinds);
3877
+ function ts() {
3878
+ const e = (d.kinds || Y).map((a) => a.id), t = Qi();
3879
+ return t && e.includes(t) ? t : Re(d.kinds);
3919
3880
  }
3920
3881
  function de(e) {
3921
- K = Zi.has(e) ? e : null, T = null, g.querySelectorAll(".nf-tool").forEach((t) => {
3922
- t.dataset.active = String(t.dataset.tool === K);
3923
- }), l.canvas && (l.canvas.dataset.draw = K ? "true" : "false"), Z() && x();
3882
+ q = _i.has(e) ? e : null, M = null, f.querySelectorAll(".nf-tool").forEach((t) => {
3883
+ t.dataset.active = String(t.dataset.tool === q);
3884
+ }), n.canvas && (n.canvas.dataset.draw = q ? "true" : "false"), B() && O();
3924
3885
  }
3925
- function At(e) {
3886
+ function St(e) {
3926
3887
  return Math.min(1, Math.max(0, e));
3927
3888
  }
3928
- function ce() {
3929
- return l.shot || l.canvas;
3889
+ function pe() {
3890
+ return n.shot || n.canvas;
3930
3891
  }
3931
- function Se(e) {
3932
- const t = ce().getBoundingClientRect();
3892
+ function Ae(e) {
3893
+ const t = pe().getBoundingClientRect();
3933
3894
  return {
3934
- x: At((e.clientX - t.left) / Math.max(t.width, 1)),
3935
- y: At((e.clientY - t.top) / Math.max(t.height, 1))
3895
+ x: St((e.clientX - t.left) / Math.max(t.width, 1)),
3896
+ y: St((e.clientY - t.top) / Math.max(t.height, 1))
3936
3897
  };
3937
3898
  }
3938
- function ss(e) {
3939
- const t = ce().getBoundingClientRect();
3899
+ function as(e) {
3900
+ const t = pe().getBoundingClientRect();
3940
3901
  return e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom;
3941
3902
  }
3942
- function ea(e) {
3943
- const t = Se(e), a = k.crop();
3903
+ function Xt(e) {
3904
+ const t = Ae(e), a = A.crop();
3944
3905
  return {
3945
3906
  x: a.x + t.x * a.w,
3946
3907
  y: a.y + t.y * a.h
@@ -3951,86 +3912,86 @@ function Le(e, t) {
3951
3912
  return {
3952
3913
  x: a,
3953
3914
  y: o,
3954
- w: Math.max(He, Math.abs(t.x - e.x)),
3955
- h: Math.max(He, Math.abs(t.y - e.y))
3915
+ w: Math.max(Ke, Math.abs(t.x - e.x)),
3916
+ h: Math.max(Ke, Math.abs(t.y - e.y))
3956
3917
  };
3957
3918
  }
3958
- function tt(e) {
3959
- g && (e ? g.dataset.grabbing = "true" : delete g.dataset.grabbing);
3919
+ function Qe(e) {
3920
+ f && (e ? f.dataset.grabbing = "true" : delete f.dataset.grabbing);
3960
3921
  }
3961
- function Ve(e) {
3922
+ function $e(e) {
3962
3923
  try {
3963
- l.canvas.setPointerCapture(e.pointerId);
3924
+ n.canvas.setPointerCapture(e.pointerId);
3964
3925
  } catch {
3965
3926
  }
3966
3927
  }
3967
- function Ge() {
3968
- window.addEventListener("pointermove", aa), window.addEventListener("pointerup", Ae), window.addEventListener("pointercancel", Ae);
3928
+ function He() {
3929
+ window.addEventListener("pointermove", ea), window.addEventListener("pointerup", Ce), window.addEventListener("pointercancel", Ce);
3969
3930
  }
3970
- function ta() {
3971
- window.removeEventListener("pointermove", aa), window.removeEventListener("pointerup", Ae), window.removeEventListener("pointercancel", Ae);
3931
+ function Qt() {
3932
+ window.removeEventListener("pointermove", ea), window.removeEventListener("pointerup", Ce), window.removeEventListener("pointercancel", Ce);
3972
3933
  }
3973
- function rs(e) {
3974
- if (e.button !== 0 || !Z())
3934
+ function os(e) {
3935
+ if (e.button !== 0 || !B())
3975
3936
  return;
3976
- if (!e.target.closest(".nf-sticker") && !ss(e)) {
3977
- T = null, x();
3937
+ if (!e.target.closest(".nf-sticker") && !as(e)) {
3938
+ M = null, O();
3978
3939
  return;
3979
3940
  }
3980
3941
  const t = e.target.closest(".nf-handle"), a = e.target.closest(".nf-sticker");
3981
3942
  if (a && a.dataset.preview !== "true") {
3982
- e.preventDefault(), e.stopPropagation(), T = a.dataset.id, Ve(e), ns({
3943
+ e.preventDefault(), e.stopPropagation(), M = a.dataset.id, $e(e), is({
3983
3944
  kind: "sticker",
3984
- id: T,
3945
+ id: M,
3985
3946
  dir: (t == null ? void 0 : t.dataset.dir) || "move"
3986
- }, e), x();
3947
+ }, e), O();
3987
3948
  return;
3988
3949
  }
3989
- if (T = null, K === "crop") {
3990
- e.preventDefault(), Ve(e), S = { kind: "crop", start: Se(e), current: Se(e) }, Ge(), x();
3950
+ if (M = null, q === "crop") {
3951
+ e.preventDefault(), $e(e), j = { kind: "crop", start: Ae(e), current: Ae(e) }, He(), O();
3991
3952
  return;
3992
3953
  }
3993
- if (K === "arrow" || K === "rect" || K === "circle") {
3994
- e.preventDefault(), Ve(e);
3995
- const o = ea(e);
3996
- S = { kind: "sticker", type: K, start: o, current: o }, Ge(), x();
3954
+ if (q === "arrow" || q === "rect" || q === "circle") {
3955
+ e.preventDefault(), $e(e);
3956
+ const o = Xt(e);
3957
+ j = { kind: "sticker", type: q, start: o, current: o }, He(), O();
3997
3958
  return;
3998
3959
  }
3999
- x();
3960
+ O();
4000
3961
  }
4001
- function ns(e, t) {
3962
+ function is(e, t) {
4002
3963
  t.preventDefault(), t.stopPropagation();
4003
- const a = ce().getBoundingClientRect(), o = k.list().find((s) => s.id === e.id);
4004
- w = {
3964
+ const a = pe().getBoundingClientRect(), o = A.list().find((s) => s.id === e.id);
3965
+ E = {
4005
3966
  ...e,
4006
3967
  startX: t.clientX,
4007
3968
  startY: t.clientY,
4008
- crop: k.crop(),
3969
+ crop: A.crop(),
4009
3970
  sticker: o ? { ...o } : null,
4010
3971
  rect: a
4011
- }, tt(e.dir === "move" || e.dir === "start" || e.dir === "end"), Ge();
3972
+ }, Qe(e.dir === "move" || e.dir === "start" || e.dir === "end"), He();
4012
3973
  }
4013
- function aa(e) {
4014
- if (S) {
4015
- S.current = S.kind === "crop" ? Se(e) : ea(e), x();
3974
+ function ea(e) {
3975
+ if (j) {
3976
+ j.current = j.kind === "crop" ? Ae(e) : Xt(e), O();
4016
3977
  return;
4017
3978
  }
4018
- if (!w)
3979
+ if (!E)
4019
3980
  return;
4020
- const t = (e.clientX - w.startX) / w.rect.width * w.crop.w, a = (e.clientY - w.startY) / w.rect.height * w.crop.h, o = w.sticker;
3981
+ const t = (e.clientX - E.startX) / E.rect.width * E.crop.w, a = (e.clientY - E.startY) / E.rect.height * E.crop.h, o = E.sticker;
4021
3982
  if (o) {
4022
- if (w.dir === "end")
4023
- k.update(o.id, {
3983
+ if (E.dir === "end")
3984
+ A.update(o.id, {
4024
3985
  x2: o.x2 + t,
4025
3986
  y2: o.y2 + a
4026
3987
  });
4027
- else if (w.dir === "start")
4028
- k.update(o.id, {
3988
+ else if (E.dir === "start")
3989
+ A.update(o.id, {
4029
3990
  x: o.x + t,
4030
3991
  y: o.y + a
4031
3992
  });
4032
- else if (w.dir === "move")
4033
- k.update(o.id, {
3993
+ else if (E.dir === "move")
3994
+ A.update(o.id, {
4034
3995
  x: o.x + t,
4035
3996
  y: o.y + a,
4036
3997
  x2: (o.x2 || o.x) + t,
@@ -4038,12 +3999,12 @@ function aa(e) {
4038
3999
  });
4039
4000
  else {
4040
4001
  const s = { x: o.x, y: o.y, w: o.w, h: o.h };
4041
- ls(s, w.dir, t, a), k.update(o.id, s);
4002
+ ss(s, E.dir, t, a), A.update(o.id, s);
4042
4003
  }
4043
- x();
4004
+ O();
4044
4005
  }
4045
4006
  }
4046
- function ls(e, t, a, o) {
4007
+ function ss(e, t, a, o) {
4047
4008
  if (t.includes("e") && (e.w = Math.max(0.04, e.w + a)), t.includes("s") && (e.h = Math.max(0.04, e.h + o)), t.includes("w")) {
4048
4009
  const s = Math.max(0.04, e.w - a);
4049
4010
  e.x += e.w - s, e.w = s;
@@ -4053,52 +4014,52 @@ function ls(e, t, a, o) {
4053
4014
  e.y += e.h - s, e.h = s;
4054
4015
  }
4055
4016
  }
4056
- function Ae(e) {
4057
- if (ta(), tt(!1), S) {
4058
- us();
4017
+ function Ce(e) {
4018
+ if (Qt(), Qe(!1), j) {
4019
+ rs();
4059
4020
  return;
4060
4021
  }
4061
- if (w) {
4062
- if (w.kind === "sticker") {
4063
- const t = l.canvas.getBoundingClientRect();
4064
- (e.clientX < t.left - 24 || e.clientX > t.right + 24 || e.clientY < t.top - 24 || e.clientY > t.bottom + 24) && (k.remove(w.id), T = null);
4022
+ if (E) {
4023
+ if (E.kind === "sticker") {
4024
+ const t = n.canvas.getBoundingClientRect();
4025
+ (e.clientX < t.left - 24 || e.clientX > t.right + 24 || e.clientY < t.top - 24 || e.clientY > t.bottom + 24) && (A.remove(E.id), M = null);
4065
4026
  }
4066
- w = null, x();
4027
+ E = null, O();
4067
4028
  }
4068
4029
  }
4069
- function us() {
4070
- const e = S;
4071
- if (S = null, !e)
4030
+ function rs() {
4031
+ const e = j;
4032
+ if (j = null, !e)
4072
4033
  return;
4073
4034
  if (e.kind === "crop") {
4074
4035
  const a = Le(e.start, e.current);
4075
4036
  if (Math.abs(e.current.x - e.start.x) < wt || Math.abs(e.current.y - e.start.y) < wt) {
4076
- x();
4037
+ O();
4077
4038
  return;
4078
4039
  }
4079
- const s = k.crop();
4080
- k.setCrop({
4040
+ const s = A.crop();
4041
+ A.setCrop({
4081
4042
  x: s.x + a.x * s.w,
4082
4043
  y: s.y + a.y * s.h,
4083
4044
  w: a.w * s.w,
4084
4045
  h: a.h * s.h
4085
- }), Y();
4046
+ }), ee();
4086
4047
  return;
4087
4048
  }
4088
- const t = ds(e);
4089
- t && (T = t.id), x();
4049
+ const t = ns(e);
4050
+ t && (M = t.id), O();
4090
4051
  }
4091
- function ds(e) {
4052
+ function ns(e) {
4092
4053
  if (e.type === "arrow") {
4093
4054
  const t = e.current.x - e.start.x, a = e.current.y - e.start.y;
4094
- return Math.hypot(t, a) < He ? k.add("arrow", {
4055
+ return Math.hypot(t, a) < Ke ? A.add("arrow", {
4095
4056
  x: e.start.x,
4096
4057
  y: e.start.y,
4097
4058
  x2: e.start.x + 0.12,
4098
4059
  y2: e.start.y,
4099
4060
  w: 0.12,
4100
4061
  h: 0.02
4101
- }) : k.add("arrow", {
4062
+ }) : A.add("arrow", {
4102
4063
  x: e.start.x,
4103
4064
  y: e.start.y,
4104
4065
  x2: e.current.x,
@@ -4107,121 +4068,121 @@ function ds(e) {
4107
4068
  h: Math.abs(a)
4108
4069
  });
4109
4070
  }
4110
- return k.add(e.type, Le(e.start, e.current));
4071
+ return A.add(e.type, Le(e.start, e.current));
4111
4072
  }
4112
- function cs() {
4113
- k.resetCrop(), T = null, Y();
4073
+ function ls() {
4074
+ A.resetCrop(), M = null, ee();
4114
4075
  }
4115
- function Ce() {
4116
- l.resetCrop && (l.resetCrop.hidden = !k.isCropped());
4076
+ function ze() {
4077
+ n.resetCrop && (n.resetCrop.hidden = !A.isCropped());
4117
4078
  }
4118
- function xe(e) {
4119
- if (!l.audio)
4079
+ function Ue(e) {
4080
+ if (!n.audio)
4120
4081
  return;
4121
- const t = m(e ? "tool.audioStop" : "tool.audio");
4122
- l.audio.title = t, l.audio.setAttribute("aria-label", t), l.audio.dataset.active = String(!!e);
4082
+ const t = p(e ? "tool.audioStop" : "tool.audio");
4083
+ n.audio.title = t, n.audio.setAttribute("aria-label", t), n.audio.dataset.active = String(!!e);
4123
4084
  }
4124
- function Z() {
4125
- return q(F);
4085
+ function B() {
4086
+ return Z(H);
4126
4087
  }
4127
- function pe() {
4128
- if (!l.stage || !l.palette || !l.actions || !l.recapture)
4088
+ function ge() {
4089
+ if (!n.stage || !n.palette || !n.actions || !n.recapture)
4129
4090
  return;
4130
- const e = Z();
4131
- l.stage.hidden = !e && !V, l.palette.hidden = !e, l.discard && (l.discard.hidden = !e), l.restore && (l.restore.hidden = e || !ie), e ? (l.palette.appendChild(l.discard), l.palette.appendChild(l.recapture)) : l.audio ? l.audio.after(l.recapture) : l.actions.insertBefore(l.recapture, l.submit || null), l.recapture.hidden = !1;
4091
+ const e = B();
4092
+ n.stage.hidden = !e && !K, n.palette.hidden = !e, n.discard && (n.discard.hidden = !e), n.restore && (n.restore.hidden = e || !ie), e ? (n.palette.appendChild(n.discard), n.palette.appendChild(n.recapture)) : n.audio ? n.audio.after(n.recapture) : n.actions.insertBefore(n.recapture, n.submit || null), n.recapture.hidden = !1;
4132
4093
  }
4133
- function ps() {
4134
- Z() && (ie = F), F = "", de(null), pe(), Y();
4094
+ function us() {
4095
+ B() && (ie = H), H = "", de(null), ge(), ee();
4135
4096
  }
4136
- function gs() {
4137
- q(ie) && (F = ie, pe(), Y());
4097
+ function cs() {
4098
+ Z(ie) && (H = ie, ge(), ee());
4138
4099
  }
4139
- function oa() {
4100
+ function ta() {
4140
4101
  return {
4141
- capture: typeof c.capture == "function" ? c.capture : void 0,
4142
- onBeforeCapture: typeof c.onBeforeCapture == "function" ? c.onBeforeCapture : void 0
4102
+ capture: typeof d.capture == "function" ? d.capture : void 0,
4103
+ onBeforeCapture: typeof d.onBeforeCapture == "function" ? d.onBeforeCapture : void 0
4143
4104
  };
4144
4105
  }
4145
- function ia(e) {
4146
- if (!q(e))
4147
- throw new Error(m("status.screenshotFailed"));
4148
- F = e, ie = e, k = Ye(), B = { w: 0, h: 0 }, T = null, S = null, w = null, de(null);
4106
+ function aa(e) {
4107
+ if (!Z(e))
4108
+ throw new Error(p("status.screenshotFailed"));
4109
+ H = e, ie = e, A = Je(), G = { w: 0, h: 0 }, M = null, j = null, E = null, de(null);
4149
4110
  }
4150
- async function ms() {
4151
- if (!(Me || !l.dialog || l.dialog.hidden)) {
4152
- Me = !0, l.recapture.disabled = !0, A(m("status.capturing"), !0), l.dialog.hidden = !0;
4111
+ async function ds() {
4112
+ if (!(Ie || !n.dialog || n.dialog.hidden)) {
4113
+ Ie = !0, n.recapture.disabled = !0, S(p("status.capturing"), !0), n.dialog.hidden = !0;
4153
4114
  try {
4154
4115
  let e = "";
4155
4116
  try {
4156
- e = await mi();
4117
+ e = await pi();
4157
4118
  } catch {
4158
- e = await $t(oa());
4119
+ e = await Vt(ta());
4159
4120
  }
4160
- ia(e), A("");
4121
+ aa(e), S("");
4161
4122
  } catch (e) {
4162
- A((e == null ? void 0 : e.message) || m("status.screenshotFailed"));
4123
+ S((e == null ? void 0 : e.message) || p("status.screenshotFailed"));
4163
4124
  } finally {
4164
- l.dialog.hidden = !1, l.recapture.disabled = !1, Me = !1, pe(), Y();
4125
+ n.dialog.hidden = !1, n.recapture.disabled = !1, Ie = !1, ge(), ee();
4165
4126
  }
4166
4127
  }
4167
4128
  }
4168
- function hs() {
4129
+ function ps() {
4169
4130
  try {
4170
- if (J || (J = Ei((t) => {
4171
- const a = l.text.value.trim();
4172
- l.text.value = a ? `${a} ${t}` : t;
4173
- })), !J.isSupported()) {
4174
- A(m("status.audioUnsupported"));
4131
+ if (Q || (Q = zi((t) => {
4132
+ const a = n.text.value.trim();
4133
+ n.text.value = a ? `${a} ${t}` : t;
4134
+ })), !Q.isSupported()) {
4135
+ S(p("status.audioUnsupported"));
4175
4136
  return;
4176
4137
  }
4177
- const e = J.start({ lang: fe() });
4178
- xe(e), A(e ? m("status.listening") : "");
4138
+ const e = Q.start({ lang: ye() });
4139
+ Ue(e), S(e ? p("status.listening") : "");
4179
4140
  } catch (e) {
4180
- A(e.message);
4141
+ S(e.message);
4181
4142
  }
4182
4143
  }
4183
- async function fs() {
4184
- if (!c.video) {
4185
- A(m("status.videoDisabled"));
4144
+ async function gs() {
4145
+ if (!d.video) {
4146
+ S(p("status.videoDisabled"));
4186
4147
  return;
4187
4148
  }
4188
- l.dialog.hidden = !0, l.stop.hidden = !1, se(), l.launcher.hidden = !0, ne = Pi({
4149
+ n.dialog.hidden = !0, n.stop.hidden = !1, se(), n.launcher.hidden = !0, le = ji({
4189
4150
  onStart() {
4190
4151
  },
4191
4152
  onStop(e) {
4192
- V = e, l.stop.hidden = !0, we(), l.dialog.hidden = !1, pe(), Y(), A(m(e ? "status.videoAttached" : "status.recordingCancelled"));
4153
+ K = e, n.stop.hidden = !0, Se(), n.dialog.hidden = !1, ge(), ee(), S(p(e ? "status.videoAttached" : "status.recordingCancelled"));
4193
4154
  },
4194
4155
  onError(e) {
4195
- A(e.message);
4156
+ S(e.message);
4196
4157
  }
4197
4158
  });
4198
4159
  try {
4199
- await ne.start();
4160
+ await le.start();
4200
4161
  } catch (e) {
4201
- l.stop.hidden = !0, we(), l.dialog.hidden = !1, A(e.message);
4162
+ n.stop.hidden = !0, Se(), n.dialog.hidden = !1, S(e.message);
4202
4163
  }
4203
4164
  }
4204
- function Y() {
4205
- if (l.shot = null, !Z()) {
4206
- l.canvas.style.removeProperty("--nf-shot-aspect"), l.canvas.style.removeProperty("aspect-ratio"), l.canvas.innerHTML = V ? `<video class="nf-recording-preview" controls src="${URL.createObjectURL(V)}"></video>` : "", Ce();
4165
+ function ee() {
4166
+ if (n.shot = null, !B()) {
4167
+ n.canvas.style.removeProperty("--nf-shot-aspect"), n.canvas.style.removeProperty("aspect-ratio"), n.canvas.innerHTML = K ? `<video class="nf-recording-preview" controls src="${URL.createObjectURL(K)}"></video>` : "", ze();
4207
4168
  return;
4208
4169
  }
4209
- l.canvas.innerHTML = `<div class="nf-shot"><img alt="${z(m("shot.alt"))}" src="${F}" draggable="false"></div>`, l.shot = l.canvas.querySelector(".nf-shot");
4210
- const e = l.shot.querySelector("img");
4170
+ n.canvas.innerHTML = `<div class="nf-shot"><img alt="${x(p("shot.alt"))}" src="${H}" draggable="false"></div>`, n.shot = n.canvas.querySelector(".nf-shot");
4171
+ const e = n.shot.querySelector("img");
4211
4172
  e.draggable = !1, e.addEventListener("dragstart", (a) => a.preventDefault());
4212
4173
  const t = () => {
4213
- ys(e), x();
4174
+ ms(e), O();
4214
4175
  };
4215
- e.addEventListener("load", t), e.complete && e.naturalWidth && t(), Ce();
4176
+ e.addEventListener("load", t), e.complete && e.naturalWidth && t(), ze();
4216
4177
  }
4217
- function ys(e) {
4218
- const t = e.naturalWidth || B.w, a = e.naturalHeight || B.h;
4219
- if (t && a && (B = { w: t, h: a }, l.canvas.style.setProperty("--nf-shot-aspect", String(t / a)), l.canvas.style.aspectRatio = `${t} / ${a}`), !l.shot || !B.w || !B.h)
4178
+ function ms(e) {
4179
+ const t = e.naturalWidth || G.w, a = e.naturalHeight || G.h;
4180
+ if (t && a && (G = { w: t, h: a }, n.canvas.style.setProperty("--nf-shot-aspect", String(t / a)), n.canvas.style.aspectRatio = `${t} / ${a}`), !n.shot || !G.w || !G.h)
4220
4181
  return;
4221
- const o = k.crop(), s = B.w / B.h, i = o.w / o.h * s, r = Math.min(1, i / s), n = Math.min(1, s / i);
4222
- l.shot.style.left = `${(1 - r) / 2 * 100}%`, l.shot.style.top = `${(1 - n) / 2 * 100}%`, l.shot.style.width = `${r * 100}%`, l.shot.style.height = `${n * 100}%`, e.style.width = `${100 / o.w}%`, e.style.height = `${100 / o.h}%`, e.style.left = `${-o.x / o.w * 100}%`, e.style.top = `${-o.y / o.h * 100}%`;
4182
+ const o = A.crop(), s = G.w / G.h, i = o.w / o.h * s, r = Math.min(1, i / s), l = Math.min(1, s / i);
4183
+ n.shot.style.left = `${(1 - r) / 2 * 100}%`, n.shot.style.top = `${(1 - l) / 2 * 100}%`, n.shot.style.width = `${r * 100}%`, n.shot.style.height = `${l * 100}%`, e.style.width = `${100 / o.w}%`, e.style.height = `${100 / o.h}%`, e.style.left = `${-o.x / o.w * 100}%`, e.style.top = `${-o.y / o.h * 100}%`;
4223
4184
  }
4224
- function vs(e) {
4185
+ function hs(e) {
4225
4186
  return e.type === "arrow" ? {
4226
4187
  id: "preview",
4227
4188
  type: "arrow",
@@ -4239,63 +4200,63 @@ function vs(e) {
4239
4200
  ...Le(e.start, e.current)
4240
4201
  };
4241
4202
  }
4242
- function x() {
4243
- if ((l.shot || l.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((i) => i.remove()), !Z() || !l.shot) {
4244
- Ce();
4203
+ function O() {
4204
+ if ((n.shot || n.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((i) => i.remove()), !B() || !n.shot) {
4205
+ ze();
4245
4206
  return;
4246
4207
  }
4247
- const t = k.crop(), a = ce(), o = Xe(a.clientWidth || 400);
4248
- if (l.shot.style.setProperty("--nf-anno-stroke", `${o.stroke}px`), l.shot.style.setProperty("--nf-anno-badge", `${o.badgeRadius * 2}px`), l.shot.style.setProperty("--nf-anno-badge-font", `${o.fontSize}px`), l.shot.style.setProperty("--nf-anno-handle", `${Math.max(8, o.stroke * 2.5)}px`), (S == null ? void 0 : S.kind) === "crop") {
4208
+ const t = A.crop(), a = pe(), o = Nt(a.clientWidth || 400);
4209
+ if (n.shot.style.setProperty("--nf-anno-stroke", `${o.stroke}px`), n.shot.style.setProperty("--nf-anno-badge", `${o.badgeRadius * 2}px`), n.shot.style.setProperty("--nf-anno-badge-font", `${o.fontSize}px`), n.shot.style.setProperty("--nf-anno-handle", `${Math.max(8, o.stroke * 2.5)}px`), (j == null ? void 0 : j.kind) === "crop") {
4249
4210
  const i = document.createElement("div");
4250
- i.className = "nf-crop", Ct(i, Le(S.start, S.current), { x: 0, y: 0, w: 1, h: 1 }), l.shot.appendChild(i);
4211
+ i.className = "nf-crop", At(i, Le(j.start, j.current), { x: 0, y: 0, w: 1, h: 1 }), n.shot.appendChild(i);
4251
4212
  }
4252
- const s = k.list().slice();
4253
- if ((S == null ? void 0 : S.kind) === "sticker" && s.push(vs(S)), s.forEach((i) => {
4254
- const r = i.id === "preview", n = !r && i.id === T, u = document.createElement("div");
4255
- if (u.className = `nf-sticker nf-${i.type}`, u.dataset.id = i.id, n && (u.dataset.selected = "true"), r && (u.dataset.preview = "true"), i.type === "arrow" ? ks(u, i, t, n, o) : (Ct(u, i, t), n && ["nw", "ne", "sw", "se"].forEach((d) => qe(u, d))), !r && i.number) {
4256
- const d = document.createElement("span");
4257
- d.className = "nf-badge", d.textContent = String(i.number), u.appendChild(d);
4213
+ const s = A.list().slice();
4214
+ if ((j == null ? void 0 : j.kind) === "sticker" && s.push(hs(j)), s.forEach((i) => {
4215
+ const r = i.id === "preview", l = !r && i.id === M, u = document.createElement("div");
4216
+ if (u.className = `nf-sticker nf-${i.type}`, u.dataset.id = i.id, l && (u.dataset.selected = "true"), r && (u.dataset.preview = "true"), i.type === "arrow" ? fs(u, i, t, l, o) : (At(u, i, t), l && ["nw", "ne", "sw", "se"].forEach((c) => Ge(u, c))), !r && i.number) {
4217
+ const c = document.createElement("span");
4218
+ c.className = "nf-badge", c.textContent = String(i.number), u.appendChild(c);
4258
4219
  }
4259
- l.shot.appendChild(u);
4260
- }), l.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((i) => i.remove()), V) {
4220
+ n.shot.appendChild(u);
4221
+ }), n.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((i) => i.remove()), K) {
4261
4222
  const i = document.createElement("video");
4262
- i.className = "nf-recording-preview", i.controls = !0, i.src = URL.createObjectURL(V), i.style.position = "absolute", i.style.right = "8px", i.style.bottom = "8px", i.style.width = "160px", l.canvas.appendChild(i);
4223
+ i.className = "nf-recording-preview", i.controls = !0, i.src = URL.createObjectURL(K), i.style.position = "absolute", i.style.right = "8px", i.style.bottom = "8px", i.style.width = "160px", n.canvas.appendChild(i);
4263
4224
  }
4264
- Ce();
4225
+ ze();
4265
4226
  }
4266
- function ks(e, t, a, o, s = Xe(400)) {
4267
- const i = ce(), r = i.clientWidth, n = i.clientHeight, u = (t.x - a.x) / a.w * r, d = (t.y - a.y) / a.h * n, p = ((t.x2 ?? t.x + t.w) - a.x) / a.w * r, y = ((t.y2 ?? t.y) - a.y) / a.h * n, v = Math.max(18, s.arrowHead + s.stroke * 2), b = Math.min(u, p) - v, C = Math.min(d, y) - v, E = Math.max(2, Math.abs(p - u)) + v * 2, M = Math.max(2, Math.abs(y - d)) + v * 2, P = u - b, $ = d - C, X = p - b, Q = y - C, N = Kt(P, $, X, Q, s), ee = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4268
- e.style.left = `${b}px`, e.style.top = `${C}px`, e.style.width = `${E}px`, e.style.height = `${M}px`, ee.setAttribute("class", "nf-arrow-svg"), ee.setAttribute("viewBox", `0 0 ${E} ${M}`), ee.setAttribute("width", String(E)), ee.setAttribute("height", String(M)), ee.innerHTML = `
4269
- <line class="nf-arrow-hit" x1="${P}" y1="${$}" x2="${X}" y2="${Q}" />
4270
- <line class="nf-arrow-shaft" x1="${P}" y1="${$}" x2="${N.shaftEnd.x}" y2="${N.shaftEnd.y}" />
4271
- <polygon class="nf-arrow-head" points="${N.tipX},${N.tipY} ${N.left.x},${N.left.y} ${N.right.x},${N.right.y}" />
4272
- `, e.appendChild(ee), o && (qe(e, "start", { left: P - 5, top: $ - 5 }), qe(e, "end", { left: X - 5, top: Q - 5 }));
4227
+ function fs(e, t, a, o, s = Nt(400)) {
4228
+ const i = pe(), r = i.clientWidth, l = i.clientHeight, u = (t.x - a.x) / a.w * r, c = (t.y - a.y) / a.h * l, g = ((t.x2 ?? t.x + t.w) - a.x) / a.w * r, v = ((t.y2 ?? t.y) - a.y) / a.h * l, k = Math.max(18, s.arrowHead + s.stroke * 2), w = Math.min(u, g) - k, b = Math.min(c, v) - k, z = Math.max(2, Math.abs(g - u)) + k * 2, R = Math.max(2, Math.abs(v - c)) + k * 2, T = u - w, $ = c - b, P = g - w, m = v - b, C = Ui(T, $, P, m, s), X = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4229
+ e.style.left = `${w}px`, e.style.top = `${b}px`, e.style.width = `${z}px`, e.style.height = `${R}px`, X.setAttribute("class", "nf-arrow-svg"), X.setAttribute("viewBox", `0 0 ${z} ${R}`), X.setAttribute("width", String(z)), X.setAttribute("height", String(R)), X.innerHTML = `
4230
+ <line class="nf-arrow-hit" x1="${T}" y1="${$}" x2="${P}" y2="${m}" />
4231
+ <line class="nf-arrow-shaft" x1="${T}" y1="${$}" x2="${C.shaftEnd.x}" y2="${C.shaftEnd.y}" />
4232
+ <polygon class="nf-arrow-head" points="${C.tipX},${C.tipY} ${C.left.x},${C.left.y} ${C.right.x},${C.right.y}" />
4233
+ `, e.appendChild(X), o && (Ge(e, "start", { left: T - 5, top: $ - 5 }), Ge(e, "end", { left: P - 5, top: m - 5 }));
4273
4234
  }
4274
- function qe(e, t, a) {
4235
+ function Ge(e, t, a) {
4275
4236
  const o = document.createElement("span");
4276
4237
  o.className = "nf-handle", o.dataset.dir = t, a && (o.style.left = `${a.left}px`, o.style.top = `${a.top}px`), e.appendChild(o);
4277
4238
  }
4278
- function Ct(e, t, a) {
4239
+ function At(e, t, a) {
4279
4240
  e.style.left = `${(t.x - a.x) / a.w * 100}%`, e.style.top = `${(t.y - a.y) / a.h * 100}%`, e.style.width = `${t.w / a.w * 100}%`, e.style.height = `${t.h / a.h * 100}%`;
4280
4241
  }
4281
- function sa() {
4242
+ function oa() {
4282
4243
  try {
4283
- return String(localStorage.getItem(Wt) || "").trim();
4244
+ return String(localStorage.getItem(qt) || "").trim();
4284
4245
  } catch {
4285
4246
  return "";
4286
4247
  }
4287
4248
  }
4288
- function bs(e) {
4249
+ function ys(e) {
4289
4250
  const t = String(e || "").trim();
4290
- if (!(!t || t === _e()))
4251
+ if (!(!t || t === qe()))
4291
4252
  try {
4292
- localStorage.setItem(Wt, t);
4253
+ localStorage.setItem(qt, t);
4293
4254
  } catch {
4294
4255
  }
4295
4256
  }
4296
- function ra() {
4257
+ function ia() {
4297
4258
  try {
4298
- const e = localStorage.getItem(Jt);
4259
+ const e = localStorage.getItem(Wt);
4299
4260
  if (!e)
4300
4261
  return { diagnostics: !1, logs: !1 };
4301
4262
  const t = JSON.parse(e);
@@ -4307,81 +4268,81 @@ function ra() {
4307
4268
  return { diagnostics: !1, logs: !1 };
4308
4269
  }
4309
4270
  }
4310
- function zt(e = {}) {
4271
+ function Ct(e = {}) {
4311
4272
  const t = {
4312
- ...ra(),
4273
+ ...ia(),
4313
4274
  ...e
4314
4275
  };
4315
4276
  try {
4316
- localStorage.setItem(Jt, JSON.stringify({
4277
+ localStorage.setItem(Wt, JSON.stringify({
4317
4278
  diagnostics: !!t.diagnostics,
4318
4279
  logs: !!t.logs
4319
4280
  }));
4320
4281
  } catch {
4321
4282
  }
4322
4283
  }
4323
- function na() {
4324
- return !!(String(I.userId || "").trim() || String(I.email || "").trim() || String(I.displayName || "").trim());
4284
+ function sa() {
4285
+ return !!(String(N.userId || "").trim() || String(N.email || "").trim() || String(N.displayName || "").trim());
4325
4286
  }
4326
- function la() {
4287
+ function ra() {
4327
4288
  return String(
4328
- I.displayName || I.email || I.userId || ""
4289
+ N.displayName || N.email || N.userId || ""
4329
4290
  ).trim();
4330
4291
  }
4331
- function _e() {
4332
- return m("form.authorPlaceholder");
4292
+ function qe() {
4293
+ return p("form.authorPlaceholder");
4333
4294
  }
4334
- function ws() {
4295
+ function vs() {
4335
4296
  var t;
4336
- if (na())
4337
- return la() || _e();
4338
- const e = String(((t = l.author) == null ? void 0 : t.value) || "").trim();
4339
- return e ? (bs(e), e) : _e();
4297
+ if (sa())
4298
+ return ra() || qe();
4299
+ const e = String(((t = n.author) == null ? void 0 : t.value) || "").trim();
4300
+ return e ? (ys(e), e) : qe();
4340
4301
  }
4341
- function ua() {
4342
- if (!l.author)
4302
+ function na() {
4303
+ if (!n.author)
4343
4304
  return;
4344
- const e = na();
4345
- if (l.author.hidden = e, e) {
4346
- l.author.value = "";
4305
+ const e = sa();
4306
+ if (n.author.hidden = e, e) {
4307
+ n.author.value = "";
4347
4308
  return;
4348
4309
  }
4349
- l.author.value = sa();
4310
+ n.author.value = oa();
4350
4311
  }
4351
- function da(e, t = _t) {
4312
+ function la(e, t = Gt) {
4352
4313
  const a = Number(e);
4353
- return Number.isFinite(a) ? Math.min(Yi, Math.max(0, Math.floor(a))) : t;
4314
+ return Number.isFinite(a) ? Math.min(Zi, Math.max(0, Math.floor(a))) : t;
4354
4315
  }
4355
- function ca(e) {
4356
- e.key !== "Escape" || !l.dialog || l.dialog.hidden || Re && !Pe || re();
4316
+ function ua(e) {
4317
+ e.key !== "Escape" || !n.dialog || n.dialog.hidden || Pe && !xe || re();
4357
4318
  }
4358
- function pa(e = {}) {
4359
- ki(e);
4319
+ function ca(e = {}) {
4320
+ yi(e);
4360
4321
  const t = Object.prototype.hasOwnProperty.call(e, "kinds");
4361
- c = {
4362
- ...c,
4363
- endpoint: String(e.endpoint || c.endpoint || "").replace(/\/$/, ""),
4364
- projectKey: e.projectKey == null ? c.projectKey : String(e.projectKey),
4365
- version: e.version == null ? c.version : String(e.version),
4366
- name: e.name == null ? c.name : String(e.name || ""),
4367
- targets: e.targets === void 0 ? c.targets : e.targets,
4368
- hideLauncher: e.hideLauncher == null ? c.hideLauncher : !!e.hideLauncher,
4369
- theme: Yt(e.theme ?? c.theme),
4370
- video: e.video == null ? c.video : !!e.video,
4371
- consoleLogLimit: e.consoleLogLimit == null ? c.consoleLogLimit : da(e.consoleLogLimit, c.consoleLogLimit),
4372
- kinds: t ? _i(e.kinds) : c.kinds,
4373
- kindsCustom: t ? !0 : c.kindsCustom,
4374
- capture: e.capture === void 0 ? c.capture : e.capture,
4375
- onBeforeCapture: e.onBeforeCapture === void 0 ? c.onBeforeCapture : e.onBeforeCapture,
4376
- onOpen: e.onOpen === void 0 ? c.onOpen : e.onOpen,
4377
- onClose: e.onClose === void 0 ? c.onClose : e.onClose,
4378
- displayLink: e.displayLink == null ? c.displayLink : !!e.displayLink,
4379
- locale: e.locale === void 0 ? c.locale : e.locale == null || e.locale === "" ? null : String(e.locale),
4380
- translations: e.translations === void 0 ? c.translations : e.translations && typeof e.translations == "object" ? e.translations : null
4322
+ d = {
4323
+ ...d,
4324
+ endpoint: String(e.endpoint || d.endpoint || "").replace(/\/$/, ""),
4325
+ projectKey: e.projectKey == null ? d.projectKey : String(e.projectKey),
4326
+ version: e.version == null ? d.version : String(e.version),
4327
+ name: e.name == null ? d.name : String(e.name || ""),
4328
+ targets: e.targets === void 0 ? d.targets : e.targets,
4329
+ hideLauncher: e.hideLauncher == null ? d.hideLauncher : !!e.hideLauncher,
4330
+ theme: Zt(e.theme ?? d.theme),
4331
+ video: e.video == null ? d.video : !!e.video,
4332
+ consoleLogLimit: e.consoleLogLimit == null ? d.consoleLogLimit : la(e.consoleLogLimit, d.consoleLogLimit),
4333
+ kinds: t ? Gi(e.kinds) : d.kinds,
4334
+ kindsCustom: t ? !0 : d.kindsCustom,
4335
+ capture: e.capture === void 0 ? d.capture : e.capture,
4336
+ onBeforeCapture: e.onBeforeCapture === void 0 ? d.onBeforeCapture : e.onBeforeCapture,
4337
+ onOpen: e.onOpen === void 0 ? d.onOpen : e.onOpen,
4338
+ onClose: e.onClose === void 0 ? d.onClose : e.onClose,
4339
+ displayLink: e.displayLink == null ? d.displayLink : !!e.displayLink,
4340
+ locale: e.locale === void 0 ? d.locale : e.locale == null || e.locale === "" ? null : String(e.locale),
4341
+ translations: e.translations === void 0 ? d.translations : e.translations && typeof e.translations == "object" ? e.translations : null
4381
4342
  };
4382
4343
  }
4383
- function ga(e) {
4384
- const t = c[e];
4344
+ function da(e) {
4345
+ const t = d[e];
4385
4346
  if (typeof t == "function")
4386
4347
  try {
4387
4348
  t();
@@ -4389,74 +4350,74 @@ function ga(e) {
4389
4350
  console.warn(`Notefully.${e} failed:`, a);
4390
4351
  }
4391
4352
  }
4392
- function Ss() {
4393
- return ue;
4353
+ function ks() {
4354
+ return ce;
4394
4355
  }
4395
- function As() {
4396
- return fe();
4356
+ function bs() {
4357
+ return ye();
4397
4358
  }
4398
- function Cs(e, t) {
4399
- return c.locale = e == null || e === "" ? null : String(e), t !== void 0 && (c.translations = t && typeof t == "object" ? t : null), g ? se() : Xt(), Ue;
4359
+ function ws(e, t) {
4360
+ return d.locale = e == null || e === "" ? null : String(e), t !== void 0 && (d.translations = t && typeof t == "object" ? t : null), f ? se() : Jt(), Te;
4400
4361
  }
4401
- function at(e = {}) {
4402
- return pa(e), g && se(), Ue;
4362
+ function et(e = {}) {
4363
+ return ca(e), f && se(), Te;
4403
4364
  }
4404
- function zs(e = {}) {
4405
- return pa(e), Qe(), se(), Ue;
4365
+ function Ss(e = {}) {
4366
+ return ca(e), Ye(), se(), Te;
4406
4367
  }
4407
- function js(e) {
4408
- return at({ theme: e });
4368
+ function As(e) {
4369
+ return et({ theme: e });
4409
4370
  }
4410
- function Es(e) {
4371
+ function Cs(e) {
4411
4372
  const t = !!e;
4412
- return !t && g && l.dialog && !l.dialog.hidden && re(), at({ hideLauncher: !t });
4373
+ return !t && f && n.dialog && !n.dialog.hidden && re(), et({ hideLauncher: !t });
4413
4374
  }
4414
- function Rs() {
4415
- const e = la() || sa() || void 0, t = yi({
4416
- ...I,
4417
- displayName: I.displayName || e
4375
+ function zs() {
4376
+ const e = ra() || oa() || void 0, t = hi({
4377
+ ...N,
4378
+ displayName: N.displayName || e
4418
4379
  });
4419
- D = Bi(t), O = Ni(
4420
- qt.snapshot().slice(-da(c.consoleLogLimit))
4380
+ V = Vi(t), I = $i(
4381
+ Ht.snapshot().slice(-la(d.consoleLogLimit))
4421
4382
  );
4422
- const a = ra();
4423
- a.diagnostics && be(D, !0), a.logs && O.length && be(O, !0), H = !1;
4383
+ const a = ia();
4384
+ a.diagnostics && we(V, !0), a.logs && I.length && we(I, !0), _ = !1;
4424
4385
  }
4425
- function ze(e) {
4426
- H = !!e, l.privacyPanel && (l.privacyPanel.hidden = !H), l.privacyChange && (l.privacyChange.setAttribute("aria-expanded", H ? "true" : "false"), l.privacyChange.dataset.active = String(H)), H && it();
4386
+ function Ee(e) {
4387
+ _ = !!e, n.privacyPanel && (n.privacyPanel.hidden = !_), n.privacyChange && (n.privacyChange.setAttribute("aria-expanded", _ ? "true" : "false"), n.privacyChange.dataset.active = String(_)), _ && at();
4427
4388
  }
4428
- function ot() {
4429
- if (!l.privacy || !l.privacyText || !l.privacyChange)
4389
+ function tt() {
4390
+ if (!n.privacy || !n.privacyText || !n.privacyChange)
4430
4391
  return;
4431
- const e = Hi({
4432
- diagnostics: D,
4433
- logs: O
4392
+ const e = Ni({
4393
+ diagnostics: V,
4394
+ logs: I
4434
4395
  });
4435
- l.privacyText.textContent = e, l.privacyText.hidden = !e;
4436
- const t = D.length === 0 && O.length === 0;
4437
- l.privacySummary && (l.privacySummary.hidden = t), l.privacy.hidden = t, l.privacyChange.hidden = !1;
4396
+ n.privacyText.textContent = e, n.privacyText.hidden = !e;
4397
+ const t = V.length === 0 && I.length === 0;
4398
+ n.privacySummary && (n.privacySummary.hidden = t), n.privacy.hidden = t, n.privacyChange.hidden = !1;
4438
4399
  }
4439
- function ma(e, t, a) {
4400
+ function pa(e, t, a) {
4440
4401
  return `<label class="nf-privacy-toggle">
4441
- <span class="nf-privacy-toggle-label">${z(m("privacy.redact"))}</span>
4442
- <input type="checkbox" ${e ? "checked" : ""} ${t ? 'data-indeterminate="true"' : ""} aria-label="${z(a)}">
4402
+ <span class="nf-privacy-toggle-label">${x(p("privacy.redact"))}</span>
4403
+ <input type="checkbox" ${e ? "checked" : ""} ${t ? 'data-indeterminate="true"' : ""} aria-label="${x(a)}">
4443
4404
  </label>`;
4444
4405
  }
4445
- function jt(e, t, a, o, s, i = null) {
4446
- const r = ma(s, !1, `${m("privacy.redact")} ${a}`), n = typeof o == "string" ? o : String(o || "");
4406
+ function zt(e, t, a, o, s, i = null) {
4407
+ const r = pa(s, !1, `${p("privacy.redact")} ${a}`), l = typeof o == "string" ? o : String(o || "");
4447
4408
  if (s) {
4448
- const d = n ? `${a}: ${n}` : a;
4449
- return `<div class="nf-privacy-row" data-kind="${z(e)}" data-id="${z(t)}" data-redacted="true">
4409
+ const c = l ? `${a}: ${l}` : a;
4410
+ return `<div class="nf-privacy-row" data-kind="${x(e)}" data-id="${x(t)}" data-redacted="true">
4450
4411
  <div class="nf-privacy-row-text">
4451
- <div class="nf-privacy-row-summary" title="${z(d)}">${z(d)}</div>
4412
+ <div class="nf-privacy-row-summary" title="${x(c)}">${x(c)}</div>
4452
4413
  </div>
4453
4414
  ${r}
4454
4415
  </div>`;
4455
4416
  }
4456
- const u = i ?? z(n);
4457
- return `<div class="nf-privacy-row" data-kind="${z(e)}" data-id="${z(t)}">
4417
+ const u = i ?? x(l);
4418
+ return `<div class="nf-privacy-row" data-kind="${x(e)}" data-id="${x(t)}">
4458
4419
  <div class="nf-privacy-row-text">
4459
- <div class="nf-privacy-row-title">${z(a)}</div>
4420
+ <div class="nf-privacy-row-title">${x(a)}</div>
4460
4421
  <div class="nf-privacy-row-detail">${u}</div>
4461
4422
  </div>
4462
4423
  ${r}
@@ -4465,43 +4426,43 @@ function jt(e, t, a, o, s, i = null) {
4465
4426
  function Et(e, t, a, o) {
4466
4427
  if (!a.length)
4467
4428
  return "";
4468
- const s = Ki(a), i = s.checked && !s.indeterminate;
4469
- return `<section class="nf-privacy-section" data-section="${z(e)}"${i ? ' data-redacted="true"' : ""}>
4429
+ const s = Bi(a), i = s.checked && !s.indeterminate;
4430
+ return `<section class="nf-privacy-section" data-section="${x(e)}"${i ? ' data-redacted="true"' : ""}>
4470
4431
  <div class="nf-privacy-section-head">
4471
- <h3 class="nf-privacy-section-title">${z(t)}</h3>
4472
- ${ma(s.checked, s.indeterminate, `${m("privacy.redact")} ${t}`)}
4432
+ <h3 class="nf-privacy-section-title">${x(t)}</h3>
4433
+ ${pa(s.checked, s.indeterminate, `${p("privacy.redact")} ${t}`)}
4473
4434
  </div>
4474
4435
  <div class="nf-privacy-rows"${i ? " hidden" : ""}>${o}</div>
4475
4436
  </section>`;
4476
4437
  }
4477
- function it() {
4478
- if (!l.privacyScroll)
4438
+ function at() {
4439
+ if (!n.privacyScroll)
4479
4440
  return;
4480
- const e = D.map((a) => jt(
4441
+ const e = V.map((a) => zt(
4481
4442
  "diagnostic",
4482
4443
  a.key,
4483
4444
  a.label,
4484
- Gi(a.value),
4445
+ Ki(a.value),
4485
4446
  a.redacted
4486
- )).join(""), t = O.map((a) => {
4487
- const o = Ai(a);
4488
- return jt(
4447
+ )).join(""), t = I.map((a) => {
4448
+ const o = wi(a);
4449
+ return zt(
4489
4450
  "log",
4490
4451
  a.id,
4491
4452
  a.level,
4492
4453
  o,
4493
4454
  a.redacted,
4494
- a.redacted ? null : Ci(a)
4455
+ a.redacted ? null : Si(a)
4495
4456
  );
4496
4457
  }).join("");
4497
- l.privacyScroll.innerHTML = [
4498
- Et("diagnostics", m("privacy.section.diagnostics"), D, e),
4499
- O.length ? Et("logs", m("privacy.section.logs"), O, t) : ""
4500
- ].join(""), l.privacyScroll.querySelectorAll('input[data-indeterminate="true"]').forEach((a) => {
4458
+ n.privacyScroll.innerHTML = [
4459
+ Et("diagnostics", p("privacy.section.diagnostics"), V, e),
4460
+ I.length ? Et("logs", p("privacy.section.logs"), I, t) : ""
4461
+ ].join(""), n.privacyScroll.querySelectorAll('input[data-indeterminate="true"]').forEach((a) => {
4501
4462
  a.indeterminate = !0, a.removeAttribute("data-indeterminate");
4502
- }), ot();
4463
+ }), tt();
4503
4464
  }
4504
- function Ps(e) {
4465
+ function Es(e) {
4505
4466
  const t = e.target;
4506
4467
  if (!(t instanceof HTMLInputElement) || t.type !== "checkbox")
4507
4468
  return;
@@ -4509,167 +4470,205 @@ function Ps(e) {
4509
4470
  if (o) {
4510
4471
  const i = o.dataset.kind, r = o.dataset.id;
4511
4472
  if (i === "diagnostic") {
4512
- const n = D.find((u) => u.key === r);
4513
- n && (n.redacted = s);
4473
+ const l = V.find((u) => u.key === r);
4474
+ l && (l.redacted = s);
4514
4475
  } else if (i === "log") {
4515
- const n = O.find((u) => u.id === r);
4516
- n && (n.redacted = s);
4476
+ const l = I.find((u) => u.id === r);
4477
+ l && (l.redacted = s);
4517
4478
  }
4518
4479
  } else if (a) {
4519
4480
  const i = a.dataset.section;
4520
- i === "diagnostics" ? (be(D, s), zt({ diagnostics: s })) : i === "logs" && (be(O, s), zt({ logs: s }));
4481
+ i === "diagnostics" ? (we(V, s), Ct({ diagnostics: s })) : i === "logs" && (we(I, s), Ct({ logs: s }));
4521
4482
  } else
4522
4483
  return;
4523
- it();
4484
+ at();
4524
4485
  }
4525
- async function ha() {
4526
- Qe(), ue || (ue = !0, ga("onOpen")), fa(), se(), l.launcher.hidden = !0, k = Ye(), B = { w: 0, h: 0 }, V = null, F = "", ie = "", T = null, S = null, w = null, _ = is(), et(_), de(null), xe(!1), l.text.value = "", ua(), A(""), Rs();
4486
+ async function ga() {
4487
+ Ye(), ce || (ce = !0, da("onOpen")), ma(), se(), n.launcher.hidden = !0, A = Je(), G = { w: 0, h: 0 }, K = null, H = "", ie = "", M = null, j = null, E = null, J = ts(), Xe(J), de(null), Ue(!1), n.text.value = "", na(), S(""), zs();
4527
4488
  try {
4528
- ia(await $t(oa())), A("");
4489
+ aa(await Vt(ta())), S("");
4529
4490
  } catch (t) {
4530
- F = "", A((t == null ? void 0 : t.message) || m("status.screenshotFailed"));
4491
+ H = "", S((t == null ? void 0 : t.message) || p("status.screenshotFailed"));
4531
4492
  }
4532
- pe(), ze(!1), ot(), l.dialog.hidden = !1, Y(), l.text.focus();
4493
+ ge(), Ee(!1), tt(), n.dialog.hidden = !1, ee(), n.text.focus();
4533
4494
  }
4534
4495
  function re() {
4535
- if (!g)
4496
+ if (!f)
4536
4497
  return;
4537
- const e = ue;
4538
- J == null || J.stop(), xe(!1), ta(), S = null, w = null, tt(!1), fa(), ze(!1), l.dialog.hidden = !0, l.stop.hidden = !0, we(), e && (ue = !1, ga("onClose"));
4498
+ const e = ce;
4499
+ Q == null || Q.stop(), Ue(!1), Qt(), j = null, E = null, Qe(!1), ma(), Ee(!1), n.dialog.hidden = !0, n.stop.hidden = !0, Se(), e && (ce = !1, da("onClose"));
4539
4500
  }
4540
- function Ls(e = "") {
4541
- const t = l.dialog, a = l.panel, o = l.panelBody, s = l.successMsg, i = l.successLink, r = String(e || "").trim(), n = !!(c.displayLink && r);
4501
+ function js(e = "") {
4502
+ const t = n.dialog, a = n.panel, o = n.panelBody, s = n.successMsg, i = n.successLink, r = String(e || "").trim(), l = !!(d.displayLink && r);
4542
4503
  if (!t || !a || !o || !s)
4543
4504
  return Promise.resolve(!1);
4544
- Re = !0, Pe = n, A("");
4545
- const u = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, d = a.getBoundingClientRect();
4546
- if (o.hidden = !0, s.hidden = !1, t.classList.add("nf-success"), t.classList.toggle("nf-success-sticky", n), t.style.opacity = "1", i && (n ? (i.hidden = !1, i.href = r) : (i.hidden = !0, i.removeAttribute("href"))), n) {
4505
+ Pe = !0, xe = l, S("");
4506
+ const u = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, c = a.getBoundingClientRect();
4507
+ if (o.hidden = !0, s.hidden = !1, t.classList.add("nf-success"), t.classList.toggle("nf-success-sticky", l), t.style.opacity = "1", i && (l ? (i.hidden = !1, i.href = r) : (i.hidden = !0, i.removeAttribute("href"))), l) {
4547
4508
  if (u)
4548
4509
  return Promise.resolve(!0);
4549
- const b = a.getBoundingClientRect(), C = b.width > 0 ? d.width / b.width : 1, E = b.height > 0 ? d.height / b.height : 1;
4550
- return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${C}, ${E})`, a.getBoundingClientRect(), new Promise((M) => {
4551
- let P = !1;
4510
+ const w = a.getBoundingClientRect(), b = w.width > 0 ? c.width / w.width : 1, z = w.height > 0 ? c.height / w.height : 1;
4511
+ return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${b}, ${z})`, a.getBoundingClientRect(), new Promise((R) => {
4512
+ let T = !1;
4552
4513
  const $ = () => {
4553
- P || (P = !0, a.removeEventListener("transitionend", X), M(!0));
4554
- }, X = (Q) => {
4555
- Q.target !== a || Q.propertyName !== "transform" || $();
4514
+ T || (T = !0, a.removeEventListener("transitionend", P), R(!0));
4515
+ }, P = (m) => {
4516
+ m.target !== a || m.propertyName !== "transform" || $();
4556
4517
  };
4557
- a.addEventListener("transitionend", X), requestAnimationFrame(() => {
4518
+ a.addEventListener("transitionend", P), requestAnimationFrame(() => {
4558
4519
  a.style.transition = "transform 0.48s cubic-bezier(0.22, 1, 0.36, 1)", a.style.transform = "scale(1)";
4559
4520
  }), window.setTimeout($, 700);
4560
4521
  });
4561
4522
  }
4562
4523
  if (u)
4563
- return new Promise((b) => {
4564
- window.setTimeout(() => b(!1), 1e3);
4524
+ return new Promise((w) => {
4525
+ window.setTimeout(() => w(!1), 1e3);
4565
4526
  });
4566
- const p = a.getBoundingClientRect(), y = p.width > 0 ? d.width / p.width : 1, v = p.height > 0 ? d.height / p.height : 1;
4567
- return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${y}, ${v})`, a.getBoundingClientRect(), new Promise((b) => {
4568
- let C = !1;
4569
- const E = () => {
4570
- C || (C = !0, a.removeEventListener("transitionend", M), window.setTimeout(() => {
4571
- t.style.transition = "opacity 0.28s ease", t.style.opacity = "0", window.setTimeout(() => b(!1), 280);
4527
+ const g = a.getBoundingClientRect(), v = g.width > 0 ? c.width / g.width : 1, k = g.height > 0 ? c.height / g.height : 1;
4528
+ return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${v}, ${k})`, a.getBoundingClientRect(), new Promise((w) => {
4529
+ let b = !1;
4530
+ const z = () => {
4531
+ b || (b = !0, a.removeEventListener("transitionend", R), window.setTimeout(() => {
4532
+ t.style.transition = "opacity 0.28s ease", t.style.opacity = "0", window.setTimeout(() => w(!1), 280);
4572
4533
  }, 1e3));
4573
- }, M = (P) => {
4574
- P.target !== a || P.propertyName !== "transform" || E();
4534
+ }, R = (T) => {
4535
+ T.target !== a || T.propertyName !== "transform" || z();
4575
4536
  };
4576
- a.addEventListener("transitionend", M), requestAnimationFrame(() => {
4537
+ a.addEventListener("transitionend", R), requestAnimationFrame(() => {
4577
4538
  a.style.transition = "transform 0.48s cubic-bezier(0.22, 1, 0.36, 1)", a.style.transform = "scale(1)";
4578
- }), window.setTimeout(E, 700);
4539
+ }), window.setTimeout(z, 700);
4579
4540
  });
4580
4541
  }
4581
- function fa() {
4582
- Re = !1, Pe = !1, l.dialog && (l.dialog.classList.remove("nf-success", "nf-success-sticky"), l.dialog.style.opacity = "", l.dialog.style.transition = "", l.panel && (l.panel.style.transform = "", l.panel.style.transition = "", l.panel.style.transformOrigin = ""), l.panelBody && (l.panelBody.hidden = !1), l.successMsg && (l.successMsg.hidden = !0), l.successLink && (l.successLink.hidden = !0, l.successLink.removeAttribute("href")));
4542
+ function ma() {
4543
+ Pe = !1, xe = !1, n.dialog && (n.dialog.classList.remove("nf-success", "nf-success-sticky"), n.dialog.style.opacity = "", n.dialog.style.transition = "", n.panel && (n.panel.style.transform = "", n.panel.style.transition = "", n.panel.style.transformOrigin = ""), n.panelBody && (n.panelBody.hidden = !1), n.successMsg && (n.successMsg.hidden = !0), n.successLink && (n.successLink.hidden = !0, n.successLink.removeAttribute("href")));
4583
4544
  }
4584
- function xs(e = {}) {
4585
- I = { ...I, ...vi(e) }, ua();
4545
+ function Rs(e = {}) {
4546
+ N = { ...N, ...fi(e) }, na();
4586
4547
  }
4587
- async function ya() {
4588
- if (Qe(), Ie)
4548
+ async function ha() {
4549
+ var t, a;
4550
+ if (Ye(), Ve)
4589
4551
  return null;
4590
- const e = l.text.value.trim();
4591
- if (!e && !Z() && !V)
4592
- return A(m("status.emptyReport")), null;
4593
- if (!c.endpoint || !c.projectKey)
4594
- return A(m("status.missingConfig")), null;
4595
- Ie = !0, Rt(!0), A(m("status.submitting"), !0);
4552
+ const e = n.text.value.trim();
4553
+ if (!e && !B() && !K)
4554
+ return S(p("status.emptyReport")), null;
4555
+ if (!d.endpoint || !d.projectKey)
4556
+ return S(p("status.missingConfig")), null;
4557
+ Ve = !0, jt(!0), S(p("status.submitting"), !0);
4596
4558
  try {
4597
- const t = ws(), a = new FormData();
4598
- a.append("message", e), a.append("kind", _), a.append("version", c.version || "0.0.0"), a.append("author", t), c.name && a.append("name", c.name), a.append("context", JSON.stringify(qi({
4599
- author: t,
4600
- diagnostics: D,
4601
- logs: O
4602
- })));
4603
- const o = k.crop(), s = k.list(), i = k.isCropped() ? xi(s, o) : s;
4604
- if (a.append("annotations", JSON.stringify(i)), Array.isArray(c.targets) && a.append("targets", JSON.stringify(c.targets)), Z()) {
4605
- const d = k.isCropped() ? await Mi(F, o) : await Xi(F);
4606
- if (a.append("screenshot", d, "screenshot.png"), s.length) {
4607
- const p = await Ii(
4608
- F,
4609
- o,
4610
- s,
4611
- {
4612
- mark: St("--nf-mark", "#fdd341"),
4613
- markText: St("--nf-mark-text", "#2a2140")
4614
- }
4615
- );
4616
- a.append("screenshotBaked", p, "screenshot.baked.png");
4559
+ const o = vs(), s = A.crop(), i = A.list(), r = A.isCropped(), l = r ? Pi(i, s) : i, u = r ? { x: 0, y: 0, w: 1, h: 1 } : s, c = Hi({
4560
+ author: o,
4561
+ diagnostics: V,
4562
+ logs: I
4563
+ }), g = {
4564
+ width: typeof screen < "u" ? screen.width : null,
4565
+ height: typeof screen < "u" ? screen.height : null,
4566
+ dpr: window.devicePixelRatio || 1
4567
+ }, v = [];
4568
+ let k = 2048, w = null, b = null;
4569
+ B() && (b = await vt(H, {
4570
+ crop: r ? s : { x: 0, y: 0, w: 1, h: 1 },
4571
+ maxEdge: k
4572
+ }));
4573
+ for (let z = 1; z <= 3; z += 1) {
4574
+ const R = z === 3 || !b, T = R ? {
4575
+ ...b ? { width: b.width, height: b.height, mime: b.mime } : {},
4576
+ attempt: z,
4577
+ omitted: !0
4578
+ } : {
4579
+ width: b.width,
4580
+ height: b.height,
4581
+ mime: b.mime,
4582
+ attempt: z
4583
+ }, $ = {
4584
+ ...c,
4585
+ screen: g,
4586
+ screenshotMeta: T
4587
+ };
4588
+ R && B() && ($.screenshotError = {
4589
+ message: (w == null ? void 0 : w.message) || "Screenshot omitted after failed uploads",
4590
+ attempts: [...v]
4591
+ });
4592
+ const P = new FormData();
4593
+ P.append("message", e), P.append("kind", J), P.append("version", d.version || "0.0.0"), P.append("author", o), d.name && P.append("name", d.name), P.append("context", JSON.stringify($)), P.append("annotations", JSON.stringify(l)), P.append("crop", JSON.stringify(u)), Array.isArray(d.targets) && P.append("targets", JSON.stringify(d.targets)), !R && b && P.append("screenshot", b.blob, `screenshot.${b.ext}`), K && P.append("recording", K, "recording.webm");
4594
+ try {
4595
+ const m = await fetch(`${d.endpoint}/v1/reports`, {
4596
+ method: "POST",
4597
+ headers: {
4598
+ "X-Notefully-Key": d.projectKey
4599
+ },
4600
+ body: P
4601
+ });
4602
+ let C = null;
4603
+ try {
4604
+ C = await m.json();
4605
+ } catch {
4606
+ C = null;
4607
+ }
4608
+ if (!m.ok) {
4609
+ const ne = new Error((C == null ? void 0 : C.error) || `${p("status.submitFailed")} (${m.status})`);
4610
+ throw ne.status = m.status, ne.code = C == null ? void 0 : C.code, ne.json = C, ne;
4611
+ }
4612
+ return R && B() && S(p("status.submitWithoutImage"), !0), await js((C == null ? void 0 : C.trackerUrl) || "") || re(), C;
4613
+ } catch (m) {
4614
+ if (w = m, v.push({
4615
+ attempt: z,
4616
+ maxEdge: R ? null : k,
4617
+ status: (m == null ? void 0 : m.status) || null,
4618
+ code: (m == null ? void 0 : m.code) || null,
4619
+ message: String((m == null ? void 0 : m.message) || m)
4620
+ }), R || !b)
4621
+ throw S(((t = m == null ? void 0 : m.json) == null ? void 0 : t.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
4622
+ if (!Oi(m, (m == null ? void 0 : m.json) || null))
4623
+ throw S(((a = m == null ? void 0 : m.json) == null ? void 0 : a.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
4624
+ if (z === 1) {
4625
+ S(p("status.submitTooLarge"), !0), k = Fi(k), b = await vt(H, {
4626
+ crop: r ? s : { x: 0, y: 0, w: 1, h: 1 },
4627
+ maxEdge: k
4628
+ });
4629
+ continue;
4630
+ }
4631
+ S(p("status.submitTooLarge"), !0), b = null;
4617
4632
  }
4618
4633
  }
4619
- V && a.append("recording", V, "recording.webm");
4620
- const r = await fetch(`${c.endpoint}/v1/reports`, {
4621
- method: "POST",
4622
- headers: {
4623
- "X-Notefully-Key": c.projectKey
4624
- },
4625
- body: a
4626
- });
4627
- let n = null;
4628
- try {
4629
- n = await r.json();
4630
- } catch {
4631
- n = null;
4632
- }
4633
- if (!r.ok)
4634
- throw A((n == null ? void 0 : n.error) || m("status.submitFailed")), new Error((n == null ? void 0 : n.error) || `${m("status.submitFailed")} (${r.status})`);
4635
- return await Ls((n == null ? void 0 : n.trackerUrl) || "") || re(), n;
4634
+ throw w || new Error(p("status.submitFailed"));
4636
4635
  } finally {
4637
- Ie = !1, Rt(!1);
4636
+ Ve = !1, jt(!1);
4638
4637
  }
4639
4638
  }
4640
- function Rt(e) {
4641
- l.submit && (l.submit.disabled = !!e, l.submit.setAttribute("aria-busy", e ? "true" : "false"));
4639
+ function jt(e) {
4640
+ n.submit && (n.submit.disabled = !!e, n.submit.setAttribute("aria-busy", e ? "true" : "false"));
4642
4641
  }
4643
- function Us() {
4644
- re(), document.removeEventListener("keydown", ca), g == null || g.remove(), g = null, l = {};
4642
+ function Ps() {
4643
+ re(), document.removeEventListener("keydown", ua), f == null || f.remove(), f = null, n = {};
4645
4644
  }
4646
- const Ue = {
4647
- init: zs,
4648
- configure: at,
4649
- setTheme: js,
4650
- setVisible: Es,
4651
- open: ha,
4645
+ const Te = {
4646
+ init: Ss,
4647
+ configure: et,
4648
+ setTheme: As,
4649
+ setVisible: Cs,
4650
+ open: ga,
4652
4651
  close: re,
4653
- isOpen: Ss,
4654
- getLocale: As,
4655
- setLocale: Cs,
4656
- identify: xs,
4657
- submit: ya,
4658
- destroy: Us
4652
+ isOpen: ks,
4653
+ getLocale: bs,
4654
+ setLocale: ws,
4655
+ identify: Rs,
4656
+ submit: ha,
4657
+ destroy: Ps
4659
4658
  };
4660
- typeof window < "u" && (window.Notefully = Ue);
4659
+ typeof window < "u" && (window.Notefully = Te);
4661
4660
  export {
4662
4661
  re as close,
4663
- at as configure,
4664
- Ue as default,
4665
- Us as destroy,
4666
- As as getLocaleTag,
4667
- xs as identify,
4668
- zs as init,
4669
- Ss as isOpen,
4670
- ha as open,
4671
- Cs as setLocale,
4672
- js as setTheme,
4673
- Es as setVisible,
4674
- ya as submit
4662
+ et as configure,
4663
+ Te as default,
4664
+ Ps as destroy,
4665
+ bs as getLocaleTag,
4666
+ Rs as identify,
4667
+ Ss as init,
4668
+ ks as isOpen,
4669
+ ga as open,
4670
+ ws as setLocale,
4671
+ As as setTheme,
4672
+ Cs as setVisible,
4673
+ ha as submit
4675
4674
  };