@makefully/notefully 0.2.12 → 0.2.13

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