@makefully/notefully 0.1.2 → 0.1.4

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
- function ae(t, e) {
1
+ function oe(t, e) {
2
2
  if (t.match(/^[a-z]+:\/\//i))
3
3
  return t;
4
4
  if (t.match(/^\/\//))
@@ -16,15 +16,15 @@ const se = /* @__PURE__ */ (() => {
16
16
  );
17
17
  return () => (t += 1, `u${e()}${t}`);
18
18
  })();
19
- function H(t) {
19
+ function j(t) {
20
20
  const e = [];
21
21
  for (let r = 0, n = t.length; r < n; r++)
22
22
  e.push(t[r]);
23
23
  return e;
24
24
  }
25
- let N = null;
26
- function Ht(t = {}) {
27
- return N || (t.includeStyleProperties ? (N = t.includeStyleProperties, N) : (N = H(window.getComputedStyle(document.documentElement)), N));
25
+ let _ = null;
26
+ function jt(t = {}) {
27
+ return _ || (t.includeStyleProperties ? (_ = t.includeStyleProperties, _) : (_ = j(window.getComputedStyle(document.documentElement)), _));
28
28
  }
29
29
  function X(t, e) {
30
30
  const n = (t.ownerDocument.defaultView || window).getComputedStyle(t).getPropertyValue(e);
@@ -69,8 +69,8 @@ async function fe(t) {
69
69
  return Promise.resolve().then(() => new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then((e) => `data:image/svg+xml;charset=utf-8,${e}`);
70
70
  }
71
71
  async function he(t, e, r) {
72
- const n = "http://www.w3.org/2000/svg", i = document.createElementNS(n, "svg"), o = document.createElementNS(n, "foreignObject");
73
- return i.setAttribute("width", `${e}`), i.setAttribute("height", `${r}`), i.setAttribute("viewBox", `0 0 ${e} ${r}`), o.setAttribute("width", "100%"), o.setAttribute("height", "100%"), o.setAttribute("x", "0"), o.setAttribute("y", "0"), o.setAttribute("externalResourcesRequired", "true"), i.appendChild(o), o.appendChild(t), fe(i);
72
+ const n = "http://www.w3.org/2000/svg", i = document.createElementNS(n, "svg"), a = document.createElementNS(n, "foreignObject");
73
+ return i.setAttribute("width", `${e}`), i.setAttribute("height", `${r}`), i.setAttribute("viewBox", `0 0 ${e} ${r}`), a.setAttribute("width", "100%"), a.setAttribute("height", "100%"), a.setAttribute("x", "0"), a.setAttribute("y", "0"), a.setAttribute("externalResourcesRequired", "true"), i.appendChild(a), a.appendChild(t), fe(i);
74
74
  }
75
75
  const C = (t, e) => {
76
76
  if (t instanceof e)
@@ -83,27 +83,27 @@ function pe(t) {
83
83
  return `${t.cssText} content: '${e.replace(/'|"/g, "")}';`;
84
84
  }
85
85
  function me(t, e) {
86
- return Ht(e).map((r) => {
86
+ return jt(e).map((r) => {
87
87
  const n = t.getPropertyValue(r), i = t.getPropertyPriority(r);
88
88
  return `${r}: ${n}${i ? " !important" : ""};`;
89
89
  }).join(" ");
90
90
  }
91
91
  function ye(t, e, r, n) {
92
- const i = `.${t}:${e}`, o = r.cssText ? pe(r) : me(r, n);
93
- return document.createTextNode(`${i}{${o}}`);
92
+ const i = `.${t}:${e}`, a = r.cssText ? pe(r) : me(r, n);
93
+ return document.createTextNode(`${i}{${a}}`);
94
94
  }
95
95
  function Et(t, e, r, n) {
96
- const i = window.getComputedStyle(t, r), o = i.getPropertyValue("content");
97
- if (o === "" || o === "none")
96
+ const i = window.getComputedStyle(t, r), a = i.getPropertyValue("content");
97
+ if (a === "" || a === "none")
98
98
  return;
99
- const a = se();
99
+ const o = se();
100
100
  try {
101
- e.className = `${e.className} ${a}`;
101
+ e.className = `${e.className} ${o}`;
102
102
  } catch {
103
103
  return;
104
104
  }
105
105
  const s = document.createElement("style");
106
- s.appendChild(ye(a, r, i, n)), e.appendChild(s);
106
+ s.appendChild(ye(o, r, i, n)), e.appendChild(s);
107
107
  }
108
108
  function ge(t, e, r) {
109
109
  Et(t, e, ":before", r), Et(t, e, ":after", r);
@@ -143,37 +143,37 @@ async function Vt(t, e, r) {
143
143
  if (n.status === 404)
144
144
  throw new Error(`Resource "${n.url}" not found`);
145
145
  const i = await n.blob();
146
- return new Promise((o, a) => {
146
+ return new Promise((a, o) => {
147
147
  const s = new FileReader();
148
- s.onerror = a, s.onloadend = () => {
148
+ s.onerror = o, s.onloadend = () => {
149
149
  try {
150
- o(r({ res: n, result: s.result }));
150
+ a(r({ res: n, result: s.result }));
151
151
  } catch (l) {
152
- a(l);
152
+ o(l);
153
153
  }
154
154
  }, s.readAsDataURL(i);
155
155
  });
156
156
  }
157
- const ot = {};
157
+ const at = {};
158
158
  function Se(t, e, r) {
159
159
  let n = t.replace(/\?.*/, "");
160
160
  return r && (n = t), /ttf|otf|eot|woff2?/i.test(n) && (n = n.replace(/.*\//, "")), e ? `[${e}]${n}` : n;
161
161
  }
162
162
  async function bt(t, e, r) {
163
163
  const n = Se(t, e, r.includeQueryParams);
164
- if (ot[n] != null)
165
- return ot[n];
164
+ if (at[n] != null)
165
+ return at[n];
166
166
  r.cacheBust && (t += (/\?/.test(t) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
167
167
  let i;
168
168
  try {
169
- const o = await Vt(t, r.fetchRequestInit, ({ res: a, result: s }) => (e || (e = a.headers.get("Content-Type") || ""), ve(s)));
170
- i = xe(o, e);
171
- } catch (o) {
169
+ const a = await Vt(t, r.fetchRequestInit, ({ res: o, result: s }) => (e || (e = o.headers.get("Content-Type") || ""), ve(s)));
170
+ i = xe(a, e);
171
+ } catch (a) {
172
172
  i = r.imagePlaceholder || "";
173
- let a = `Failed to fetch resource: ${t}`;
174
- o && (a = typeof o == "string" ? o : o.message), a && console.warn(a);
173
+ let o = `Failed to fetch resource: ${t}`;
174
+ a && (o = typeof a == "string" ? a : a.message), o && console.warn(o);
175
175
  }
176
- return ot[n] = i, i;
176
+ return at[n] = i, i;
177
177
  }
178
178
  async function Ee(t) {
179
179
  const e = t.toDataURL();
@@ -181,9 +181,9 @@ async function Ee(t) {
181
181
  }
182
182
  async function Ce(t, e) {
183
183
  if (t.currentSrc) {
184
- const o = document.createElement("canvas"), a = o.getContext("2d");
185
- o.width = t.clientWidth, o.height = t.clientHeight, a == null || a.drawImage(t, 0, 0, o.width, o.height);
186
- const s = o.toDataURL();
184
+ const a = document.createElement("canvas"), o = a.getContext("2d");
185
+ a.width = t.clientWidth, a.height = t.clientHeight, o == null || o.drawImage(t, 0, 0, a.width, a.height);
186
+ const s = a.toDataURL();
187
187
  return Y(s);
188
188
  }
189
189
  const r = t.poster, n = wt(r), i = await bt(r, n, e);
@@ -206,8 +206,8 @@ async function Le(t, e, r) {
206
206
  var n, i;
207
207
  if (Bt(e))
208
208
  return e;
209
- let o = [];
210
- return Re(t) && t.assignedNodes ? o = H(t.assignedNodes()) : C(t, HTMLIFrameElement) && (!((n = t.contentDocument) === null || n === void 0) && n.body) ? o = H(t.contentDocument.body.childNodes) : o = H(((i = t.shadowRoot) !== null && i !== void 0 ? i : t).childNodes), o.length === 0 || C(t, HTMLVideoElement) || await o.reduce((a, s) => a.then(() => tt(s, r)).then((l) => {
209
+ let a = [];
210
+ return Re(t) && t.assignedNodes ? a = j(t.assignedNodes()) : C(t, HTMLIFrameElement) && (!((n = t.contentDocument) === null || n === void 0) && n.body) ? a = j(t.contentDocument.body.childNodes) : a = j(((i = t.shadowRoot) !== null && i !== void 0 ? i : t).childNodes), a.length === 0 || C(t, HTMLVideoElement) || await a.reduce((o, s) => o.then(() => tt(s, r)).then((l) => {
211
211
  l && e.appendChild(l);
212
212
  }), Promise.resolve()), e;
213
213
  }
@@ -216,9 +216,9 @@ function Pe(t, e, r) {
216
216
  if (!n)
217
217
  return;
218
218
  const i = window.getComputedStyle(t);
219
- i.cssText ? (n.cssText = i.cssText, n.transformOrigin = i.transformOrigin) : Ht(r).forEach((o) => {
220
- let a = i.getPropertyValue(o);
221
- o === "font-size" && a.endsWith("px") && (a = `${Math.floor(parseFloat(a.substring(0, a.length - 2))) - 0.1}px`), C(t, HTMLIFrameElement) && o === "display" && a === "inline" && (a = "block"), o === "d" && e.getAttribute("d") && (a = `path(${e.getAttribute("d")})`), n.setProperty(o, a, i.getPropertyPriority(o));
219
+ i.cssText ? (n.cssText = i.cssText, n.transformOrigin = i.transformOrigin) : jt(r).forEach((a) => {
220
+ let o = i.getPropertyValue(a);
221
+ a === "font-size" && o.endsWith("px") && (o = `${Math.floor(parseFloat(o.substring(0, o.length - 2))) - 0.1}px`), C(t, HTMLIFrameElement) && a === "display" && o === "inline" && (o = "block"), a === "d" && e.getAttribute("d") && (o = `path(${e.getAttribute("d")})`), n.setProperty(a, o, i.getPropertyPriority(a));
222
222
  });
223
223
  }
224
224
  function ke(t, e) {
@@ -238,8 +238,8 @@ async function Ie(t, e) {
238
238
  if (r.length === 0)
239
239
  return t;
240
240
  const n = {};
241
- for (let o = 0; o < r.length; o++) {
242
- const s = r[o].getAttribute("xlink:href");
241
+ for (let a = 0; a < r.length; a++) {
242
+ const s = r[a].getAttribute("xlink:href");
243
243
  if (s) {
244
244
  const l = t.querySelector(s), v = document.querySelector(s);
245
245
  !l && v && !n[s] && (n[s] = await tt(v, e, !0));
@@ -247,39 +247,39 @@ async function Ie(t, e) {
247
247
  }
248
248
  const i = Object.values(n);
249
249
  if (i.length) {
250
- const o = "http://www.w3.org/1999/xhtml", a = document.createElementNS(o, "svg");
251
- a.setAttribute("xmlns", o), a.style.position = "absolute", a.style.width = "0", a.style.height = "0", a.style.overflow = "hidden", a.style.display = "none";
252
- const s = document.createElementNS(o, "defs");
253
- a.appendChild(s);
250
+ const a = "http://www.w3.org/1999/xhtml", o = document.createElementNS(a, "svg");
251
+ o.setAttribute("xmlns", a), o.style.position = "absolute", o.style.width = "0", o.style.height = "0", o.style.overflow = "hidden", o.style.display = "none";
252
+ const s = document.createElementNS(a, "defs");
253
+ o.appendChild(s);
254
254
  for (let l = 0; l < i.length; l++)
255
255
  s.appendChild(i[l]);
256
- t.appendChild(a);
256
+ t.appendChild(o);
257
257
  }
258
258
  return t;
259
259
  }
260
260
  async function tt(t, e, r) {
261
261
  return !r && e.filter && !e.filter(t) ? null : Promise.resolve(t).then((n) => $e(n, e)).then((n) => Le(t, n, e)).then((n) => Ae(t, n, e)).then((n) => Ie(n, e));
262
262
  }
263
- const Nt = /url\((['"]?)([^'"]+?)\1\)/g, De = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, je = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
264
- function Fe(t) {
263
+ const _t = /url\((['"]?)([^'"]+?)\1\)/g, De = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Fe = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
264
+ function Oe(t) {
265
265
  const e = t.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
266
266
  return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`, "g");
267
267
  }
268
- function Oe(t) {
268
+ function He(t) {
269
269
  const e = [];
270
- return t.replace(Nt, (r, n, i) => (e.push(i), r)), e.filter((r) => !ct(r));
270
+ return t.replace(_t, (r, n, i) => (e.push(i), r)), e.filter((r) => !ct(r));
271
271
  }
272
- async function He(t, e, r, n, i) {
272
+ async function je(t, e, r, n, i) {
273
273
  try {
274
- const o = r ? ae(e, r) : e, a = wt(e);
274
+ const a = r ? oe(e, r) : e, o = wt(e);
275
275
  let s;
276
- return i || (s = await bt(o, a, n)), t.replace(Fe(e), `$1${s}$3`);
276
+ return i || (s = await bt(a, o, n)), t.replace(Oe(e), `$1${s}$3`);
277
277
  } catch {
278
278
  }
279
279
  return t;
280
280
  }
281
281
  function Ue(t, { preferredFontFormat: e }) {
282
- return e ? t.replace(je, (r) => {
282
+ return e ? t.replace(Fe, (r) => {
283
283
  for (; ; ) {
284
284
  const [n, , i] = De.exec(r) || [];
285
285
  if (!i)
@@ -289,52 +289,52 @@ function Ue(t, { preferredFontFormat: e }) {
289
289
  }
290
290
  }) : t;
291
291
  }
292
- function _t(t) {
293
- return t.search(Nt) !== -1;
292
+ function Nt(t) {
293
+ return t.search(_t) !== -1;
294
294
  }
295
295
  async function Wt(t, e, r) {
296
- if (!_t(t))
296
+ if (!Nt(t))
297
297
  return t;
298
298
  const n = Ue(t, r);
299
- return Oe(n).reduce((o, a) => o.then((s) => He(s, a, e, r)), Promise.resolve(n));
299
+ return He(n).reduce((a, o) => a.then((s) => je(s, o, e, r)), Promise.resolve(n));
300
300
  }
301
- async function _(t, e, r) {
301
+ async function N(t, e, r) {
302
302
  var n;
303
303
  const i = (n = e.style) === null || n === void 0 ? void 0 : n.getPropertyValue(t);
304
304
  if (i) {
305
- const o = await Wt(i, null, r);
306
- return e.style.setProperty(t, o, e.style.getPropertyPriority(t)), !0;
305
+ const a = await Wt(i, null, r);
306
+ return e.style.setProperty(t, a, e.style.getPropertyPriority(t)), !0;
307
307
  }
308
308
  return !1;
309
309
  }
310
310
  async function Ve(t, e) {
311
- await _("background", t, e) || await _("background-image", t, e), await _("mask", t, e) || await _("-webkit-mask", t, e) || await _("mask-image", t, e) || await _("-webkit-mask-image", t, e);
311
+ await N("background", t, e) || await N("background-image", t, e), await N("mask", t, e) || await N("-webkit-mask", t, e) || await N("mask-image", t, e) || await N("-webkit-mask-image", t, e);
312
312
  }
313
313
  async function Be(t, e) {
314
314
  const r = C(t, HTMLImageElement);
315
315
  if (!(r && !ct(t.src)) && !(C(t, SVGImageElement) && !ct(t.href.baseVal)))
316
316
  return;
317
317
  const n = r ? t.src : t.href.baseVal, i = await bt(n, wt(n), e);
318
- await new Promise((o, a) => {
319
- t.onload = o, t.onerror = e.onImageErrorHandler ? (...l) => {
318
+ await new Promise((a, o) => {
319
+ t.onload = a, t.onerror = e.onImageErrorHandler ? (...l) => {
320
320
  try {
321
- o(e.onImageErrorHandler(...l));
321
+ a(e.onImageErrorHandler(...l));
322
322
  } catch (v) {
323
- a(v);
323
+ o(v);
324
324
  }
325
- } : a;
325
+ } : o;
326
326
  const s = t;
327
- s.decode && (s.decode = o), s.loading === "lazy" && (s.loading = "eager"), r ? (t.srcset = "", t.src = i) : t.href.baseVal = i;
327
+ s.decode && (s.decode = a), s.loading === "lazy" && (s.loading = "eager"), r ? (t.srcset = "", t.src = i) : t.href.baseVal = i;
328
328
  });
329
329
  }
330
- async function Ne(t, e) {
331
- const n = H(t.childNodes).map((i) => qt(i, e));
330
+ async function _e(t, e) {
331
+ const n = j(t.childNodes).map((i) => qt(i, e));
332
332
  await Promise.all(n).then(() => t);
333
333
  }
334
334
  async function qt(t, e) {
335
- C(t, Element) && (await Ve(t, e), await Be(t, e), await Ne(t, e));
335
+ C(t, Element) && (await Ve(t, e), await Be(t, e), await _e(t, e));
336
336
  }
337
- function _e(t, e) {
337
+ function Ne(t, e) {
338
338
  const { style: r } = t;
339
339
  e.backgroundColor && (r.backgroundColor = e.backgroundColor), e.width && (r.width = `${e.width}px`), e.height && (r.height = `${e.height}px`);
340
340
  const n = e.style;
@@ -352,11 +352,11 @@ async function Rt(t) {
352
352
  }
353
353
  async function Lt(t, e) {
354
354
  let r = t.cssText;
355
- const n = /url\(["']?([^"')]+)["']?\)/g, o = (r.match(/url\([^)]+\)/g) || []).map(async (a) => {
356
- let s = a.replace(n, "$1");
357
- return s.startsWith("https://") || (s = new URL(s, t.url).href), Vt(s, e.fetchRequestInit, ({ result: l }) => (r = r.replace(a, `url(${l})`), [a, l]));
355
+ const n = /url\(["']?([^"')]+)["']?\)/g, a = (r.match(/url\([^)]+\)/g) || []).map(async (o) => {
356
+ let s = o.replace(n, "$1");
357
+ return s.startsWith("https://") || (s = new URL(s, t.url).href), Vt(s, e.fetchRequestInit, ({ result: l }) => (r = r.replace(o, `url(${l})`), [o, l]));
358
358
  });
359
- return Promise.all(o).then(() => r);
359
+ return Promise.all(a).then(() => r);
360
360
  }
361
361
  function Pt(t) {
362
362
  if (t == null)
@@ -371,15 +371,15 @@ function Pt(t) {
371
371
  e.push(l[0]);
372
372
  }
373
373
  n = n.replace(i, "");
374
- const o = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, a = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", s = new RegExp(a, "gi");
374
+ const a = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, o = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", s = new RegExp(o, "gi");
375
375
  for (; ; ) {
376
- let l = o.exec(n);
376
+ let l = a.exec(n);
377
377
  if (l === null) {
378
378
  if (l = s.exec(n), l === null)
379
379
  break;
380
- o.lastIndex = s.lastIndex;
380
+ a.lastIndex = s.lastIndex;
381
381
  } else
382
- s.lastIndex = o.lastIndex;
382
+ s.lastIndex = a.lastIndex;
383
383
  e.push(l[0]);
384
384
  }
385
385
  return e;
@@ -389,15 +389,15 @@ async function We(t, e) {
389
389
  return t.forEach((i) => {
390
390
  if ("cssRules" in i)
391
391
  try {
392
- H(i.cssRules || []).forEach((o, a) => {
393
- if (o.type === CSSRule.IMPORT_RULE) {
394
- let s = a + 1;
395
- const l = o.href, v = Rt(l).then((y) => Lt(y, e)).then((y) => Pt(y).forEach((h) => {
392
+ j(i.cssRules || []).forEach((a, o) => {
393
+ if (a.type === CSSRule.IMPORT_RULE) {
394
+ let s = o + 1;
395
+ const l = a.href, v = Rt(l).then((y) => Lt(y, e)).then((y) => Pt(y).forEach((p) => {
396
396
  try {
397
- i.insertRule(h, h.startsWith("@import") ? s += 1 : i.cssRules.length);
397
+ i.insertRule(p, p.startsWith("@import") ? s += 1 : i.cssRules.length);
398
398
  } catch (g) {
399
399
  console.error("Error inserting rule from remote css", {
400
- rule: h,
400
+ rule: p,
401
401
  error: g
402
402
  });
403
403
  }
@@ -407,32 +407,32 @@ async function We(t, e) {
407
407
  n.push(v);
408
408
  }
409
409
  });
410
- } catch (o) {
411
- const a = t.find((s) => s.href == null) || document.styleSheets[0];
410
+ } catch (a) {
411
+ const o = t.find((s) => s.href == null) || document.styleSheets[0];
412
412
  i.href != null && n.push(Rt(i.href).then((s) => Lt(s, e)).then((s) => Pt(s).forEach((l) => {
413
- a.insertRule(l, a.cssRules.length);
413
+ o.insertRule(l, o.cssRules.length);
414
414
  })).catch((s) => {
415
415
  console.error("Error loading remote stylesheet", s);
416
- })), console.error("Error inlining remote css file", o);
416
+ })), console.error("Error inlining remote css file", a);
417
417
  }
418
418
  }), Promise.all(n).then(() => (t.forEach((i) => {
419
419
  if ("cssRules" in i)
420
420
  try {
421
- H(i.cssRules || []).forEach((o) => {
422
- r.push(o);
421
+ j(i.cssRules || []).forEach((a) => {
422
+ r.push(a);
423
423
  });
424
- } catch (o) {
425
- console.error(`Error while reading CSS rules from ${i.href}`, o);
424
+ } catch (a) {
425
+ console.error(`Error while reading CSS rules from ${i.href}`, a);
426
426
  }
427
427
  }), r));
428
428
  }
429
429
  function qe(t) {
430
- return t.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => _t(e.style.getPropertyValue("src")));
430
+ return t.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => Nt(e.style.getPropertyValue("src")));
431
431
  }
432
432
  async function ze(t, e) {
433
433
  if (t.ownerDocument == null)
434
434
  throw new Error("Provided element is not within a Document");
435
- const r = H(t.ownerDocument.styleSheets), n = await We(r, e);
435
+ const r = j(t.ownerDocument.styleSheets), n = await We(r, e);
436
436
  return qe(n);
437
437
  }
438
438
  function zt(t) {
@@ -441,19 +441,19 @@ function zt(t) {
441
441
  function Ke(t) {
442
442
  const e = /* @__PURE__ */ new Set();
443
443
  function r(n) {
444
- (n.style.fontFamily || getComputedStyle(n).fontFamily).split(",").forEach((o) => {
445
- e.add(zt(o));
446
- }), Array.from(n.children).forEach((o) => {
447
- o instanceof HTMLElement && r(o);
444
+ (n.style.fontFamily || getComputedStyle(n).fontFamily).split(",").forEach((a) => {
445
+ e.add(zt(a));
446
+ }), Array.from(n.children).forEach((a) => {
447
+ a instanceof HTMLElement && r(a);
448
448
  });
449
449
  }
450
450
  return r(t), e;
451
451
  }
452
452
  async function Xe(t, e) {
453
453
  const r = await ze(t, e), n = Ke(t);
454
- return (await Promise.all(r.filter((o) => n.has(zt(o.style.fontFamily))).map((o) => {
455
- const a = o.parentStyleSheet ? o.parentStyleSheet.href : null;
456
- return Wt(o.cssText, a, e);
454
+ return (await Promise.all(r.filter((a) => n.has(zt(a.style.fontFamily))).map((a) => {
455
+ const o = a.parentStyleSheet ? a.parentStyleSheet.href : null;
456
+ return Wt(a.cssText, o, e);
457
457
  }))).join(`
458
458
  `);
459
459
  }
@@ -466,11 +466,11 @@ async function Ye(t, e) {
466
466
  }
467
467
  async function Ge(t, e = {}) {
468
468
  const { width: r, height: n } = Ut(t, e), i = await tt(t, e, !0);
469
- return await Ye(i, e), await qt(i, e), _e(i, e), await he(i, r, n);
469
+ return await Ye(i, e), await qt(i, e), Ne(i, e), await he(i, r, n);
470
470
  }
471
471
  async function Je(t, e = {}) {
472
- const { width: r, height: n } = Ut(t, e), i = await Ge(t, e), o = await Y(i), a = document.createElement("canvas"), s = a.getContext("2d"), l = e.pixelRatio || ue(), v = e.canvasWidth || r, y = e.canvasHeight || n;
473
- return a.width = v * l, a.height = y * l, e.skipAutoScale || de(a), a.style.width = `${v}`, a.style.height = `${y}`, e.backgroundColor && (s.fillStyle = e.backgroundColor, s.fillRect(0, 0, a.width, a.height)), s.drawImage(o, 0, 0, a.width, a.height), a;
472
+ const { width: r, height: n } = Ut(t, e), i = await Ge(t, e), a = await Y(i), o = document.createElement("canvas"), s = o.getContext("2d"), l = e.pixelRatio || ue(), v = e.canvasWidth || r, y = e.canvasHeight || n;
473
+ return o.width = v * l, o.height = y * l, e.skipAutoScale || de(o), o.style.width = `${v}`, o.style.height = `${y}`, e.backgroundColor && (s.fillStyle = e.backgroundColor, s.fillRect(0, 0, o.width, o.height)), s.drawImage(a, 0, 0, o.width, o.height), o;
474
474
  }
475
475
  async function Ze(t, e = {}) {
476
476
  return (await Je(t, e)).toDataURL();
@@ -533,79 +533,79 @@ const kt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), Tt = {
533
533
  "endpoint",
534
534
  "projectKey",
535
535
  "version",
536
+ "name",
536
537
  "targets",
537
538
  "hideLauncher",
538
539
  "theme",
539
540
  "video"
540
541
  ]), It = {
541
- slug: "Project slug comes from the relay project tied to your projectKey (Showfully Notefully settings) — it is not a widget init option.",
542
- projectSlug: "Project slug comes from the relay project tied to your projectKey (Showfully Notefully settings) — it is not a widget init option.",
543
- project: "Pass projectKey (nfk_…) from Showfully Notefully settings — there is no project slug/name option on the widget.",
542
+ slug: "Use init({ name }) for a per-app report prefix (same idea as package.json name). slug is not a widget option.",
543
+ projectSlug: "Use init({ name }) for a per-app report prefix. projectSlug is not a widget option.",
544
+ project: "Pass projectKey (nfk_…) from Showfully Notefully settings — there is no project option on the widget.",
544
545
  username: "Pass people via Notefully.identify({ displayName }) (username is an identify alias), not init().",
545
546
  userId: "Pass people via Notefully.identify({ userId, email, displayName }), not init().",
546
547
  email: "Pass people via Notefully.identify({ userId, email, displayName }), not init().",
547
- displayName: "Pass people via Notefully.identify({ userId, email, displayName }), not init().",
548
- name: "Pass people via Notefully.identify({ displayName }) (name is an identify alias), not init()."
548
+ displayName: "Pass people via Notefully.identify({ userId, email, displayName }), not init()."
549
549
  };
550
550
  function nn(t = {}, e = {}) {
551
- const r = e.warn || Kt, n = t && typeof t == "object" ? t : {}, i = {}, o = [];
552
- for (const a of kt)
553
- Object.prototype.hasOwnProperty.call(n, a) && (i[a] = n[a]);
554
- for (const [a, s] of Object.entries(Tt))
555
- Object.prototype.hasOwnProperty.call(n, a) && (Object.prototype.hasOwnProperty.call(i, s) || (i[s] = n[a]));
556
- for (const a of Object.keys(n))
557
- kt.has(a) || Object.prototype.hasOwnProperty.call(Tt, a) || o.push(a);
558
- if (o.length) {
559
- const a = o.some((s) => s === "slug" || s === "projectSlug") ? " Project slug is relay/dashboard config from the project key, not identify()." : "";
551
+ const r = e.warn || Kt, n = t && typeof t == "object" ? t : {}, i = {}, a = [];
552
+ for (const o of kt)
553
+ Object.prototype.hasOwnProperty.call(n, o) && (i[o] = n[o]);
554
+ for (const [o, s] of Object.entries(Tt))
555
+ Object.prototype.hasOwnProperty.call(n, o) && (Object.prototype.hasOwnProperty.call(i, s) || (i[s] = n[o]));
556
+ for (const o of Object.keys(n))
557
+ kt.has(o) || Object.prototype.hasOwnProperty.call(Tt, o) || a.push(o);
558
+ if (a.length) {
559
+ const o = a.some((s) => s === "name" || s === "slug" || s === "projectSlug") ? " Pass the package/report name via Notefully.init({ name }), not identify()." : "";
560
560
  r(
561
- `Notefully.identify: ignoring unknown key(s): ${o.join(", ")}. Supported: userId, email, displayName (aliases: id → userId; username/name → displayName).` + a
561
+ `Notefully.identify: ignoring unknown key(s): ${a.join(", ")}. Supported: userId, email, displayName (aliases: id → userId; username/name → displayName).` + o
562
562
  );
563
563
  }
564
564
  return i;
565
565
  }
566
566
  function rn(t = {}, e = {}) {
567
- const r = e.warn || Kt, n = t && typeof t == "object" ? t : {}, i = Object.keys(n).filter((o) => !At.has(o));
567
+ const r = e.warn || Kt, n = t && typeof t == "object" ? t : {}, i = Object.keys(n).filter((a) => !At.has(a));
568
568
  if (i.length)
569
- for (const o of i) {
570
- if (It[o]) {
571
- r(`Notefully.init: ignoring "${o}". ${It[o]}`);
569
+ for (const a of i) {
570
+ if (It[a]) {
571
+ r(`Notefully.init: ignoring "${a}". ${It[a]}`);
572
572
  continue;
573
573
  }
574
574
  r(
575
- `Notefully.init: ignoring unknown key "${o}". Supported: ${[...At].join(", ")}.`
575
+ `Notefully.init: ignoring unknown key "${a}". Supported: ${[...At].join(", ")}.`
576
576
  );
577
577
  }
578
578
  }
579
579
  function Kt(t) {
580
580
  typeof console < "u" && typeof console.warn == "function" && console.warn(t);
581
581
  }
582
- const on = 80;
583
- function an() {
582
+ const an = 80;
583
+ function on() {
584
584
  const t = [], e = {};
585
585
  let r = !1;
586
- const n = (o, a) => {
586
+ const n = (a, o) => {
587
587
  let s = "";
588
588
  try {
589
- s = a.map((l) => l instanceof Error ? l.stack || l.message : typeof l == "string" ? l : JSON.stringify(l)).join(" ");
589
+ s = o.map((l) => l instanceof Error ? l.stack || l.message : typeof l == "string" ? l : JSON.stringify(l)).join(" ");
590
590
  } catch {
591
- s = String(a[0]);
591
+ s = String(o[0]);
592
592
  }
593
593
  t.push({
594
- level: o,
594
+ level: a,
595
595
  text: s.slice(0, 2e3),
596
596
  at: Date.now()
597
- }), t.length > on && t.shift();
597
+ }), t.length > an && t.shift();
598
598
  };
599
599
  return {
600
600
  hook: () => {
601
- r || typeof window > "u" || (r = !0, ["log", "info", "warn", "error"].forEach((o) => {
602
- e[o] = console[o].bind(console), console[o] = (...a) => {
603
- n(o, a), e[o](...a);
601
+ r || typeof window > "u" || (r = !0, ["log", "info", "warn", "error"].forEach((a) => {
602
+ e[a] = console[a].bind(console), console[a] = (...o) => {
603
+ n(a, o), e[a](...o);
604
604
  };
605
- }), window.addEventListener("error", (o) => {
606
- n("error", [o.message || "window.error"]);
607
- }), window.addEventListener("unhandledrejection", (o) => {
608
- n("error", [o.reason || "unhandledrejection"]);
605
+ }), window.addEventListener("error", (a) => {
606
+ n("error", [a.message || "window.error"]);
607
+ }), window.addEventListener("unhandledrejection", (a) => {
608
+ n("error", [a.reason || "unhandledrejection"]);
609
609
  }));
610
610
  },
611
611
  snapshot() {
@@ -627,10 +627,10 @@ function sn(t) {
627
627
  start: () => {
628
628
  if (!e)
629
629
  throw new Error("Speech recognition is not supported in this browser.");
630
- return n ? (i(), !1) : (r = new e(), r.continuous = !0, r.interimResults = !0, r.lang = navigator.language || "en-US", r.onresult = (a) => {
630
+ return n ? (i(), !1) : (r = new e(), r.continuous = !0, r.interimResults = !0, r.lang = navigator.language || "en-US", r.onresult = (o) => {
631
631
  let s = "";
632
- for (let l = a.resultIndex; l < a.results.length; l += 1)
633
- a.results[l].isFinal && (s += a.results[l][0].transcript);
632
+ for (let l = o.resultIndex; l < o.results.length; l += 1)
633
+ o.results[l].isFinal && (s += o.results[l][0].transcript);
634
634
  s && t(s);
635
635
  }, r.onerror = () => {
636
636
  n = !1;
@@ -645,9 +645,9 @@ function sn(t) {
645
645
  }
646
646
  const cn = 60 * 1e3;
647
647
  function ln({ onStart: t, onStop: e, onError: r }) {
648
- let n = null, i = null, o = [], a = null;
648
+ let n = null, i = null, a = [], o = null;
649
649
  const s = () => {
650
- if (a && (clearTimeout(a), a = null), i && i.state !== "inactive")
650
+ if (o && (clearTimeout(o), o = null), i && i.state !== "inactive")
651
651
  try {
652
652
  i.stop();
653
653
  } catch {
@@ -661,7 +661,7 @@ function ln({ onStart: t, onStop: e, onError: r }) {
661
661
  s(), e(null);
662
662
  };
663
663
  return { start: async () => {
664
- var y, h;
664
+ var y, p;
665
665
  if (!((y = navigator.mediaDevices) != null && y.getDisplayMedia))
666
666
  throw new Error("Screen recording is not supported in this browser.");
667
667
  n = await navigator.mediaDevices.getDisplayMedia({
@@ -669,14 +669,14 @@ function ln({ onStart: t, onStop: e, onError: r }) {
669
669
  audio: !1,
670
670
  preferCurrentTab: !0,
671
671
  selfBrowserSurface: "include"
672
- }), o = [], i = new MediaRecorder(n, {
672
+ }), a = [], i = new MediaRecorder(n, {
673
673
  mimeType: MediaRecorder.isTypeSupported("video/webm;codecs=vp9") ? "video/webm;codecs=vp9" : "video/webm"
674
674
  }), i.ondataavailable = (g) => {
675
- g.data && g.data.size && o.push(g.data);
675
+ g.data && g.data.size && a.push(g.data);
676
676
  }, i.onstop = () => {
677
- const g = o.length ? new Blob(o, { type: i.mimeType || "video/webm" }) : null;
677
+ const g = a.length ? new Blob(a, { type: i.mimeType || "video/webm" }) : null;
678
678
  s(), e(g);
679
- }, (h = n.getVideoTracks()[0]) == null || h.addEventListener("ended", () => l()), i.start(), a = setTimeout(l, cn);
679
+ }, (p = n.getVideoTracks()[0]) == null || p.addEventListener("ended", () => l()), i.start(), o = setTimeout(l, cn);
680
680
  }, stop: l };
681
681
  }
682
682
  function un() {
@@ -697,51 +697,51 @@ function un() {
697
697
  }
698
698
  };
699
699
  }
700
- const at = { x: 0, y: 0, w: 1, h: 1 };
700
+ const ot = { x: 0, y: 0, w: 1, h: 1 };
701
701
  function Xt() {
702
702
  const t = un();
703
- let e = [], r = { ...at }, n = 1;
703
+ let e = [], r = { ...ot }, n = 1;
704
704
  return {
705
- list: () => e.filter((o) => fn(o, r)),
705
+ list: () => e.filter((a) => fn(a, r)),
706
706
  all: () => e.slice(),
707
707
  crop: () => ({ ...r }),
708
- setCrop(o) {
709
- return r = dn(o), r;
708
+ setCrop(a) {
709
+ return r = dn(a), r;
710
710
  },
711
711
  resetCrop() {
712
- return r = { ...at }, r;
712
+ return r = { ...ot }, r;
713
713
  },
714
714
  isCropped() {
715
715
  return r.x > 1e-6 || r.y > 1e-6 || r.w < 1 - 1e-6 || r.h < 1 - 1e-6;
716
716
  },
717
- add(o, a) {
717
+ add(a, o) {
718
718
  const s = {
719
719
  id: `s${n++}`,
720
- type: o,
720
+ type: a,
721
721
  number: t.alloc(),
722
722
  x: 0.2,
723
723
  y: 0.2,
724
- w: o === "arrow" ? 0.2 : 0.22,
725
- h: o === "arrow" ? 0.05 : 0.16,
724
+ w: a === "arrow" ? 0.2 : 0.22,
725
+ h: a === "arrow" ? 0.05 : 0.16,
726
726
  x2: 0.4,
727
727
  y2: 0.28,
728
- ...a
728
+ ...o
729
729
  };
730
730
  return e.push(s), s;
731
731
  },
732
- update(o, a) {
733
- const s = e.find((l) => l.id === o);
734
- return s ? (Object.assign(s, a), s) : null;
732
+ update(a, o) {
733
+ const s = e.find((l) => l.id === a);
734
+ return s ? (Object.assign(s, o), s) : null;
735
735
  },
736
- remove(o) {
737
- const a = e.findIndex((l) => l.id === o);
738
- if (a < 0)
736
+ remove(a) {
737
+ const o = e.findIndex((l) => l.id === a);
738
+ if (o < 0)
739
739
  return null;
740
- const [s] = e.splice(a, 1);
740
+ const [s] = e.splice(o, 1);
741
741
  return t.free(s.number), s;
742
742
  },
743
743
  reset() {
744
- for (e = [], r = { ...at }, n = 1; t.peekUsed().length; )
744
+ for (e = [], r = { ...ot }, n = 1; t.peekUsed().length; )
745
745
  t.free(t.peekUsed()[0]);
746
746
  }
747
747
  };
@@ -755,31 +755,31 @@ function fn(t, e) {
755
755
  return r >= e.x && n >= e.y && r <= e.x + e.w && n <= e.y + e.h;
756
756
  }
757
757
  function hn(t, e, r, n = {}) {
758
- const i = n.mark || "#fdd341", o = n.markText || "#2a2140";
759
- return new Promise((a, s) => {
758
+ const i = n.mark || "#fdd341", a = n.markText || "#2a2140";
759
+ return new Promise((o, s) => {
760
760
  const l = new Image();
761
761
  l.onload = () => {
762
- const v = Math.round(e.x * l.width), y = Math.round(e.y * l.height), h = Math.max(1, Math.round(e.w * l.width)), g = Math.max(1, Math.round(e.h * l.height)), P = document.createElement("canvas");
763
- P.width = h, P.height = g;
764
- const d = P.getContext("2d");
765
- d.drawImage(l, v, y, h, g, 0, 0, h, g), d.lineWidth = Math.max(3, Math.round(h / 400)), d.strokeStyle = i, d.fillStyle = i, d.font = `700 ${Math.max(14, Math.round(h / 40))}px sans-serif`, r.forEach((p) => {
766
- const k = lt(p.x, e, h), T = ut(p.y, e, g), A = p.w / e.w * h, U = p.h / e.h * g;
767
- if (p.type === "rect")
768
- d.strokeRect(k, T, A, U);
769
- else if (p.type === "circle")
770
- d.beginPath(), d.ellipse(k + A / 2, T + U / 2, A / 2, U / 2, 0, 0, Math.PI * 2), d.stroke();
771
- else if (p.type === "arrow") {
772
- const ie = lt(p.x2 ?? p.x + p.w, e, h), oe = ut(p.y2 ?? p.y, e, g);
773
- mn(d, k, T, ie, oe);
762
+ const v = Math.round(e.x * l.width), y = Math.round(e.y * l.height), p = Math.max(1, Math.round(e.w * l.width)), g = Math.max(1, Math.round(e.h * l.height)), P = document.createElement("canvas");
763
+ P.width = p, P.height = g;
764
+ const f = P.getContext("2d");
765
+ f.drawImage(l, v, y, p, g, 0, 0, p, g), f.lineWidth = Math.max(3, Math.round(p / 400)), f.strokeStyle = i, f.fillStyle = i, f.font = `700 ${Math.max(14, Math.round(p / 40))}px sans-serif`, r.forEach((m) => {
766
+ const k = lt(m.x, e, p), T = ut(m.y, e, g), A = m.w / e.w * p, U = m.h / e.h * g;
767
+ if (m.type === "rect")
768
+ f.strokeRect(k, T, A, U);
769
+ else if (m.type === "circle")
770
+ f.beginPath(), f.ellipse(k + A / 2, T + U / 2, A / 2, U / 2, 0, 0, Math.PI * 2), f.stroke();
771
+ else if (m.type === "arrow") {
772
+ const ie = lt(m.x2 ?? m.x + m.w, e, p), ae = ut(m.y2 ?? m.y, e, g);
773
+ mn(f, k, T, ie, ae);
774
774
  }
775
- const V = pn(p, e, h, g, k, T, A), I = String(p.number);
776
- d.beginPath(), d.arc(V.x, V.y, 11, 0, Math.PI * 2), d.fill(), d.fillStyle = o, d.textAlign = "center", d.textBaseline = "middle", d.fillText(I, V.x, V.y), d.fillStyle = i;
777
- }), P.toBlob((p) => {
778
- if (!p) {
775
+ const V = pn(m, e, p, g, k, T, A), I = String(m.number);
776
+ f.beginPath(), f.arc(V.x, V.y, 11, 0, Math.PI * 2), f.fill(), f.fillStyle = a, f.textAlign = "center", f.textBaseline = "middle", f.fillText(I, V.x, V.y), f.fillStyle = i;
777
+ }), P.toBlob((m) => {
778
+ if (!m) {
779
779
  s(new Error("Could not encode screenshot"));
780
780
  return;
781
781
  }
782
- a(p);
782
+ o(m);
783
783
  }, "image/png");
784
784
  }, l.onerror = () => s(new Error("Could not load screenshot")), l.src = t;
785
785
  });
@@ -790,19 +790,19 @@ function lt(t, e, r) {
790
790
  function ut(t, e, r) {
791
791
  return (t - e.y) / e.h * r;
792
792
  }
793
- function pn(t, e, r, n, i, o, a) {
793
+ function pn(t, e, r, n, i, a, o) {
794
794
  if (t.type === "arrow") {
795
795
  const s = lt(t.x2 ?? t.x + t.w, e, r), l = ut(t.y2 ?? t.y, e, n);
796
796
  return {
797
797
  x: (i + s) / 2,
798
- y: (o + l) / 2
798
+ y: (a + l) / 2
799
799
  };
800
800
  }
801
- return { x: i + a / 2, y: o };
801
+ return { x: i + o / 2, y: a };
802
802
  }
803
803
  function mn(t, e, r, n, i) {
804
- const o = Math.atan2(i - r, n - e), a = 14, s = 2, l = n - Math.cos(o) * s, v = i - Math.sin(o) * s;
805
- t.beginPath(), t.moveTo(e, r), t.lineTo(l, v), t.stroke(), t.beginPath(), t.moveTo(n, i), t.lineTo(n - a * Math.cos(o - 0.4), i - a * Math.sin(o - 0.4)), t.lineTo(n - a * Math.cos(o + 0.4), i - a * Math.sin(o + 0.4)), t.closePath(), t.fill();
804
+ const a = Math.atan2(i - r, n - e), o = 14, s = 2, l = n - Math.cos(a) * s, v = i - Math.sin(a) * s;
805
+ t.beginPath(), t.moveTo(e, r), t.lineTo(l, v), t.stroke(), t.beginPath(), t.moveTo(n, i), t.lineTo(n - o * Math.cos(a - 0.4), i - o * Math.sin(a - 0.4)), t.lineTo(n - o * Math.cos(a + 0.4), i - o * Math.sin(a + 0.4)), t.closePath(), t.fill();
806
806
  }
807
807
  const yn = ["bug", "idea", "other"], gn = ["maker", "all-business", "brighter-day", "quiet-night"], Yt = "maker", wn = /* @__PURE__ */ new Set(["crop", "arrow", "rect", "circle"]), dt = 0.02, Dt = 0.05, bn = `
808
808
  <svg class="nf-launcher-icon" viewBox="0 0 24 24" aria-hidden="true">
@@ -813,7 +813,7 @@ const yn = ["bug", "idea", "other"], gn = ["maker", "all-business", "brighter-da
813
813
  function D(t) {
814
814
  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>`;
815
815
  }
816
- const j = {
816
+ const F = {
817
817
  crop: D('<path d="M6 3v5H1M18 21v-5h5M8 5h8a2 2 0 0 1 2 2v8M16 19H8a2 2 0 0 1-2-2V8"/>'),
818
818
  resetCrop: D('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),
819
819
  arrow: D('<path d="M5 19 19 5"/><path d="M9 5h10v10"/>'),
@@ -822,17 +822,18 @@ const j = {
822
822
  discard: D('<path d="M4 7h16"/><path d="M9 7V5h6v2"/><path d="M6 7l1 13h10l1-13"/>'),
823
823
  audio: D('<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0"/><path d="M12 18v3"/>'),
824
824
  video: D('<rect x="3" y="7" width="13" height="10" rx="2"/><path d="M16 10.5 21 8v8l-5-2.5z"/>')
825
- }, Gt = an();
825
+ }, Gt = on();
826
826
  Gt.hook();
827
- let m = {
827
+ let d = {
828
828
  endpoint: "",
829
829
  projectKey: "",
830
830
  version: "0.0.0",
831
+ name: "",
831
832
  targets: null,
832
833
  hideLauncher: !1,
833
834
  theme: Yt,
834
835
  video: !1
835
- }, ft = {}, u = null, c = {}, f = Xt(), S = "", q = "", L = null, G = "bug", O = null, R = null, b = null, w = null, K = null, B = null, W = null, F = { w: 0, h: 0 };
836
+ }, ft = {}, u = null, c = {}, h = Xt(), S = "", q = "", L = null, G = "bug", H = null, R = null, b = null, w = null, K = null, B = null, W = null, O = { w: 0, h: 0 };
836
837
  function E(t) {
837
838
  return u.querySelector(t);
838
839
  }
@@ -840,7 +841,7 @@ function Jt(t) {
840
841
  const e = String(t || "").trim().toLowerCase().replace(/\s+/g, "-");
841
842
  return gn.includes(e) ? e : Yt;
842
843
  }
843
- function jt(t, e) {
844
+ function Ft(t, e) {
844
845
  return u && getComputedStyle(u).getPropertyValue(t).trim() || e;
845
846
  }
846
847
  function x(t, e = !1) {
@@ -855,11 +856,11 @@ function vt() {
855
856
  <div class="nf-panel">
856
857
  <div class="nf-stage">
857
858
  <div class="nf-palette">
858
- <button class="nf-tool nf-icon-btn" type="button" data-tool="crop" title="Crop" aria-label="Crop">${j.crop}</button>
859
- <button class="nf-reset-crop nf-icon-btn" type="button" title="Reset crop" aria-label="Reset crop" hidden>${j.resetCrop}</button>
860
- <button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" title="Arrow" aria-label="Arrow">${j.arrow}</button>
861
- <button class="nf-tool nf-icon-btn" type="button" data-tool="rect" title="Rectangle" aria-label="Rectangle">${j.rect}</button>
862
- <button class="nf-tool nf-icon-btn" type="button" data-tool="circle" title="Circle" aria-label="Circle">${j.circle}</button>
859
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="crop" title="Crop" aria-label="Crop">${F.crop}</button>
860
+ <button class="nf-reset-crop nf-icon-btn" type="button" title="Reset crop" aria-label="Reset crop" hidden>${F.resetCrop}</button>
861
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" title="Arrow" aria-label="Arrow">${F.arrow}</button>
862
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="rect" title="Rectangle" aria-label="Rectangle">${F.rect}</button>
863
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="circle" title="Circle" aria-label="Circle">${F.circle}</button>
863
864
  </div>
864
865
  <div class="nf-canvas"></div>
865
866
  </div>
@@ -870,9 +871,9 @@ function vt() {
870
871
  <button type="button" data-kind="other">Other</button>
871
872
  </div>
872
873
  <div class="nf-actions">
873
- <button class="nf-discard-shot nf-icon-btn" type="button" title="Discard screenshot" aria-label="Discard screenshot">${j.discard}</button>
874
- <button class="nf-audio nf-icon-btn" type="button" title="Record audio" aria-label="Record audio">${j.audio}</button>
875
- <button class="nf-video nf-icon-btn" type="button" title="Record video" aria-label="Record video">${j.video}</button>
874
+ <button class="nf-discard-shot nf-icon-btn" type="button" title="Discard screenshot" aria-label="Discard screenshot">${F.discard}</button>
875
+ <button class="nf-audio nf-icon-btn" type="button" title="Record audio" aria-label="Record audio">${F.audio}</button>
876
+ <button class="nf-video nf-icon-btn" type="button" title="Record video" aria-label="Record video">${F.video}</button>
876
877
  <button class="nf-submit" type="button">Submit</button>
877
878
  </div>
878
879
  <button class="nf-restore" type="button" hidden>Restore screenshot</button>
@@ -898,10 +899,10 @@ function vt() {
898
899
  }
899
900
  function et() {
900
901
  var t;
901
- u && (u.dataset.theme = Jt(m.theme), m.hideLauncher ? u.setAttribute("data-nf-hidden-launcher", "") : u.removeAttribute("data-nf-hidden-launcher"), c.video && (c.video.hidden = !m.video), (t = c.dialog) != null && t.hidden && J());
902
+ u && (u.dataset.theme = Jt(d.theme), d.hideLauncher ? u.setAttribute("data-nf-hidden-launcher", "") : u.removeAttribute("data-nf-hidden-launcher"), c.video && (c.video.hidden = !d.video), (t = c.dialog) != null && t.hidden && J());
902
903
  }
903
904
  function J() {
904
- c.launcher && (c.launcher.hidden = !!m.hideLauncher);
905
+ c.launcher && (c.launcher.hidden = !!d.hideLauncher);
905
906
  }
906
907
  function vn() {
907
908
  c.launcher.addEventListener("click", () => ee()), E(".nf-dialog").addEventListener("click", (t) => {
@@ -920,11 +921,11 @@ function ht(t) {
920
921
  });
921
922
  }
922
923
  function pt(t) {
923
- O = wn.has(t) ? t : null, R = null, u.querySelectorAll(".nf-tool").forEach((e) => {
924
- e.dataset.active = String(e.dataset.tool === O);
925
- }), c.canvas && (c.canvas.dataset.draw = O ? "true" : "false"), S && $();
924
+ H = wn.has(t) ? t : null, R = null, u.querySelectorAll(".nf-tool").forEach((e) => {
925
+ e.dataset.active = String(e.dataset.tool === H);
926
+ }), c.canvas && (c.canvas.dataset.draw = H ? "true" : "false"), S && $();
926
927
  }
927
- function Ft(t) {
928
+ function Ot(t) {
928
929
  return Math.min(1, Math.max(0, t));
929
930
  }
930
931
  function nt() {
@@ -933,8 +934,8 @@ function nt() {
933
934
  function Z(t) {
934
935
  const e = nt().getBoundingClientRect();
935
936
  return {
936
- x: Ft((t.clientX - e.left) / Math.max(e.width, 1)),
937
- y: Ft((t.clientY - e.top) / Math.max(e.height, 1))
937
+ x: Ot((t.clientX - e.left) / Math.max(e.width, 1)),
938
+ y: Ot((t.clientY - e.top) / Math.max(e.height, 1))
938
939
  };
939
940
  }
940
941
  function xn(t) {
@@ -942,7 +943,7 @@ function xn(t) {
942
943
  return t.clientX >= e.left && t.clientX <= e.right && t.clientY >= e.top && t.clientY <= e.bottom;
943
944
  }
944
945
  function Zt(t) {
945
- const e = Z(t), r = f.crop();
946
+ const e = Z(t), r = h.crop();
946
947
  return {
947
948
  x: r.x + e.x * r.w,
948
949
  y: r.y + e.y * r.h
@@ -988,26 +989,26 @@ function Sn(t) {
988
989
  }, t), $();
989
990
  return;
990
991
  }
991
- if (R = null, O === "crop") {
992
+ if (R = null, H === "crop") {
992
993
  t.preventDefault(), st(t), b = { kind: "crop", start: Z(t), current: Z(t) }, mt(), $();
993
994
  return;
994
995
  }
995
- if (O === "arrow" || O === "rect" || O === "circle") {
996
+ if (H === "arrow" || H === "rect" || H === "circle") {
996
997
  t.preventDefault(), st(t);
997
998
  const n = Zt(t);
998
- b = { kind: "sticker", type: O, start: n, current: n }, mt(), $();
999
+ b = { kind: "sticker", type: H, start: n, current: n }, mt(), $();
999
1000
  return;
1000
1001
  }
1001
1002
  $();
1002
1003
  }
1003
1004
  function En(t, e) {
1004
1005
  e.preventDefault(), e.stopPropagation();
1005
- const r = nt().getBoundingClientRect(), n = f.list().find((i) => i.id === t.id);
1006
+ const r = nt().getBoundingClientRect(), n = h.list().find((i) => i.id === t.id);
1006
1007
  w = {
1007
1008
  ...t,
1008
1009
  startX: e.clientX,
1009
1010
  startY: e.clientY,
1010
- crop: f.crop(),
1011
+ crop: h.crop(),
1011
1012
  sticker: n ? { ...n } : null,
1012
1013
  rect: r
1013
1014
  }, xt(t.dir === "move" || t.dir === "start" || t.dir === "end"), mt();
@@ -1022,17 +1023,17 @@ function te(t) {
1022
1023
  const e = (t.clientX - w.startX) / w.rect.width * w.crop.w, r = (t.clientY - w.startY) / w.rect.height * w.crop.h, n = w.sticker;
1023
1024
  if (n) {
1024
1025
  if (w.dir === "end")
1025
- f.update(n.id, {
1026
+ h.update(n.id, {
1026
1027
  x2: n.x2 + e,
1027
1028
  y2: n.y2 + r
1028
1029
  });
1029
1030
  else if (w.dir === "start")
1030
- f.update(n.id, {
1031
+ h.update(n.id, {
1031
1032
  x: n.x + e,
1032
1033
  y: n.y + r
1033
1034
  });
1034
1035
  else if (w.dir === "move")
1035
- f.update(n.id, {
1036
+ h.update(n.id, {
1036
1037
  x: n.x + e,
1037
1038
  y: n.y + r,
1038
1039
  x2: (n.x2 || n.x) + e,
@@ -1040,7 +1041,7 @@ function te(t) {
1040
1041
  });
1041
1042
  else {
1042
1043
  const i = { x: n.x, y: n.y, w: n.w, h: n.h };
1043
- Cn(i, w.dir, e, r), f.update(n.id, i);
1044
+ Cn(i, w.dir, e, r), h.update(n.id, i);
1044
1045
  }
1045
1046
  $();
1046
1047
  }
@@ -1063,7 +1064,7 @@ function Q(t) {
1063
1064
  if (w) {
1064
1065
  if (w.kind === "sticker") {
1065
1066
  const e = c.canvas.getBoundingClientRect();
1066
- (t.clientX < e.left - 24 || t.clientX > e.right + 24 || t.clientY < e.top - 24 || t.clientY > e.bottom + 24) && (f.remove(w.id), R = null);
1067
+ (t.clientX < e.left - 24 || t.clientX > e.right + 24 || t.clientY < e.top - 24 || t.clientY > e.bottom + 24) && (h.remove(w.id), R = null);
1067
1068
  }
1068
1069
  w = null, $();
1069
1070
  }
@@ -1078,8 +1079,8 @@ function Mn() {
1078
1079
  $();
1079
1080
  return;
1080
1081
  }
1081
- const i = f.crop();
1082
- f.setCrop({
1082
+ const i = h.crop();
1083
+ h.setCrop({
1083
1084
  x: i.x + r.x * i.w,
1084
1085
  y: i.y + r.y * i.h,
1085
1086
  w: r.w * i.w,
@@ -1093,14 +1094,14 @@ function Mn() {
1093
1094
  function $n(t) {
1094
1095
  if (t.type === "arrow") {
1095
1096
  const e = t.current.x - t.start.x, r = t.current.y - t.start.y;
1096
- return Math.hypot(e, r) < dt ? f.add("arrow", {
1097
+ return Math.hypot(e, r) < dt ? h.add("arrow", {
1097
1098
  x: t.start.x,
1098
1099
  y: t.start.y,
1099
1100
  x2: t.start.x + 0.12,
1100
1101
  y2: t.start.y,
1101
1102
  w: 0.12,
1102
1103
  h: 0.02
1103
- }) : f.add("arrow", {
1104
+ }) : h.add("arrow", {
1104
1105
  x: t.start.x,
1105
1106
  y: t.start.y,
1106
1107
  x2: t.current.x,
@@ -1109,13 +1110,13 @@ function $n(t) {
1109
1110
  h: Math.abs(r)
1110
1111
  });
1111
1112
  }
1112
- return f.add(t.type, rt(t.start, t.current));
1113
+ return h.add(t.type, rt(t.start, t.current));
1113
1114
  }
1114
1115
  function Rn() {
1115
- f.resetCrop(), R = null, z();
1116
+ h.resetCrop(), R = null, z();
1116
1117
  }
1117
1118
  function yt() {
1118
- c.resetCrop && (c.resetCrop.hidden = !f.isCropped());
1119
+ c.resetCrop && (c.resetCrop.hidden = !h.isCropped());
1119
1120
  }
1120
1121
  function St(t) {
1121
1122
  if (!c.audio)
@@ -1145,7 +1146,7 @@ function kn() {
1145
1146
  }
1146
1147
  }
1147
1148
  async function Tn() {
1148
- if (!m.video) {
1149
+ if (!d.video) {
1149
1150
  x("Video is disabled on this host.");
1150
1151
  return;
1151
1152
  }
@@ -1179,11 +1180,11 @@ function z() {
1179
1180
  t.addEventListener("load", e), t.complete && t.naturalWidth && e();
1180
1181
  }
1181
1182
  function An(t) {
1182
- const e = t.naturalWidth || F.w, r = t.naturalHeight || F.h;
1183
- if (e && r && (F = { w: e, h: r }, c.canvas.style.setProperty("--nf-shot-aspect", String(e / r)), c.canvas.style.aspectRatio = `${e} / ${r}`), !c.shot || !F.w || !F.h)
1183
+ const e = t.naturalWidth || O.w, r = t.naturalHeight || O.h;
1184
+ if (e && r && (O = { w: e, h: r }, c.canvas.style.setProperty("--nf-shot-aspect", String(e / r)), c.canvas.style.aspectRatio = `${e} / ${r}`), !c.shot || !O.w || !O.h)
1184
1185
  return;
1185
- const n = f.crop(), i = F.w / F.h, o = n.w / n.h * i, a = Math.min(1, o / i), s = Math.min(1, i / o);
1186
- c.shot.style.left = `${(1 - a) / 2 * 100}%`, c.shot.style.top = `${(1 - s) / 2 * 100}%`, c.shot.style.width = `${a * 100}%`, c.shot.style.height = `${s * 100}%`, t.style.width = `${100 / n.w}%`, t.style.height = `${100 / n.h}%`, t.style.left = `${-n.x / n.w * 100}%`, t.style.top = `${-n.y / n.h * 100}%`;
1186
+ const n = h.crop(), i = O.w / O.h, a = n.w / n.h * i, o = Math.min(1, a / i), s = Math.min(1, i / a);
1187
+ c.shot.style.left = `${(1 - o) / 2 * 100}%`, c.shot.style.top = `${(1 - s) / 2 * 100}%`, c.shot.style.width = `${o * 100}%`, c.shot.style.height = `${s * 100}%`, t.style.width = `${100 / n.w}%`, t.style.height = `${100 / n.h}%`, t.style.left = `${-n.x / n.w * 100}%`, t.style.top = `${-n.y / n.h * 100}%`;
1187
1188
  }
1188
1189
  function In(t) {
1189
1190
  return t.type === "arrow" ? {
@@ -1208,19 +1209,19 @@ function $() {
1208
1209
  yt();
1209
1210
  return;
1210
1211
  }
1211
- const e = f.crop();
1212
+ const e = h.crop();
1212
1213
  if ((b == null ? void 0 : b.kind) === "crop") {
1213
1214
  const n = document.createElement("div");
1214
- n.className = "nf-crop", Ot(n, rt(b.start, b.current), { x: 0, y: 0, w: 1, h: 1 }), c.shot.appendChild(n);
1215
+ n.className = "nf-crop", Ht(n, rt(b.start, b.current), { x: 0, y: 0, w: 1, h: 1 }), c.shot.appendChild(n);
1215
1216
  }
1216
- const r = f.list().slice();
1217
+ const r = h.list().slice();
1217
1218
  if ((b == null ? void 0 : b.kind) === "sticker" && r.push(In(b)), r.forEach((n) => {
1218
- const i = n.id === "preview", o = !i && n.id === R, a = document.createElement("div");
1219
- if (a.className = `nf-sticker nf-${n.type}`, a.dataset.id = n.id, o && (a.dataset.selected = "true"), i && (a.dataset.preview = "true"), n.type === "arrow" ? Dn(a, n, e, o) : (Ot(a, n, e), o && ["nw", "ne", "sw", "se"].forEach((s) => gt(a, s))), !i && n.number) {
1219
+ const i = n.id === "preview", a = !i && n.id === R, o = document.createElement("div");
1220
+ if (o.className = `nf-sticker nf-${n.type}`, o.dataset.id = n.id, a && (o.dataset.selected = "true"), i && (o.dataset.preview = "true"), n.type === "arrow" ? Dn(o, n, e, a) : (Ht(o, n, e), a && ["nw", "ne", "sw", "se"].forEach((s) => gt(o, s))), !i && n.number) {
1220
1221
  const s = document.createElement("span");
1221
- s.className = "nf-badge", s.textContent = String(n.number), a.appendChild(s);
1222
+ s.className = "nf-badge", s.textContent = String(n.number), o.appendChild(s);
1222
1223
  }
1223
- c.shot.appendChild(a);
1224
+ c.shot.appendChild(o);
1224
1225
  }), c.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((n) => n.remove()), L) {
1225
1226
  const n = document.createElement("video");
1226
1227
  n.className = "nf-recording-preview", n.controls = !0, n.src = URL.createObjectURL(L), n.style.position = "absolute", n.style.right = "8px", n.style.bottom = "8px", n.style.width = "160px", c.canvas.appendChild(n);
@@ -1228,8 +1229,8 @@ function $() {
1228
1229
  yt();
1229
1230
  }
1230
1231
  function Dn(t, e, r, n) {
1231
- const i = nt(), o = i.clientWidth, a = i.clientHeight, s = (e.x - r.x) / r.w * o, l = (e.y - r.y) / r.h * a, v = ((e.x2 ?? e.x + e.w) - r.x) / r.w * o, y = ((e.y2 ?? e.y) - r.y) / r.h * a, h = 18, g = Math.min(s, v) - h, P = Math.min(l, y) - h, d = Math.max(2, Math.abs(v - s)) + h * 2, p = Math.max(2, Math.abs(y - l)) + h * 2, k = s - g, T = l - P, A = v - g, U = y - P, V = `nf-ah-${e.id}`, I = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1232
- t.style.left = `${g}px`, t.style.top = `${P}px`, t.style.width = `${d}px`, t.style.height = `${p}px`, I.setAttribute("class", "nf-arrow-svg"), I.setAttribute("viewBox", `0 0 ${d} ${p}`), I.setAttribute("width", String(d)), I.setAttribute("height", String(p)), I.innerHTML = `
1232
+ const i = nt(), a = i.clientWidth, o = i.clientHeight, s = (e.x - r.x) / r.w * a, l = (e.y - r.y) / r.h * o, v = ((e.x2 ?? e.x + e.w) - r.x) / r.w * a, y = ((e.y2 ?? e.y) - r.y) / r.h * o, p = 18, g = Math.min(s, v) - p, P = Math.min(l, y) - p, f = Math.max(2, Math.abs(v - s)) + p * 2, m = Math.max(2, Math.abs(y - l)) + p * 2, k = s - g, T = l - P, A = v - g, U = y - P, V = `nf-ah-${e.id}`, I = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1233
+ t.style.left = `${g}px`, t.style.top = `${P}px`, t.style.width = `${f}px`, t.style.height = `${m}px`, I.setAttribute("class", "nf-arrow-svg"), I.setAttribute("viewBox", `0 0 ${f} ${m}`), I.setAttribute("width", String(f)), I.setAttribute("height", String(m)), I.innerHTML = `
1233
1234
  <defs>
1234
1235
  <marker id="${V}" markerWidth="10" markerHeight="10" refX="8" refY="5" orient="auto">
1235
1236
  <path d="M0,0 L10,5 L0,10 Z" fill="currentColor" />
@@ -1243,23 +1244,24 @@ function gt(t, e, r) {
1243
1244
  const n = document.createElement("span");
1244
1245
  n.className = "nf-handle", n.dataset.dir = e, r && (n.style.left = `${r.left}px`, n.style.top = `${r.top}px`), t.appendChild(n);
1245
1246
  }
1246
- function Ot(t, e, r) {
1247
+ function Ht(t, e, r) {
1247
1248
  t.style.left = `${(e.x - r.x) / r.w * 100}%`, t.style.top = `${(e.y - r.y) / r.h * 100}%`, t.style.width = `${e.w / r.w * 100}%`, t.style.height = `${e.h / r.h * 100}%`;
1248
1249
  }
1249
- function jn(t = {}) {
1250
- return rn(t), m = {
1251
- ...m,
1252
- endpoint: String(t.endpoint || m.endpoint || "").replace(/\/$/, ""),
1253
- projectKey: t.projectKey == null ? m.projectKey : String(t.projectKey),
1254
- version: t.version == null ? m.version : String(t.version),
1255
- targets: t.targets === void 0 ? m.targets : t.targets,
1256
- hideLauncher: t.hideLauncher == null ? m.hideLauncher : !!t.hideLauncher,
1257
- theme: Jt(t.theme ?? m.theme),
1258
- video: t.video == null ? m.video : !!t.video
1250
+ function Fn(t = {}) {
1251
+ return rn(t), d = {
1252
+ ...d,
1253
+ endpoint: String(t.endpoint || d.endpoint || "").replace(/\/$/, ""),
1254
+ projectKey: t.projectKey == null ? d.projectKey : String(t.projectKey),
1255
+ version: t.version == null ? d.version : String(t.version),
1256
+ name: t.name == null ? d.name : String(t.name || ""),
1257
+ targets: t.targets === void 0 ? d.targets : t.targets,
1258
+ hideLauncher: t.hideLauncher == null ? d.hideLauncher : !!t.hideLauncher,
1259
+ theme: Jt(t.theme ?? d.theme),
1260
+ video: t.video == null ? d.video : !!t.video
1259
1261
  }, vt(), et(), re;
1260
1262
  }
1261
1263
  async function ee() {
1262
- vt(), et(), c.launcher.hidden = !0, f = Xt(), F = { w: 0, h: 0 }, L = null, R = null, b = null, w = null, G = "bug", ht("bug"), pt(null), St(!1), c.text.value = "", x("Capturing…");
1264
+ vt(), et(), c.launcher.hidden = !0, h = Xt(), O = { w: 0, h: 0 }, L = null, R = null, b = null, w = null, G = "bug", ht("bug"), pt(null), St(!1), c.text.value = "", x("Capturing…");
1263
1265
  try {
1264
1266
  S = await tn(), q = S, c.stage.hidden = !1, c.restore.hidden = !0;
1265
1267
  } catch {
@@ -1270,7 +1272,7 @@ async function ee() {
1270
1272
  function it() {
1271
1273
  u && (B == null || B.stop(), St(!1), Qt(), b = null, w = null, xt(!1), c.dialog.hidden = !0, c.stop.hidden = !0, J());
1272
1274
  }
1273
- function Fn(t = {}) {
1275
+ function On(t = {}) {
1274
1276
  ft = { ...ft, ...nn(t) };
1275
1277
  }
1276
1278
  async function ne() {
@@ -1278,30 +1280,30 @@ async function ne() {
1278
1280
  const t = c.text.value.trim();
1279
1281
  if (!t && !S && !L)
1280
1282
  return x("Add a note, screenshot, or video first."), null;
1281
- if (!m.endpoint || !m.projectKey)
1283
+ if (!d.endpoint || !d.projectKey)
1282
1284
  return x("Notefully is missing endpoint or projectKey."), null;
1283
1285
  x("Submitting…", !0);
1284
1286
  const e = new FormData();
1285
- if (e.append("message", t), e.append("kind", G), e.append("version", m.version || "0.0.0"), e.append("context", JSON.stringify({
1287
+ if (e.append("message", t), e.append("kind", G), e.append("version", d.version || "0.0.0"), d.name && e.append("name", d.name), e.append("context", JSON.stringify({
1286
1288
  ...en(ft),
1287
1289
  console: Gt.snapshot()
1288
- })), e.append("annotations", JSON.stringify(f.list())), Array.isArray(m.targets) && e.append("targets", JSON.stringify(m.targets)), S) {
1290
+ })), e.append("annotations", JSON.stringify(h.list())), Array.isArray(d.targets) && e.append("targets", JSON.stringify(d.targets)), S) {
1289
1291
  const i = await hn(
1290
1292
  S,
1291
- f.crop(),
1292
- f.list(),
1293
+ h.crop(),
1294
+ h.list(),
1293
1295
  {
1294
- mark: jt("--nf-mark", "#fdd341"),
1295
- markText: jt("--nf-mark-text", "#2a2140")
1296
+ mark: Ft("--nf-mark", "#fdd341"),
1297
+ markText: Ft("--nf-mark-text", "#2a2140")
1296
1298
  }
1297
1299
  );
1298
1300
  e.append("screenshot", i, "screenshot.png");
1299
1301
  }
1300
1302
  L && e.append("recording", L, "recording.webm");
1301
- const r = await fetch(`${m.endpoint}/v1/reports`, {
1303
+ const r = await fetch(`${d.endpoint}/v1/reports`, {
1302
1304
  method: "POST",
1303
1305
  headers: {
1304
- "X-Notefully-Key": m.projectKey
1306
+ "X-Notefully-Key": d.projectKey
1305
1307
  },
1306
1308
  body: e
1307
1309
  });
@@ -1315,17 +1317,17 @@ async function ne() {
1315
1317
  throw x((n == null ? void 0 : n.error) || "Submit failed."), new Error((n == null ? void 0 : n.error) || `Submit failed (${r.status})`);
1316
1318
  return x("Sent. Thank you."), it(), n;
1317
1319
  }
1318
- function On() {
1320
+ function Hn() {
1319
1321
  it(), u == null || u.remove(), u = null, c = {};
1320
1322
  }
1321
- const re = { init: jn, open: ee, close: it, identify: Fn, submit: ne, destroy: On };
1323
+ const re = { init: Fn, open: ee, close: it, identify: On, submit: ne, destroy: Hn };
1322
1324
  typeof window < "u" && (window.Notefully = re);
1323
1325
  export {
1324
1326
  it as close,
1325
1327
  re as default,
1326
- On as destroy,
1327
- Fn as identify,
1328
- jn as init,
1328
+ Hn as destroy,
1329
+ On as identify,
1330
+ Fn as init,
1329
1331
  ee as open,
1330
1332
  ne as submit
1331
1333
  };