@makefully/notefully 0.2.4 → 0.2.6

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 ve = {
1
+ const wt = {
2
2
  "launcher.open": "Leave a note…",
3
3
  "tool.crop": "Crop",
4
4
  "tool.resetCrop": "Reset crop",
@@ -55,6 +55,8 @@ const ve = {
55
55
  "status.captureEmpty": "Screenshot capture produced an empty image.",
56
56
  "shot.alt": "Screenshot",
57
57
  "privacy.redact": "Redact",
58
+ "privacy.included": "Included",
59
+ "privacy.redacted": "Redacted",
58
60
  "privacy.section.diagnostics": "Diagnostics",
59
61
  "privacy.section.logs": "Logs",
60
62
  "privacy.disclosure.both": "Also sending logs and diagnostic information",
@@ -69,15 +71,15 @@ const ve = {
69
71
  "diag.timezone": "Timezone",
70
72
  "diag.viewport": "Viewport",
71
73
  "diag.user": "User"
72
- }, ke = {
73
- "en-US": ve
74
- }, De = {
74
+ }, St = {
75
+ "en-US": wt
76
+ }, Dt = {
75
77
  en: "en-US",
76
78
  no: "nb",
77
79
  tl: "fil",
78
80
  "zh-Hans": "zh-CN",
79
81
  "zh-Hant": "zh-TW"
80
- }, va = {
82
+ }, ba = {
81
83
  "es-MX": ["es-419", "es"],
82
84
  "es-AR": ["es-419", "es"],
83
85
  "es-CL": ["es-419", "es"],
@@ -97,71 +99,71 @@ const ve = {
97
99
  "es-DO": ["es-419", "es"],
98
100
  "es-PR": ["es-419", "es"],
99
101
  "es-CU": ["es-419", "es"]
100
- }, ka = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
101
- let ue = "en-US", Pt = {};
102
- function f(e, t) {
103
- !e || !t || typeof t != "object" || (ke[String(e)] = t);
102
+ }, wa = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
103
+ let dt = "en-US", Le = {};
104
+ function f(t, e) {
105
+ !t || !e || typeof e != "object" || (St[String(t)] = e);
104
106
  }
105
- function ie(e) {
106
- return String(e || "").trim().replace(/_/g, "-");
107
+ function st(t) {
108
+ return String(t || "").trim().replace(/_/g, "-");
107
109
  }
108
- function ba(e) {
109
- const t = ie(e);
110
- if (!t)
110
+ function Sa(t) {
111
+ const e = st(t);
112
+ if (!e)
111
113
  return ["en-US"];
112
- const a = t, o = De[a] || De[a.toLowerCase()] || a, s = [], i = (l) => {
113
- l && !s.includes(l) && s.push(l);
114
+ const a = e, o = Dt[a] || Dt[a.toLowerCase()] || a, i = [], s = (l) => {
115
+ l && !i.includes(l) && i.push(l);
114
116
  };
115
- i(o);
116
- for (const [l, u] of Object.entries(va))
117
- l.toLowerCase() === o.toLowerCase() && u.forEach(i);
118
- const r = o.split("-");
119
- for (let l = r.length - 1; l >= 1; l -= 1)
120
- i(r.slice(0, l).join("-"));
121
- return i(De[r[0]] || r[0]), i("en-US"), s;
122
- }
123
- function wa(e) {
124
- for (const t of ba(e)) {
125
- if (ke[t])
126
- return t;
127
- const a = Object.keys(ke).find(
128
- (o) => o.toLowerCase() === t.toLowerCase()
117
+ s(o);
118
+ for (const [l, u] of Object.entries(ba))
119
+ l.toLowerCase() === o.toLowerCase() && u.forEach(s);
120
+ const n = o.split("-");
121
+ for (let l = n.length - 1; l >= 1; l -= 1)
122
+ s(n.slice(0, l).join("-"));
123
+ return s(Dt[n[0]] || n[0]), s("en-US"), i;
124
+ }
125
+ function Aa(t) {
126
+ for (const e of Sa(t)) {
127
+ if (St[e])
128
+ return e;
129
+ const a = Object.keys(St).find(
130
+ (o) => o.toLowerCase() === e.toLowerCase()
129
131
  );
130
132
  if (a)
131
133
  return a;
132
134
  }
133
135
  return "en-US";
134
136
  }
135
- function Sa(e = {}) {
136
- var t;
137
- if (e.locale != null && String(e.locale).trim())
138
- return ie(e.locale);
137
+ function Ca(t = {}) {
138
+ var e;
139
+ if (t.locale != null && String(t.locale).trim())
140
+ return st(t.locale);
139
141
  if (typeof document < "u") {
140
- const a = (t = document.documentElement) == null ? void 0 : t.lang;
142
+ const a = (e = document.documentElement) == null ? void 0 : e.lang;
141
143
  if (a && String(a).trim())
142
- return ie(a);
144
+ return st(a);
143
145
  }
144
- return typeof navigator < "u" && navigator.language ? ie(navigator.language) : "en-US";
146
+ return typeof navigator < "u" && navigator.language ? st(navigator.language) : "en-US";
145
147
  }
146
- function Aa(e, t) {
147
- return e != null && (ue = ie(e) || "en-US"), ue;
148
+ function za(t, e) {
149
+ return t != null && (dt = st(t) || "en-US"), dt;
148
150
  }
149
- function Ca(e) {
150
- Pt = e && typeof e == "object" ? { ...e } : {};
151
+ function Ea(t) {
152
+ Le = t && typeof t == "object" ? { ...t } : {};
151
153
  }
152
- function be() {
153
- return ue;
154
+ function At() {
155
+ return dt;
154
156
  }
155
- function za(e = ue) {
156
- const t = ie(e).split("-")[0].toLowerCase();
157
- return ka.has(t) ? "rtl" : "ltr";
157
+ function Ra(t = dt) {
158
+ const e = st(t).split("-")[0].toLowerCase();
159
+ return wa.has(e) ? "rtl" : "ltr";
158
160
  }
159
- function p(e, t) {
160
- const a = String(e || ""), o = wa(ue), s = ke[o] || ve;
161
- let i = Pt[a] ?? s[a] ?? ve[a] ?? a;
162
- return t && typeof t == "object" && (i = String(i).replace(/\{(\w+)\}/g, (r, l) => t[l] == null ? `{${l}}` : String(t[l]))), String(i);
161
+ function p(t, e) {
162
+ const a = String(t || ""), o = Aa(dt), i = St[o] || wt;
163
+ let s = Le[a] ?? i[a] ?? wt[a] ?? a;
164
+ return e && typeof e == "object" && (s = String(s).replace(/\{(\w+)\}/g, (n, l) => e[l] == null ? `{${l}}` : String(e[l]))), String(s);
163
165
  }
164
- const Ea = {
166
+ const ja = {
165
167
  "launcher.open": "Оставете бележка...",
166
168
  "tool.crop": "Реколта",
167
169
  "tool.resetCrop": "Нулиране на изрязването",
@@ -218,7 +220,7 @@ const Ea = {
218
220
  "diag.timezone": "Часова зона",
219
221
  "diag.viewport": "Изгледна плоча",
220
222
  "diag.user": "Потребител"
221
- }, ja = {
223
+ }, Pa = {
222
224
  "launcher.open": "Deixa una nota...",
223
225
  "tool.crop": "Cultiu",
224
226
  "tool.resetCrop": "Restablir el cultiu",
@@ -275,7 +277,7 @@ const Ea = {
275
277
  "diag.timezone": "Zona horària",
276
278
  "diag.viewport": "Porta de vista",
277
279
  "diag.user": "Usuari"
278
- }, Ra = {
280
+ }, xa = {
279
281
  "launcher.open": "Zanechte poznámku...",
280
282
  "tool.crop": "Oříznout",
281
283
  "tool.resetCrop": "Obnovit oříznutí",
@@ -332,7 +334,7 @@ const Ea = {
332
334
  "diag.timezone": "Časové pásmo",
333
335
  "diag.viewport": "Výřez",
334
336
  "diag.user": "Uživatel"
335
- }, Pa = {
337
+ }, La = {
336
338
  "launcher.open": "Efterlad en note...",
337
339
  "tool.crop": "Afgrøde",
338
340
  "tool.resetCrop": "Nulstil afgrøde",
@@ -389,7 +391,7 @@ const Ea = {
389
391
  "diag.timezone": "Tidszone",
390
392
  "diag.viewport": "Viewport",
391
393
  "diag.user": "Bruger"
392
- }, xa = {
394
+ }, Ua = {
393
395
  "launcher.open": "Hinterlassen Sie eine Notiz...",
394
396
  "tool.crop": "Ernte",
395
397
  "tool.resetCrop": "Zuschnitt zurücksetzen",
@@ -446,7 +448,7 @@ const Ea = {
446
448
  "diag.timezone": "Zeitzone",
447
449
  "diag.viewport": "Sichtfenster",
448
450
  "diag.user": "Nutzer"
449
- }, La = {
451
+ }, Ta = {
450
452
  "launcher.open": "Αφήστε ένα σημείωμα...",
451
453
  "tool.crop": "Καλλιέργεια",
452
454
  "tool.resetCrop": "Επαναφορά της καλλιέργειας",
@@ -503,7 +505,7 @@ const Ea = {
503
505
  "diag.timezone": "Ζώνη ώρας",
504
506
  "diag.viewport": "Θύρα προβολής",
505
507
  "diag.user": "Χρήστης"
506
- }, Ua = {
508
+ }, Fa = {
507
509
  "launcher.open": "Leave a note…",
508
510
  "tool.crop": "Crop",
509
511
  "tool.resetCrop": "Reset crop",
@@ -560,6 +562,8 @@ const Ea = {
560
562
  "status.captureEmpty": "Screenshot capture produced an empty image.",
561
563
  "shot.alt": "Screenshot",
562
564
  "privacy.redact": "Redact",
565
+ "privacy.included": "Included",
566
+ "privacy.redacted": "Redacted",
563
567
  "privacy.section.diagnostics": "Diagnostics",
564
568
  "privacy.section.logs": "Logs",
565
569
  "privacy.disclosure.both": "Also sending logs and diagnostic information",
@@ -574,7 +578,7 @@ const Ea = {
574
578
  "diag.timezone": "Timezone",
575
579
  "diag.viewport": "Viewport",
576
580
  "diag.user": "User"
577
- }, Ta = {
581
+ }, Ma = {
578
582
  "launcher.open": "Deja una nota...",
579
583
  "tool.crop": "Cultivo",
580
584
  "tool.resetCrop": "Restablecer cultivo",
@@ -631,7 +635,7 @@ const Ea = {
631
635
  "diag.timezone": "Zona horaria",
632
636
  "diag.viewport": "Ventana",
633
637
  "diag.user": "Usuario"
634
- }, Fa = {
638
+ }, Da = {
635
639
  "launcher.open": "Deja una nota...",
636
640
  "tool.crop": "Cultivo",
637
641
  "tool.resetCrop": "Restablecer recorte",
@@ -688,7 +692,7 @@ const Ea = {
688
692
  "diag.timezone": "Zona horaria",
689
693
  "diag.viewport": "ViEWPORT",
690
694
  "diag.user": "Usuario"
691
- }, Da = {
695
+ }, Oa = {
692
696
  "launcher.open": "Jäta märkus...",
693
697
  "tool.crop": "Põllukultuur",
694
698
  "tool.resetCrop": "Lähtesta põllukultuur",
@@ -745,7 +749,7 @@ const Ea = {
745
749
  "diag.timezone": "Ajavöönd",
746
750
  "diag.viewport": "Vaatenurk",
747
751
  "diag.user": "Kasutaja"
748
- }, Oa = {
752
+ }, Ia = {
749
753
  "launcher.open": "Jätä muistiinpano...",
750
754
  "tool.crop": "Viljely",
751
755
  "tool.resetCrop": "Nollaa rajaus",
@@ -802,7 +806,7 @@ const Ea = {
802
806
  "diag.timezone": "Aikavyöhyke",
803
807
  "diag.viewport": "Näyttöikkuna",
804
808
  "diag.user": "Käyttäjä"
805
- }, Ma = {
809
+ }, Va = {
806
810
  "launcher.open": "Laissez un message...",
807
811
  "tool.crop": "Récolte",
808
812
  "tool.resetCrop": "Réinitialiser la récolte",
@@ -859,7 +863,7 @@ const Ea = {
859
863
  "diag.timezone": "Fuseau horaire",
860
864
  "diag.viewport": "Viewport",
861
865
  "diag.user": "Utilisateur"
862
- }, Ia = {
866
+ }, $a = {
863
867
  "launcher.open": "एक नोट छोड़ें...",
864
868
  "tool.crop": "क्रॉप",
865
869
  "tool.resetCrop": "क्रॉप रीसेट करें",
@@ -916,7 +920,7 @@ const Ea = {
916
920
  "diag.timezone": "टाइमज़ोन",
917
921
  "diag.viewport": "व्यूपोर्ट",
918
922
  "diag.user": "यूज़र"
919
- }, Va = {
923
+ }, Ba = {
920
924
  "launcher.open": "Ostavite poruku...",
921
925
  "tool.crop": "Usjev",
922
926
  "tool.resetCrop": "Resetirajte obrezivanje",
@@ -973,7 +977,7 @@ const Ea = {
973
977
  "diag.timezone": "Vremenska zona",
974
978
  "diag.viewport": "Prikaznica",
975
979
  "diag.user": "Korisnik"
976
- }, $a = {
980
+ }, Na = {
977
981
  "launcher.open": "Hagyjon egy jegyzetet...",
978
982
  "tool.crop": "Termés",
979
983
  "tool.resetCrop": "Vágás visszaállítása",
@@ -1030,7 +1034,7 @@ const Ea = {
1030
1034
  "diag.timezone": "Időzóna",
1031
1035
  "diag.viewport": "Nézetablak",
1032
1036
  "diag.user": "Felhasználó"
1033
- }, Ba = {
1037
+ }, Ka = {
1034
1038
  "launcher.open": "Tinggalkan catatan...",
1035
1039
  "tool.crop": "Panas",
1036
1040
  "tool.resetCrop": "Setel ulang tanaman",
@@ -1087,7 +1091,7 @@ const Ea = {
1087
1091
  "diag.timezone": "Zona Waktu",
1088
1092
  "diag.viewport": "Pintu pandang",
1089
1093
  "diag.user": "Pengguna"
1090
- }, Na = {
1094
+ }, Ha = {
1091
1095
  "launcher.open": "Lascia una nota...",
1092
1096
  "tool.crop": "Ritaglia",
1093
1097
  "tool.resetCrop": "Reimposta il ritaglio",
@@ -1144,7 +1148,7 @@ const Ea = {
1144
1148
  "diag.timezone": "Fuso orario",
1145
1149
  "diag.viewport": "Viewport",
1146
1150
  "diag.user": "Utente"
1147
- }, Ka = {
1151
+ }, Ga = {
1148
1152
  "launcher.open": "メモを残してください...",
1149
1153
  "tool.crop": "クロップ",
1150
1154
  "tool.resetCrop": "トリミングをリセット",
@@ -1201,7 +1205,7 @@ const Ea = {
1201
1205
  "diag.timezone": "タイムゾーン",
1202
1206
  "diag.viewport": "ビューポート",
1203
1207
  "diag.user": "ユーザ"
1204
- }, Ha = {
1208
+ }, qa = {
1205
1209
  "launcher.open": "메모 남기기...",
1206
1210
  "tool.crop": "크롭",
1207
1211
  "tool.resetCrop": "크롭 재설정",
@@ -1258,7 +1262,7 @@ const Ea = {
1258
1262
  "diag.timezone": "타임존",
1259
1263
  "diag.viewport": "뷰포트",
1260
1264
  "diag.user": "사용자"
1261
- }, Ga = {
1265
+ }, _a = {
1262
1266
  "launcher.open": "Palikite pastabą...",
1263
1267
  "tool.crop": "Apkarpyti",
1264
1268
  "tool.resetCrop": "Iš naujo nustatyti apkarpymą",
@@ -1315,7 +1319,7 @@ const Ea = {
1315
1319
  "diag.timezone": "Laiko juosta",
1316
1320
  "diag.viewport": "Peržiūros sritis",
1317
1321
  "diag.user": "Vartotojas"
1318
- }, qa = {
1322
+ }, Wa = {
1319
1323
  "launcher.open": "Atstājiet piezīmi...",
1320
1324
  "tool.crop": "Kultūraugs",
1321
1325
  "tool.resetCrop": "Atiestatīt apgriešanu",
@@ -1372,7 +1376,7 @@ const Ea = {
1372
1376
  "diag.timezone": "Laika josla",
1373
1377
  "diag.viewport": "Skatu laukums",
1374
1378
  "diag.user": "Lietotājs"
1375
- }, _a = {
1379
+ }, Za = {
1376
1380
  "launcher.open": "Legg igjen et notat...",
1377
1381
  "tool.crop": "Beskjæring",
1378
1382
  "tool.resetCrop": "Tilbakestill beskjæring",
@@ -1429,7 +1433,7 @@ const Ea = {
1429
1433
  "diag.timezone": "Tidssone",
1430
1434
  "diag.viewport": "Visningsport",
1431
1435
  "diag.user": "Bruker"
1432
- }, Wa = {
1436
+ }, Ja = {
1433
1437
  "launcher.open": "Laat een briefje achter...",
1434
1438
  "tool.crop": "Gewas",
1435
1439
  "tool.resetCrop": "Bijsnijden opnieuw instellen",
@@ -1486,7 +1490,7 @@ const Ea = {
1486
1490
  "diag.timezone": "Tijdzone",
1487
1491
  "diag.viewport": "Viewport",
1488
1492
  "diag.user": "Gebruiker"
1489
- }, Za = {
1493
+ }, Ya = {
1490
1494
  "launcher.open": "Zostaw notatkę...",
1491
1495
  "tool.crop": "Uprawa",
1492
1496
  "tool.resetCrop": "Resetuj kadrowanie",
@@ -1543,7 +1547,7 @@ const Ea = {
1543
1547
  "diag.timezone": "Strefa czasowa",
1544
1548
  "diag.viewport": "rzutnia",
1545
1549
  "diag.user": "Użytkownik"
1546
- }, Ja = {
1550
+ }, Xa = {
1547
1551
  "launcher.open": "Deixe uma nota...",
1548
1552
  "tool.crop": "Colheita",
1549
1553
  "tool.resetCrop": "Redefinir o corte",
@@ -1600,7 +1604,7 @@ const Ea = {
1600
1604
  "diag.timezone": "Fuso horário",
1601
1605
  "diag.viewport": "Janela de visualização",
1602
1606
  "diag.user": "Usuário"
1603
- }, Ya = {
1607
+ }, Qa = {
1604
1608
  "launcher.open": "Deixe uma nota...",
1605
1609
  "tool.crop": "Colheita",
1606
1610
  "tool.resetCrop": "Redefinir o recorte",
@@ -1657,7 +1661,7 @@ const Ea = {
1657
1661
  "diag.timezone": "Fuso horário",
1658
1662
  "diag.viewport": "Viewport",
1659
1663
  "diag.user": "Utilizador"
1660
- }, Xa = {
1664
+ }, to = {
1661
1665
  "launcher.open": "Lăsați o notă...",
1662
1666
  "tool.crop": "Cultură",
1663
1667
  "tool.resetCrop": "Resetați recolta",
@@ -1714,7 +1718,7 @@ const Ea = {
1714
1718
  "diag.timezone": "Fus orar",
1715
1719
  "diag.viewport": "Portul de vizualizare",
1716
1720
  "diag.user": "Utilizator"
1717
- }, Qa = {
1721
+ }, eo = {
1718
1722
  "launcher.open": "Оставьте заметку...",
1719
1723
  "tool.crop": "урожай",
1720
1724
  "tool.resetCrop": "Сбросить урожай",
@@ -1771,7 +1775,7 @@ const Ea = {
1771
1775
  "diag.timezone": "Часовой пояс",
1772
1776
  "diag.viewport": "окно просмотра",
1773
1777
  "diag.user": "Пользователь"
1774
- }, eo = {
1778
+ }, ao = {
1775
1779
  "launcher.open": "Zanechať poznámku...",
1776
1780
  "tool.crop": "Oplodina",
1777
1781
  "tool.resetCrop": "Obnoviť orezanie",
@@ -1828,7 +1832,7 @@ const Ea = {
1828
1832
  "diag.timezone": "Časové pásmo",
1829
1833
  "diag.viewport": "Zobrazenie",
1830
1834
  "diag.user": "Používateľ"
1831
- }, to = {
1835
+ }, oo = {
1832
1836
  "launcher.open": "Pustite opombo...",
1833
1837
  "tool.crop": "Pridelek",
1834
1838
  "tool.resetCrop": "Ponastavi obrezovanje",
@@ -1885,7 +1889,7 @@ const Ea = {
1885
1889
  "diag.timezone": "Časovni pas",
1886
1890
  "diag.viewport": "Razgledna plošča",
1887
1891
  "diag.user": "Uporabnik"
1888
- }, ao = {
1892
+ }, io = {
1889
1893
  "launcher.open": "Ostavite belešku...",
1890
1894
  "tool.crop": "Usjev",
1891
1895
  "tool.resetCrop": "Resetujte usev",
@@ -1942,7 +1946,7 @@ const Ea = {
1942
1946
  "diag.timezone": "Vremenska zona",
1943
1947
  "diag.viewport": "Viedport",
1944
1948
  "diag.user": "Korisnik"
1945
- }, oo = {
1949
+ }, so = {
1946
1950
  "launcher.open": "Lämna en anteckning...",
1947
1951
  "tool.crop": "Skörda",
1948
1952
  "tool.resetCrop": "Återställ beskärning",
@@ -1999,7 +2003,7 @@ const Ea = {
1999
2003
  "diag.timezone": "Tidszon",
2000
2004
  "diag.viewport": "Viewport",
2001
2005
  "diag.user": "Användare"
2002
- }, io = {
2006
+ }, ro = {
2003
2007
  "launcher.open": "Mag-iwan ng tala...",
2004
2008
  "tool.crop": "Pag-ani",
2005
2009
  "tool.resetCrop": "I-reset ang panani",
@@ -2056,7 +2060,7 @@ const Ea = {
2056
2060
  "diag.timezone": "Timesone",
2057
2061
  "diag.viewport": "Viewport",
2058
2062
  "diag.user": "Gumagamit"
2059
- }, so = {
2063
+ }, no = {
2060
2064
  "launcher.open": "ทิ้งหมายเหตุ...",
2061
2065
  "tool.crop": "พืชผล",
2062
2066
  "tool.resetCrop": "รีเซ็ตการตัดพืช",
@@ -2113,7 +2117,7 @@ const Ea = {
2113
2117
  "diag.timezone": "เขตเวลา",
2114
2118
  "diag.viewport": "พอร์ตมุมมอง",
2115
2119
  "diag.user": "ผู้ใช้"
2116
- }, ro = {
2120
+ }, lo = {
2117
2121
  "launcher.open": "Bir not bırakın...",
2118
2122
  "tool.crop": "Mahsul",
2119
2123
  "tool.resetCrop": "Kırpmayı sıfırla",
@@ -2170,7 +2174,7 @@ const Ea = {
2170
2174
  "diag.timezone": "Saat dilimi",
2171
2175
  "diag.viewport": "Görünüm noktası",
2172
2176
  "diag.user": "Kullanıcı"
2173
- }, no = {
2177
+ }, uo = {
2174
2178
  "launcher.open": "Залиште записку...",
2175
2179
  "tool.crop": "Урожай",
2176
2180
  "tool.resetCrop": "Скинути обрізку",
@@ -2227,7 +2231,7 @@ const Ea = {
2227
2231
  "diag.timezone": "Часовий пояс",
2228
2232
  "diag.viewport": "Вигляд",
2229
2233
  "diag.user": "Користувач"
2230
- }, lo = {
2234
+ }, co = {
2231
2235
  "launcher.open": "Để lại một ghi chú...",
2232
2236
  "tool.crop": "Cây trồng",
2233
2237
  "tool.resetCrop": "Đặt lại cây trồng",
@@ -2284,7 +2288,7 @@ const Ea = {
2284
2288
  "diag.timezone": "Múi giờ",
2285
2289
  "diag.viewport": "Cổng quan sát",
2286
2290
  "diag.user": "Người dùng"
2287
- }, uo = {
2291
+ }, po = {
2288
2292
  "launcher.open": "留个笔记...",
2289
2293
  "tool.crop": "作物",
2290
2294
  "tool.resetCrop": "重置裁剪",
@@ -2341,7 +2345,7 @@ const Ea = {
2341
2345
  "diag.timezone": "时区",
2342
2346
  "diag.viewport": "视口",
2343
2347
  "diag.user": "用户"
2344
- }, co = {
2348
+ }, go = {
2345
2349
  "launcher.open": "留下筆記...",
2346
2350
  "tool.crop": "作物",
2347
2351
  "tool.resetCrop": "重設裁切",
@@ -2399,556 +2403,556 @@ const Ea = {
2399
2403
  "diag.viewport": "視埠",
2400
2404
  "diag.user": "使用者"
2401
2405
  };
2402
- f("en-US", ve);
2403
- f("bg", Ea);
2404
- f("ca", ja);
2405
- f("cs", Ra);
2406
- f("da", Pa);
2407
- f("de", xa);
2408
- f("el", La);
2409
- f("en-GB", Ua);
2410
- f("es", Ta);
2411
- f("es-419", Fa);
2412
- f("et", Da);
2413
- f("fi", Oa);
2414
- f("fr", Ma);
2415
- f("hi", Ia);
2416
- f("hr", Va);
2417
- f("hu", $a);
2418
- f("id", Ba);
2419
- f("it", Na);
2420
- f("ja", Ka);
2421
- f("ko", Ha);
2422
- f("lt", Ga);
2423
- f("lv", qa);
2424
- f("nb", _a);
2425
- f("nl", Wa);
2426
- f("pl", Za);
2427
- f("pt-BR", Ja);
2428
- f("pt-PT", Ya);
2429
- f("ro", Xa);
2430
- f("ru", Qa);
2431
- f("sk", eo);
2432
- f("sl", to);
2433
- f("sr", ao);
2434
- f("sv", oo);
2435
- f("fil", io);
2436
- f("th", so);
2437
- f("tr", ro);
2438
- f("uk", no);
2439
- f("vi", lo);
2440
- f("zh-CN", uo);
2441
- f("zh-TW", co);
2442
- function po(e, t) {
2443
- if (e.match(/^[a-z]+:\/\//i))
2444
- return e;
2445
- if (e.match(/^\/\//))
2446
- return window.location.protocol + e;
2447
- if (e.match(/^[a-z]+:/i))
2448
- return e;
2449
- const a = document.implementation.createHTMLDocument(), o = a.createElement("base"), s = a.createElement("a");
2450
- return a.head.appendChild(o), a.body.appendChild(s), t && (o.href = t), s.href = e, s.href;
2406
+ f("en-US", wt);
2407
+ f("bg", ja);
2408
+ f("ca", Pa);
2409
+ f("cs", xa);
2410
+ f("da", La);
2411
+ f("de", Ua);
2412
+ f("el", Ta);
2413
+ f("en-GB", Fa);
2414
+ f("es", Ma);
2415
+ f("es-419", Da);
2416
+ f("et", Oa);
2417
+ f("fi", Ia);
2418
+ f("fr", Va);
2419
+ f("hi", $a);
2420
+ f("hr", Ba);
2421
+ f("hu", Na);
2422
+ f("id", Ka);
2423
+ f("it", Ha);
2424
+ f("ja", Ga);
2425
+ f("ko", qa);
2426
+ f("lt", _a);
2427
+ f("lv", Wa);
2428
+ f("nb", Za);
2429
+ f("nl", Ja);
2430
+ f("pl", Ya);
2431
+ f("pt-BR", Xa);
2432
+ f("pt-PT", Qa);
2433
+ f("ro", to);
2434
+ f("ru", eo);
2435
+ f("sk", ao);
2436
+ f("sl", oo);
2437
+ f("sr", io);
2438
+ f("sv", so);
2439
+ f("fil", ro);
2440
+ f("th", no);
2441
+ f("tr", lo);
2442
+ f("uk", uo);
2443
+ f("vi", co);
2444
+ f("zh-CN", po);
2445
+ f("zh-TW", go);
2446
+ function mo(t, e) {
2447
+ if (t.match(/^[a-z]+:\/\//i))
2448
+ return t;
2449
+ if (t.match(/^\/\//))
2450
+ return window.location.protocol + t;
2451
+ if (t.match(/^[a-z]+:/i))
2452
+ return t;
2453
+ const a = document.implementation.createHTMLDocument(), o = a.createElement("base"), i = a.createElement("a");
2454
+ return a.head.appendChild(o), a.body.appendChild(i), e && (o.href = e), i.href = t, i.href;
2451
2455
  }
2452
- const go = /* @__PURE__ */ (() => {
2453
- let e = 0;
2454
- const t = () => (
2456
+ const ho = /* @__PURE__ */ (() => {
2457
+ let t = 0;
2458
+ const e = () => (
2455
2459
  // eslint-disable-next-line no-bitwise
2456
2460
  `0000${(Math.random() * 36 ** 4 << 0).toString(36)}`.slice(-4)
2457
2461
  );
2458
- return () => (e += 1, `u${t()}${e}`);
2462
+ return () => (t += 1, `u${e()}${t}`);
2459
2463
  })();
2460
- function J(e) {
2461
- const t = [];
2462
- for (let a = 0, o = e.length; a < o; a++)
2463
- t.push(e[a]);
2464
- return t;
2464
+ function Y(t) {
2465
+ const e = [];
2466
+ for (let a = 0, o = t.length; a < o; a++)
2467
+ e.push(t[a]);
2468
+ return e;
2465
2469
  }
2466
- let ae = null;
2467
- function xt(e = {}) {
2468
- return ae || (e.includeStyleProperties ? (ae = e.includeStyleProperties, ae) : (ae = J(window.getComputedStyle(document.documentElement)), ae));
2470
+ let ot = null;
2471
+ function Ue(t = {}) {
2472
+ return ot || (t.includeStyleProperties ? (ot = t.includeStyleProperties, ot) : (ot = Y(window.getComputedStyle(document.documentElement)), ot));
2469
2473
  }
2470
- function we(e, t) {
2471
- const o = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
2474
+ function Ct(t, e) {
2475
+ const o = (t.ownerDocument.defaultView || window).getComputedStyle(t).getPropertyValue(e);
2472
2476
  return o ? parseFloat(o.replace("px", "")) : 0;
2473
2477
  }
2474
- function mo(e) {
2475
- const t = we(e, "border-left-width"), a = we(e, "border-right-width");
2476
- return e.clientWidth + t + a;
2478
+ function fo(t) {
2479
+ const e = Ct(t, "border-left-width"), a = Ct(t, "border-right-width");
2480
+ return t.clientWidth + e + a;
2477
2481
  }
2478
- function ho(e) {
2479
- const t = we(e, "border-top-width"), a = we(e, "border-bottom-width");
2480
- return e.clientHeight + t + a;
2482
+ function yo(t) {
2483
+ const e = Ct(t, "border-top-width"), a = Ct(t, "border-bottom-width");
2484
+ return t.clientHeight + e + a;
2481
2485
  }
2482
- function Lt(e, t = {}) {
2483
- const a = t.width || mo(e), o = t.height || ho(e);
2486
+ function Te(t, e = {}) {
2487
+ const a = e.width || fo(t), o = e.height || yo(t);
2484
2488
  return { width: a, height: o };
2485
2489
  }
2486
- function fo() {
2487
- let e, t;
2490
+ function vo() {
2491
+ let t, e;
2488
2492
  try {
2489
- t = process;
2493
+ e = process;
2490
2494
  } catch {
2491
2495
  }
2492
- const a = t && t.env ? t.env.devicePixelRatio : null;
2493
- return a && (e = parseInt(a, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
2496
+ const a = e && e.env ? e.env.devicePixelRatio : null;
2497
+ return a && (t = parseInt(a, 10), Number.isNaN(t) && (t = 1)), t || window.devicePixelRatio || 1;
2494
2498
  }
2495
2499
  const U = 16384;
2496
- function yo(e) {
2497
- (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));
2500
+ function ko(t) {
2501
+ (t.width > U || t.height > U) && (t.width > U && t.height > U ? t.width > t.height ? (t.height *= U / t.width, t.width = U) : (t.width *= U / t.height, t.height = U) : t.width > U ? (t.height *= U / t.width, t.width = U) : (t.width *= U / t.height, t.height = U));
2498
2502
  }
2499
- function Se(e) {
2500
- return new Promise((t, a) => {
2503
+ function zt(t) {
2504
+ return new Promise((e, a) => {
2501
2505
  const o = new Image();
2502
2506
  o.onload = () => {
2503
2507
  o.decode().then(() => {
2504
- requestAnimationFrame(() => t(o));
2508
+ requestAnimationFrame(() => e(o));
2505
2509
  });
2506
- }, o.onerror = a, o.crossOrigin = "anonymous", o.decoding = "async", o.src = e;
2510
+ }, o.onerror = a, o.crossOrigin = "anonymous", o.decoding = "async", o.src = t;
2507
2511
  });
2508
2512
  }
2509
- async function vo(e) {
2510
- return Promise.resolve().then(() => new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then((t) => `data:image/svg+xml;charset=utf-8,${t}`);
2513
+ async function bo(t) {
2514
+ return Promise.resolve().then(() => new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then((e) => `data:image/svg+xml;charset=utf-8,${e}`);
2511
2515
  }
2512
- async function ko(e, t, a) {
2513
- const o = "http://www.w3.org/2000/svg", s = document.createElementNS(o, "svg"), i = document.createElementNS(o, "foreignObject");
2514
- 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);
2516
+ async function wo(t, e, a) {
2517
+ const o = "http://www.w3.org/2000/svg", i = document.createElementNS(o, "svg"), s = document.createElementNS(o, "foreignObject");
2518
+ return i.setAttribute("width", `${e}`), i.setAttribute("height", `${a}`), i.setAttribute("viewBox", `0 0 ${e} ${a}`), s.setAttribute("width", "100%"), s.setAttribute("height", "100%"), s.setAttribute("x", "0"), s.setAttribute("y", "0"), s.setAttribute("externalResourcesRequired", "true"), i.appendChild(s), s.appendChild(t), bo(i);
2515
2519
  }
2516
- const L = (e, t) => {
2517
- if (e instanceof t)
2520
+ const L = (t, e) => {
2521
+ if (t instanceof e)
2518
2522
  return !0;
2519
- const a = Object.getPrototypeOf(e);
2520
- return a === null ? !1 : a.constructor.name === t.name || L(a, t);
2523
+ const a = Object.getPrototypeOf(t);
2524
+ return a === null ? !1 : a.constructor.name === e.name || L(a, e);
2521
2525
  };
2522
- function bo(e) {
2523
- const t = e.getPropertyValue("content");
2524
- return `${e.cssText} content: '${t.replace(/'|"/g, "")}';`;
2525
- }
2526
- function wo(e, t) {
2527
- return xt(t).map((a) => {
2528
- const o = e.getPropertyValue(a), s = e.getPropertyPriority(a);
2529
- return `${a}: ${o}${s ? " !important" : ""};`;
2526
+ function So(t) {
2527
+ const e = t.getPropertyValue("content");
2528
+ return `${t.cssText} content: '${e.replace(/'|"/g, "")}';`;
2529
+ }
2530
+ function Ao(t, e) {
2531
+ return Ue(e).map((a) => {
2532
+ const o = t.getPropertyValue(a), i = t.getPropertyPriority(a);
2533
+ return `${a}: ${o}${i ? " !important" : ""};`;
2530
2534
  }).join(" ");
2531
2535
  }
2532
- function So(e, t, a, o) {
2533
- const s = `.${e}:${t}`, i = a.cssText ? bo(a) : wo(a, o);
2534
- return document.createTextNode(`${s}{${i}}`);
2536
+ function Co(t, e, a, o) {
2537
+ const i = `.${t}:${e}`, s = a.cssText ? So(a) : Ao(a, o);
2538
+ return document.createTextNode(`${i}{${s}}`);
2535
2539
  }
2536
- function it(e, t, a, o) {
2537
- const s = window.getComputedStyle(e, a), i = s.getPropertyValue("content");
2538
- if (i === "" || i === "none")
2540
+ function re(t, e, a, o) {
2541
+ const i = window.getComputedStyle(t, a), s = i.getPropertyValue("content");
2542
+ if (s === "" || s === "none")
2539
2543
  return;
2540
- const r = go();
2544
+ const n = ho();
2541
2545
  try {
2542
- t.className = `${t.className} ${r}`;
2546
+ e.className = `${e.className} ${n}`;
2543
2547
  } catch {
2544
2548
  return;
2545
2549
  }
2546
2550
  const l = document.createElement("style");
2547
- l.appendChild(So(r, a, s, o)), t.appendChild(l);
2551
+ l.appendChild(Co(n, a, i, o)), e.appendChild(l);
2548
2552
  }
2549
- function Ao(e, t, a) {
2550
- it(e, t, ":before", a), it(e, t, ":after", a);
2553
+ function zo(t, e, a) {
2554
+ re(t, e, ":before", a), re(t, e, ":after", a);
2551
2555
  }
2552
- const st = "application/font-woff", rt = "image/jpeg", Co = {
2553
- woff: st,
2554
- woff2: st,
2556
+ const ne = "application/font-woff", le = "image/jpeg", Eo = {
2557
+ woff: ne,
2558
+ woff2: ne,
2555
2559
  ttf: "application/font-truetype",
2556
2560
  eot: "application/vnd.ms-fontobject",
2557
2561
  png: "image/png",
2558
- jpg: rt,
2559
- jpeg: rt,
2562
+ jpg: le,
2563
+ jpeg: le,
2560
2564
  gif: "image/gif",
2561
2565
  tiff: "image/tiff",
2562
2566
  svg: "image/svg+xml",
2563
2567
  webp: "image/webp"
2564
2568
  };
2565
- function zo(e) {
2566
- const t = /\.([^./]*?)$/g.exec(e);
2567
- return t ? t[1] : "";
2569
+ function Ro(t) {
2570
+ const e = /\.([^./]*?)$/g.exec(t);
2571
+ return e ? e[1] : "";
2568
2572
  }
2569
- function _e(e) {
2570
- const t = zo(e).toLowerCase();
2571
- return Co[t] || "";
2573
+ function Wt(t) {
2574
+ const e = Ro(t).toLowerCase();
2575
+ return Eo[e] || "";
2572
2576
  }
2573
- function Eo(e) {
2574
- return e.split(/,/)[1];
2577
+ function jo(t) {
2578
+ return t.split(/,/)[1];
2575
2579
  }
2576
- function Be(e) {
2577
- return e.search(/^(data:)/) !== -1;
2580
+ function Nt(t) {
2581
+ return t.search(/^(data:)/) !== -1;
2578
2582
  }
2579
- function jo(e, t) {
2580
- return `data:${t};base64,${e}`;
2583
+ function Po(t, e) {
2584
+ return `data:${e};base64,${t}`;
2581
2585
  }
2582
- async function Ut(e, t, a) {
2583
- const o = await fetch(e, t);
2586
+ async function Fe(t, e, a) {
2587
+ const o = await fetch(t, e);
2584
2588
  if (o.status === 404)
2585
2589
  throw new Error(`Resource "${o.url}" not found`);
2586
- const s = await o.blob();
2587
- return new Promise((i, r) => {
2590
+ const i = await o.blob();
2591
+ return new Promise((s, n) => {
2588
2592
  const l = new FileReader();
2589
- l.onerror = r, l.onloadend = () => {
2593
+ l.onerror = n, l.onloadend = () => {
2590
2594
  try {
2591
- i(a({ res: o, result: l.result }));
2595
+ s(a({ res: o, result: l.result }));
2592
2596
  } catch (u) {
2593
- r(u);
2597
+ n(u);
2594
2598
  }
2595
- }, l.readAsDataURL(s);
2599
+ }, l.readAsDataURL(i);
2596
2600
  });
2597
2601
  }
2598
- const Oe = {};
2599
- function Ro(e, t, a) {
2600
- let o = e.replace(/\?.*/, "");
2601
- return a && (o = e), /ttf|otf|eot|woff2?/i.test(o) && (o = o.replace(/.*\//, "")), t ? `[${t}]${o}` : o;
2602
- }
2603
- async function We(e, t, a) {
2604
- const o = Ro(e, t, a.includeQueryParams);
2605
- if (Oe[o] != null)
2606
- return Oe[o];
2607
- a.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
2608
- let s;
2602
+ const Ot = {};
2603
+ function xo(t, e, a) {
2604
+ let o = t.replace(/\?.*/, "");
2605
+ return a && (o = t), /ttf|otf|eot|woff2?/i.test(o) && (o = o.replace(/.*\//, "")), e ? `[${e}]${o}` : o;
2606
+ }
2607
+ async function Zt(t, e, a) {
2608
+ const o = xo(t, e, a.includeQueryParams);
2609
+ if (Ot[o] != null)
2610
+ return Ot[o];
2611
+ a.cacheBust && (t += (/\?/.test(t) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
2612
+ let i;
2609
2613
  try {
2610
- const i = await Ut(e, a.fetchRequestInit, ({ res: r, result: l }) => (t || (t = r.headers.get("Content-Type") || ""), Eo(l)));
2611
- s = jo(i, t);
2612
- } catch (i) {
2613
- s = a.imagePlaceholder || "";
2614
- let r = `Failed to fetch resource: ${e}`;
2615
- i && (r = typeof i == "string" ? i : i.message), r && console.warn(r);
2614
+ const s = await Fe(t, a.fetchRequestInit, ({ res: n, result: l }) => (e || (e = n.headers.get("Content-Type") || ""), jo(l)));
2615
+ i = Po(s, e);
2616
+ } catch (s) {
2617
+ i = a.imagePlaceholder || "";
2618
+ let n = `Failed to fetch resource: ${t}`;
2619
+ s && (n = typeof s == "string" ? s : s.message), n && console.warn(n);
2616
2620
  }
2617
- return Oe[o] = s, s;
2618
- }
2619
- async function Po(e) {
2620
- const t = e.toDataURL();
2621
- return t === "data:," ? e.cloneNode(!1) : Se(t);
2622
- }
2623
- async function xo(e, t) {
2624
- if (e.currentSrc) {
2625
- const i = document.createElement("canvas"), r = i.getContext("2d");
2626
- i.width = e.clientWidth, i.height = e.clientHeight, r == null || r.drawImage(e, 0, 0, i.width, i.height);
2627
- const l = i.toDataURL();
2628
- return Se(l);
2621
+ return Ot[o] = i, i;
2622
+ }
2623
+ async function Lo(t) {
2624
+ const e = t.toDataURL();
2625
+ return e === "data:," ? t.cloneNode(!1) : zt(e);
2626
+ }
2627
+ async function Uo(t, e) {
2628
+ if (t.currentSrc) {
2629
+ const s = document.createElement("canvas"), n = s.getContext("2d");
2630
+ s.width = t.clientWidth, s.height = t.clientHeight, n == null || n.drawImage(t, 0, 0, s.width, s.height);
2631
+ const l = s.toDataURL();
2632
+ return zt(l);
2629
2633
  }
2630
- const a = e.poster, o = _e(a), s = await We(a, o, t);
2631
- return Se(s);
2634
+ const a = t.poster, o = Wt(a), i = await Zt(a, o, e);
2635
+ return zt(i);
2632
2636
  }
2633
- async function Lo(e, t) {
2637
+ async function To(t, e) {
2634
2638
  var a;
2635
2639
  try {
2636
- if (!((a = e == null ? void 0 : e.contentDocument) === null || a === void 0) && a.body)
2637
- return await xe(e.contentDocument.body, t, !0);
2640
+ if (!((a = t == null ? void 0 : t.contentDocument) === null || a === void 0) && a.body)
2641
+ return await Ut(t.contentDocument.body, e, !0);
2638
2642
  } catch {
2639
2643
  }
2640
- return e.cloneNode(!1);
2644
+ return t.cloneNode(!1);
2641
2645
  }
2642
- async function Uo(e, t) {
2643
- return L(e, HTMLCanvasElement) ? Po(e) : L(e, HTMLVideoElement) ? xo(e, t) : L(e, HTMLIFrameElement) ? Lo(e, t) : e.cloneNode(Tt(e));
2646
+ async function Fo(t, e) {
2647
+ return L(t, HTMLCanvasElement) ? Lo(t) : L(t, HTMLVideoElement) ? Uo(t, e) : L(t, HTMLIFrameElement) ? To(t, e) : t.cloneNode(Me(t));
2644
2648
  }
2645
- const To = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Tt = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
2646
- async function Fo(e, t, a) {
2647
- var o, s;
2648
- if (Tt(t))
2649
- return t;
2650
- let i = [];
2651
- return To(e) && e.assignedNodes ? i = J(e.assignedNodes()) : L(e, HTMLIFrameElement) && (!((o = e.contentDocument) === null || o === void 0) && o.body) ? i = J(e.contentDocument.body.childNodes) : i = J(((s = e.shadowRoot) !== null && s !== void 0 ? s : e).childNodes), i.length === 0 || L(e, HTMLVideoElement) || await i.reduce((r, l) => r.then(() => xe(l, a)).then((u) => {
2652
- u && t.appendChild(u);
2653
- }), Promise.resolve()), t;
2649
+ const Mo = (t) => t.tagName != null && t.tagName.toUpperCase() === "SLOT", Me = (t) => t.tagName != null && t.tagName.toUpperCase() === "SVG";
2650
+ async function Do(t, e, a) {
2651
+ var o, i;
2652
+ if (Me(e))
2653
+ return e;
2654
+ let s = [];
2655
+ return Mo(t) && t.assignedNodes ? s = Y(t.assignedNodes()) : L(t, HTMLIFrameElement) && (!((o = t.contentDocument) === null || o === void 0) && o.body) ? s = Y(t.contentDocument.body.childNodes) : s = Y(((i = t.shadowRoot) !== null && i !== void 0 ? i : t).childNodes), s.length === 0 || L(t, HTMLVideoElement) || await s.reduce((n, l) => n.then(() => Ut(l, a)).then((u) => {
2656
+ u && e.appendChild(u);
2657
+ }), Promise.resolve()), e;
2654
2658
  }
2655
- function Do(e, t, a) {
2656
- const o = t.style;
2659
+ function Oo(t, e, a) {
2660
+ const o = e.style;
2657
2661
  if (!o)
2658
2662
  return;
2659
- const s = window.getComputedStyle(e);
2660
- s.cssText ? (o.cssText = s.cssText, o.transformOrigin = s.transformOrigin) : xt(a).forEach((i) => {
2661
- let r = s.getPropertyValue(i);
2662
- 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));
2663
+ const i = window.getComputedStyle(t);
2664
+ i.cssText ? (o.cssText = i.cssText, o.transformOrigin = i.transformOrigin) : Ue(a).forEach((s) => {
2665
+ let n = i.getPropertyValue(s);
2666
+ s === "font-size" && n.endsWith("px") && (n = `${Math.floor(parseFloat(n.substring(0, n.length - 2))) - 0.1}px`), L(t, HTMLIFrameElement) && s === "display" && n === "inline" && (n = "block"), s === "d" && e.getAttribute("d") && (n = `path(${e.getAttribute("d")})`), o.setProperty(s, n, i.getPropertyPriority(s));
2663
2667
  });
2664
2668
  }
2665
- function Oo(e, t) {
2666
- L(e, HTMLTextAreaElement) && (t.innerHTML = e.value), L(e, HTMLInputElement) && t.setAttribute("value", e.value);
2669
+ function Io(t, e) {
2670
+ L(t, HTMLTextAreaElement) && (e.innerHTML = t.value), L(t, HTMLInputElement) && e.setAttribute("value", t.value);
2667
2671
  }
2668
- function Mo(e, t) {
2669
- if (L(e, HTMLSelectElement)) {
2670
- const o = Array.from(t.children).find((s) => e.value === s.getAttribute("value"));
2672
+ function Vo(t, e) {
2673
+ if (L(t, HTMLSelectElement)) {
2674
+ const o = Array.from(e.children).find((i) => t.value === i.getAttribute("value"));
2671
2675
  o && o.setAttribute("selected", "");
2672
2676
  }
2673
2677
  }
2674
- function Io(e, t, a) {
2675
- return L(t, Element) && (Do(e, t, a), Ao(e, t, a), Oo(e, t), Mo(e, t)), t;
2678
+ function $o(t, e, a) {
2679
+ return L(e, Element) && (Oo(t, e, a), zo(t, e, a), Io(t, e), Vo(t, e)), e;
2676
2680
  }
2677
- async function Vo(e, t) {
2678
- const a = e.querySelectorAll ? e.querySelectorAll("use") : [];
2681
+ async function Bo(t, e) {
2682
+ const a = t.querySelectorAll ? t.querySelectorAll("use") : [];
2679
2683
  if (a.length === 0)
2680
- return e;
2684
+ return t;
2681
2685
  const o = {};
2682
- for (let i = 0; i < a.length; i++) {
2683
- const l = a[i].getAttribute("xlink:href");
2686
+ for (let s = 0; s < a.length; s++) {
2687
+ const l = a[s].getAttribute("xlink:href");
2684
2688
  if (l) {
2685
- const u = e.querySelector(l), c = document.querySelector(l);
2686
- !u && c && !o[l] && (o[l] = await xe(c, t, !0));
2689
+ const u = t.querySelector(l), d = document.querySelector(l);
2690
+ !u && d && !o[l] && (o[l] = await Ut(d, e, !0));
2687
2691
  }
2688
2692
  }
2689
- const s = Object.values(o);
2690
- if (s.length) {
2691
- const i = "http://www.w3.org/1999/xhtml", r = document.createElementNS(i, "svg");
2692
- r.setAttribute("xmlns", i), r.style.position = "absolute", r.style.width = "0", r.style.height = "0", r.style.overflow = "hidden", r.style.display = "none";
2693
- const l = document.createElementNS(i, "defs");
2694
- r.appendChild(l);
2695
- for (let u = 0; u < s.length; u++)
2696
- l.appendChild(s[u]);
2697
- e.appendChild(r);
2693
+ const i = Object.values(o);
2694
+ if (i.length) {
2695
+ const s = "http://www.w3.org/1999/xhtml", n = document.createElementNS(s, "svg");
2696
+ n.setAttribute("xmlns", s), n.style.position = "absolute", n.style.width = "0", n.style.height = "0", n.style.overflow = "hidden", n.style.display = "none";
2697
+ const l = document.createElementNS(s, "defs");
2698
+ n.appendChild(l);
2699
+ for (let u = 0; u < i.length; u++)
2700
+ l.appendChild(i[u]);
2701
+ t.appendChild(n);
2698
2702
  }
2699
- return e;
2703
+ return t;
2700
2704
  }
2701
- async function xe(e, t, a) {
2702
- 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));
2705
+ async function Ut(t, e, a) {
2706
+ return !a && e.filter && !e.filter(t) ? null : Promise.resolve(t).then((o) => Fo(o, e)).then((o) => Do(t, o, e)).then((o) => $o(t, o, e)).then((o) => Bo(o, e));
2703
2707
  }
2704
- const Ft = /url\((['"]?)([^'"]+?)\1\)/g, $o = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Bo = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
2705
- function No(e) {
2706
- const t = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
2707
- return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
2708
+ const De = /url\((['"]?)([^'"]+?)\1\)/g, No = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Ko = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
2709
+ function Ho(t) {
2710
+ const e = t.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
2711
+ return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`, "g");
2708
2712
  }
2709
- function Ko(e) {
2710
- const t = [];
2711
- return e.replace(Ft, (a, o, s) => (t.push(s), a)), t.filter((a) => !Be(a));
2713
+ function Go(t) {
2714
+ const e = [];
2715
+ return t.replace(De, (a, o, i) => (e.push(i), a)), e.filter((a) => !Nt(a));
2712
2716
  }
2713
- async function Ho(e, t, a, o, s) {
2717
+ async function qo(t, e, a, o, i) {
2714
2718
  try {
2715
- const i = a ? po(t, a) : t, r = _e(t);
2719
+ const s = a ? mo(e, a) : e, n = Wt(e);
2716
2720
  let l;
2717
- return s || (l = await We(i, r, o)), e.replace(No(t), `$1${l}$3`);
2721
+ return i || (l = await Zt(s, n, o)), t.replace(Ho(e), `$1${l}$3`);
2718
2722
  } catch {
2719
2723
  }
2720
- return e;
2724
+ return t;
2721
2725
  }
2722
- function Go(e, { preferredFontFormat: t }) {
2723
- return t ? e.replace(Bo, (a) => {
2726
+ function _o(t, { preferredFontFormat: e }) {
2727
+ return e ? t.replace(Ko, (a) => {
2724
2728
  for (; ; ) {
2725
- const [o, , s] = $o.exec(a) || [];
2726
- if (!s)
2729
+ const [o, , i] = No.exec(a) || [];
2730
+ if (!i)
2727
2731
  return "";
2728
- if (s === t)
2732
+ if (i === e)
2729
2733
  return `src: ${o};`;
2730
2734
  }
2731
- }) : e;
2735
+ }) : t;
2732
2736
  }
2733
- function Dt(e) {
2734
- return e.search(Ft) !== -1;
2737
+ function Oe(t) {
2738
+ return t.search(De) !== -1;
2735
2739
  }
2736
- async function Ot(e, t, a) {
2737
- if (!Dt(e))
2738
- return e;
2739
- const o = Go(e, a);
2740
- return Ko(o).reduce((i, r) => i.then((l) => Ho(l, r, t, a)), Promise.resolve(o));
2740
+ async function Ie(t, e, a) {
2741
+ if (!Oe(t))
2742
+ return t;
2743
+ const o = _o(t, a);
2744
+ return Go(o).reduce((s, n) => s.then((l) => qo(l, n, e, a)), Promise.resolve(o));
2741
2745
  }
2742
- async function oe(e, t, a) {
2746
+ async function it(t, e, a) {
2743
2747
  var o;
2744
- const s = (o = t.style) === null || o === void 0 ? void 0 : o.getPropertyValue(e);
2745
- if (s) {
2746
- const i = await Ot(s, null, a);
2747
- return t.style.setProperty(e, i, t.style.getPropertyPriority(e)), !0;
2748
+ const i = (o = e.style) === null || o === void 0 ? void 0 : o.getPropertyValue(t);
2749
+ if (i) {
2750
+ const s = await Ie(i, null, a);
2751
+ return e.style.setProperty(t, s, e.style.getPropertyPriority(t)), !0;
2748
2752
  }
2749
2753
  return !1;
2750
2754
  }
2751
- async function qo(e, t) {
2752
- await oe("background", e, t) || await oe("background-image", e, t), await oe("mask", e, t) || await oe("-webkit-mask", e, t) || await oe("mask-image", e, t) || await oe("-webkit-mask-image", e, t);
2755
+ async function Wo(t, e) {
2756
+ await it("background", t, e) || await it("background-image", t, e), await it("mask", t, e) || await it("-webkit-mask", t, e) || await it("mask-image", t, e) || await it("-webkit-mask-image", t, e);
2753
2757
  }
2754
- async function _o(e, t) {
2755
- const a = L(e, HTMLImageElement);
2756
- if (!(a && !Be(e.src)) && !(L(e, SVGImageElement) && !Be(e.href.baseVal)))
2758
+ async function Zo(t, e) {
2759
+ const a = L(t, HTMLImageElement);
2760
+ if (!(a && !Nt(t.src)) && !(L(t, SVGImageElement) && !Nt(t.href.baseVal)))
2757
2761
  return;
2758
- const o = a ? e.src : e.href.baseVal, s = await We(o, _e(o), t);
2759
- await new Promise((i, r) => {
2760
- e.onload = i, e.onerror = t.onImageErrorHandler ? (...u) => {
2762
+ const o = a ? t.src : t.href.baseVal, i = await Zt(o, Wt(o), e);
2763
+ await new Promise((s, n) => {
2764
+ t.onload = s, t.onerror = e.onImageErrorHandler ? (...u) => {
2761
2765
  try {
2762
- i(t.onImageErrorHandler(...u));
2763
- } catch (c) {
2764
- r(c);
2766
+ s(e.onImageErrorHandler(...u));
2767
+ } catch (d) {
2768
+ n(d);
2765
2769
  }
2766
- } : r;
2767
- const l = e;
2768
- l.decode && (l.decode = i), l.loading === "lazy" && (l.loading = "eager"), a ? (e.srcset = "", e.src = s) : e.href.baseVal = s;
2770
+ } : n;
2771
+ const l = t;
2772
+ l.decode && (l.decode = s), l.loading === "lazy" && (l.loading = "eager"), a ? (t.srcset = "", t.src = i) : t.href.baseVal = i;
2769
2773
  });
2770
2774
  }
2771
- async function Wo(e, t) {
2772
- const o = J(e.childNodes).map((s) => Mt(s, t));
2773
- await Promise.all(o).then(() => e);
2774
- }
2775
- async function Mt(e, t) {
2776
- L(e, Element) && (await qo(e, t), await _o(e, t), await Wo(e, t));
2777
- }
2778
- function Zo(e, t) {
2779
- const { style: a } = e;
2780
- t.backgroundColor && (a.backgroundColor = t.backgroundColor), t.width && (a.width = `${t.width}px`), t.height && (a.height = `${t.height}px`);
2781
- const o = t.style;
2782
- return o != null && Object.keys(o).forEach((s) => {
2783
- a[s] = o[s];
2784
- }), e;
2785
- }
2786
- const nt = {};
2787
- async function lt(e) {
2788
- let t = nt[e];
2789
- if (t != null)
2790
- return t;
2791
- const o = await (await fetch(e)).text();
2792
- return t = { url: e, cssText: o }, nt[e] = t, t;
2793
- }
2794
- async function ut(e, t) {
2795
- let a = e.cssText;
2796
- const o = /url\(["']?([^"')]+)["']?\)/g, i = (a.match(/url\([^)]+\)/g) || []).map(async (r) => {
2797
- let l = r.replace(o, "$1");
2798
- return l.startsWith("https://") || (l = new URL(l, e.url).href), Ut(l, t.fetchRequestInit, ({ result: u }) => (a = a.replace(r, `url(${u})`), [r, u]));
2775
+ async function Jo(t, e) {
2776
+ const o = Y(t.childNodes).map((i) => Ve(i, e));
2777
+ await Promise.all(o).then(() => t);
2778
+ }
2779
+ async function Ve(t, e) {
2780
+ L(t, Element) && (await Wo(t, e), await Zo(t, e), await Jo(t, e));
2781
+ }
2782
+ function Yo(t, e) {
2783
+ const { style: a } = t;
2784
+ e.backgroundColor && (a.backgroundColor = e.backgroundColor), e.width && (a.width = `${e.width}px`), e.height && (a.height = `${e.height}px`);
2785
+ const o = e.style;
2786
+ return o != null && Object.keys(o).forEach((i) => {
2787
+ a[i] = o[i];
2788
+ }), t;
2789
+ }
2790
+ const ue = {};
2791
+ async function ce(t) {
2792
+ let e = ue[t];
2793
+ if (e != null)
2794
+ return e;
2795
+ const o = await (await fetch(t)).text();
2796
+ return e = { url: t, cssText: o }, ue[t] = e, e;
2797
+ }
2798
+ async function de(t, e) {
2799
+ let a = t.cssText;
2800
+ const o = /url\(["']?([^"')]+)["']?\)/g, s = (a.match(/url\([^)]+\)/g) || []).map(async (n) => {
2801
+ let l = n.replace(o, "$1");
2802
+ return l.startsWith("https://") || (l = new URL(l, t.url).href), Fe(l, e.fetchRequestInit, ({ result: u }) => (a = a.replace(n, `url(${u})`), [n, u]));
2799
2803
  });
2800
- return Promise.all(i).then(() => a);
2804
+ return Promise.all(s).then(() => a);
2801
2805
  }
2802
- function ct(e) {
2803
- if (e == null)
2806
+ function pe(t) {
2807
+ if (t == null)
2804
2808
  return [];
2805
- const t = [], a = /(\/\*[\s\S]*?\*\/)/gi;
2806
- let o = e.replace(a, "");
2807
- const s = new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
2809
+ const e = [], a = /(\/\*[\s\S]*?\*\/)/gi;
2810
+ let o = t.replace(a, "");
2811
+ const i = new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
2808
2812
  for (; ; ) {
2809
- const u = s.exec(o);
2813
+ const u = i.exec(o);
2810
2814
  if (u === null)
2811
2815
  break;
2812
- t.push(u[0]);
2816
+ e.push(u[0]);
2813
2817
  }
2814
- o = o.replace(s, "");
2815
- 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");
2818
+ o = o.replace(i, "");
2819
+ const s = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, n = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", l = new RegExp(n, "gi");
2816
2820
  for (; ; ) {
2817
- let u = i.exec(o);
2821
+ let u = s.exec(o);
2818
2822
  if (u === null) {
2819
2823
  if (u = l.exec(o), u === null)
2820
2824
  break;
2821
- i.lastIndex = l.lastIndex;
2825
+ s.lastIndex = l.lastIndex;
2822
2826
  } else
2823
- l.lastIndex = i.lastIndex;
2824
- t.push(u[0]);
2827
+ l.lastIndex = s.lastIndex;
2828
+ e.push(u[0]);
2825
2829
  }
2826
- return t;
2830
+ return e;
2827
2831
  }
2828
- async function Jo(e, t) {
2832
+ async function Xo(t, e) {
2829
2833
  const a = [], o = [];
2830
- return e.forEach((s) => {
2831
- if ("cssRules" in s)
2834
+ return t.forEach((i) => {
2835
+ if ("cssRules" in i)
2832
2836
  try {
2833
- J(s.cssRules || []).forEach((i, r) => {
2834
- if (i.type === CSSRule.IMPORT_RULE) {
2835
- let l = r + 1;
2836
- const u = i.href, c = lt(u).then((g) => ut(g, t)).then((g) => ct(g).forEach((v) => {
2837
+ Y(i.cssRules || []).forEach((s, n) => {
2838
+ if (s.type === CSSRule.IMPORT_RULE) {
2839
+ let l = n + 1;
2840
+ const u = s.href, d = ce(u).then((g) => de(g, e)).then((g) => pe(g).forEach((k) => {
2837
2841
  try {
2838
- s.insertRule(v, v.startsWith("@import") ? l += 1 : s.cssRules.length);
2839
- } catch (k) {
2842
+ i.insertRule(k, k.startsWith("@import") ? l += 1 : i.cssRules.length);
2843
+ } catch (v) {
2840
2844
  console.error("Error inserting rule from remote css", {
2841
- rule: v,
2842
- error: k
2845
+ rule: k,
2846
+ error: v
2843
2847
  });
2844
2848
  }
2845
2849
  })).catch((g) => {
2846
2850
  console.error("Error loading remote css", g.toString());
2847
2851
  });
2848
- o.push(c);
2852
+ o.push(d);
2849
2853
  }
2850
2854
  });
2851
- } catch (i) {
2852
- const r = e.find((l) => l.href == null) || document.styleSheets[0];
2853
- s.href != null && o.push(lt(s.href).then((l) => ut(l, t)).then((l) => ct(l).forEach((u) => {
2854
- r.insertRule(u, r.cssRules.length);
2855
+ } catch (s) {
2856
+ const n = t.find((l) => l.href == null) || document.styleSheets[0];
2857
+ i.href != null && o.push(ce(i.href).then((l) => de(l, e)).then((l) => pe(l).forEach((u) => {
2858
+ n.insertRule(u, n.cssRules.length);
2855
2859
  })).catch((l) => {
2856
2860
  console.error("Error loading remote stylesheet", l);
2857
- })), console.error("Error inlining remote css file", i);
2861
+ })), console.error("Error inlining remote css file", s);
2858
2862
  }
2859
- }), Promise.all(o).then(() => (e.forEach((s) => {
2860
- if ("cssRules" in s)
2863
+ }), Promise.all(o).then(() => (t.forEach((i) => {
2864
+ if ("cssRules" in i)
2861
2865
  try {
2862
- J(s.cssRules || []).forEach((i) => {
2863
- a.push(i);
2866
+ Y(i.cssRules || []).forEach((s) => {
2867
+ a.push(s);
2864
2868
  });
2865
- } catch (i) {
2866
- console.error(`Error while reading CSS rules from ${s.href}`, i);
2869
+ } catch (s) {
2870
+ console.error(`Error while reading CSS rules from ${i.href}`, s);
2867
2871
  }
2868
2872
  }), a));
2869
2873
  }
2870
- function Yo(e) {
2871
- return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => Dt(t.style.getPropertyValue("src")));
2874
+ function Qo(t) {
2875
+ return t.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => Oe(e.style.getPropertyValue("src")));
2872
2876
  }
2873
- async function Xo(e, t) {
2874
- if (e.ownerDocument == null)
2877
+ async function ti(t, e) {
2878
+ if (t.ownerDocument == null)
2875
2879
  throw new Error("Provided element is not within a Document");
2876
- const a = J(e.ownerDocument.styleSheets), o = await Jo(a, t);
2877
- return Yo(o);
2880
+ const a = Y(t.ownerDocument.styleSheets), o = await Xo(a, e);
2881
+ return Qo(o);
2878
2882
  }
2879
- function It(e) {
2880
- return e.trim().replace(/["']/g, "");
2883
+ function $e(t) {
2884
+ return t.trim().replace(/["']/g, "");
2881
2885
  }
2882
- function Qo(e) {
2883
- const t = /* @__PURE__ */ new Set();
2886
+ function ei(t) {
2887
+ const e = /* @__PURE__ */ new Set();
2884
2888
  function a(o) {
2885
- (o.style.fontFamily || getComputedStyle(o).fontFamily).split(",").forEach((i) => {
2886
- t.add(It(i));
2887
- }), Array.from(o.children).forEach((i) => {
2888
- i instanceof HTMLElement && a(i);
2889
+ (o.style.fontFamily || getComputedStyle(o).fontFamily).split(",").forEach((s) => {
2890
+ e.add($e(s));
2891
+ }), Array.from(o.children).forEach((s) => {
2892
+ s instanceof HTMLElement && a(s);
2889
2893
  });
2890
2894
  }
2891
- return a(e), t;
2895
+ return a(t), e;
2892
2896
  }
2893
- async function ei(e, t) {
2894
- const a = await Xo(e, t), o = Qo(e);
2895
- return (await Promise.all(a.filter((i) => o.has(It(i.style.fontFamily))).map((i) => {
2896
- const r = i.parentStyleSheet ? i.parentStyleSheet.href : null;
2897
- return Ot(i.cssText, r, t);
2897
+ async function ai(t, e) {
2898
+ const a = await ti(t, e), o = ei(t);
2899
+ return (await Promise.all(a.filter((s) => o.has($e(s.style.fontFamily))).map((s) => {
2900
+ const n = s.parentStyleSheet ? s.parentStyleSheet.href : null;
2901
+ return Ie(s.cssText, n, e);
2898
2902
  }))).join(`
2899
2903
  `);
2900
2904
  }
2901
- async function ti(e, t) {
2902
- const a = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await ei(e, t);
2905
+ async function oi(t, e) {
2906
+ const a = e.fontEmbedCSS != null ? e.fontEmbedCSS : e.skipFonts ? null : await ai(t, e);
2903
2907
  if (a) {
2904
- const o = document.createElement("style"), s = document.createTextNode(a);
2905
- o.appendChild(s), e.firstChild ? e.insertBefore(o, e.firstChild) : e.appendChild(o);
2908
+ const o = document.createElement("style"), i = document.createTextNode(a);
2909
+ o.appendChild(i), t.firstChild ? t.insertBefore(o, t.firstChild) : t.appendChild(o);
2906
2910
  }
2907
2911
  }
2908
- async function ai(e, t = {}) {
2909
- const { width: a, height: o } = Lt(e, t), s = await xe(e, t, !0);
2910
- return await ti(s, t), await Mt(s, t), Zo(s, t), await ko(s, a, o);
2912
+ async function ii(t, e = {}) {
2913
+ const { width: a, height: o } = Te(t, e), i = await Ut(t, e, !0);
2914
+ return await oi(i, e), await Ve(i, e), Yo(i, e), await wo(i, a, o);
2911
2915
  }
2912
- async function oi(e, t = {}) {
2913
- const { width: a, height: o } = Lt(e, t), s = await ai(e, t), i = await Se(s), r = document.createElement("canvas"), l = r.getContext("2d"), u = t.pixelRatio || fo(), c = t.canvasWidth || a, g = t.canvasHeight || o;
2914
- return r.width = c * u, r.height = g * u, t.skipAutoScale || yo(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;
2916
+ async function si(t, e = {}) {
2917
+ const { width: a, height: o } = Te(t, e), i = await ii(t, e), s = await zt(i), n = document.createElement("canvas"), l = n.getContext("2d"), u = e.pixelRatio || vo(), d = e.canvasWidth || a, g = e.canvasHeight || o;
2918
+ return n.width = d * u, n.height = g * u, e.skipAutoScale || ko(n), n.style.width = `${d}`, n.style.height = `${g}`, e.backgroundColor && (l.fillStyle = e.backgroundColor, l.fillRect(0, 0, n.width, n.height)), l.drawImage(s, 0, 0, n.width, n.height), n;
2915
2919
  }
2916
- async function dt(e, t = {}) {
2917
- return (await oi(e, t)).toDataURL();
2920
+ async function ge(t, e = {}) {
2921
+ return (await si(t, e)).toDataURL();
2918
2922
  }
2919
- const Ae = "data-nf-capture-chrome", ii = "data-nf-canvas-snap", si = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
2920
- function Vt(e) {
2921
- return e instanceof Element && (e.hasAttribute(Ae) || e.hasAttribute("data-nf-mask-cover") || e.id === "notefully");
2923
+ const Et = "data-nf-capture-chrome", ri = "data-nf-canvas-snap", ni = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
2924
+ function Be(t) {
2925
+ return t instanceof Element && (t.hasAttribute(Et) || t.hasAttribute("data-nf-mask-cover") || t.id === "notefully");
2922
2926
  }
2923
- function ri() {
2924
- const e = [];
2925
- return Array.from(document.styleSheets).forEach((t) => {
2927
+ function li() {
2928
+ const t = [];
2929
+ return Array.from(document.styleSheets).forEach((e) => {
2926
2930
  try {
2927
- t.cssRules;
2931
+ e.cssRules;
2928
2932
  } catch {
2929
2933
  try {
2930
- if (t.disabled)
2934
+ if (e.disabled)
2931
2935
  return;
2932
- t.disabled = !0, e.push(t);
2936
+ e.disabled = !0, t.push(e);
2933
2937
  } catch {
2934
- const a = t.ownerNode;
2935
- a && "disabled" in a && !a.disabled && (a.disabled = !0, e.push({ node: a }));
2938
+ const a = e.ownerNode;
2939
+ a && "disabled" in a && !a.disabled && (a.disabled = !0, t.push({ node: a }));
2936
2940
  }
2937
2941
  }
2938
2942
  }), () => {
2939
- e.forEach((t) => {
2943
+ t.forEach((e) => {
2940
2944
  try {
2941
- t && t.node ? t.node.disabled = !1 : t && (t.disabled = !1);
2945
+ e && e.node ? e.node.disabled = !1 : e && (e.disabled = !1);
2942
2946
  } catch {
2943
2947
  }
2944
2948
  });
2945
2949
  };
2946
2950
  }
2947
- function ni() {
2948
- const e = [];
2951
+ function ui() {
2952
+ const t = [];
2949
2953
  return document.querySelectorAll('input[type="password"], [data-notefully-mask]').forEach((a) => {
2950
- const o = a.getBoundingClientRect(), s = document.createElement("div");
2951
- s.setAttribute("data-nf-mask-cover", "1"), s.style.cssText = [
2954
+ const o = a.getBoundingClientRect(), i = document.createElement("div");
2955
+ i.setAttribute("data-nf-mask-cover", "1"), i.style.cssText = [
2952
2956
  "position:fixed",
2953
2957
  `left:${o.left}px`,
2954
2958
  `top:${o.top}px`,
@@ -2957,50 +2961,50 @@ function ni() {
2957
2961
  "background:#111",
2958
2962
  "z-index:2147483646",
2959
2963
  "pointer-events:none"
2960
- ].join(";"), document.body.appendChild(s), e.push(s);
2961
- }), () => e.forEach((a) => a.remove());
2964
+ ].join(";"), document.body.appendChild(i), t.push(i);
2965
+ }), () => t.forEach((a) => a.remove());
2962
2966
  }
2963
- function li() {
2964
- const e = document.querySelector(`[${Ae}]`);
2965
- if (e)
2966
- return e;
2967
- const t = document.createElement("div");
2968
- return t.setAttribute(Ae, "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;
2967
+ function ci() {
2968
+ const t = document.querySelector(`[${Et}]`);
2969
+ if (t)
2970
+ return t;
2971
+ const e = document.createElement("div");
2972
+ return e.setAttribute(Et, "1"), e.className = "nf-capture-chrome", e.setAttribute("role", "status"), e.setAttribute("aria-live", "polite"), e.innerHTML = `<span class="nf-capture-chrome-pill">${p("status.capturing")}</span>`, document.body.appendChild(e), e;
2969
2973
  }
2970
- function ui() {
2971
- document.querySelectorAll(`[${Ae}]`).forEach((e) => e.remove());
2974
+ function di() {
2975
+ document.querySelectorAll(`[${Et}]`).forEach((t) => t.remove());
2972
2976
  }
2973
- function Ne() {
2974
- return new Promise((e) => {
2975
- requestAnimationFrame(() => requestAnimationFrame(e));
2977
+ function Kt() {
2978
+ return new Promise((t) => {
2979
+ requestAnimationFrame(() => requestAnimationFrame(t));
2976
2980
  });
2977
2981
  }
2978
- function Y(e) {
2979
- if (typeof e != "string" || !e.startsWith("data:image/"))
2982
+ function X(t) {
2983
+ if (typeof t != "string" || !t.startsWith("data:image/"))
2980
2984
  return !1;
2981
- const t = e.indexOf(",");
2982
- return t > 0 && t < e.length - 1;
2985
+ const e = t.indexOf(",");
2986
+ return e > 0 && e < t.length - 1;
2983
2987
  }
2984
- function ci() {
2985
- const e = document.documentElement, t = document.body, a = Math.max(
2988
+ function pi() {
2989
+ const t = document.documentElement, e = document.body, a = Math.max(
2986
2990
  window.innerWidth || 0,
2987
- (e == null ? void 0 : e.clientWidth) || 0,
2988
- (e == null ? void 0 : e.scrollWidth) || 0,
2991
+ (t == null ? void 0 : t.clientWidth) || 0,
2989
2992
  (t == null ? void 0 : t.scrollWidth) || 0,
2993
+ (e == null ? void 0 : e.scrollWidth) || 0,
2990
2994
  1
2991
2995
  ), o = Math.max(
2992
2996
  window.innerHeight || 0,
2993
- (e == null ? void 0 : e.clientHeight) || 0,
2994
- (e == null ? void 0 : e.scrollHeight) || 0,
2997
+ (t == null ? void 0 : t.clientHeight) || 0,
2995
2998
  (t == null ? void 0 : t.scrollHeight) || 0,
2999
+ (e == null ? void 0 : e.scrollHeight) || 0,
2996
3000
  1
2997
3001
  );
2998
3002
  return { width: a, height: o };
2999
3003
  }
3000
- async function di() {
3001
- const e = [], t = Array.from(document.querySelectorAll("canvas"));
3002
- for (const a of t) {
3003
- if (a.closest("#notefully") || Vt(a))
3004
+ async function gi() {
3005
+ const t = [], e = Array.from(document.querySelectorAll("canvas"));
3006
+ for (const a of e) {
3007
+ if (a.closest("#notefully") || Be(a))
3004
3008
  continue;
3005
3009
  let o = "";
3006
3010
  try {
@@ -3010,16 +3014,16 @@ async function di() {
3010
3014
  }
3011
3015
  if (!o || o === "data:,")
3012
3016
  continue;
3013
- const s = document.createElement("img"), i = getComputedStyle(a);
3014
- 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 });
3017
+ const i = document.createElement("img"), s = getComputedStyle(a);
3018
+ i.setAttribute(ri, "1"), i.alt = "", i.src = o, i.className = a.className, i.style.cssText = a.style.cssText, i.style.width = s.width, i.style.height = s.height, i.style.maxWidth = s.maxWidth, i.style.maxHeight = s.maxHeight, i.style.objectFit = "fill", i.style.display = s.display === "inline" ? "inline-block" : s.display, a.replaceWith(i), t.push({ canvas: a, img: i });
3015
3019
  }
3016
- return await Promise.all(e.map(({ img: a }) => {
3020
+ return await Promise.all(t.map(({ img: a }) => {
3017
3021
  if (!a.complete)
3018
3022
  return new Promise((o) => {
3019
3023
  a.onload = () => o(), a.onerror = () => o();
3020
3024
  });
3021
3025
  })), () => {
3022
- e.forEach(({ canvas: a, img: o }) => {
3026
+ t.forEach(({ canvas: a, img: o }) => {
3023
3027
  try {
3024
3028
  o.parentNode && o.replaceWith(a);
3025
3029
  } catch {
@@ -3027,38 +3031,38 @@ async function di() {
3027
3031
  });
3028
3032
  };
3029
3033
  }
3030
- async function pi(e) {
3031
- if (!e)
3034
+ async function mi(t) {
3035
+ if (!t)
3032
3036
  return null;
3033
- if (typeof e == "string")
3034
- return Y(e) ? e : null;
3035
- if (typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement)
3037
+ if (typeof t == "string")
3038
+ return X(t) ? t : null;
3039
+ if (typeof HTMLCanvasElement < "u" && t instanceof HTMLCanvasElement)
3036
3040
  try {
3037
- const t = e.toDataURL("image/png");
3038
- return Y(t) ? t : null;
3041
+ const e = t.toDataURL("image/png");
3042
+ return X(e) ? e : null;
3039
3043
  } catch {
3040
3044
  return null;
3041
3045
  }
3042
- if (typeof Blob < "u" && e instanceof Blob) {
3043
- const t = await gi(e);
3044
- return Y(t) ? t : null;
3046
+ if (typeof Blob < "u" && t instanceof Blob) {
3047
+ const e = await hi(t);
3048
+ return X(e) ? e : null;
3045
3049
  }
3046
3050
  return null;
3047
3051
  }
3048
- async function gi(e) {
3052
+ async function hi(t) {
3049
3053
  if (typeof FileReader == "function")
3050
- return new Promise((o, s) => {
3051
- const i = new FileReader();
3052
- i.onload = () => o(String(i.result || "")), i.onerror = () => s(i.error || new Error("Could not read capture blob")), i.readAsDataURL(e);
3054
+ return new Promise((o, i) => {
3055
+ const s = new FileReader();
3056
+ s.onload = () => o(String(s.result || "")), s.onerror = () => i(s.error || new Error("Could not read capture blob")), s.readAsDataURL(t);
3053
3057
  });
3054
- const t = Buffer.from(await e.arrayBuffer());
3055
- return `data:${e.type || "application/octet-stream"};base64,${t.toString("base64")}`;
3058
+ const e = Buffer.from(await t.arrayBuffer());
3059
+ return `data:${t.type || "application/octet-stream"};base64,${e.toString("base64")}`;
3056
3060
  }
3057
- async function mi() {
3058
- var t;
3059
- if (!((t = navigator.mediaDevices) != null && t.getDisplayMedia))
3061
+ async function fi() {
3062
+ var e;
3063
+ if (!((e = navigator.mediaDevices) != null && e.getDisplayMedia))
3060
3064
  throw new Error(p("status.screenUnsupported"));
3061
- const e = await navigator.mediaDevices.getDisplayMedia({
3065
+ const t = await navigator.mediaDevices.getDisplayMedia({
3062
3066
  video: { displaySurface: "browser" },
3063
3067
  audio: !1,
3064
3068
  preferCurrentTab: !0,
@@ -3066,76 +3070,76 @@ async function mi() {
3066
3070
  });
3067
3071
  try {
3068
3072
  const a = document.createElement("video");
3069
- a.muted = !0, a.playsInline = !0, a.srcObject = e, await a.play(), a.videoWidth || await new Promise((l) => {
3073
+ a.muted = !0, a.playsInline = !0, a.srcObject = t, await a.play(), a.videoWidth || await new Promise((l) => {
3070
3074
  a.onloadedmetadata = () => l();
3071
- }), await Ne();
3072
- const o = a.videoWidth || 1, s = a.videoHeight || 1, i = document.createElement("canvas");
3073
- i.width = o, i.height = s, i.getContext("2d").drawImage(a, 0, 0, o, s);
3074
- const r = i.toDataURL("image/png");
3075
- if (!Y(r))
3075
+ }), await Kt();
3076
+ const o = a.videoWidth || 1, i = a.videoHeight || 1, s = document.createElement("canvas");
3077
+ s.width = o, s.height = i, s.getContext("2d").drawImage(a, 0, 0, o, i);
3078
+ const n = s.toDataURL("image/png");
3079
+ if (!X(n))
3076
3080
  throw new Error(p("status.screenEmpty"));
3077
- return r;
3081
+ return n;
3078
3082
  } finally {
3079
- e.getTracks().forEach((a) => a.stop());
3083
+ t.getTracks().forEach((a) => a.stop());
3080
3084
  }
3081
3085
  }
3082
- async function $t(e = {}) {
3083
- const t = document.getElementById("notefully"), a = t ? t.style.display : "", o = li(), s = ri();
3084
- let i = () => {
3086
+ async function Ne(t = {}) {
3087
+ const e = document.getElementById("notefully"), a = e ? e.style.display : "", o = ci(), i = li();
3088
+ let s = () => {
3085
3089
  };
3086
- t && (t.style.display = "none");
3087
- const r = ni();
3090
+ e && (e.style.display = "none");
3091
+ const n = ui();
3088
3092
  try {
3089
- if (typeof e.onBeforeCapture == "function" && await e.onBeforeCapture(), await Ne(), typeof e.capture == "function") {
3090
- const v = await pi(await e.capture());
3091
- if (v)
3092
- return v;
3093
+ if (typeof t.onBeforeCapture == "function" && await t.onBeforeCapture(), await Kt(), typeof t.capture == "function") {
3094
+ const k = await mi(await t.capture());
3095
+ if (k)
3096
+ return k;
3093
3097
  }
3094
- i = await di(), await Ne();
3095
- const { width: l, height: u } = ci(), c = {
3098
+ s = await gi(), await Kt();
3099
+ const { width: l, height: u } = pi(), d = {
3096
3100
  cacheBust: !0,
3097
3101
  width: l,
3098
3102
  height: u,
3099
3103
  pixelRatio: Math.min(window.devicePixelRatio || 1, 2),
3100
- filter: (v) => !Vt(v),
3104
+ filter: (k) => !Be(k),
3101
3105
  // 404 / CORS images must not abort the whole capture.
3102
- imagePlaceholder: si,
3106
+ imagePlaceholder: ni,
3103
3107
  onImageErrorHandler: () => {
3104
3108
  }
3105
3109
  };
3106
3110
  let g = "";
3107
3111
  try {
3108
- g = await dt(document.body, c);
3112
+ g = await ge(document.body, d);
3109
3113
  } catch {
3110
- g = await dt(document.body, { ...c, skipFonts: !0 });
3114
+ g = await ge(document.body, { ...d, skipFonts: !0 });
3111
3115
  }
3112
- if (!Y(g))
3116
+ if (!X(g))
3113
3117
  throw new Error(p("status.captureEmpty"));
3114
3118
  return g;
3115
3119
  } finally {
3116
3120
  try {
3117
- i();
3121
+ s();
3118
3122
  } catch {
3119
3123
  }
3120
- r(), s(), o.remove(), ui(), t && (t.style.display = a);
3124
+ n(), i(), o.remove(), di(), e && (e.style.display = a);
3121
3125
  }
3122
3126
  }
3123
- function hi(e = "") {
3124
- const t = String(e || "");
3125
- 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" : "";
3127
+ function yi(t = "") {
3128
+ const e = String(t || "");
3129
+ return e ? /Windows NT/i.test(e) ? "Windows" : /iPhone|iPad|iPod/i.test(e) ? "iOS" : /Mac OS X|Macintosh/i.test(e) ? "macOS" : /Android/i.test(e) ? "Android" : /CrOS/i.test(e) ? "ChromeOS" : /Linux/i.test(e) ? "Linux" : "Other" : "";
3126
3130
  }
3127
- function fi(e = "") {
3128
- const t = String(e || "");
3129
- 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" : "";
3131
+ function vi(t = "") {
3132
+ const e = String(t || "");
3133
+ return e ? /Edg\//i.test(e) ? "Edge" : /OPR\/|Opera/i.test(e) ? "Opera" : /Firefox\//i.test(e) ? "Firefox" : /Chrome\//i.test(e) || /CriOS\//i.test(e) ? "Chrome" : /Safari\//i.test(e) ? "Safari" : "Other" : "";
3130
3134
  }
3131
- function yi(e = {}) {
3132
- const t = navigator.userAgent;
3135
+ function ki(t = {}) {
3136
+ const e = navigator.userAgent;
3133
3137
  return {
3134
3138
  url: location.href,
3135
3139
  title: document.title,
3136
- userAgent: t,
3137
- os: hi(t),
3138
- browser: fi(t),
3140
+ userAgent: e,
3141
+ os: yi(e),
3142
+ browser: vi(e),
3139
3143
  language: navigator.language,
3140
3144
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
3141
3145
  viewport: {
@@ -3149,17 +3153,17 @@ function yi(e = {}) {
3149
3153
  dpr: window.devicePixelRatio || 1
3150
3154
  },
3151
3155
  user: {
3152
- userId: e.userId || null,
3153
- email: e.email || null,
3154
- displayName: e.displayName || null
3156
+ userId: t.userId || null,
3157
+ email: t.email || null,
3158
+ displayName: t.displayName || null
3155
3159
  }
3156
3160
  };
3157
3161
  }
3158
- const pt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), gt = {
3162
+ const me = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), he = {
3159
3163
  id: "userId",
3160
3164
  username: "displayName",
3161
3165
  name: "displayName"
3162
- }, mt = /* @__PURE__ */ new Set([
3166
+ }, fe = /* @__PURE__ */ new Set([
3163
3167
  "endpoint",
3164
3168
  "projectKey",
3165
3169
  "version",
@@ -3177,7 +3181,7 @@ const pt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), gt = {
3177
3181
  "displayLink",
3178
3182
  "locale",
3179
3183
  "translations"
3180
- ]), ht = {
3184
+ ]), ye = {
3181
3185
  slug: "Use init({ name }) for a per-app report prefix (same idea as package.json name). slug is not a widget option.",
3182
3186
  projectSlug: "Use init({ name }) for a per-app report prefix. projectSlug is not a widget option.",
3183
3187
  project: "Pass projectKey (nfk_…) from Showfully Notefully settings — there is no project option on the widget.",
@@ -3186,217 +3190,220 @@ const pt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), gt = {
3186
3190
  email: "Pass people via Notefully.identify({ userId, email, displayName }), not init().",
3187
3191
  displayName: "Pass people via Notefully.identify({ userId, email, displayName }), not init()."
3188
3192
  };
3189
- function vi(e = {}, t = {}) {
3190
- const a = t.warn || Bt, o = e && typeof e == "object" ? e : {}, s = {}, i = [];
3191
- for (const r of pt)
3192
- Object.prototype.hasOwnProperty.call(o, r) && (s[r] = o[r]);
3193
- for (const [r, l] of Object.entries(gt))
3194
- Object.prototype.hasOwnProperty.call(o, r) && (Object.prototype.hasOwnProperty.call(s, l) || (s[l] = o[r]));
3195
- for (const r of Object.keys(o))
3196
- pt.has(r) || Object.prototype.hasOwnProperty.call(gt, r) || i.push(r);
3197
- if (i.length) {
3198
- const r = i.some((l) => l === "name" || l === "slug" || l === "projectSlug") ? " Pass the package/report name via Notefully.init({ name }), not identify()." : "";
3193
+ function bi(t = {}, e = {}) {
3194
+ const a = e.warn || Ke, o = t && typeof t == "object" ? t : {}, i = {}, s = [];
3195
+ for (const n of me)
3196
+ Object.prototype.hasOwnProperty.call(o, n) && (i[n] = o[n]);
3197
+ for (const [n, l] of Object.entries(he))
3198
+ Object.prototype.hasOwnProperty.call(o, n) && (Object.prototype.hasOwnProperty.call(i, l) || (i[l] = o[n]));
3199
+ for (const n of Object.keys(o))
3200
+ me.has(n) || Object.prototype.hasOwnProperty.call(he, n) || s.push(n);
3201
+ if (s.length) {
3202
+ const n = s.some((l) => l === "name" || l === "slug" || l === "projectSlug") ? " Pass the package/report name via Notefully.init({ name }), not identify()." : "";
3199
3203
  a(
3200
- `Notefully.identify: ignoring unknown key(s): ${i.join(", ")}. Supported: userId, email, displayName (aliases: id → userId; username/name → displayName).` + r
3204
+ `Notefully.identify: ignoring unknown key(s): ${s.join(", ")}. Supported: userId, email, displayName (aliases: id → userId; username/name → displayName).` + n
3201
3205
  );
3202
3206
  }
3203
- return s;
3204
- }
3205
- function ki(e = {}, t = {}) {
3206
- const a = t.warn || Bt, o = e && typeof e == "object" ? e : {}, s = Object.keys(o).filter((i) => !mt.has(i));
3207
- if (s.length)
3208
- for (const i of s) {
3209
- if (ht[i]) {
3210
- a(`Notefully.init: ignoring "${i}". ${ht[i]}`);
3207
+ return i;
3208
+ }
3209
+ function wi(t = {}, e = {}) {
3210
+ const a = e.warn || Ke, o = t && typeof t == "object" ? t : {}, i = Object.keys(o).filter((s) => !fe.has(s));
3211
+ if (i.length)
3212
+ for (const s of i) {
3213
+ if (ye[s]) {
3214
+ a(`Notefully.init: ignoring "${s}". ${ye[s]}`);
3211
3215
  continue;
3212
3216
  }
3213
3217
  a(
3214
- `Notefully.init: ignoring unknown key "${i}". Supported: ${[...mt].join(", ")}.`
3218
+ `Notefully.init: ignoring unknown key "${s}". Supported: ${[...fe].join(", ")}.`
3215
3219
  );
3216
3220
  }
3217
3221
  }
3218
- function Bt(e) {
3219
- typeof console < "u" && typeof console.warn == "function" && console.warn(e);
3222
+ function Ke(t) {
3223
+ typeof console < "u" && typeof console.warn == "function" && console.warn(t);
3220
3224
  }
3221
- const ft = /expression\s*\(|url\s*\(|@import|javascript:|behavior\s*:|-moz-binding|\bbinding\s*:/i, bi = /(?:^|\s)(?=[a-z-]+\s*:\s*[^;]+;)/i;
3222
- function yt(e) {
3223
- if (e instanceof Error)
3224
- return e.stack || e.message || String(e);
3225
- if (typeof e == "string")
3226
- return e;
3225
+ const ve = /expression\s*\(|url\s*\(|@import|javascript:|behavior\s*:|-moz-binding|\bbinding\s*:/i, Si = /(?:^|\s)(?=[a-z-]+\s*:\s*[^;]+;)/i;
3226
+ function ke(t) {
3227
+ if (t instanceof Error)
3228
+ return t.stack || t.message || String(t);
3229
+ if (typeof t == "string")
3230
+ return t;
3227
3231
  try {
3228
- return JSON.stringify(e);
3232
+ return JSON.stringify(t);
3229
3233
  } catch {
3230
- return String(e);
3234
+ return String(t);
3231
3235
  }
3232
3236
  }
3233
- function Ze(e) {
3234
- if (!e || typeof e != "string")
3237
+ function Jt(t) {
3238
+ if (!t || typeof t != "string")
3235
3239
  return "";
3236
- let t = e.replace(/[\u0000-\u001F\u007F]/g, "").trim();
3237
- return t ? (ft.test(t) && (t = t.split(";").map((a) => a.trim()).filter((a) => a && !ft.test(a)).join("; "), t && !t.endsWith(";") && (t += ";")), t.slice(0, 500)) : "";
3240
+ let e = t.replace(/[\u0000-\u001F\u007F]/g, "").trim();
3241
+ return e ? (ve.test(e) && (e = e.split(";").map((a) => a.trim()).filter((a) => a && !ve.test(a)).join("; "), e && !e.endsWith(";") && (e += ";")), e.slice(0, 500)) : "";
3238
3242
  }
3239
- function wi(e = []) {
3240
- if (!e.length)
3243
+ function Ai(t = []) {
3244
+ if (!t.length)
3241
3245
  return { text: "", segments: [{ text: "", style: null }] };
3242
- const t = e[0];
3243
- if (typeof t != "string" || !t.includes("%c")) {
3244
- const r = e.map(yt).join(" ");
3245
- return { text: r, segments: [{ text: r, style: null }] };
3246
+ const e = t[0];
3247
+ if (typeof e != "string" || !e.includes("%c")) {
3248
+ const n = t.map(ke).join(" ");
3249
+ return { text: n, segments: [{ text: n, style: null }] };
3246
3250
  }
3247
- const a = t.split("%c"), o = [];
3248
- let s = 1;
3249
- for (let r = 0; r < a.length; r++) {
3250
- const l = a[r];
3251
- if (r === 0) {
3251
+ const a = e.split("%c"), o = [];
3252
+ let i = 1;
3253
+ for (let n = 0; n < a.length; n++) {
3254
+ const l = a[n];
3255
+ if (n === 0) {
3252
3256
  l && o.push({ text: l, style: null });
3253
3257
  continue;
3254
3258
  }
3255
- const u = s < e.length ? String(e[s++] ?? "") : "", c = Ze(u) || null;
3256
- o.push({ text: l, style: c });
3259
+ const u = i < t.length ? String(t[i++] ?? "") : "", d = Jt(u) || null;
3260
+ o.push({ text: l, style: d });
3257
3261
  }
3258
- if (s < e.length) {
3259
- const r = e.slice(s).map(yt).join(" ");
3260
- r && o.push({
3261
- text: (o.length ? " " : "") + r,
3262
+ if (i < t.length) {
3263
+ const n = t.slice(i).map(ke).join(" ");
3264
+ n && o.push({
3265
+ text: (o.length ? " " : "") + n,
3262
3266
  style: null
3263
3267
  });
3264
3268
  }
3265
3269
  return {
3266
- text: o.map((r) => r.text).join(""),
3270
+ text: o.map((n) => n.text).join(""),
3267
3271
  segments: o.length ? o : [{ text: "", style: null }]
3268
3272
  };
3269
3273
  }
3270
- function Si(e) {
3271
- const t = String(e ?? "");
3272
- if (!t.includes("%c"))
3273
- return [{ text: t, style: null }];
3274
- const a = t.split("%c"), o = a[a.length - 1], s = o.match(bi);
3275
- let i = "";
3276
- if (s) {
3277
- const u = s.index, c = /\s/.test(o[u]) ? u + 1 : u;
3278
- /^[a-z-]+\s*:/i.test(o.slice(c)) && (a[a.length - 1] = o.slice(0, c).replace(/\s+$/, ""), i = o.slice(c).trim());
3274
+ function Ci(t) {
3275
+ const e = String(t ?? "");
3276
+ if (!e.includes("%c"))
3277
+ return [{ text: e, style: null }];
3278
+ const a = e.split("%c"), o = a[a.length - 1], i = o.match(Si);
3279
+ let s = "";
3280
+ if (i) {
3281
+ const u = i.index, d = /\s/.test(o[u]) ? u + 1 : u;
3282
+ /^[a-z-]+\s*:/i.test(o.slice(d)) && (a[a.length - 1] = o.slice(0, d).replace(/\s+$/, ""), s = o.slice(d).trim());
3279
3283
  }
3280
- const r = Ze(i) || null, l = [];
3284
+ const n = Jt(s) || null, l = [];
3281
3285
  for (let u = 0; u < a.length; u++) {
3282
- const c = a[u];
3286
+ const d = a[u];
3283
3287
  if (u === 0) {
3284
- c && l.push({ text: c, style: null });
3288
+ d && l.push({ text: d, style: null });
3285
3289
  continue;
3286
3290
  }
3287
3291
  l.push({
3288
- text: c,
3289
- style: u === 1 ? r : null
3292
+ text: d,
3293
+ style: u === 1 ? n : null
3290
3294
  });
3291
3295
  }
3292
- return l.length ? l : [{ text: t, style: null }];
3296
+ return l.length ? l : [{ text: e, style: null }];
3293
3297
  }
3294
- function Nt(e = {}) {
3295
- return Array.isArray(e.segments) && e.segments.length ? e.segments.map((t) => ({
3296
- text: String((t == null ? void 0 : t.text) ?? ""),
3297
- style: Ze(t == null ? void 0 : t.style) || null
3298
- })) : Si(e.text);
3298
+ function He(t = {}) {
3299
+ return Array.isArray(t.segments) && t.segments.length ? t.segments.map((e) => ({
3300
+ text: String((e == null ? void 0 : e.text) ?? ""),
3301
+ style: Jt(e == null ? void 0 : e.style) || null
3302
+ })) : Ci(t.text);
3299
3303
  }
3300
- function Ai(e = {}) {
3301
- return Nt(e).map((a) => a.text).join("");
3304
+ function zi(t = {}) {
3305
+ return He(t).map((a) => a.text).join("");
3302
3306
  }
3303
- function vt(e) {
3304
- return String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3307
+ function be(t) {
3308
+ return String(t ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3305
3309
  }
3306
- function Ci(e = {}) {
3307
- return Nt(e).map((t) => {
3308
- const a = vt(t.text);
3309
- return t.style ? `<span class="nf-console-styled" style="${vt(t.style)}">${a}</span>` : a;
3310
+ function Ei(t = {}) {
3311
+ return He(t).map((e) => {
3312
+ const a = be(e.text);
3313
+ return e.style ? `<span class="nf-console-styled" style="${be(e.style)}">${a}</span>` : a;
3310
3314
  }).join("");
3311
3315
  }
3312
- const zi = 80;
3313
- function Ei() {
3314
- const e = [], t = {};
3316
+ const Ri = 80;
3317
+ function ji() {
3318
+ const t = [], e = {};
3315
3319
  let a = !1;
3316
- const o = (i, r) => {
3320
+ const o = (s, n) => {
3317
3321
  let l = "", u = null;
3318
3322
  try {
3319
- const g = wi(r);
3323
+ const g = Ai(n);
3320
3324
  l = g.text, u = g.segments;
3321
3325
  } catch {
3322
- l = String(r[0]), u = [{ text: l, style: null }];
3326
+ l = String(n[0]), u = [{ text: l, style: null }];
3323
3327
  }
3324
- const c = {
3325
- level: i,
3328
+ const d = {
3329
+ level: s,
3326
3330
  text: l.slice(0, 2e3),
3327
3331
  at: Date.now()
3328
3332
  };
3329
- u && u.some((g) => g.style) && (c.segments = u.map((g) => ({
3333
+ u && u.some((g) => g.style) && (d.segments = u.map((g) => ({
3330
3334
  text: String(g.text || "").slice(0, 2e3),
3331
3335
  style: g.style || null
3332
- }))), e.push(c), e.length > zi && e.shift();
3336
+ }))), t.push(d), t.length > Ri && t.shift();
3333
3337
  };
3334
3338
  return {
3335
3339
  hook: () => {
3336
- a || typeof window > "u" || (a = !0, ["log", "info", "warn", "error"].forEach((i) => {
3337
- t[i] = console[i].bind(console), console[i] = (...r) => {
3338
- o(i, r), t[i](...r);
3340
+ a || typeof window > "u" || (a = !0, ["log", "info", "warn", "error"].forEach((s) => {
3341
+ e[s] = console[s].bind(console), console[s] = (...n) => {
3342
+ o(s, n), e[s](...n);
3339
3343
  };
3340
- }), window.addEventListener("error", (i) => {
3341
- o("error", [i.message || "window.error"]);
3342
- }), window.addEventListener("unhandledrejection", (i) => {
3343
- o("error", [i.reason || "unhandledrejection"]);
3344
+ }), window.addEventListener("error", (s) => {
3345
+ o("error", [s.message || "window.error"]);
3346
+ }), window.addEventListener("unhandledrejection", (s) => {
3347
+ o("error", [s.reason || "unhandledrejection"]);
3344
3348
  }));
3345
3349
  },
3346
3350
  snapshot() {
3347
- return e.slice();
3351
+ return t.slice();
3348
3352
  }
3349
3353
  };
3350
3354
  }
3351
- function ji(e) {
3352
- const t = window.SpeechRecognition || window.webkitSpeechRecognition;
3353
- let a = null, o = !1;
3354
- const s = () => {
3355
- if (o = !1, a)
3355
+ function Pi(t, e = {}) {
3356
+ const a = window.SpeechRecognition || window.webkitSpeechRecognition, o = typeof e.onActiveChange == "function" ? e.onActiveChange : null;
3357
+ let i = null, s = !1;
3358
+ const n = (d) => {
3359
+ const g = !!d;
3360
+ s !== g && (s = g, o == null || o(s));
3361
+ }, l = () => {
3362
+ if (n(!1), i)
3356
3363
  try {
3357
- a.stop();
3364
+ i.stop();
3358
3365
  } catch {
3359
3366
  }
3360
3367
  };
3361
3368
  return {
3362
- start: (r = {}) => {
3363
- if (!t)
3369
+ start: (d = {}) => {
3370
+ if (!a)
3364
3371
  throw new Error(p("status.speechUnsupported"));
3365
- return o ? (s(), !1) : (a = new t(), a.continuous = !0, a.interimResults = !0, a.lang = r.lang || navigator.language || "en-US", a.onresult = (l) => {
3366
- let u = "";
3367
- for (let c = l.resultIndex; c < l.results.length; c += 1)
3368
- l.results[c].isFinal && (u += l.results[c][0].transcript);
3369
- u && e(u);
3370
- }, a.onerror = () => {
3371
- o = !1;
3372
- }, a.onend = () => {
3373
- o = !1;
3374
- }, a.start(), o = !0, !0);
3372
+ return s ? (l(), !1) : (i = new a(), i.continuous = !0, i.interimResults = !0, i.lang = d.lang || navigator.language || "en-US", i.onresult = (g) => {
3373
+ let k = "";
3374
+ for (let v = g.resultIndex; v < g.results.length; v += 1)
3375
+ g.results[v].isFinal && (k += g.results[v][0].transcript);
3376
+ k && t(k);
3377
+ }, i.onerror = () => {
3378
+ n(!1);
3379
+ }, i.onend = () => {
3380
+ n(!1);
3381
+ }, i.start(), n(!0), !0);
3375
3382
  },
3376
- stop: s,
3377
- isSupported: () => !!t,
3378
- isActive: () => o
3383
+ stop: l,
3384
+ isSupported: () => !!a,
3385
+ isActive: () => s
3379
3386
  };
3380
3387
  }
3381
- const Ri = 60 * 1e3;
3382
- function Pi({ onStart: e, onStop: t, onError: a }) {
3383
- let o = null, s = null, i = [], r = null;
3388
+ const xi = 60 * 1e3;
3389
+ function Li({ onStart: t, onStop: e, onError: a }) {
3390
+ let o = null, i = null, s = [], n = null;
3384
3391
  const l = () => {
3385
- if (r && (clearTimeout(r), r = null), s && s.state !== "inactive")
3392
+ if (n && (clearTimeout(n), n = null), i && i.state !== "inactive")
3386
3393
  try {
3387
- s.stop();
3394
+ i.stop();
3388
3395
  } catch {
3389
3396
  }
3390
3397
  o && (o.getTracks().forEach((g) => g.stop()), o = null);
3391
3398
  }, u = () => {
3392
- if (s && s.state === "recording") {
3393
- s.stop();
3399
+ if (i && i.state === "recording") {
3400
+ i.stop();
3394
3401
  return;
3395
3402
  }
3396
- l(), t(null);
3403
+ l(), e(null);
3397
3404
  };
3398
3405
  return { start: async () => {
3399
- var g, v;
3406
+ var g, k;
3400
3407
  if (!((g = navigator.mediaDevices) != null && g.getDisplayMedia))
3401
3408
  throw new Error("Screen recording is not supported in this browser.");
3402
3409
  o = await navigator.mediaDevices.getDisplayMedia({
@@ -3404,172 +3411,172 @@ function Pi({ onStart: e, onStop: t, onError: a }) {
3404
3411
  audio: !1,
3405
3412
  preferCurrentTab: !0,
3406
3413
  selfBrowserSurface: "include"
3407
- }), i = [], s = new MediaRecorder(o, {
3414
+ }), s = [], i = new MediaRecorder(o, {
3408
3415
  mimeType: MediaRecorder.isTypeSupported("video/webm;codecs=vp9") ? "video/webm;codecs=vp9" : "video/webm"
3409
- }), s.ondataavailable = (k) => {
3410
- k.data && k.data.size && i.push(k.data);
3411
- }, s.onstop = () => {
3412
- const k = i.length ? new Blob(i, { type: s.mimeType || "video/webm" }) : null;
3413
- l(), t(k);
3414
- }, (v = o.getVideoTracks()[0]) == null || v.addEventListener("ended", () => u()), s.start(), r = setTimeout(u, Ri);
3416
+ }), i.ondataavailable = (v) => {
3417
+ v.data && v.data.size && s.push(v.data);
3418
+ }, i.onstop = () => {
3419
+ const v = s.length ? new Blob(s, { type: i.mimeType || "video/webm" }) : null;
3420
+ l(), e(v);
3421
+ }, (k = o.getVideoTracks()[0]) == null || k.addEventListener("ended", () => u()), i.start(), n = setTimeout(u, xi), t();
3415
3422
  }, stop: u };
3416
3423
  }
3417
- function xi() {
3418
- const e = /* @__PURE__ */ new Set();
3424
+ function Ui() {
3425
+ const t = /* @__PURE__ */ new Set();
3419
3426
  return {
3420
3427
  alloc() {
3421
- let t = 1;
3422
- for (; e.has(t); )
3423
- t += 1;
3424
- return e.add(t), t;
3428
+ let e = 1;
3429
+ for (; t.has(e); )
3430
+ e += 1;
3431
+ return t.add(e), e;
3425
3432
  },
3426
- free(t) {
3427
- const a = Number(t);
3428
- Number.isInteger(a) && a > 0 && e.delete(a);
3433
+ free(e) {
3434
+ const a = Number(e);
3435
+ Number.isInteger(a) && a > 0 && t.delete(a);
3429
3436
  },
3430
3437
  peekUsed() {
3431
- return [...e].sort((t, a) => t - a);
3438
+ return [...t].sort((e, a) => e - a);
3432
3439
  }
3433
3440
  };
3434
3441
  }
3435
- const Me = { x: 0, y: 0, w: 1, h: 1 };
3436
- function Je() {
3437
- const e = xi();
3438
- let t = [], a = { ...Me }, o = 1;
3442
+ const It = { x: 0, y: 0, w: 1, h: 1 };
3443
+ function Yt() {
3444
+ const t = Ui();
3445
+ let e = [], a = { ...It }, o = 1;
3439
3446
  return {
3440
- list: () => t.filter((i) => Ti(i, a)),
3441
- all: () => t.slice(),
3447
+ list: () => e.filter((s) => Mi(s, a)),
3448
+ all: () => e.slice(),
3442
3449
  crop: () => ({ ...a }),
3443
- setCrop(i) {
3444
- return a = Ui(i), a;
3450
+ setCrop(s) {
3451
+ return a = Fi(s), a;
3445
3452
  },
3446
3453
  resetCrop() {
3447
- return a = { ...Me }, a;
3454
+ return a = { ...It }, a;
3448
3455
  },
3449
3456
  isCropped() {
3450
3457
  return a.x > 1e-6 || a.y > 1e-6 || a.w < 1 - 1e-6 || a.h < 1 - 1e-6;
3451
3458
  },
3452
- add(i, r) {
3459
+ add(s, n) {
3453
3460
  const l = {
3454
3461
  id: `s${o++}`,
3455
- type: i,
3456
- number: e.alloc(),
3462
+ type: s,
3463
+ number: t.alloc(),
3457
3464
  x: 0.2,
3458
3465
  y: 0.2,
3459
- w: i === "arrow" ? 0.2 : 0.22,
3460
- h: i === "arrow" ? 0.05 : 0.16,
3466
+ w: s === "arrow" ? 0.2 : 0.22,
3467
+ h: s === "arrow" ? 0.05 : 0.16,
3461
3468
  x2: 0.4,
3462
3469
  y2: 0.28,
3463
- ...r
3470
+ ...n
3464
3471
  };
3465
- return t.push(l), l;
3472
+ return e.push(l), l;
3466
3473
  },
3467
- update(i, r) {
3468
- const l = t.find((u) => u.id === i);
3469
- return l ? (Object.assign(l, r), l) : null;
3474
+ update(s, n) {
3475
+ const l = e.find((u) => u.id === s);
3476
+ return l ? (Object.assign(l, n), l) : null;
3470
3477
  },
3471
- remove(i) {
3472
- const r = t.findIndex((u) => u.id === i);
3473
- if (r < 0)
3478
+ remove(s) {
3479
+ const n = e.findIndex((u) => u.id === s);
3480
+ if (n < 0)
3474
3481
  return null;
3475
- const [l] = t.splice(r, 1);
3476
- return e.free(l.number), l;
3482
+ const [l] = e.splice(n, 1);
3483
+ return t.free(l.number), l;
3477
3484
  },
3478
3485
  reset() {
3479
- for (t = [], a = { ...Me }, o = 1; e.peekUsed().length; )
3480
- e.free(e.peekUsed()[0]);
3486
+ for (e = [], a = { ...It }, o = 1; t.peekUsed().length; )
3487
+ t.free(t.peekUsed()[0]);
3481
3488
  }
3482
3489
  };
3483
3490
  }
3484
- function Li(e, t) {
3485
- 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;
3486
- return (Array.isArray(e) ? e : []).map((r) => {
3491
+ function Ti(t, e) {
3492
+ const a = Number(e == null ? void 0 : e.w) || 1, o = Number(e == null ? void 0 : e.h) || 1, i = Number(e == null ? void 0 : e.x) || 0, s = Number(e == null ? void 0 : e.y) || 0;
3493
+ return (Array.isArray(t) ? t : []).map((n) => {
3487
3494
  const l = {
3488
- ...r,
3489
- x: (r.x - s) / a,
3490
- y: (r.y - i) / o,
3491
- w: (r.w || 0) / a,
3492
- h: (r.h || 0) / o
3495
+ ...n,
3496
+ x: (n.x - i) / a,
3497
+ y: (n.y - s) / o,
3498
+ w: (n.w || 0) / a,
3499
+ h: (n.h || 0) / o
3493
3500
  };
3494
- return Number.isFinite(r.x2) && (l.x2 = (r.x2 - s) / a), Number.isFinite(r.y2) && (l.y2 = (r.y2 - i) / o), l;
3501
+ return Number.isFinite(n.x2) && (l.x2 = (n.x2 - i) / a), Number.isFinite(n.y2) && (l.y2 = (n.y2 - s) / o), l;
3495
3502
  });
3496
3503
  }
3497
- function Ui(e) {
3498
- 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);
3499
- return { x: t, y: a, w: o, h: s };
3504
+ function Fi(t) {
3505
+ const e = Math.min(Math.max(t.x, 0), 0.95), a = Math.min(Math.max(t.y, 0), 0.95), o = Math.min(Math.max(t.w, 0.05), 1 - e), i = Math.min(Math.max(t.h, 0.05), 1 - a);
3506
+ return { x: e, y: a, w: o, h: i };
3500
3507
  }
3501
- function Ti(e, t) {
3502
- 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;
3503
- return a >= t.x && o >= t.y && a <= t.x + t.w && o <= t.y + t.h;
3508
+ function Mi(t, e) {
3509
+ const a = t.type === "arrow" ? (t.x + (t.x2 ?? t.x)) / 2 : t.x + (t.w || 0) / 2, o = t.type === "arrow" ? (t.y + (t.y2 ?? t.y)) / 2 : t.y + (t.h || 0) / 2;
3510
+ return a >= e.x && o >= e.y && a <= e.x + e.w && o <= e.y + e.h;
3504
3511
  }
3505
- function Kt(e) {
3506
- const t = Math.max(1, Number(e) || 1);
3512
+ function Ge(t) {
3513
+ const e = Math.max(1, Number(t) || 1);
3507
3514
  return {
3508
- stroke: Math.max(2, t * 75e-4),
3509
- badgeRadius: Math.max(8, t * 0.025),
3510
- fontSize: Math.max(10, t * 0.0275),
3511
- arrowHead: Math.max(8, t * 0.035),
3515
+ stroke: Math.max(2, e * 75e-4),
3516
+ badgeRadius: Math.max(8, e * 0.025),
3517
+ fontSize: Math.max(10, e * 0.0275),
3518
+ arrowHead: Math.max(8, e * 0.035),
3512
3519
  arrowHeadAngle: 0.4
3513
3520
  };
3514
3521
  }
3515
- function Fi(e, t, a, o, s) {
3516
- 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 = {
3517
- x: u - r * Math.cos(i - s.arrowHeadAngle),
3518
- y: c - r * Math.sin(i - s.arrowHeadAngle)
3522
+ function Di(t, e, a, o, i) {
3523
+ const s = Math.atan2(o - e, a - t), n = i.arrowHead, l = Math.min(i.stroke, n * 0.2), u = a, d = o, g = a - Math.cos(s) * n, k = o - Math.sin(s) * n, v = {
3524
+ x: u - n * Math.cos(s - i.arrowHeadAngle),
3525
+ y: d - n * Math.sin(s - i.arrowHeadAngle)
3519
3526
  }, w = {
3520
- x: u - r * Math.cos(i + s.arrowHeadAngle),
3521
- y: c - r * Math.sin(i + s.arrowHeadAngle)
3527
+ x: u - n * Math.cos(s + i.arrowHeadAngle),
3528
+ y: d - n * Math.sin(s + i.arrowHeadAngle)
3522
3529
  }, b = {
3523
- x: a - Math.cos(i) * l,
3524
- y: o - Math.sin(i) * l
3530
+ x: a - Math.cos(s) * l,
3531
+ y: o - Math.sin(s) * l
3525
3532
  };
3526
- return { angle: i, tipX: u, tipY: c, baseX: g, baseY: v, left: k, right: w, shaftEnd: b };
3533
+ return { angle: s, tipX: u, tipY: d, baseX: g, baseY: k, left: v, right: w, shaftEnd: b };
3527
3534
  }
3528
- async function kt(e, t = {}) {
3529
- 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 Ii(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 = Di(u, c, o), v = g.width, k = g.height, w = document.createElement("canvas");
3530
- w.width = v, w.height = k, w.getContext("2d").drawImage(i, r, l, u, c, 0, 0, v, k);
3531
- const z = await bt(w, "image/webp", s);
3535
+ async function we(t, e = {}) {
3536
+ const a = e.crop || { x: 0, y: 0, w: 1, h: 1 }, o = Math.max(1, Number(e.maxEdge) || 2048), i = e.webpQuality ?? 0.82, s = await $i(t), n = Math.round(a.x * s.width), l = Math.round(a.y * s.height), u = Math.max(1, Math.round(a.w * s.width)), d = Math.max(1, Math.round(a.h * s.height)), g = Oi(u, d, o), k = g.width, v = g.height, w = document.createElement("canvas");
3537
+ w.width = k, w.height = v, w.getContext("2d").drawImage(s, n, l, u, d, 0, 0, k, v);
3538
+ const z = await Se(w, "image/webp", i);
3532
3539
  if (z && z.size > 0 && z.type === "image/webp")
3533
- return { blob: z, width: v, height: k, mime: "image/webp", ext: "webp" };
3534
- const R = await bt(w, "image/png");
3535
- if (!R || !R.size)
3540
+ return { blob: z, width: k, height: v, mime: "image/webp", ext: "webp" };
3541
+ const j = await Se(w, "image/png");
3542
+ if (!j || !j.size)
3536
3543
  throw new Error("Could not encode screenshot");
3537
- return { blob: R, width: v, height: k, mime: "image/png", ext: "png" };
3544
+ return { blob: j, width: k, height: v, mime: "image/png", ext: "png" };
3538
3545
  }
3539
- function Di(e, t, a = 2048) {
3540
- 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));
3546
+ function Oi(t, e, a = 2048) {
3547
+ const o = Math.max(1, Number(t) || 1), i = Math.max(1, Number(e) || 1), s = Math.max(1, Number(a) || 2048), n = Math.min(1, s / Math.max(o, i));
3541
3548
  return {
3542
- width: Math.max(1, Math.round(o * r)),
3543
- height: Math.max(1, Math.round(s * r)),
3544
- scale: r
3549
+ width: Math.max(1, Math.round(o * n)),
3550
+ height: Math.max(1, Math.round(i * n)),
3551
+ scale: n
3545
3552
  };
3546
3553
  }
3547
- function Oi(e = 2048) {
3548
- const t = Math.floor(Number(e) / 2);
3549
- return Math.max(1, Math.min(1024, t || 1024));
3554
+ function Ii(t = 2048) {
3555
+ const e = Math.floor(Number(t) / 2);
3556
+ return Math.max(1, Math.min(1024, e || 1024));
3550
3557
  }
3551
- function Mi(e, t = null) {
3552
- 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)
3558
+ function Vi(t, e = null) {
3559
+ if ((e == null ? void 0 : e.code) === "payload_too_large" || Number(e == null ? void 0 : e.status) === 413 || Number(t == null ? void 0 : t.status) === 413)
3553
3560
  return !0;
3554
- const a = String((e == null ? void 0 : e.message) || e || (t == null ? void 0 : t.error) || "").toLowerCase();
3555
- 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;
3561
+ const a = String((t == null ? void 0 : t.message) || t || (e == null ? void 0 : e.error) || "").toLowerCase();
3562
+ 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(t == null ? void 0 : t.status) === 413;
3556
3563
  }
3557
- function Ii(e) {
3558
- return new Promise((t, a) => {
3564
+ function $i(t) {
3565
+ return new Promise((e, a) => {
3559
3566
  const o = new Image();
3560
- o.onload = () => t(o), o.onerror = () => a(new Error("Could not load screenshot")), o.src = e;
3567
+ o.onload = () => e(o), o.onerror = () => a(new Error("Could not load screenshot")), o.src = t;
3561
3568
  });
3562
3569
  }
3563
- function bt(e, t, a) {
3570
+ function Se(t, e, a) {
3564
3571
  return new Promise((o) => {
3565
3572
  try {
3566
- e.toBlob((s) => o(s), t, a);
3573
+ t.toBlob((i) => o(i), e, a);
3567
3574
  } catch {
3568
3575
  o(null);
3569
3576
  }
3570
3577
  });
3571
3578
  }
3572
- const Vi = [
3579
+ const Bi = [
3573
3580
  "url",
3574
3581
  "title",
3575
3582
  "userAgent",
@@ -3580,142 +3587,143 @@ const Vi = [
3580
3587
  "viewport",
3581
3588
  "user"
3582
3589
  ];
3583
- function $i(e) {
3584
- return !e || typeof e != "object" ? !1 : !!(e.userId || e.email || e.displayName);
3590
+ function Ni(t) {
3591
+ return !t || typeof t != "object" ? !1 : !!(t.userId || t.email || t.displayName);
3585
3592
  }
3586
- function Bi(e = {}) {
3587
- const t = [];
3588
- for (const a of Vi) {
3589
- const o = e[a];
3590
- o == null || o === "" || a === "user" && !$i(o) || t.push({
3593
+ function Ki(t = {}) {
3594
+ const e = [];
3595
+ for (const a of Bi) {
3596
+ const o = t[a];
3597
+ o == null || o === "" || a === "user" && !Ni(o) || e.push({
3591
3598
  key: a,
3592
3599
  label: p(`diag.${a}`),
3593
3600
  value: o,
3594
3601
  redacted: !1
3595
3602
  });
3596
3603
  }
3597
- return t;
3604
+ return e;
3598
3605
  }
3599
- function Ni(e = []) {
3600
- return e.map((t, a) => {
3606
+ function Hi(t = []) {
3607
+ return t.map((e, a) => {
3601
3608
  const o = {
3602
- id: `log-${a}-${t.at || 0}`,
3603
- level: t.level || "log",
3604
- text: String(t.text || ""),
3605
- at: t.at || 0,
3609
+ id: `log-${a}-${e.at || 0}`,
3610
+ level: e.level || "log",
3611
+ text: String(e.text || ""),
3612
+ at: e.at || 0,
3606
3613
  redacted: !1
3607
3614
  };
3608
- return Array.isArray(t.segments) && t.segments.length && (o.segments = t.segments), o;
3615
+ return Array.isArray(e.segments) && e.segments.length && (o.segments = e.segments), o;
3609
3616
  });
3610
3617
  }
3611
- function Ki(e = []) {
3612
- if (!e.length)
3613
- return { checked: !1, indeterminate: !1 };
3614
- const t = e.filter((a) => a.redacted).length;
3615
- return t === 0 ? { checked: !1, indeterminate: !1 } : t === e.length ? { checked: !0, indeterminate: !1 } : { checked: !1, indeterminate: !0 };
3618
+ function Gi(t = []) {
3619
+ if (!t.length)
3620
+ return { checked: !0, indeterminate: !1 };
3621
+ const e = t.filter((a) => !a.redacted).length;
3622
+ return e === t.length ? { checked: !0, indeterminate: !1 } : e === 0 ? { checked: !1, indeterminate: !1 } : { checked: !1, indeterminate: !0 };
3616
3623
  }
3617
- function Ce(e, t) {
3618
- e.forEach((a) => {
3619
- a.redacted = !!t;
3624
+ function Rt(t, e) {
3625
+ t.forEach((a) => {
3626
+ a.redacted = !!e;
3620
3627
  });
3621
3628
  }
3622
- function Hi(e = {}) {
3623
- const t = e.diagnostics || [], a = e.logs || [], o = t.some((i) => !i.redacted), s = a.length > 0 && a.some((i) => !i.redacted);
3624
- return o && s ? p("privacy.disclosure.both") : o ? p("privacy.disclosure.diagnostics") : s ? p("privacy.disclosure.logs") : "";
3629
+ function qi(t = {}) {
3630
+ const e = t.diagnostics || [], a = t.logs || [], o = e.some((s) => !s.redacted), i = a.length > 0 && a.some((s) => !s.redacted);
3631
+ return o && i ? p("privacy.disclosure.both") : o ? p("privacy.disclosure.diagnostics") : i ? p("privacy.disclosure.logs") : "";
3625
3632
  }
3626
- function Gi(e) {
3627
- if (e == null)
3633
+ function _i(t) {
3634
+ if (t == null)
3628
3635
  return "";
3629
- if (typeof e == "string" || typeof e == "number" || typeof e == "boolean")
3630
- return String(e);
3636
+ if (typeof t == "string" || typeof t == "number" || typeof t == "boolean")
3637
+ return String(t);
3631
3638
  try {
3632
- return JSON.stringify(e);
3639
+ return JSON.stringify(t);
3633
3640
  } catch {
3634
- return String(e);
3641
+ return String(t);
3635
3642
  }
3636
3643
  }
3637
- function qi(e = {}) {
3638
- const t = {};
3639
- e.author != null && e.author !== "" && (t.author = e.author);
3640
- for (const o of e.diagnostics || [])
3641
- o.redacted || (t[o.key] = o.value);
3642
- const a = (e.logs || []).filter((o) => !o.redacted).map((o) => {
3643
- const s = {
3644
+ function Wi(t = {}) {
3645
+ const e = {};
3646
+ t.author != null && t.author !== "" && (e.author = t.author);
3647
+ for (const o of t.diagnostics || [])
3648
+ o.redacted || (e[o.key] = o.value);
3649
+ const a = (t.logs || []).filter((o) => !o.redacted).map((o) => {
3650
+ const i = {
3644
3651
  level: o.level,
3645
3652
  text: o.text,
3646
3653
  at: o.at
3647
3654
  };
3648
- return Array.isArray(o.segments) && o.segments.length && (s.segments = o.segments), s;
3655
+ return Array.isArray(o.segments) && o.segments.length && (i.segments = o.segments), i;
3649
3656
  });
3650
- return t.console = a, t;
3657
+ return e.console = a, e;
3651
3658
  }
3652
- const _ = [
3659
+ const Z = [
3653
3660
  { id: "bug", label: "Bug" },
3654
3661
  { id: "idea", label: "Idea" },
3655
3662
  { id: "other", label: "Other" }
3656
3663
  ];
3657
- function wt(e) {
3658
- return String(e || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32);
3659
- }
3660
- function ye(e) {
3661
- const t = String(e || "").trim();
3662
- return t ? t.split(/[-_\s]+/).filter(Boolean).map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join(" ") : "";
3663
- }
3664
- function _i(e) {
3665
- if (!Array.isArray(e) || !e.length)
3666
- return _.map((o) => ({ ...o }));
3667
- const t = /* @__PURE__ */ new Set(), a = [];
3668
- for (const o of e) {
3669
- let s = "", i = "", r = "", l = "";
3670
- if (typeof o == "string" || typeof o == "number" ? (s = wt(o), i = ye(s)) : o && typeof o == "object" && (s = wt(o.id ?? o.value ?? o.kind), i = String(o.label || o.name || ye(s)).trim() || ye(s), r = String(o.title || "").trim(), l = String(o.description || o.intro || "").trim()), !s || t.has(s))
3664
+ function Ae(t) {
3665
+ return String(t || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32);
3666
+ }
3667
+ function bt(t) {
3668
+ const e = String(t || "").trim();
3669
+ return e ? e.split(/[-_\s]+/).filter(Boolean).map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join(" ") : "";
3670
+ }
3671
+ function Zi(t) {
3672
+ if (!Array.isArray(t) || !t.length)
3673
+ return Z.map((o) => ({ ...o }));
3674
+ const e = /* @__PURE__ */ new Set(), a = [];
3675
+ for (const o of t) {
3676
+ let i = "", s = "", n = "", l = "";
3677
+ if (typeof o == "string" || typeof o == "number" ? (i = Ae(o), s = bt(i)) : o && typeof o == "object" && (i = Ae(o.id ?? o.value ?? o.kind), s = String(o.label || o.name || bt(i)).trim() || bt(i), n = String(o.title || "").trim(), l = String(o.description || o.intro || "").trim()), !i || e.has(i))
3671
3678
  continue;
3672
- t.add(s);
3673
- const u = { id: s, label: i };
3674
- r && (u.title = r), l && (u.description = l), a.push(u);
3679
+ e.add(i);
3680
+ const u = { id: i, label: s };
3681
+ n && (u.title = n), l && (u.description = l), a.push(u);
3675
3682
  }
3676
- return a.length ? a : _.map((o) => ({ ...o }));
3683
+ return a.length ? a : Z.map((o) => ({ ...o }));
3677
3684
  }
3678
- function Le(e) {
3685
+ function Tt(t) {
3679
3686
  var a;
3680
- const t = Array.isArray(e) && e.length ? e : _;
3681
- return t.some((o) => o.id === "bug") ? "bug" : ((a = t[0]) == null ? void 0 : a.id) || "other";
3687
+ const e = Array.isArray(t) && t.length ? t : Z;
3688
+ return e.some((o) => o.id === "bug") ? "bug" : ((a = e[0]) == null ? void 0 : a.id) || "other";
3682
3689
  }
3683
- const Wi = ["maker", "all-business", "brighter-day", "quiet-night"], Ht = "maker", Zi = /* @__PURE__ */ new Set(["crop", "arrow", "rect", "circle"]), Ke = 0.02, St = 0.05, Ji = `
3690
+ const Ji = ["maker", "all-business", "brighter-day", "quiet-night"], qe = "maker", Yi = /* @__PURE__ */ new Set(["crop", "arrow", "rect", "circle"]), Ht = 0.02, Ce = 0.05, Xi = `
3684
3691
  <svg class="nf-launcher-icon" viewBox="0 0 24 24" aria-hidden="true">
3685
3692
  <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"/>
3686
3693
  <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"/>
3687
3694
  </svg>
3688
3695
  `;
3689
- function D(e) {
3690
- 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>`;
3691
- }
3692
- const T = {
3693
- crop: D('<path d="M6 3v5H1M18 21v-5h5M8 5h8a2 2 0 0 1 2 2v8M16 19H8a2 2 0 0 1-2-2V8"/>'),
3694
- resetCrop: D('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),
3695
- arrow: D('<path d="M5 19 19 5"/><path d="M9 5h10v10"/>'),
3696
- rect: D('<rect x="4" y="6" width="16" height="12" rx="1.5"/>'),
3697
- circle: D('<circle cx="12" cy="12" r="8"/>'),
3698
- discard: D('<path d="M4 7h16"/><path d="M9 7V5h6v2"/><path d="M6 7l1 13h10l1-13"/>'),
3699
- recapture: D('<path d="M4 8h3l2-2h6l2 2h3v11H4z"/><circle cx="12" cy="13" r="3.5"/>'),
3700
- privacy: D('<path d="M8 6h13M8 12h13M8 18h13"/><path d="M3 6h.01M3 12h.01M3 18h.01"/>'),
3701
- 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"/>'),
3702
- video: D('<rect x="3" y="7" width="13" height="10" rx="2"/><path d="M16 10.5 21 8v8l-5-2.5z"/>'),
3703
- openArrow: D('<path d="M5 12h14"/><path d="m13 6 6 6-6 6"/>'),
3704
- close: D('<path d="M6 6l12 12M18 6 6 18"/>')
3705
- }, Gt = Ei();
3706
- Gt.hook();
3707
- const qt = 10, Yi = 80, _t = "notefully.author", Wt = "notefully.kind", Zt = "notefully.redactSections";
3708
- let d = {
3696
+ function F(t) {
3697
+ 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">${t}</svg>`;
3698
+ }
3699
+ const x = {
3700
+ crop: F('<path d="M6 3v5H1M18 21v-5h5M8 5h8a2 2 0 0 1 2 2v8M16 19H8a2 2 0 0 1-2-2V8"/>'),
3701
+ resetCrop: F('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),
3702
+ arrow: F('<path d="M5 19 19 5"/><path d="M9 5h10v10"/>'),
3703
+ rect: F('<rect x="4" y="6" width="16" height="12" rx="1.5"/>'),
3704
+ circle: F('<circle cx="12" cy="12" r="8"/>'),
3705
+ discard: F('<path d="M4 7h16"/><path d="M9 7V5h6v2"/><path d="M6 7l1 13h10l1-13"/>'),
3706
+ recapture: F('<path d="M4 8h3l2-2h6l2 2h3v11H4z"/><circle cx="12" cy="13" r="3.5"/>'),
3707
+ privacy: F('<path d="M8 6h13M8 12h13M8 18h13"/><path d="M3 6h.01M3 12h.01M3 18h.01"/>'),
3708
+ audio: F('<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"/>'),
3709
+ video: F('<rect x="3" y="7" width="13" height="10" rx="2"/><path d="M16 10.5 21 8v8l-5-2.5z"/>'),
3710
+ stop: '<svg class="nf-icon" viewBox="0 0 24 24" fill="currentColor" stroke="none" aria-hidden="true"><rect x="7" y="7" width="10" height="10" rx="1.5"/></svg>',
3711
+ openArrow: F('<path d="M5 12h14"/><path d="m13 6 6 6-6 6"/>'),
3712
+ close: F('<path d="M6 6l12 12M18 6 6 18"/>')
3713
+ }, _e = ji();
3714
+ _e.hook();
3715
+ const We = 10, Qi = 80, Ze = "notefully.author", Je = "notefully.kind", Ye = "notefully.redactSections";
3716
+ let c = {
3709
3717
  endpoint: "",
3710
3718
  projectKey: "",
3711
3719
  version: "0.0.0",
3712
3720
  name: "",
3713
3721
  targets: null,
3714
3722
  hideLauncher: !1,
3715
- theme: Ht,
3723
+ theme: qe,
3716
3724
  video: !1,
3717
- consoleLogLimit: qt,
3718
- kinds: _.map((e) => ({ ...e })),
3725
+ consoleLogLimit: We,
3726
+ kinds: Z.map((t) => ({ ...t })),
3719
3727
  kindsCustom: !1,
3720
3728
  capture: null,
3721
3729
  onBeforeCapture: null,
@@ -3724,25 +3732,27 @@ let d = {
3724
3732
  displayLink: !1,
3725
3733
  locale: null,
3726
3734
  translations: null
3727
- }, ce = !1, Ie = !1, N = {}, y = null, n = {}, A = Je(), G = "", se = "", K = null, H = Le(_), W = null, M = null, j = null, E = null, fe = null, Q = null, le = null, q = { w: 0, h: 0 }, Ve = !1, de = !1, pe = !1, $ = [], V = [], Z = !1;
3728
- function h(e) {
3729
- return y.querySelector(e);
3735
+ }, pt = !1, Vt = !1, K = {}, y = null, r = {}, A = Yt(), q = "", rt = "", H = null, G = Tt(Z), J = null, O = null, R = null, E = null, kt = null, _ = null, V = null, tt = !1, ct = { w: 0, h: 0 }, $t = !1, gt = !1, mt = !1, B = [], $ = [], W = !1;
3736
+ function h(t) {
3737
+ return y.querySelector(t);
3730
3738
  }
3731
- function Jt(e) {
3732
- const t = String(e || "").trim().toLowerCase().replace(/\s+/g, "-");
3733
- return Wi.includes(t) ? t : Ht;
3739
+ function Xe(t) {
3740
+ const e = String(t || "").trim().toLowerCase().replace(/\s+/g, "-");
3741
+ return Ji.includes(e) ? e : qe;
3734
3742
  }
3735
- function S(e, t = !1) {
3736
- n.status && (n.status.textContent = e || "", fe && (clearTimeout(fe), fe = null), e && !t && (fe = setTimeout(() => {
3737
- n.status.textContent = "";
3743
+ function S(t, e = !1) {
3744
+ r.status && (r.status.textContent = t || "", kt && (clearTimeout(kt), kt = null), t && !e && (kt = setTimeout(() => {
3745
+ r.status.textContent = "";
3738
3746
  }, 4e3)));
3739
3747
  }
3740
- function Ye() {
3748
+ function Xt() {
3741
3749
  return y && document.body.contains(y) || (y = document.createElement("div"), y.id = "notefully", y.innerHTML = `
3742
- <button class="nf-launcher" type="button" data-i18n-title="launcher.open" data-i18n-aria="launcher.open">${Ji}</button>
3750
+ <button class="nf-launcher" type="button" data-i18n-title="launcher.open" data-i18n-aria="launcher.open">${Xi}</button>
3743
3751
  <div class="nf-dialog" hidden>
3744
3752
  <div class="nf-panel">
3745
- <button class="nf-close nf-icon-btn" type="button" data-i18n-title="form.close" data-i18n-aria="form.close">${T.close}</button>
3753
+ <div class="nf-pill nf-close-pill">
3754
+ <button class="nf-close nf-icon-btn" type="button" data-i18n-title="form.close" data-i18n-aria="form.close">${x.close}</button>
3755
+ </div>
3746
3756
  <div class="nf-panel-body">
3747
3757
  <div class="nf-heading">
3748
3758
  <h2 class="nf-title"></h2>
@@ -3753,51 +3763,58 @@ function Ye() {
3753
3763
  <div class="nf-canvas"></div>
3754
3764
  <div class="nf-palette">
3755
3765
  <div class="nf-palette-tools">
3756
- <button class="nf-tool nf-icon-btn" type="button" data-tool="crop" data-i18n-title="tool.crop" data-i18n-aria="tool.crop">${T.crop}</button>
3757
- <button class="nf-reset-crop nf-icon-btn" type="button" data-i18n-title="tool.resetCrop" data-i18n-aria="tool.resetCrop" hidden>${T.resetCrop}</button>
3758
- <button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" data-i18n-title="tool.arrow" data-i18n-aria="tool.arrow">${T.arrow}</button>
3759
- <button class="nf-tool nf-icon-btn" type="button" data-tool="rect" data-i18n-title="tool.rect" data-i18n-aria="tool.rect">${T.rect}</button>
3760
- <button class="nf-tool nf-icon-btn" type="button" data-tool="circle" data-i18n-title="tool.circle" data-i18n-aria="tool.circle">${T.circle}</button>
3766
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="crop" data-i18n-title="tool.crop" data-i18n-aria="tool.crop">${x.crop}</button>
3767
+ <button class="nf-reset-crop nf-icon-btn" type="button" data-i18n-title="tool.resetCrop" data-i18n-aria="tool.resetCrop" hidden>${x.resetCrop}</button>
3768
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" data-i18n-title="tool.arrow" data-i18n-aria="tool.arrow">${x.arrow}</button>
3769
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="rect" data-i18n-title="tool.rect" data-i18n-aria="tool.rect">${x.rect}</button>
3770
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="circle" data-i18n-title="tool.circle" data-i18n-aria="tool.circle">${x.circle}</button>
3761
3771
  </div>
3762
3772
  <div class="nf-palette-shot">
3763
- <button class="nf-recapture nf-icon-btn" type="button" data-i18n-title="tool.recapture" data-i18n-aria="tool.recapture">${T.recapture}</button>
3764
- <button class="nf-discard-shot nf-icon-btn" type="button" data-i18n-title="tool.discard" data-i18n-aria="tool.discard">${T.discard}</button>
3773
+ <button class="nf-recapture nf-icon-btn" type="button" data-i18n-title="tool.recapture" data-i18n-aria="tool.recapture">${x.recapture}</button>
3774
+ <button class="nf-discard-shot nf-icon-btn" type="button" data-i18n-title="tool.discard" data-i18n-aria="tool.discard">${x.discard}</button>
3765
3775
  </div>
3766
3776
  </div>
3767
3777
  </div>
3768
3778
  </div>
3769
3779
  <textarea class="nf-text"></textarea>
3770
3780
  <input class="nf-author" type="text" name="author" autocomplete="nickname" data-i18n-placeholder="form.authorPlaceholder" data-i18n-aria="form.author">
3771
- <div class="nf-kind-row">
3772
- <div class="nf-kind"></div>
3773
- <div class="nf-privacy-summary">
3774
- <span class="nf-privacy-text"></span>
3775
- <button class="nf-privacy-change nf-icon-btn" type="button" data-i18n-title="tool.privacy" data-i18n-aria="tool.privacy" aria-expanded="false">${T.privacy}</button>
3781
+ <div class="nf-privacy-stack">
3782
+ <div class="nf-kind-row">
3783
+ <div class="nf-kind"></div>
3784
+ <div class="nf-privacy-summary">
3785
+ <span class="nf-privacy-text"></span>
3786
+ <div class="nf-pill nf-privacy-toggle-pill">
3787
+ <button class="nf-privacy-change nf-icon-btn" type="button" data-i18n-title="tool.privacy" data-i18n-aria="tool.privacy" aria-expanded="false">${x.privacy}</button>
3788
+ </div>
3789
+ </div>
3776
3790
  </div>
3777
- </div>
3778
- <div class="nf-privacy">
3779
- <div class="nf-privacy-panel" hidden>
3780
- <div class="nf-privacy-scroll"></div>
3781
- <button class="nf-privacy-done" type="button" data-i18n-text="form.done"></button>
3791
+ <div class="nf-privacy">
3792
+ <div class="nf-privacy-panel" hidden>
3793
+ <div class="nf-privacy-scroll"></div>
3794
+ </div>
3782
3795
  </div>
3783
3796
  </div>
3784
3797
  <div class="nf-actions">
3785
- <button class="nf-restore nf-icon-btn" type="button" data-i18n-title="tool.restore" data-i18n-aria="tool.restore" hidden>${T.resetCrop}</button>
3786
- <button class="nf-audio nf-icon-btn" type="button" data-i18n-title="tool.audio" data-i18n-aria="tool.audio">${T.audio}</button>
3787
- <button class="nf-video nf-icon-btn" type="button" data-i18n-title="tool.video" data-i18n-aria="tool.video">${T.video}</button>
3788
- <button class="nf-submit" type="button" data-i18n-text="form.submit"></button>
3798
+ <button class="nf-restore nf-icon-btn" type="button" data-i18n-title="tool.restore" data-i18n-aria="tool.restore" hidden>${x.resetCrop}</button>
3799
+ <div class="nf-actions-media">
3800
+ <button class="nf-audio nf-icon-btn" type="button" data-i18n-title="tool.audio" data-i18n-aria="tool.audio">${x.audio}</button>
3801
+ <button class="nf-video nf-icon-btn" type="button" data-i18n-title="tool.video" data-i18n-aria="tool.video">${x.video}</button>
3802
+ </div>
3803
+ <div class="nf-pill nf-submit-pill">
3804
+ <button class="nf-submit" type="button" data-i18n-text="form.submit"></button>
3805
+ </div>
3789
3806
  </div>
3790
3807
  <div class="nf-status"></div>
3791
3808
  </div>
3792
3809
  <p class="nf-success-msg" hidden aria-live="polite" data-i18n-text="form.success"></p>
3793
3810
  <a class="nf-success-link" hidden target="_blank" rel="noopener noreferrer" data-i18n-aria="form.viewReport">
3794
3811
  <span class="nf-success-link-label" data-i18n-text="form.viewReport"></span>
3795
- ${T.openArrow}
3812
+ ${x.openArrow}
3796
3813
  </a>
3797
3814
  </div>
3798
3815
  </div>
3799
- <button class="nf-stop-video" type="button" hidden data-i18n-text="tool.stopVideo"></button>
3800
- `, document.body.appendChild(y), n = {
3816
+ <button class="nf-stop-video nf-icon-btn" type="button" hidden data-i18n-title="tool.stopVideo" data-i18n-aria="tool.stopVideo">${x.stop}</button>
3817
+ `, document.body.appendChild(y), r = {
3801
3818
  launcher: h(".nf-launcher"),
3802
3819
  dialog: h(".nf-dialog"),
3803
3820
  panel: h(".nf-panel"),
@@ -3816,6 +3833,7 @@ function Ye() {
3816
3833
  canvas: h(".nf-canvas"),
3817
3834
  text: h(".nf-text"),
3818
3835
  author: h(".nf-author"),
3836
+ privacyStack: h(".nf-privacy-stack"),
3819
3837
  kindRow: h(".nf-kind-row"),
3820
3838
  kind: h(".nf-kind"),
3821
3839
  privacy: h(".nf-privacy"),
@@ -3824,8 +3842,8 @@ function Ye() {
3824
3842
  privacyChange: h(".nf-privacy-change"),
3825
3843
  privacyPanel: h(".nf-privacy-panel"),
3826
3844
  privacyScroll: h(".nf-privacy-scroll"),
3827
- privacyDone: h(".nf-privacy-done"),
3828
3845
  actions: h(".nf-actions"),
3846
+ actionsMedia: h(".nf-actions-media"),
3829
3847
  restore: h(".nf-restore"),
3830
3848
  status: h(".nf-status"),
3831
3849
  audio: h(".nf-audio"),
@@ -3836,810 +3854,857 @@ function Ye() {
3836
3854
  resetCrop: h(".nf-reset-crop"),
3837
3855
  submit: h(".nf-submit"),
3838
3856
  shot: null
3839
- }, Qi(), re()), y;
3857
+ }, es(), nt()), y;
3840
3858
  }
3841
- function re() {
3842
- var e;
3843
- y && (Yt(), y.dataset.theme = Jt(d.theme), y.lang = be(), y.dir = za(be()), d.hideLauncher ? y.setAttribute("data-nf-hidden-launcher", "") : y.removeAttribute("data-nf-hidden-launcher"), n.video && (n.video.hidden = !d.video), Xi(), $.length && $.forEach((t) => {
3844
- t.label = p(`diag.${t.key}`);
3845
- }), Qt(), Z ? ot() : at(), (e = n.dialog) != null && e.hidden && ze());
3859
+ function nt() {
3860
+ var t;
3861
+ y && (Qe(), y.dataset.theme = Xe(c.theme), y.lang = At(), y.dir = Ra(At()), c.hideLauncher ? y.setAttribute("data-nf-hidden-launcher", "") : y.removeAttribute("data-nf-hidden-launcher"), r.video && (r.video.hidden = !c.video), ts(), B.length && B.forEach((e) => {
3862
+ e.label = p(`diag.${e.key}`);
3863
+ }), ea(), W ? se() : ie(), (t = r.dialog) != null && t.hidden && jt());
3846
3864
  }
3847
- function Yt() {
3848
- const e = Sa({
3849
- locale: d.locale == null ? void 0 : d.locale
3865
+ function Qe() {
3866
+ const t = Ca({
3867
+ locale: c.locale == null ? void 0 : c.locale
3850
3868
  });
3851
- Ca(d.translations), Aa(e);
3869
+ Ea(c.translations), za(t);
3852
3870
  }
3853
- function Xi() {
3871
+ function ts() {
3854
3872
  if (y) {
3855
- if (y.querySelectorAll("[data-i18n-title]").forEach((e) => {
3856
- e.title = p(e.getAttribute("data-i18n-title"));
3857
- }), y.querySelectorAll("[data-i18n-aria]").forEach((e) => {
3858
- e.setAttribute("aria-label", p(e.getAttribute("data-i18n-aria")));
3859
- }), y.querySelectorAll("[data-i18n-placeholder]").forEach((e) => {
3860
- e.setAttribute("placeholder", p(e.getAttribute("data-i18n-placeholder")));
3861
- }), y.querySelectorAll("[data-i18n-text]").forEach((e) => {
3862
- e.textContent = p(e.getAttribute("data-i18n-text"));
3863
- }), n.audio) {
3864
- const e = n.audio.dataset.active === "true";
3865
- Te(e);
3873
+ if (y.querySelectorAll("[data-i18n-title]").forEach((t) => {
3874
+ t.title = p(t.getAttribute("data-i18n-title"));
3875
+ }), y.querySelectorAll("[data-i18n-aria]").forEach((t) => {
3876
+ t.setAttribute("aria-label", p(t.getAttribute("data-i18n-aria")));
3877
+ }), y.querySelectorAll("[data-i18n-placeholder]").forEach((t) => {
3878
+ t.setAttribute("placeholder", p(t.getAttribute("data-i18n-placeholder")));
3879
+ }), y.querySelectorAll("[data-i18n-text]").forEach((t) => {
3880
+ t.textContent = p(t.getAttribute("data-i18n-text"));
3881
+ }), r.audio) {
3882
+ const t = r.audio.dataset.active === "true";
3883
+ ft(t);
3866
3884
  }
3867
- Qe();
3885
+ te();
3868
3886
  }
3869
3887
  }
3870
- function Xt(e) {
3871
- if (d.kindsCustom)
3872
- return e.label;
3873
- const t = `kind.${e.id}`, a = p(t);
3874
- return a === t ? e.label : a;
3888
+ function ta(t) {
3889
+ if (c.kindsCustom)
3890
+ return t.label;
3891
+ const e = `kind.${t.id}`, a = p(e);
3892
+ return a === e ? t.label : a;
3875
3893
  }
3876
- function ze() {
3877
- n.launcher && (n.launcher.hidden = !!d.hideLauncher);
3894
+ function jt() {
3895
+ r.launcher && (r.launcher.hidden = !!c.hideLauncher);
3878
3896
  }
3879
- function Qi() {
3880
- var t;
3881
- n.launcher.addEventListener("click", () => ha()), h(".nf-dialog").addEventListener("click", (a) => {
3882
- de && !pe || a.target === n.dialog && ee();
3883
- }), (t = n.close) == null || t.addEventListener("click", () => {
3884
- de && !pe || ee();
3885
- }), document.addEventListener("keydown", da), y.querySelectorAll(".nf-tool").forEach((a) => {
3886
- a.addEventListener("click", () => ge(a.dataset.tool));
3887
- }), n.resetCrop.addEventListener("click", ds), n.canvas.addEventListener("pointerdown", rs), n.canvas.addEventListener("dragstart", (a) => a.preventDefault());
3888
- const e = h(".nf-kind");
3889
- e && e.addEventListener("click", (a) => {
3897
+ function es() {
3898
+ var e;
3899
+ r.launcher.addEventListener("click", () => ya()), h(".nf-dialog").addEventListener("click", (a) => {
3900
+ gt && !mt || a.target === r.dialog && et();
3901
+ }), (e = r.close) == null || e.addEventListener("click", () => {
3902
+ gt && !mt || et();
3903
+ }), document.addEventListener("keydown", ga), y.querySelectorAll(".nf-tool").forEach((a) => {
3904
+ a.addEventListener("click", () => ht(a.dataset.tool));
3905
+ }), r.resetCrop.addEventListener("click", gs), r.canvas.addEventListener("pointerdown", ls), r.canvas.addEventListener("dragstart", (a) => a.preventDefault());
3906
+ const t = h(".nf-kind");
3907
+ t && t.addEventListener("click", (a) => {
3890
3908
  const o = a.target.closest("[data-kind]");
3891
- o && Xe(o.dataset.kind);
3892
- }), n.discard.addEventListener("click", ps), n.recapture.addEventListener("click", () => {
3893
- ms().catch((a) => S(a.message || p("status.recaptureFailed")));
3894
- }), n.restore.addEventListener("click", gs), n.audio.addEventListener("click", hs), n.video.addEventListener("click", fs), n.stop.addEventListener("click", () => le == null ? void 0 : le.stop()), n.privacyChange.addEventListener("click", () => Pe(!Z)), n.privacyDone.addEventListener("click", () => Pe(!1)), n.privacyScroll.addEventListener("change", Ps), h(".nf-submit").addEventListener("click", () => {
3895
- ya().catch((a) => S(a.message || p("status.submitFailed")));
3896
- }), Qt(), ge(null);
3897
- }
3898
- function x(e) {
3899
- return String(e || "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3900
- }
3901
- function Qt() {
3902
- const e = y == null ? void 0 : y.querySelector(".nf-kind");
3903
- if (!e)
3909
+ o && Qt(o.dataset.kind);
3910
+ }), r.discard.addEventListener("click", ms), r.recapture.addEventListener("click", () => {
3911
+ fs().catch((a) => S(a.message || p("status.recaptureFailed")));
3912
+ }), r.restore.addEventListener("click", hs), r.audio.addEventListener("click", ys), r.video.addEventListener("click", () => {
3913
+ vs().catch((a) => S((a == null ? void 0 : a.message) || p("status.screenUnsupported")));
3914
+ }), r.stop.addEventListener("click", () => V == null ? void 0 : V.stop()), r.privacyChange.addEventListener("click", () => oe(!W)), r.privacyScroll.addEventListener("change", Ms), h(".nf-submit").addEventListener("click", () => {
3915
+ ka().catch((a) => S(a.message || p("status.submitFailed")));
3916
+ }), ea(), ht(null);
3917
+ }
3918
+ function M(t) {
3919
+ return String(t || "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3920
+ }
3921
+ function ea() {
3922
+ const t = y == null ? void 0 : y.querySelector(".nf-kind");
3923
+ if (!t)
3904
3924
  return;
3905
- const t = Array.isArray(d.kinds) && d.kinds.length ? d.kinds : _;
3906
- e.innerHTML = t.map((s) => `<button type="button" data-kind="${x(s.id)}">${x(Xt(s))}</button>`).join("");
3907
- const o = t.map((s) => s.id).includes(H) ? H : Le(t);
3908
- Xe(o);
3925
+ const e = Array.isArray(c.kinds) && c.kinds.length ? c.kinds : Z;
3926
+ t.innerHTML = e.map((i) => `<button type="button" data-kind="${M(i.id)}">${M(ta(i))}</button>`).join("");
3927
+ const o = e.map((i) => i.id).includes(G) ? G : Tt(e);
3928
+ Qt(o);
3909
3929
  }
3910
- function Xe(e) {
3911
- H = (d.kinds || _).map((a) => a.id).includes(e) ? e : Le(d.kinds), y == null || y.querySelectorAll("[data-kind]").forEach((a) => {
3912
- a.dataset.active = String(a.dataset.kind === H);
3913
- }), os(H), Qe();
3930
+ function Qt(t) {
3931
+ G = (c.kinds || Z).map((a) => a.id).includes(t) ? t : Tt(c.kinds), y == null || y.querySelectorAll("[data-kind]").forEach((a) => {
3932
+ a.dataset.active = String(a.dataset.kind === G);
3933
+ }), ss(G), te();
3914
3934
  }
3915
- function es() {
3916
- return (Array.isArray(d.kinds) && d.kinds.length ? d.kinds : _).find((t) => t.id === H) || null;
3935
+ function as() {
3936
+ return (Array.isArray(c.kinds) && c.kinds.length ? c.kinds : Z).find((e) => e.id === G) || null;
3917
3937
  }
3918
- function ts() {
3919
- const e = es(), t = (e == null ? void 0 : e.id) || H || "other", a = t === "bug" || t === "idea" || t === "other", o = (e == null ? void 0 : e.title) && String(e.title).trim() || p(a ? `form.title.${t}` : "form.title.other"), s = (e == null ? void 0 : e.description) && String(e.description).trim() || p(a ? `form.intro.${t}` : "form.intro.other"), i = a ? p(`form.placeholder.${t}`) : p("form.placeholder.custom", {
3920
- kind: e ? Xt(e) : ye(t)
3938
+ function os() {
3939
+ const t = as(), e = (t == null ? void 0 : t.id) || G || "other", a = e === "bug" || e === "idea" || e === "other", o = (t == null ? void 0 : t.title) && String(t.title).trim() || p(a ? `form.title.${e}` : "form.title.other"), i = (t == null ? void 0 : t.description) && String(t.description).trim() || p(a ? `form.intro.${e}` : "form.intro.other"), s = a ? p(`form.placeholder.${e}`) : p("form.placeholder.custom", {
3940
+ kind: t ? ta(t) : bt(e)
3921
3941
  });
3922
- return { title: o, intro: s, placeholder: i };
3942
+ return { title: o, intro: i, placeholder: s };
3923
3943
  }
3924
- function Qe() {
3925
- if (!n.title && !n.intro && !n.text)
3944
+ function te() {
3945
+ if (!r.title && !r.intro && !r.text)
3926
3946
  return;
3927
- const e = ts(), t = I() ? ` ${p("form.screenshotNote")}` : "";
3928
- n.title && (n.title.textContent = e.title), n.intro && (n.intro.textContent = `${e.intro}${t}`), n.text && n.text.setAttribute("placeholder", e.placeholder);
3947
+ const t = os(), e = I() ? ` ${p("form.screenshotNote")}` : "";
3948
+ r.title && (r.title.textContent = t.title), r.intro && (r.intro.textContent = `${t.intro}${e}`), r.text && r.text.setAttribute("placeholder", t.placeholder);
3929
3949
  }
3930
- function as() {
3950
+ function is() {
3931
3951
  try {
3932
- return String(localStorage.getItem(Wt) || "").trim().toLowerCase();
3952
+ return String(localStorage.getItem(Je) || "").trim().toLowerCase();
3933
3953
  } catch {
3934
3954
  return "";
3935
3955
  }
3936
3956
  }
3937
- function os(e) {
3938
- const t = String(e || "").trim().toLowerCase();
3939
- if (t)
3957
+ function ss(t) {
3958
+ const e = String(t || "").trim().toLowerCase();
3959
+ if (e)
3940
3960
  try {
3941
- localStorage.setItem(Wt, t);
3961
+ localStorage.setItem(Je, e);
3942
3962
  } catch {
3943
3963
  }
3944
3964
  }
3945
- function is() {
3946
- const e = (d.kinds || _).map((a) => a.id), t = as();
3947
- return t && e.includes(t) ? t : Le(d.kinds);
3965
+ function rs() {
3966
+ const t = (c.kinds || Z).map((a) => a.id), e = is();
3967
+ return e && t.includes(e) ? e : Tt(c.kinds);
3948
3968
  }
3949
- function ge(e) {
3950
- W = Zi.has(e) ? e : null, M = null, y.querySelectorAll(".nf-tool").forEach((t) => {
3951
- t.dataset.active = String(t.dataset.tool === W);
3952
- }), n.canvas && (n.canvas.dataset.draw = W ? "true" : "false"), I() && O();
3969
+ function ht(t) {
3970
+ J = Yi.has(t) ? t : null, O = null, y.querySelectorAll(".nf-tool").forEach((e) => {
3971
+ e.dataset.active = String(e.dataset.tool === J);
3972
+ }), r.canvas && (r.canvas.dataset.draw = J ? "true" : "false"), I() && D();
3953
3973
  }
3954
- function At(e) {
3955
- return Math.min(1, Math.max(0, e));
3974
+ function ze(t) {
3975
+ return Math.min(1, Math.max(0, t));
3956
3976
  }
3957
- function me() {
3958
- return n.shot || n.canvas;
3977
+ function yt() {
3978
+ return r.shot || r.canvas;
3959
3979
  }
3960
- function Ee(e) {
3961
- const t = me().getBoundingClientRect();
3980
+ function Pt(t) {
3981
+ const e = yt().getBoundingClientRect();
3962
3982
  return {
3963
- x: At((e.clientX - t.left) / Math.max(t.width, 1)),
3964
- y: At((e.clientY - t.top) / Math.max(t.height, 1))
3983
+ x: ze((t.clientX - e.left) / Math.max(e.width, 1)),
3984
+ y: ze((t.clientY - e.top) / Math.max(e.height, 1))
3965
3985
  };
3966
3986
  }
3967
- function ss(e) {
3968
- const t = me().getBoundingClientRect();
3969
- return e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom;
3987
+ function ns(t) {
3988
+ const e = yt().getBoundingClientRect();
3989
+ return t.clientX >= e.left && t.clientX <= e.right && t.clientY >= e.top && t.clientY <= e.bottom;
3970
3990
  }
3971
- function ea(e) {
3972
- const t = Ee(e), a = A.crop();
3991
+ function aa(t) {
3992
+ const e = Pt(t), a = A.crop();
3973
3993
  return {
3974
- x: a.x + t.x * a.w,
3975
- y: a.y + t.y * a.h
3994
+ x: a.x + e.x * a.w,
3995
+ y: a.y + e.y * a.h
3976
3996
  };
3977
3997
  }
3978
- function Ue(e, t) {
3979
- const a = Math.min(e.x, t.x), o = Math.min(e.y, t.y);
3998
+ function Ft(t, e) {
3999
+ const a = Math.min(t.x, e.x), o = Math.min(t.y, e.y);
3980
4000
  return {
3981
4001
  x: a,
3982
4002
  y: o,
3983
- w: Math.max(Ke, Math.abs(t.x - e.x)),
3984
- h: Math.max(Ke, Math.abs(t.y - e.y))
4003
+ w: Math.max(Ht, Math.abs(e.x - t.x)),
4004
+ h: Math.max(Ht, Math.abs(e.y - t.y))
3985
4005
  };
3986
4006
  }
3987
- function et(e) {
3988
- y && (e ? y.dataset.grabbing = "true" : delete y.dataset.grabbing);
4007
+ function ee(t) {
4008
+ y && (t ? y.dataset.grabbing = "true" : delete y.dataset.grabbing);
3989
4009
  }
3990
- function $e(e) {
4010
+ function Bt(t) {
3991
4011
  try {
3992
- n.canvas.setPointerCapture(e.pointerId);
4012
+ r.canvas.setPointerCapture(t.pointerId);
3993
4013
  } catch {
3994
4014
  }
3995
4015
  }
3996
- function He() {
3997
- window.addEventListener("pointermove", aa), window.addEventListener("pointerup", je), window.addEventListener("pointercancel", je);
4016
+ function Gt() {
4017
+ window.addEventListener("pointermove", ia), window.addEventListener("pointerup", xt), window.addEventListener("pointercancel", xt);
3998
4018
  }
3999
- function ta() {
4000
- window.removeEventListener("pointermove", aa), window.removeEventListener("pointerup", je), window.removeEventListener("pointercancel", je);
4019
+ function oa() {
4020
+ window.removeEventListener("pointermove", ia), window.removeEventListener("pointerup", xt), window.removeEventListener("pointercancel", xt);
4001
4021
  }
4002
- function rs(e) {
4003
- if (e.button !== 0 || !I())
4022
+ function ls(t) {
4023
+ if (t.button !== 0 || !I())
4004
4024
  return;
4005
- if (!e.target.closest(".nf-sticker") && !ss(e)) {
4006
- M = null, O();
4025
+ if (!t.target.closest(".nf-sticker") && !ns(t)) {
4026
+ O = null, D();
4007
4027
  return;
4008
4028
  }
4009
- const t = e.target.closest(".nf-handle"), a = e.target.closest(".nf-sticker");
4029
+ const e = t.target.closest(".nf-handle"), a = t.target.closest(".nf-sticker");
4010
4030
  if (a && a.dataset.preview !== "true") {
4011
- e.preventDefault(), e.stopPropagation(), M = a.dataset.id, $e(e), ns({
4031
+ t.preventDefault(), t.stopPropagation(), O = a.dataset.id, Bt(t), us({
4012
4032
  kind: "sticker",
4013
- id: M,
4014
- dir: (t == null ? void 0 : t.dataset.dir) || "move"
4015
- }, e), O();
4033
+ id: O,
4034
+ dir: (e == null ? void 0 : e.dataset.dir) || "move"
4035
+ }, t), D();
4016
4036
  return;
4017
4037
  }
4018
- if (M = null, W === "crop") {
4019
- e.preventDefault(), $e(e), j = { kind: "crop", start: Ee(e), current: Ee(e) }, He(), O();
4038
+ if (O = null, J === "crop") {
4039
+ t.preventDefault(), Bt(t), R = { kind: "crop", start: Pt(t), current: Pt(t) }, Gt(), D();
4020
4040
  return;
4021
4041
  }
4022
- if (W === "arrow" || W === "rect" || W === "circle") {
4023
- e.preventDefault(), $e(e);
4024
- const o = ea(e);
4025
- j = { kind: "sticker", type: W, start: o, current: o }, He(), O();
4042
+ if (J === "arrow" || J === "rect" || J === "circle") {
4043
+ t.preventDefault(), Bt(t);
4044
+ const o = aa(t);
4045
+ R = { kind: "sticker", type: J, start: o, current: o }, Gt(), D();
4026
4046
  return;
4027
4047
  }
4028
- O();
4048
+ D();
4029
4049
  }
4030
- function ns(e, t) {
4031
- t.preventDefault(), t.stopPropagation();
4032
- const a = me().getBoundingClientRect(), o = A.list().find((s) => s.id === e.id);
4050
+ function us(t, e) {
4051
+ e.preventDefault(), e.stopPropagation();
4052
+ const a = yt().getBoundingClientRect(), o = A.list().find((i) => i.id === t.id);
4033
4053
  E = {
4034
- ...e,
4035
- startX: t.clientX,
4036
- startY: t.clientY,
4054
+ ...t,
4055
+ startX: e.clientX,
4056
+ startY: e.clientY,
4037
4057
  crop: A.crop(),
4038
4058
  sticker: o ? { ...o } : null,
4039
4059
  rect: a
4040
- }, et(e.dir === "move" || e.dir === "start" || e.dir === "end"), He();
4060
+ }, ee(t.dir === "move" || t.dir === "start" || t.dir === "end"), Gt();
4041
4061
  }
4042
- function aa(e) {
4043
- if (j) {
4044
- j.current = j.kind === "crop" ? Ee(e) : ea(e), O();
4062
+ function ia(t) {
4063
+ if (R) {
4064
+ R.current = R.kind === "crop" ? Pt(t) : aa(t), D();
4045
4065
  return;
4046
4066
  }
4047
4067
  if (!E)
4048
4068
  return;
4049
- 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;
4069
+ const e = (t.clientX - E.startX) / E.rect.width * E.crop.w, a = (t.clientY - E.startY) / E.rect.height * E.crop.h, o = E.sticker;
4050
4070
  if (o) {
4051
4071
  if (E.dir === "end")
4052
4072
  A.update(o.id, {
4053
- x2: o.x2 + t,
4073
+ x2: o.x2 + e,
4054
4074
  y2: o.y2 + a
4055
4075
  });
4056
4076
  else if (E.dir === "start")
4057
4077
  A.update(o.id, {
4058
- x: o.x + t,
4078
+ x: o.x + e,
4059
4079
  y: o.y + a
4060
4080
  });
4061
4081
  else if (E.dir === "move")
4062
4082
  A.update(o.id, {
4063
- x: o.x + t,
4083
+ x: o.x + e,
4064
4084
  y: o.y + a,
4065
- x2: (o.x2 || o.x) + t,
4085
+ x2: (o.x2 || o.x) + e,
4066
4086
  y2: (o.y2 || o.y) + a
4067
4087
  });
4068
4088
  else {
4069
- const s = { x: o.x, y: o.y, w: o.w, h: o.h };
4070
- ls(s, E.dir, t, a), A.update(o.id, s);
4089
+ const i = { x: o.x, y: o.y, w: o.w, h: o.h };
4090
+ cs(i, E.dir, e, a), A.update(o.id, i);
4071
4091
  }
4072
- O();
4092
+ D();
4073
4093
  }
4074
4094
  }
4075
- function ls(e, t, a, o) {
4076
- 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")) {
4077
- const s = Math.max(0.04, e.w - a);
4078
- e.x += e.w - s, e.w = s;
4095
+ function cs(t, e, a, o) {
4096
+ if (e.includes("e") && (t.w = Math.max(0.04, t.w + a)), e.includes("s") && (t.h = Math.max(0.04, t.h + o)), e.includes("w")) {
4097
+ const i = Math.max(0.04, t.w - a);
4098
+ t.x += t.w - i, t.w = i;
4079
4099
  }
4080
- if (t.includes("n")) {
4081
- const s = Math.max(0.04, e.h - o);
4082
- e.y += e.h - s, e.h = s;
4100
+ if (e.includes("n")) {
4101
+ const i = Math.max(0.04, t.h - o);
4102
+ t.y += t.h - i, t.h = i;
4083
4103
  }
4084
4104
  }
4085
- function je(e) {
4086
- if (ta(), et(!1), j) {
4087
- us();
4105
+ function xt(t) {
4106
+ if (oa(), ee(!1), R) {
4107
+ ds();
4088
4108
  return;
4089
4109
  }
4090
4110
  if (E) {
4091
4111
  if (E.kind === "sticker") {
4092
- const t = n.canvas.getBoundingClientRect();
4093
- (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);
4112
+ const e = r.canvas.getBoundingClientRect();
4113
+ (t.clientX < e.left - 24 || t.clientX > e.right + 24 || t.clientY < e.top - 24 || t.clientY > e.bottom + 24) && (A.remove(E.id), O = null);
4094
4114
  }
4095
- E = null, O();
4115
+ E = null, D();
4096
4116
  }
4097
4117
  }
4098
- function us() {
4099
- const e = j;
4100
- if (j = null, !e)
4118
+ function ds() {
4119
+ const t = R;
4120
+ if (R = null, !t)
4101
4121
  return;
4102
- if (e.kind === "crop") {
4103
- const a = Ue(e.start, e.current);
4104
- if (Math.abs(e.current.x - e.start.x) < St || Math.abs(e.current.y - e.start.y) < St) {
4105
- O();
4122
+ if (t.kind === "crop") {
4123
+ const a = Ft(t.start, t.current);
4124
+ if (Math.abs(t.current.x - t.start.x) < Ce || Math.abs(t.current.y - t.start.y) < Ce) {
4125
+ D();
4106
4126
  return;
4107
4127
  }
4108
- const s = A.crop();
4128
+ const i = A.crop();
4109
4129
  A.setCrop({
4110
- x: s.x + a.x * s.w,
4111
- y: s.y + a.y * s.h,
4112
- w: a.w * s.w,
4113
- h: a.h * s.h
4114
- }), te();
4130
+ x: i.x + a.x * i.w,
4131
+ y: i.y + a.y * i.h,
4132
+ w: a.w * i.w,
4133
+ h: a.h * i.h
4134
+ }), at();
4115
4135
  return;
4116
4136
  }
4117
- const t = cs(e);
4118
- t && (M = t.id), O();
4119
- }
4120
- function cs(e) {
4121
- if (e.type === "arrow") {
4122
- const t = e.current.x - e.start.x, a = e.current.y - e.start.y;
4123
- return Math.hypot(t, a) < Ke ? A.add("arrow", {
4124
- x: e.start.x,
4125
- y: e.start.y,
4126
- x2: e.start.x + 0.12,
4127
- y2: e.start.y,
4137
+ const e = ps(t);
4138
+ e && (O = e.id), D();
4139
+ }
4140
+ function ps(t) {
4141
+ if (t.type === "arrow") {
4142
+ const e = t.current.x - t.start.x, a = t.current.y - t.start.y;
4143
+ return Math.hypot(e, a) < Ht ? A.add("arrow", {
4144
+ x: t.start.x,
4145
+ y: t.start.y,
4146
+ x2: t.start.x + 0.12,
4147
+ y2: t.start.y,
4128
4148
  w: 0.12,
4129
4149
  h: 0.02
4130
4150
  }) : A.add("arrow", {
4131
- x: e.start.x,
4132
- y: e.start.y,
4133
- x2: e.current.x,
4134
- y2: e.current.y,
4135
- w: Math.abs(t),
4151
+ x: t.start.x,
4152
+ y: t.start.y,
4153
+ x2: t.current.x,
4154
+ y2: t.current.y,
4155
+ w: Math.abs(e),
4136
4156
  h: Math.abs(a)
4137
4157
  });
4138
4158
  }
4139
- return A.add(e.type, Ue(e.start, e.current));
4159
+ return A.add(t.type, Ft(t.start, t.current));
4140
4160
  }
4141
- function ds() {
4142
- A.resetCrop(), M = null, te();
4161
+ function gs() {
4162
+ A.resetCrop(), O = null, at();
4143
4163
  }
4144
- function Re() {
4145
- n.resetCrop && (n.resetCrop.hidden = !A.isCropped());
4164
+ function Lt() {
4165
+ r.resetCrop && (r.resetCrop.hidden = !A.isCropped());
4146
4166
  }
4147
- function Te(e) {
4148
- if (!n.audio)
4167
+ function ft(t) {
4168
+ if (!r.audio)
4149
4169
  return;
4150
- const t = p(e ? "tool.audioStop" : "tool.audio");
4151
- n.audio.title = t, n.audio.setAttribute("aria-label", t), n.audio.dataset.active = String(!!e);
4170
+ const e = !!t, a = p(e ? "tool.audioStop" : "tool.audio");
4171
+ r.audio.title = a, r.audio.setAttribute("aria-label", a), r.audio.dataset.active = String(e), r.audio.innerHTML = e ? x.stop : x.audio;
4172
+ }
4173
+ function ut(t) {
4174
+ if (tt = !!t, r.video) {
4175
+ const e = p(tt ? "tool.stopVideo" : "tool.video");
4176
+ r.video.title = e, r.video.setAttribute("aria-label", e), r.video.dataset.active = String(tt), r.video.innerHTML = tt ? x.stop : x.video;
4177
+ }
4178
+ if (r.stop) {
4179
+ const e = p("tool.stopVideo");
4180
+ r.stop.title = e, r.stop.setAttribute("aria-label", e), r.stop.innerHTML = x.stop, r.stop.dataset.active = "true";
4181
+ }
4152
4182
  }
4153
4183
  function I() {
4154
- return Y(G);
4184
+ return X(q);
4155
4185
  }
4156
- function he() {
4157
- if (!n.stage || !n.palette || !n.actions || !n.recapture)
4186
+ function vt() {
4187
+ if (!r.stage || !r.palette || !r.actions || !r.recapture)
4158
4188
  return;
4159
- const e = I();
4160
- n.stage.hidden = !e && !K, n.palette.hidden = !e, n.discard && (n.discard.hidden = !e), n.restore && (n.restore.hidden = e || !se), e && n.paletteShot ? (n.paletteShot.appendChild(n.recapture), n.paletteShot.appendChild(n.discard)) : n.audio ? n.audio.after(n.recapture) : n.actions.insertBefore(n.recapture, n.submit || null), n.recapture.hidden = !1, Qe();
4189
+ const t = I();
4190
+ r.stage.hidden = !t && !H, r.palette.hidden = !t, r.discard && (r.discard.hidden = !t), r.restore && (r.restore.hidden = t || !rt), t && r.paletteShot ? (r.paletteShot.appendChild(r.recapture), r.paletteShot.appendChild(r.discard)) : r.actionsMedia ? r.actionsMedia.after(r.recapture) : r.audio ? r.audio.after(r.recapture) : r.actions.insertBefore(r.recapture, r.submit || null), r.recapture.hidden = !1, te();
4161
4191
  }
4162
- function ps() {
4163
- I() && (se = G), G = "", ge(null), he(), te();
4192
+ function ms() {
4193
+ I() && (rt = q), q = "", ht(null), vt(), at();
4164
4194
  }
4165
- function gs() {
4166
- Y(se) && (G = se, he(), te());
4195
+ function hs() {
4196
+ X(rt) && (q = rt, vt(), at());
4167
4197
  }
4168
- function oa() {
4198
+ function sa() {
4169
4199
  return {
4170
- capture: typeof d.capture == "function" ? d.capture : void 0,
4171
- onBeforeCapture: typeof d.onBeforeCapture == "function" ? d.onBeforeCapture : void 0
4200
+ capture: typeof c.capture == "function" ? c.capture : void 0,
4201
+ onBeforeCapture: typeof c.onBeforeCapture == "function" ? c.onBeforeCapture : void 0
4172
4202
  };
4173
4203
  }
4174
- function ia(e) {
4175
- if (!Y(e))
4204
+ function ra(t) {
4205
+ if (!X(t))
4176
4206
  throw new Error(p("status.screenshotFailed"));
4177
- G = e, se = e, A = Je(), q = { w: 0, h: 0 }, M = null, j = null, E = null, ge(null);
4207
+ q = t, rt = t, A = Yt(), ct = { w: 0, h: 0 }, O = null, R = null, E = null, ht(null);
4178
4208
  }
4179
- async function ms() {
4180
- if (!(Ie || !n.dialog || n.dialog.hidden)) {
4181
- Ie = !0, n.recapture.disabled = !0, S(p("status.capturing"), !0), n.dialog.hidden = !0;
4209
+ async function fs() {
4210
+ if (!(Vt || !r.dialog || r.dialog.hidden)) {
4211
+ Vt = !0, r.recapture.disabled = !0, S(p("status.capturing"), !0), r.dialog.hidden = !0;
4182
4212
  try {
4183
- let e = "";
4213
+ let t = "";
4184
4214
  try {
4185
- e = await mi();
4215
+ t = await fi();
4186
4216
  } catch {
4187
- e = await $t(oa());
4217
+ t = await Ne(sa());
4188
4218
  }
4189
- ia(e), S("");
4190
- } catch (e) {
4191
- S((e == null ? void 0 : e.message) || p("status.screenshotFailed"));
4219
+ ra(t), S("");
4220
+ } catch (t) {
4221
+ S((t == null ? void 0 : t.message) || p("status.screenshotFailed"));
4192
4222
  } finally {
4193
- n.dialog.hidden = !1, n.recapture.disabled = !1, Ie = !1, he(), te();
4223
+ r.dialog.hidden = !1, r.recapture.disabled = !1, Vt = !1, vt(), at();
4194
4224
  }
4195
4225
  }
4196
4226
  }
4197
- function hs() {
4227
+ function ys() {
4198
4228
  try {
4199
- if (Q || (Q = ji((t) => {
4200
- const a = n.text.value.trim();
4201
- n.text.value = a ? `${a} ${t}` : t;
4202
- })), !Q.isSupported()) {
4229
+ if (_ || (_ = Pi((e) => {
4230
+ const a = r.text.value.trim();
4231
+ r.text.value = a ? `${a} ${e}` : e;
4232
+ }, {
4233
+ onActiveChange(e) {
4234
+ ft(e), e || S("");
4235
+ }
4236
+ })), !_.isSupported()) {
4203
4237
  S(p("status.audioUnsupported"));
4204
4238
  return;
4205
4239
  }
4206
- const e = Q.start({ lang: be() });
4207
- Te(e), S(e ? p("status.listening") : "");
4208
- } catch (e) {
4209
- S(e.message);
4240
+ if (_.isActive()) {
4241
+ _.stop();
4242
+ return;
4243
+ }
4244
+ const t = _.start({ lang: At() });
4245
+ ft(t), S(t ? p("status.listening") : "");
4246
+ } catch (t) {
4247
+ S(t.message);
4210
4248
  }
4211
4249
  }
4212
- async function fs() {
4213
- if (!d.video) {
4250
+ async function vs() {
4251
+ if (tt) {
4252
+ V == null || V.stop();
4253
+ return;
4254
+ }
4255
+ await ks();
4256
+ }
4257
+ async function ks() {
4258
+ if (!c.video) {
4214
4259
  S(p("status.videoDisabled"));
4215
4260
  return;
4216
4261
  }
4217
- n.dialog.hidden = !0, n.stop.hidden = !1, re(), n.launcher.hidden = !0, le = Pi({
4218
- onStart() {
4219
- },
4220
- onStop(e) {
4221
- K = e, n.stop.hidden = !0, ze(), n.dialog.hidden = !1, he(), te(), S(p(e ? "status.videoAttached" : "status.recordingCancelled"));
4222
- },
4223
- onError(e) {
4224
- S(e.message);
4262
+ if (!tt) {
4263
+ r.dialog.hidden = !0, r.stop.hidden = !1, nt(), r.launcher.hidden = !0, V = Li({
4264
+ onStart() {
4265
+ ut(!0);
4266
+ },
4267
+ onStop(t) {
4268
+ H = t, ut(!1), r.stop.hidden = !0, jt(), r.dialog.hidden = !1, vt(), at(), S(p(t ? "status.videoAttached" : "status.recordingCancelled"));
4269
+ },
4270
+ onError(t) {
4271
+ ut(!1), S(t.message);
4272
+ }
4273
+ });
4274
+ try {
4275
+ await V.start();
4276
+ } catch (t) {
4277
+ ut(!1), r.stop.hidden = !0, jt(), r.dialog.hidden = !1, S(t.message);
4225
4278
  }
4226
- });
4227
- try {
4228
- await le.start();
4229
- } catch (e) {
4230
- n.stop.hidden = !0, ze(), n.dialog.hidden = !1, S(e.message);
4231
4279
  }
4232
4280
  }
4233
- function te() {
4234
- if (n.shot = null, !I()) {
4235
- 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>` : "", Re();
4281
+ function bs() {
4282
+ var e;
4283
+ const t = r.shotBlock || r.canvas;
4284
+ t == null || t.style.removeProperty("--nf-shot-aspect"), (e = r.canvas) == null || e.style.removeProperty("aspect-ratio");
4285
+ }
4286
+ function ws(t, e) {
4287
+ if (!(t > 0) || !(e > 0))
4288
+ return;
4289
+ const a = r.shotBlock || r.canvas, o = t / e;
4290
+ a == null || a.style.setProperty("--nf-shot-aspect", String(o)), r.canvas && (r.canvas.style.aspectRatio = `${t} / ${e}`);
4291
+ }
4292
+ function Ss(t) {
4293
+ if (!r.shot || !r.canvas || !(t > 0))
4294
+ return;
4295
+ const e = r.canvas.clientWidth, a = r.canvas.clientHeight;
4296
+ if (!(e > 0) || !(a > 0)) {
4297
+ r.shot.style.left = "0", r.shot.style.top = "0", r.shot.style.width = "100%", r.shot.style.height = "100%";
4236
4298
  return;
4237
4299
  }
4238
- n.canvas.innerHTML = `<div class="nf-shot"><img alt="${x(p("shot.alt"))}" src="${G}" draggable="false"></div>`, n.shot = n.canvas.querySelector(".nf-shot");
4239
- const e = n.shot.querySelector("img");
4240
- e.draggable = !1, e.addEventListener("dragstart", (a) => a.preventDefault());
4241
- const t = () => {
4242
- ys(e), O();
4243
- };
4244
- e.addEventListener("load", t), e.complete && e.naturalWidth && t(), Re();
4300
+ const o = e / a, i = Math.min(1, t / o), s = Math.min(1, o / t);
4301
+ r.shot.style.left = `${(1 - i) / 2 * 100}%`, r.shot.style.top = `${(1 - s) / 2 * 100}%`, r.shot.style.width = `${i * 100}%`, r.shot.style.height = `${s * 100}%`;
4245
4302
  }
4246
- function ys(e) {
4247
- const t = e.naturalWidth || q.w, a = e.naturalHeight || q.h;
4248
- if (t && a && (q = { w: t, h: a }, n.canvas.style.setProperty("--nf-shot-aspect", String(t / a)), n.canvas.style.aspectRatio = `${t} / ${a}`), !n.shot || !q.w || !q.h)
4303
+ function at() {
4304
+ if (r.shot = null, !I()) {
4305
+ bs(), r.canvas.innerHTML = H ? `<video class="nf-recording-preview" controls src="${URL.createObjectURL(H)}"></video>` : "", Lt();
4249
4306
  return;
4250
- const o = A.crop(), s = q.w / q.h, i = o.w / o.h * s, r = Math.min(1, i / s), l = Math.min(1, s / i);
4251
- 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}%`;
4307
+ }
4308
+ r.canvas.innerHTML = `<div class="nf-shot"><img alt="${M(p("shot.alt"))}" src="${q}" draggable="false"></div>`, r.shot = r.canvas.querySelector(".nf-shot");
4309
+ const t = r.shot.querySelector("img");
4310
+ t.draggable = !1, t.addEventListener("dragstart", (a) => a.preventDefault());
4311
+ const e = () => {
4312
+ As(t), D();
4313
+ };
4314
+ t.addEventListener("load", e), t.complete && t.naturalWidth && e(), Lt();
4252
4315
  }
4253
- function vs(e) {
4254
- return e.type === "arrow" ? {
4316
+ function As(t) {
4317
+ const e = t.naturalWidth || ct.w, a = t.naturalHeight || ct.h;
4318
+ if (!r.shot || !(e > 0) || !(a > 0))
4319
+ return;
4320
+ ct = { w: e, h: a };
4321
+ const o = A.crop(), i = o.w * e, s = o.h * a, n = i / s;
4322
+ ws(i, s), t.style.width = `${100 / o.w}%`, t.style.height = `${100 / o.h}%`, t.style.left = `${-o.x / o.w * 100}%`, t.style.top = `${-o.y / o.h * 100}%`;
4323
+ const l = () => Ss(n);
4324
+ l(), requestAnimationFrame(l);
4325
+ }
4326
+ function Cs(t) {
4327
+ return t.type === "arrow" ? {
4255
4328
  id: "preview",
4256
4329
  type: "arrow",
4257
4330
  number: "",
4258
- x: e.start.x,
4259
- y: e.start.y,
4260
- x2: e.current.x,
4261
- y2: e.current.y,
4262
- w: Math.abs(e.current.x - e.start.x),
4263
- h: Math.abs(e.current.y - e.start.y)
4331
+ x: t.start.x,
4332
+ y: t.start.y,
4333
+ x2: t.current.x,
4334
+ y2: t.current.y,
4335
+ w: Math.abs(t.current.x - t.start.x),
4336
+ h: Math.abs(t.current.y - t.start.y)
4264
4337
  } : {
4265
4338
  id: "preview",
4266
- type: e.type,
4339
+ type: t.type,
4267
4340
  number: "",
4268
- ...Ue(e.start, e.current)
4341
+ ...Ft(t.start, t.current)
4269
4342
  };
4270
4343
  }
4271
- function O() {
4272
- if ((n.shot || n.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((i) => i.remove()), !I() || !n.shot) {
4273
- Re();
4344
+ function D() {
4345
+ if ((r.shot || r.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((s) => s.remove()), !I() || !r.shot) {
4346
+ Lt();
4274
4347
  return;
4275
4348
  }
4276
- const t = A.crop(), a = me(), o = Kt(a.clientWidth || 400);
4277
- 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") {
4278
- const i = document.createElement("div");
4279
- i.className = "nf-crop", Ct(i, Ue(j.start, j.current), { x: 0, y: 0, w: 1, h: 1 }), n.shot.appendChild(i);
4349
+ const e = A.crop(), a = yt(), o = Ge(a.clientWidth || 400);
4350
+ if (r.shot.style.setProperty("--nf-anno-stroke", `${o.stroke}px`), r.shot.style.setProperty("--nf-anno-badge", `${o.badgeRadius * 2}px`), r.shot.style.setProperty("--nf-anno-badge-font", `${o.fontSize}px`), r.shot.style.setProperty("--nf-anno-handle", `${Math.max(8, o.stroke * 2.5)}px`), (R == null ? void 0 : R.kind) === "crop") {
4351
+ const s = document.createElement("div");
4352
+ s.className = "nf-crop", Ee(s, Ft(R.start, R.current), { x: 0, y: 0, w: 1, h: 1 }), r.shot.appendChild(s);
4280
4353
  }
4281
- const s = A.list().slice();
4282
- if ((j == null ? void 0 : j.kind) === "sticker" && s.push(vs(j)), s.forEach((i) => {
4283
- const r = i.id === "preview", l = !r && i.id === M, u = document.createElement("div");
4284
- 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" ? ks(u, i, t, l, o) : (Ct(u, i, t), l && ["nw", "ne", "sw", "se"].forEach((c) => Ge(u, c))), !r && i.number) {
4285
- const c = document.createElement("span");
4286
- c.className = "nf-badge", c.textContent = String(i.number), u.appendChild(c);
4354
+ const i = A.list().slice();
4355
+ if ((R == null ? void 0 : R.kind) === "sticker" && i.push(Cs(R)), i.forEach((s) => {
4356
+ const n = s.id === "preview", l = !n && s.id === O, u = document.createElement("div");
4357
+ if (u.className = `nf-sticker nf-${s.type}`, u.dataset.id = s.id, l && (u.dataset.selected = "true"), n && (u.dataset.preview = "true"), s.type === "arrow" ? zs(u, s, e, l, o) : (Ee(u, s, e), l && ["nw", "ne", "sw", "se"].forEach((d) => qt(u, d))), !n && s.number) {
4358
+ const d = document.createElement("span");
4359
+ d.className = "nf-badge", d.textContent = String(s.number), u.appendChild(d);
4287
4360
  }
4288
- n.shot.appendChild(u);
4289
- }), n.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((i) => i.remove()), K) {
4290
- const i = document.createElement("video");
4291
- 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);
4361
+ r.shot.appendChild(u);
4362
+ }), r.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((s) => s.remove()), H) {
4363
+ const s = document.createElement("video");
4364
+ s.className = "nf-recording-preview", s.controls = !0, s.src = URL.createObjectURL(H), s.style.position = "absolute", s.style.right = "8px", s.style.bottom = "8px", s.style.width = "160px", r.canvas.appendChild(s);
4292
4365
  }
4293
- Re();
4366
+ Lt();
4294
4367
  }
4295
- function ks(e, t, a, o, s = Kt(400)) {
4296
- const i = me(), 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, F = u - w, B = c - b, P = g - w, m = v - b, C = Fi(F, B, P, m, s), X = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4297
- 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 = `
4298
- <line class="nf-arrow-hit" x1="${F}" y1="${B}" x2="${P}" y2="${m}" />
4299
- <line class="nf-arrow-shaft" x1="${F}" y1="${B}" x2="${C.shaftEnd.x}" y2="${C.shaftEnd.y}" />
4368
+ function zs(t, e, a, o, i = Ge(400)) {
4369
+ const s = yt(), n = s.clientWidth, l = s.clientHeight, u = (e.x - a.x) / a.w * n, d = (e.y - a.y) / a.h * l, g = ((e.x2 ?? e.x + e.w) - a.x) / a.w * n, k = ((e.y2 ?? e.y) - a.y) / a.h * l, v = Math.max(18, i.arrowHead + i.stroke * 2), w = Math.min(u, g) - v, b = Math.min(d, k) - v, z = Math.max(2, Math.abs(g - u)) + v * 2, j = Math.max(2, Math.abs(k - d)) + v * 2, T = u - w, N = d - b, P = g - w, m = k - b, C = Di(T, N, P, m, i), Q = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4370
+ t.style.left = `${w}px`, t.style.top = `${b}px`, t.style.width = `${z}px`, t.style.height = `${j}px`, Q.setAttribute("class", "nf-arrow-svg"), Q.setAttribute("viewBox", `0 0 ${z} ${j}`), Q.setAttribute("width", String(z)), Q.setAttribute("height", String(j)), Q.innerHTML = `
4371
+ <line class="nf-arrow-hit" x1="${T}" y1="${N}" x2="${P}" y2="${m}" />
4372
+ <line class="nf-arrow-shaft" x1="${T}" y1="${N}" x2="${C.shaftEnd.x}" y2="${C.shaftEnd.y}" />
4300
4373
  <polygon class="nf-arrow-head" points="${C.tipX},${C.tipY} ${C.left.x},${C.left.y} ${C.right.x},${C.right.y}" />
4301
- `, e.appendChild(X), o && (Ge(e, "start", { left: F - 5, top: B - 5 }), Ge(e, "end", { left: P - 5, top: m - 5 }));
4374
+ `, t.appendChild(Q), o && (qt(t, "start", { left: T - 5, top: N - 5 }), qt(t, "end", { left: P - 5, top: m - 5 }));
4302
4375
  }
4303
- function Ge(e, t, a) {
4376
+ function qt(t, e, a) {
4304
4377
  const o = document.createElement("span");
4305
- o.className = "nf-handle", o.dataset.dir = t, a && (o.style.left = `${a.left}px`, o.style.top = `${a.top}px`), e.appendChild(o);
4378
+ o.className = "nf-handle", o.dataset.dir = e, a && (o.style.left = `${a.left}px`, o.style.top = `${a.top}px`), t.appendChild(o);
4306
4379
  }
4307
- function Ct(e, t, a) {
4308
- 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}%`;
4380
+ function Ee(t, e, a) {
4381
+ t.style.left = `${(e.x - a.x) / a.w * 100}%`, t.style.top = `${(e.y - a.y) / a.h * 100}%`, t.style.width = `${e.w / a.w * 100}%`, t.style.height = `${e.h / a.h * 100}%`;
4309
4382
  }
4310
- function sa() {
4383
+ function na() {
4311
4384
  try {
4312
- return String(localStorage.getItem(_t) || "").trim();
4385
+ return String(localStorage.getItem(Ze) || "").trim();
4313
4386
  } catch {
4314
4387
  return "";
4315
4388
  }
4316
4389
  }
4317
- function bs(e) {
4318
- const t = String(e || "").trim();
4319
- if (!(!t || t === qe()))
4390
+ function Es(t) {
4391
+ const e = String(t || "").trim();
4392
+ if (!(!e || e === _t()))
4320
4393
  try {
4321
- localStorage.setItem(_t, t);
4394
+ localStorage.setItem(Ze, e);
4322
4395
  } catch {
4323
4396
  }
4324
4397
  }
4325
- function ra() {
4398
+ function la() {
4326
4399
  try {
4327
- const e = localStorage.getItem(Zt);
4328
- if (!e)
4400
+ const t = localStorage.getItem(Ye);
4401
+ if (!t)
4329
4402
  return { diagnostics: !1, logs: !1 };
4330
- const t = JSON.parse(e);
4403
+ const e = JSON.parse(t);
4331
4404
  return {
4332
- diagnostics: !!(t != null && t.diagnostics),
4333
- logs: !!(t != null && t.logs)
4405
+ diagnostics: !!(e != null && e.diagnostics),
4406
+ logs: !!(e != null && e.logs)
4334
4407
  };
4335
4408
  } catch {
4336
4409
  return { diagnostics: !1, logs: !1 };
4337
4410
  }
4338
4411
  }
4339
- function zt(e = {}) {
4340
- const t = {
4341
- ...ra(),
4342
- ...e
4412
+ function Re(t = {}) {
4413
+ const e = {
4414
+ ...la(),
4415
+ ...t
4343
4416
  };
4344
4417
  try {
4345
- localStorage.setItem(Zt, JSON.stringify({
4346
- diagnostics: !!t.diagnostics,
4347
- logs: !!t.logs
4418
+ localStorage.setItem(Ye, JSON.stringify({
4419
+ diagnostics: !!e.diagnostics,
4420
+ logs: !!e.logs
4348
4421
  }));
4349
4422
  } catch {
4350
4423
  }
4351
4424
  }
4352
- function na() {
4353
- return !!(String(N.userId || "").trim() || String(N.email || "").trim() || String(N.displayName || "").trim());
4425
+ function ua() {
4426
+ return !!(String(K.userId || "").trim() || String(K.email || "").trim() || String(K.displayName || "").trim());
4354
4427
  }
4355
- function la() {
4428
+ function ca() {
4356
4429
  return String(
4357
- N.displayName || N.email || N.userId || ""
4430
+ K.displayName || K.email || K.userId || ""
4358
4431
  ).trim();
4359
4432
  }
4360
- function qe() {
4433
+ function _t() {
4361
4434
  return p("form.authorPlaceholder");
4362
4435
  }
4363
- function ws() {
4364
- var t;
4365
- if (na())
4366
- return la() || qe();
4367
- const e = String(((t = n.author) == null ? void 0 : t.value) || "").trim();
4368
- return e ? (bs(e), e) : qe();
4436
+ function Rs() {
4437
+ var e;
4438
+ if (ua())
4439
+ return ca() || _t();
4440
+ const t = String(((e = r.author) == null ? void 0 : e.value) || "").trim();
4441
+ return t ? (Es(t), t) : _t();
4369
4442
  }
4370
- function ua() {
4371
- if (!n.author)
4443
+ function da() {
4444
+ if (!r.author)
4372
4445
  return;
4373
- const e = na();
4374
- if (n.author.hidden = e, e) {
4375
- n.author.value = "";
4446
+ const t = ua();
4447
+ if (r.author.hidden = t, t) {
4448
+ r.author.value = "";
4376
4449
  return;
4377
4450
  }
4378
- n.author.value = sa();
4379
- }
4380
- function ca(e, t = qt) {
4381
- const a = Number(e);
4382
- return Number.isFinite(a) ? Math.min(Yi, Math.max(0, Math.floor(a))) : t;
4383
- }
4384
- function da(e) {
4385
- e.key !== "Escape" || !n.dialog || n.dialog.hidden || de && !pe || ee();
4386
- }
4387
- function pa(e = {}) {
4388
- ki(e);
4389
- const t = Object.prototype.hasOwnProperty.call(e, "kinds");
4390
- d = {
4391
- ...d,
4392
- endpoint: String(e.endpoint || d.endpoint || "").replace(/\/$/, ""),
4393
- projectKey: e.projectKey == null ? d.projectKey : String(e.projectKey),
4394
- version: e.version == null ? d.version : String(e.version),
4395
- name: e.name == null ? d.name : String(e.name || ""),
4396
- targets: e.targets === void 0 ? d.targets : e.targets,
4397
- hideLauncher: e.hideLauncher == null ? d.hideLauncher : !!e.hideLauncher,
4398
- theme: Jt(e.theme ?? d.theme),
4399
- video: e.video == null ? d.video : !!e.video,
4400
- consoleLogLimit: e.consoleLogLimit == null ? d.consoleLogLimit : ca(e.consoleLogLimit, d.consoleLogLimit),
4401
- kinds: t ? _i(e.kinds) : d.kinds,
4402
- kindsCustom: t ? !0 : d.kindsCustom,
4403
- capture: e.capture === void 0 ? d.capture : e.capture,
4404
- onBeforeCapture: e.onBeforeCapture === void 0 ? d.onBeforeCapture : e.onBeforeCapture,
4405
- onOpen: e.onOpen === void 0 ? d.onOpen : e.onOpen,
4406
- onClose: e.onClose === void 0 ? d.onClose : e.onClose,
4407
- displayLink: e.displayLink == null ? d.displayLink : !!e.displayLink,
4408
- locale: e.locale === void 0 ? d.locale : e.locale == null || e.locale === "" ? null : String(e.locale),
4409
- translations: e.translations === void 0 ? d.translations : e.translations && typeof e.translations == "object" ? e.translations : null
4451
+ r.author.value = na();
4452
+ }
4453
+ function pa(t, e = We) {
4454
+ const a = Number(t);
4455
+ return Number.isFinite(a) ? Math.min(Qi, Math.max(0, Math.floor(a))) : e;
4456
+ }
4457
+ function ga(t) {
4458
+ t.key !== "Escape" || !r.dialog || r.dialog.hidden || gt && !mt || et();
4459
+ }
4460
+ function ma(t = {}) {
4461
+ wi(t);
4462
+ const e = Object.prototype.hasOwnProperty.call(t, "kinds");
4463
+ c = {
4464
+ ...c,
4465
+ endpoint: String(t.endpoint || c.endpoint || "").replace(/\/$/, ""),
4466
+ projectKey: t.projectKey == null ? c.projectKey : String(t.projectKey),
4467
+ version: t.version == null ? c.version : String(t.version),
4468
+ name: t.name == null ? c.name : String(t.name || ""),
4469
+ targets: t.targets === void 0 ? c.targets : t.targets,
4470
+ hideLauncher: t.hideLauncher == null ? c.hideLauncher : !!t.hideLauncher,
4471
+ theme: Xe(t.theme ?? c.theme),
4472
+ video: t.video == null ? c.video : !!t.video,
4473
+ consoleLogLimit: t.consoleLogLimit == null ? c.consoleLogLimit : pa(t.consoleLogLimit, c.consoleLogLimit),
4474
+ kinds: e ? Zi(t.kinds) : c.kinds,
4475
+ kindsCustom: e ? !0 : c.kindsCustom,
4476
+ capture: t.capture === void 0 ? c.capture : t.capture,
4477
+ onBeforeCapture: t.onBeforeCapture === void 0 ? c.onBeforeCapture : t.onBeforeCapture,
4478
+ onOpen: t.onOpen === void 0 ? c.onOpen : t.onOpen,
4479
+ onClose: t.onClose === void 0 ? c.onClose : t.onClose,
4480
+ displayLink: t.displayLink == null ? c.displayLink : !!t.displayLink,
4481
+ locale: t.locale === void 0 ? c.locale : t.locale == null || t.locale === "" ? null : String(t.locale),
4482
+ translations: t.translations === void 0 ? c.translations : t.translations && typeof t.translations == "object" ? t.translations : null
4410
4483
  };
4411
4484
  }
4412
- function ga(e) {
4413
- const t = d[e];
4414
- if (typeof t == "function")
4485
+ function ha(t) {
4486
+ const e = c[t];
4487
+ if (typeof e == "function")
4415
4488
  try {
4416
- t();
4489
+ e();
4417
4490
  } catch (a) {
4418
- console.warn(`Notefully.${e} failed:`, a);
4491
+ console.warn(`Notefully.${t} failed:`, a);
4419
4492
  }
4420
4493
  }
4421
- function Ss() {
4422
- return ce;
4494
+ function js() {
4495
+ return pt;
4423
4496
  }
4424
- function As() {
4425
- return be();
4497
+ function Ps() {
4498
+ return At();
4426
4499
  }
4427
- function Cs(e, t) {
4428
- return d.locale = e == null || e === "" ? null : String(e), t !== void 0 && (d.translations = t && typeof t == "object" ? t : null), y ? re() : Yt(), Fe;
4500
+ function xs(t, e) {
4501
+ return c.locale = t == null || t === "" ? null : String(t), e !== void 0 && (c.translations = e && typeof e == "object" ? e : null), y ? nt() : Qe(), Mt;
4429
4502
  }
4430
- function tt(e = {}) {
4431
- return pa(e), y && re(), Fe;
4503
+ function ae(t = {}) {
4504
+ return ma(t), y && nt(), Mt;
4432
4505
  }
4433
- function zs(e = {}) {
4434
- return pa(e), Ye(), re(), Fe;
4506
+ function Ls(t = {}) {
4507
+ return ma(t), Xt(), nt(), Mt;
4435
4508
  }
4436
- function Es(e) {
4437
- return tt({ theme: e });
4509
+ function Us(t) {
4510
+ return ae({ theme: t });
4438
4511
  }
4439
- function js(e) {
4440
- const t = !!e;
4441
- return !t && y && n.dialog && !n.dialog.hidden && ee(), tt({ hideLauncher: !t });
4512
+ function Ts(t) {
4513
+ const e = !!t;
4514
+ return !e && y && r.dialog && !r.dialog.hidden && et(), ae({ hideLauncher: !e });
4442
4515
  }
4443
- function Rs() {
4444
- const e = la() || sa() || void 0, t = yi({
4445
- ...N,
4446
- displayName: N.displayName || e
4516
+ function Fs() {
4517
+ const t = ca() || na() || void 0, e = ki({
4518
+ ...K,
4519
+ displayName: K.displayName || t
4447
4520
  });
4448
- $ = Bi(t), V = Ni(
4449
- Gt.snapshot().slice(-ca(d.consoleLogLimit))
4521
+ B = Ki(e), $ = Hi(
4522
+ _e.snapshot().slice(-pa(c.consoleLogLimit))
4450
4523
  );
4451
- const a = ra();
4452
- a.diagnostics && Ce($, !0), a.logs && V.length && Ce(V, !0), Z = !1;
4524
+ const a = la();
4525
+ a.diagnostics && Rt(B, !0), a.logs && $.length && Rt($, !0), W = !1;
4453
4526
  }
4454
- function Pe(e) {
4455
- Z = !!e, n.privacyPanel && (n.privacyPanel.hidden = !Z), n.privacyChange && (n.privacyChange.setAttribute("aria-expanded", Z ? "true" : "false"), n.privacyChange.dataset.active = String(Z)), Z && ot();
4527
+ function oe(t) {
4528
+ W = !!t, r.privacyPanel && (r.privacyPanel.hidden = !W), r.privacyStack && (r.privacyStack.dataset.open = String(W)), r.privacyChange && (r.privacyChange.setAttribute("aria-expanded", W ? "true" : "false"), r.privacyChange.dataset.active = String(W)), W && se();
4456
4529
  }
4457
- function at() {
4458
- if (!n.privacy || !n.privacyText || !n.privacyChange)
4530
+ function ie() {
4531
+ if (!r.privacy || !r.privacyText || !r.privacyChange)
4459
4532
  return;
4460
- const e = Hi({
4461
- diagnostics: $,
4462
- logs: V
4533
+ const t = qi({
4534
+ diagnostics: B,
4535
+ logs: $
4463
4536
  });
4464
- n.privacyText.textContent = e, n.privacyText.hidden = !e;
4465
- const t = $.length === 0 && V.length === 0;
4466
- n.privacySummary && (n.privacySummary.hidden = t), n.privacy.hidden = t, n.privacyChange.hidden = !1;
4467
- }
4468
- function ma(e, t, a) {
4469
- return `<label class="nf-privacy-toggle">
4470
- <span class="nf-privacy-toggle-label">${x(p("privacy.redact"))}</span>
4471
- <input type="checkbox" ${e ? "checked" : ""} ${t ? 'data-indeterminate="true"' : ""} aria-label="${x(a)}">
4537
+ r.privacyText.textContent = t, r.privacyText.hidden = !t;
4538
+ const e = B.length === 0 && $.length === 0;
4539
+ r.privacySummary && (r.privacySummary.hidden = e), r.privacy.hidden = e, r.privacyChange.hidden = !1;
4540
+ }
4541
+ function fa(t, e, a) {
4542
+ const i = `${p(t ? "privacy.included" : "privacy.redacted")} ${a}`;
4543
+ return `<label class="nf-privacy-toggle" data-included="${t ? "true" : "false"}">
4544
+ <span class="nf-privacy-check">
4545
+ <input type="checkbox" ${t ? "checked" : ""} ${e ? 'data-indeterminate="true"' : ""} aria-label="${M(i)}">
4546
+ </span>
4472
4547
  </label>`;
4473
4548
  }
4474
- function Et(e, t, a, o, s, i = null) {
4475
- const r = ma(s, !1, `${p("privacy.redact")} ${a}`), l = typeof o == "string" ? o : String(o || "");
4476
- if (s) {
4477
- const c = l ? `${a}: ${l}` : a;
4478
- return `<div class="nf-privacy-row" data-kind="${x(e)}" data-id="${x(t)}" data-redacted="true">
4479
- <div class="nf-privacy-row-text">
4480
- <div class="nf-privacy-row-summary" title="${x(c)}">${x(c)}</div>
4549
+ function je(t, e, a, o, i, s = null) {
4550
+ const n = fa(!i, !1, a), l = typeof o == "string" ? o : String(o || ""), u = i ? M(l) : s ?? M(l), d = l ? `${a}: ${l}` : a;
4551
+ return `<div class="nf-privacy-row" data-kind="${M(t)}" data-id="${M(e)}"${i ? ' data-redacted="true"' : ""}>
4552
+ ${n}
4553
+ <div class="nf-privacy-row-text"${i ? ` title="${M(d)}"` : ""}>
4554
+ <span class="nf-privacy-row-title">${M(a)}</span>
4555
+ <span class="nf-privacy-row-detail">${u}</span>
4481
4556
  </div>
4482
- ${r}
4483
- </div>`;
4484
- }
4485
- const u = i ?? x(l);
4486
- return `<div class="nf-privacy-row" data-kind="${x(e)}" data-id="${x(t)}">
4487
- <div class="nf-privacy-row-text">
4488
- <div class="nf-privacy-row-title">${x(a)}</div>
4489
- <div class="nf-privacy-row-detail">${u}</div>
4490
- </div>
4491
- ${r}
4492
4557
  </div>`;
4493
4558
  }
4494
- function jt(e, t, a, o) {
4559
+ function Pe(t, e, a, o) {
4495
4560
  if (!a.length)
4496
4561
  return "";
4497
- const s = Ki(a), i = s.checked && !s.indeterminate;
4498
- return `<section class="nf-privacy-section" data-section="${x(e)}"${i ? ' data-redacted="true"' : ""}>
4562
+ const i = Gi(a), s = !i.checked && !i.indeterminate;
4563
+ return `<section class="nf-privacy-section" data-section="${M(t)}"${s ? ' data-redacted="true"' : ""}>
4499
4564
  <div class="nf-privacy-section-head">
4500
- <h3 class="nf-privacy-section-title">${x(t)}</h3>
4501
- ${ma(s.checked, s.indeterminate, `${p("privacy.redact")} ${t}`)}
4565
+ ${fa(i.checked, i.indeterminate, e)}
4566
+ <h3 class="nf-privacy-section-title">${M(e)}</h3>
4502
4567
  </div>
4503
- <div class="nf-privacy-rows"${i ? " hidden" : ""}>${o}</div>
4568
+ <div class="nf-privacy-rows"${s ? " hidden" : ""}>${o}</div>
4504
4569
  </section>`;
4505
4570
  }
4506
- function ot() {
4507
- if (!n.privacyScroll)
4571
+ function se() {
4572
+ if (!r.privacyScroll)
4508
4573
  return;
4509
- const e = $.map((a) => Et(
4574
+ const t = B.map((a) => je(
4510
4575
  "diagnostic",
4511
4576
  a.key,
4512
4577
  a.label,
4513
- Gi(a.value),
4578
+ _i(a.value),
4514
4579
  a.redacted
4515
- )).join(""), t = V.map((a) => {
4516
- const o = Ai(a);
4517
- return Et(
4580
+ )).join(""), e = $.map((a) => {
4581
+ const o = zi(a);
4582
+ return je(
4518
4583
  "log",
4519
4584
  a.id,
4520
4585
  a.level,
4521
4586
  o,
4522
4587
  a.redacted,
4523
- a.redacted ? null : Ci(a)
4588
+ a.redacted ? null : Ei(a)
4524
4589
  );
4525
4590
  }).join("");
4526
- n.privacyScroll.innerHTML = [
4527
- jt("diagnostics", p("privacy.section.diagnostics"), $, e),
4528
- V.length ? jt("logs", p("privacy.section.logs"), V, t) : ""
4529
- ].join(""), n.privacyScroll.querySelectorAll('input[data-indeterminate="true"]').forEach((a) => {
4591
+ r.privacyScroll.innerHTML = [
4592
+ Pe("diagnostics", p("privacy.section.diagnostics"), B, t),
4593
+ $.length ? Pe("logs", p("privacy.section.logs"), $, e) : ""
4594
+ ].join(""), r.privacyScroll.querySelectorAll('input[data-indeterminate="true"]').forEach((a) => {
4530
4595
  a.indeterminate = !0, a.removeAttribute("data-indeterminate");
4531
- }), at();
4596
+ }), ie();
4532
4597
  }
4533
- function Ps(e) {
4534
- const t = e.target;
4535
- if (!(t instanceof HTMLInputElement) || t.type !== "checkbox")
4598
+ function Ms(t) {
4599
+ const e = t.target;
4600
+ if (!(e instanceof HTMLInputElement) || e.type !== "checkbox")
4536
4601
  return;
4537
- const a = t.closest("[data-section]"), o = t.closest(".nf-privacy-row"), s = t.checked;
4602
+ const a = e.closest("[data-section]"), o = e.closest(".nf-privacy-row"), i = !e.checked;
4538
4603
  if (o) {
4539
- const i = o.dataset.kind, r = o.dataset.id;
4540
- if (i === "diagnostic") {
4541
- const l = $.find((u) => u.key === r);
4542
- l && (l.redacted = s);
4543
- } else if (i === "log") {
4544
- const l = V.find((u) => u.id === r);
4545
- l && (l.redacted = s);
4604
+ const s = o.dataset.kind, n = o.dataset.id;
4605
+ if (s === "diagnostic") {
4606
+ const l = B.find((u) => u.key === n);
4607
+ l && (l.redacted = i);
4608
+ } else if (s === "log") {
4609
+ const l = $.find((u) => u.id === n);
4610
+ l && (l.redacted = i);
4546
4611
  }
4547
4612
  } else if (a) {
4548
- const i = a.dataset.section;
4549
- i === "diagnostics" ? (Ce($, s), zt({ diagnostics: s })) : i === "logs" && (Ce(V, s), zt({ logs: s }));
4613
+ const s = a.dataset.section;
4614
+ s === "diagnostics" ? (Rt(B, i), Re({ diagnostics: i })) : s === "logs" && (Rt($, i), Re({ logs: i }));
4550
4615
  } else
4551
4616
  return;
4552
- ot();
4617
+ se();
4553
4618
  }
4554
- async function ha() {
4555
- Ye(), ce || (ce = !0, ga("onOpen")), fa(), re(), n.launcher.hidden = !0, A = Je(), q = { w: 0, h: 0 }, K = null, G = "", se = "", M = null, j = null, E = null, H = is(), Xe(H), ge(null), Te(!1), n.text.value = "", ua(), S(""), Rs();
4619
+ async function ya() {
4620
+ Xt(), pt || (pt = !0, ha("onOpen")), va(), nt(), r.launcher.hidden = !0, A = Yt(), ct = { w: 0, h: 0 }, H = null, q = "", rt = "", O = null, R = null, E = null, G = rs(), Qt(G), ht(null), ft(!1), r.text.value = "", da(), S(""), Fs();
4556
4621
  try {
4557
- ia(await $t(oa())), S("");
4558
- } catch (t) {
4559
- G = "", S((t == null ? void 0 : t.message) || p("status.screenshotFailed"));
4622
+ ra(await Ne(sa())), S("");
4623
+ } catch (e) {
4624
+ q = "", S((e == null ? void 0 : e.message) || p("status.screenshotFailed"));
4560
4625
  }
4561
- he(), Pe(!1), at(), n.dialog.hidden = !1, te(), n.text.focus();
4626
+ vt(), oe(!1), ie(), r.dialog.hidden = !1, at(), r.text.focus();
4562
4627
  }
4563
- function ee() {
4628
+ function et() {
4564
4629
  if (!y)
4565
4630
  return;
4566
- const e = ce;
4567
- Q == null || Q.stop(), Te(!1), ta(), j = null, E = null, et(!1), fa(), Pe(!1), n.dialog.hidden = !0, n.stop.hidden = !0, ze(), e && (ce = !1, ga("onClose"));
4631
+ const t = pt;
4632
+ _ == null || _.stop(), ft(!1), tt && (V == null || V.stop()), ut(!1), oa(), R = null, E = null, ee(!1), va(), oe(!1), r.dialog.hidden = !0, r.stop.hidden = !0, jt(), t && (pt = !1, ha("onClose"));
4568
4633
  }
4569
- function xs(e = "") {
4570
- const t = n.dialog, a = n.panel, o = n.panelBody, s = n.successMsg, i = n.successLink, r = String(e || "").trim(), l = !!(d.displayLink && r);
4571
- if (!t || !a || !o || !s)
4634
+ function Ds(t = "") {
4635
+ const e = r.dialog, a = r.panel, o = r.panelBody, i = r.successMsg, s = r.successLink, n = String(t || "").trim(), l = !!(c.displayLink && n);
4636
+ if (!e || !a || !o || !i)
4572
4637
  return Promise.resolve(!1);
4573
- de = !0, pe = l, S("");
4574
- const u = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, c = a.getBoundingClientRect();
4575
- 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) {
4638
+ gt = !0, mt = l, S("");
4639
+ const u = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, d = a.getBoundingClientRect();
4640
+ if (o.hidden = !0, i.hidden = !1, e.classList.add("nf-success"), e.classList.toggle("nf-success-sticky", l), e.style.opacity = "1", s && (l ? (s.hidden = !1, s.href = n) : (s.hidden = !0, s.removeAttribute("href"))), l) {
4576
4641
  if (u)
4577
4642
  return Promise.resolve(!0);
4578
- const w = a.getBoundingClientRect(), b = w.width > 0 ? c.width / w.width : 1, z = w.height > 0 ? c.height / w.height : 1;
4579
- return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${b}, ${z})`, a.getBoundingClientRect(), new Promise((R) => {
4580
- let F = !1;
4581
- const B = () => {
4582
- F || (F = !0, a.removeEventListener("transitionend", P), R(!0));
4643
+ const w = a.getBoundingClientRect(), b = w.width > 0 ? d.width / w.width : 1, z = w.height > 0 ? d.height / w.height : 1;
4644
+ return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${b}, ${z})`, a.getBoundingClientRect(), new Promise((j) => {
4645
+ let T = !1;
4646
+ const N = () => {
4647
+ T || (T = !0, a.removeEventListener("transitionend", P), j(!0));
4583
4648
  }, P = (m) => {
4584
- m.target !== a || m.propertyName !== "transform" || B();
4649
+ m.target !== a || m.propertyName !== "transform" || N();
4585
4650
  };
4586
4651
  a.addEventListener("transitionend", P), requestAnimationFrame(() => {
4587
4652
  a.style.transition = "transform 0.48s cubic-bezier(0.22, 1, 0.36, 1)", a.style.transform = "scale(1)";
4588
- }), window.setTimeout(B, 700);
4653
+ }), window.setTimeout(N, 700);
4589
4654
  });
4590
4655
  }
4591
4656
  if (u)
4592
4657
  return new Promise((w) => {
4593
4658
  window.setTimeout(() => w(!1), 1e3);
4594
4659
  });
4595
- const g = a.getBoundingClientRect(), v = g.width > 0 ? c.width / g.width : 1, k = g.height > 0 ? c.height / g.height : 1;
4596
- return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${v}, ${k})`, a.getBoundingClientRect(), new Promise((w) => {
4660
+ const g = a.getBoundingClientRect(), k = g.width > 0 ? d.width / g.width : 1, v = g.height > 0 ? d.height / g.height : 1;
4661
+ return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${k}, ${v})`, a.getBoundingClientRect(), new Promise((w) => {
4597
4662
  let b = !1;
4598
4663
  const z = () => {
4599
- b || (b = !0, a.removeEventListener("transitionend", R), window.setTimeout(() => {
4600
- t.style.transition = "opacity 0.28s ease", t.style.opacity = "0", window.setTimeout(() => w(!1), 280);
4664
+ b || (b = !0, a.removeEventListener("transitionend", j), window.setTimeout(() => {
4665
+ e.style.transition = "opacity 0.28s ease", e.style.opacity = "0", window.setTimeout(() => w(!1), 280);
4601
4666
  }, 1e3));
4602
- }, R = (F) => {
4603
- F.target !== a || F.propertyName !== "transform" || z();
4667
+ }, j = (T) => {
4668
+ T.target !== a || T.propertyName !== "transform" || z();
4604
4669
  };
4605
- a.addEventListener("transitionend", R), requestAnimationFrame(() => {
4670
+ a.addEventListener("transitionend", j), requestAnimationFrame(() => {
4606
4671
  a.style.transition = "transform 0.48s cubic-bezier(0.22, 1, 0.36, 1)", a.style.transform = "scale(1)";
4607
4672
  }), window.setTimeout(z, 700);
4608
4673
  });
4609
4674
  }
4610
- function fa() {
4611
- de = !1, pe = !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")));
4675
+ function va() {
4676
+ gt = !1, mt = !1, r.dialog && (r.dialog.classList.remove("nf-success", "nf-success-sticky"), r.dialog.style.opacity = "", r.dialog.style.transition = "", r.panel && (r.panel.style.transform = "", r.panel.style.transition = "", r.panel.style.transformOrigin = ""), r.panelBody && (r.panelBody.hidden = !1), r.successMsg && (r.successMsg.hidden = !0), r.successLink && (r.successLink.hidden = !0, r.successLink.removeAttribute("href")));
4612
4677
  }
4613
- function Ls(e = {}) {
4614
- N = { ...N, ...vi(e) }, ua();
4678
+ function Os(t = {}) {
4679
+ K = { ...K, ...bi(t) }, da();
4615
4680
  }
4616
- async function ya() {
4617
- var t, a;
4618
- if (Ye(), Ve)
4681
+ async function ka() {
4682
+ var e, a;
4683
+ if (Xt(), $t)
4619
4684
  return null;
4620
- const e = n.text.value.trim();
4621
- if (!e && !I() && !K)
4685
+ const t = r.text.value.trim();
4686
+ if (!t && !I() && !H)
4622
4687
  return S(p("status.emptyReport")), null;
4623
- if (!d.endpoint || !d.projectKey)
4688
+ if (!c.endpoint || !c.projectKey)
4624
4689
  return S(p("status.missingConfig")), null;
4625
- Ve = !0, Rt(!0), S(p("status.submitting"), !0);
4690
+ $t = !0, xe(!0), S(p("status.submitting"), !0);
4626
4691
  try {
4627
- const o = ws(), s = A.crop(), i = A.list(), r = A.isCropped(), l = r ? Li(i, s) : i, u = r ? { x: 0, y: 0, w: 1, h: 1 } : s, c = qi({
4692
+ const o = Rs(), i = A.crop(), s = A.list(), n = A.isCropped(), l = n ? Ti(s, i) : s, u = n ? { x: 0, y: 0, w: 1, h: 1 } : i, d = Wi({
4628
4693
  author: o,
4629
- diagnostics: $,
4630
- logs: V
4694
+ diagnostics: B,
4695
+ logs: $
4631
4696
  }), g = {
4632
4697
  width: typeof screen < "u" ? screen.width : null,
4633
4698
  height: typeof screen < "u" ? screen.height : null,
4634
4699
  dpr: window.devicePixelRatio || 1
4635
- }, v = [];
4636
- let k = 2048, w = null, b = null;
4637
- I() && (b = await kt(G, {
4638
- crop: r ? s : { x: 0, y: 0, w: 1, h: 1 },
4639
- maxEdge: k
4700
+ }, k = [];
4701
+ let v = 2048, w = null, b = null;
4702
+ I() && (b = await we(q, {
4703
+ crop: n ? i : { x: 0, y: 0, w: 1, h: 1 },
4704
+ maxEdge: v
4640
4705
  }));
4641
4706
  for (let z = 1; z <= 3; z += 1) {
4642
- const R = z === 3 || !b, F = R ? {
4707
+ const j = z === 3 || !b, T = j ? {
4643
4708
  ...b ? { width: b.width, height: b.height, mime: b.mime } : {},
4644
4709
  attempt: z,
4645
4710
  omitted: !0
@@ -4648,22 +4713,22 @@ async function ya() {
4648
4713
  height: b.height,
4649
4714
  mime: b.mime,
4650
4715
  attempt: z
4651
- }, B = {
4652
- ...c,
4716
+ }, N = {
4717
+ ...d,
4653
4718
  screen: g,
4654
- screenshotMeta: F
4719
+ screenshotMeta: T
4655
4720
  };
4656
- R && I() && (B.screenshotError = {
4721
+ j && I() && (N.screenshotError = {
4657
4722
  message: (w == null ? void 0 : w.message) || "Screenshot omitted after failed uploads",
4658
- attempts: [...v]
4723
+ attempts: [...k]
4659
4724
  });
4660
4725
  const P = new FormData();
4661
- P.append("message", e), P.append("kind", H), P.append("version", d.version || "0.0.0"), P.append("author", o), d.name && P.append("name", d.name), P.append("context", JSON.stringify(B)), 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");
4726
+ P.append("message", t), P.append("kind", G), P.append("version", c.version || "0.0.0"), P.append("author", o), c.name && P.append("name", c.name), P.append("context", JSON.stringify(N)), P.append("annotations", JSON.stringify(l)), P.append("crop", JSON.stringify(u)), Array.isArray(c.targets) && P.append("targets", JSON.stringify(c.targets)), !j && b && P.append("screenshot", b.blob, `screenshot.${b.ext}`), H && P.append("recording", H, "recording.webm");
4662
4727
  try {
4663
- const m = await fetch(`${d.endpoint}/v1/reports`, {
4728
+ const m = await fetch(`${c.endpoint}/v1/reports`, {
4664
4729
  method: "POST",
4665
4730
  headers: {
4666
- "X-Notefully-Key": d.projectKey
4731
+ "X-Notefully-Key": c.projectKey
4667
4732
  },
4668
4733
  body: P
4669
4734
  });
@@ -4674,25 +4739,25 @@ async function ya() {
4674
4739
  C = null;
4675
4740
  }
4676
4741
  if (!m.ok) {
4677
- const ne = new Error((C == null ? void 0 : C.error) || `${p("status.submitFailed")} (${m.status})`);
4678
- throw ne.status = m.status, ne.code = C == null ? void 0 : C.code, ne.json = C, ne;
4742
+ const lt = new Error((C == null ? void 0 : C.error) || `${p("status.submitFailed")} (${m.status})`);
4743
+ throw lt.status = m.status, lt.code = C == null ? void 0 : C.code, lt.json = C, lt;
4679
4744
  }
4680
- return R && I() && S(p("status.submitWithoutImage"), !0), await xs((C == null ? void 0 : C.trackerUrl) || "") || ee(), C;
4745
+ return j && I() && S(p("status.submitWithoutImage"), !0), await Ds((C == null ? void 0 : C.trackerUrl) || "") || et(), C;
4681
4746
  } catch (m) {
4682
- if (w = m, v.push({
4747
+ if (w = m, k.push({
4683
4748
  attempt: z,
4684
- maxEdge: R ? null : k,
4749
+ maxEdge: j ? null : v,
4685
4750
  status: (m == null ? void 0 : m.status) || null,
4686
4751
  code: (m == null ? void 0 : m.code) || null,
4687
4752
  message: String((m == null ? void 0 : m.message) || m)
4688
- }), R || !b)
4689
- throw S(((t = m == null ? void 0 : m.json) == null ? void 0 : t.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
4690
- if (!Mi(m, (m == null ? void 0 : m.json) || null))
4753
+ }), j || !b)
4754
+ throw S(((e = m == null ? void 0 : m.json) == null ? void 0 : e.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
4755
+ if (!Vi(m, (m == null ? void 0 : m.json) || null))
4691
4756
  throw S(((a = m == null ? void 0 : m.json) == null ? void 0 : a.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
4692
4757
  if (z === 1) {
4693
- S(p("status.submitTooLarge"), !0), k = Oi(k), b = await kt(G, {
4694
- crop: r ? s : { x: 0, y: 0, w: 1, h: 1 },
4695
- maxEdge: k
4758
+ S(p("status.submitTooLarge"), !0), v = Ii(v), b = await we(q, {
4759
+ crop: n ? i : { x: 0, y: 0, w: 1, h: 1 },
4760
+ maxEdge: v
4696
4761
  });
4697
4762
  continue;
4698
4763
  }
@@ -4701,42 +4766,42 @@ async function ya() {
4701
4766
  }
4702
4767
  throw w || new Error(p("status.submitFailed"));
4703
4768
  } finally {
4704
- Ve = !1, Rt(!1);
4769
+ $t = !1, xe(!1);
4705
4770
  }
4706
4771
  }
4707
- function Rt(e) {
4708
- n.submit && (n.submit.disabled = !!e, n.submit.setAttribute("aria-busy", e ? "true" : "false"));
4709
- }
4710
- function Us() {
4711
- ee(), document.removeEventListener("keydown", da), y == null || y.remove(), y = null, n = {};
4712
- }
4713
- const Fe = {
4714
- init: zs,
4715
- configure: tt,
4716
- setTheme: Es,
4717
- setVisible: js,
4718
- open: ha,
4719
- close: ee,
4720
- isOpen: Ss,
4721
- getLocale: As,
4722
- setLocale: Cs,
4723
- identify: Ls,
4724
- submit: ya,
4725
- destroy: Us
4772
+ function xe(t) {
4773
+ r.submit && (r.submit.disabled = !!t, r.submit.setAttribute("aria-busy", t ? "true" : "false"));
4774
+ }
4775
+ function Is() {
4776
+ et(), document.removeEventListener("keydown", ga), y == null || y.remove(), y = null, r = {};
4777
+ }
4778
+ const Mt = {
4779
+ init: Ls,
4780
+ configure: ae,
4781
+ setTheme: Us,
4782
+ setVisible: Ts,
4783
+ open: ya,
4784
+ close: et,
4785
+ isOpen: js,
4786
+ getLocale: Ps,
4787
+ setLocale: xs,
4788
+ identify: Os,
4789
+ submit: ka,
4790
+ destroy: Is
4726
4791
  };
4727
- typeof window < "u" && (window.Notefully = Fe);
4792
+ typeof window < "u" && (window.Notefully = Mt);
4728
4793
  export {
4729
- ee as close,
4730
- tt as configure,
4731
- Fe as default,
4732
- Us as destroy,
4733
- As as getLocaleTag,
4734
- Ls as identify,
4735
- zs as init,
4736
- Ss as isOpen,
4737
- ha as open,
4738
- Cs as setLocale,
4739
- Es as setTheme,
4740
- js as setVisible,
4741
- ya as submit
4794
+ et as close,
4795
+ ae as configure,
4796
+ Mt as default,
4797
+ Is as destroy,
4798
+ Ps as getLocaleTag,
4799
+ Os as identify,
4800
+ Ls as init,
4801
+ js as isOpen,
4802
+ ya as open,
4803
+ xs as setLocale,
4804
+ Us as setTheme,
4805
+ Ts as setVisible,
4806
+ ka as submit
4742
4807
  };