@useinsider/guido 3.14.0-beta.8d5df20 → 3.14.0-beta.98ecc9b

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.
@@ -1,46 +1,46 @@
1
- const l = "data-ins-track-id", $ = "data-ins-track-seq", E = `(?:[^>"']|"[^"]*"|'[^']*')*`, N = new RegExp(`<a\\b${E}>`, "gi"), g = new RegExp(`<body\\b${E}>`, "i"), p = new RegExp(`<html\\b${E}>`, "i"), S = new RegExp(`\\b${l}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`, "i"), f = new RegExp(`\\b${$}\\s*=\\s*(?:"(\\d+)"|'(\\d+)'|(\\d+))`, "i"), b = "ins-track-seq", A = new RegExp(`<!--\\s*${b}:(\\d+)\\s*-->`, "i"), I = /^[1-9][0-9]{0,14}$/;
2
- function w(e) {
3
- const t = Number(e);
4
- return Number.isSafeInteger(t) && t > 0 ? t : 0;
1
+ const $ = "data-ins-track-id", l = "data-ins-track-seq", E = `(?:[^>"']|"[^"]*"|'[^']*')*`, S = new RegExp(`<a\\b${E}>`, "gi"), p = new RegExp(`<body\\b${E}>`, "i"), b = new RegExp(`<html\\b${E}>`, "i"), I = new RegExp(`\\b${$}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`, "i"), N = new RegExp(`\\b${l}\\s*=\\s*(?:"(\\d+)"|'(\\d+)'|(\\d+))`, "i"), f = "ins-track-seq", x = new RegExp(`<!--\\s*${f}:(\\d+)\\s*-->`, "i"), w = /^[1-9][0-9]{0,14}$/, q = 999999999999999;
2
+ function C(e) {
3
+ const n = Number(e);
4
+ return Number.isSafeInteger(n) && n > 0 ? n : 0;
5
5
  }
6
- function q(e) {
7
- var r;
8
- const t = (a) => {
9
- var i;
10
- const c = (i = a.exec(e)) == null ? void 0 : i[0];
11
- return c ? f.exec(c) : null;
12
- }, n = t(g) ?? t(p), s = (n == null ? void 0 : n[1]) ?? (n == null ? void 0 : n[2]) ?? (n == null ? void 0 : n[3]) ?? ((r = A.exec(e)) == null ? void 0 : r[1]) ?? "";
13
- return w(s);
6
+ function k(e) {
7
+ var a;
8
+ const n = (r) => {
9
+ var c;
10
+ const o = (c = r.exec(e)) == null ? void 0 : c[0];
11
+ return o ? N.exec(o) : null;
12
+ }, t = n(p) ?? n(b), s = (t == null ? void 0 : t[1]) ?? (t == null ? void 0 : t[2]) ?? (t == null ? void 0 : t[3]) ?? ((a = x.exec(e)) == null ? void 0 : a[1]) ?? "";
13
+ return C(s);
14
14
  }
15
- function k(e, t) {
16
- const n = `${$}="${t}"`, s = g.exec(e) ?? p.exec(e);
15
+ function D(e, n) {
16
+ const t = `${l}="${n}"`, s = p.exec(e) ?? b.exec(e);
17
17
  if (s) {
18
- const [a] = s, c = f.exec(a), i = c ? a.replace(c[0], n) : a.replace(/\/?>$/, (T) => ` ${n}${T}`);
19
- return e.slice(0, s.index) + i + e.slice(s.index + a.length);
18
+ const [r] = s, o = N.exec(r), c = o ? r.replace(o[0], t) : r.replace(/\/?>$/, (T) => ` ${t}${T}`);
19
+ return e.slice(0, s.index) + c + e.slice(s.index + r.length);
20
20
  }
21
- const r = `<!--${b}:${t}-->`;
22
- return A.test(e) ? e.replace(A, r) : `${r}${e}`;
21
+ const a = `<!--${f}:${n}-->`;
22
+ return x.test(e) ? e.replace(x, a) : `${a}${e}`;
23
23
  }
24
- function C(e, t, n) {
25
- const s = `${l}="${n}"`;
26
- return t ? e.replace(t[0], s) : e.replace(/^<a\b/i, (r) => `${r} ${s}`);
24
+ function M(e, n, t) {
25
+ const s = `${$}="${t}"`;
26
+ return n ? e.replace(n[0], s) : e.replace(/^<a\b/i, (a) => `${a} ${s}`);
27
27
  }
28
- function P(e, t = 0) {
29
- const n = /* @__PURE__ */ new Set();
28
+ function P(e, n = 0) {
29
+ const t = /* @__PURE__ */ new Set();
30
30
  let s = 0;
31
- const r = [...e.matchAll(N)].map((o) => {
32
- const [_] = o, u = S.exec(_), R = u ? u[1] ?? u[2] ?? u[3] ?? "" : "";
31
+ const a = [...e.matchAll(S)].map((i) => {
32
+ const [g] = i, u = I.exec(g), _ = u ? u[1] ?? u[2] ?? u[3] ?? "" : "";
33
33
  let d = null;
34
- return I.test(R) && !n.has(Number(R)) && (d = Number(R), n.add(d), s = Math.max(s, d)), { index: o.index, tag: _, attrMatch: u, id: d };
35
- }), a = q(e);
36
- let c = Math.max(a, s, t), i = "", T = 0, x = !1;
37
- return r.forEach((o) => {
38
- i += e.slice(T, o.index), o.id === null ? (c += 1, i += C(o.tag, o.attrMatch, c), x = !0) : i += o.tag, T = o.index + o.tag.length;
39
- }), i += e.slice(T), c > 0 && a !== c && (i = k(i, c), x = !0), { html: i, changed: x, nextSeq: c };
34
+ return w.test(_) && !t.has(Number(_)) && (d = Number(_), t.add(d), s = Math.max(s, d)), { index: i.index, tag: g, attrMatch: u, id: d };
35
+ }), r = k(e), o = Number.isSafeInteger(n) && n > 0 && n < q ? n : 0;
36
+ let c = Math.max(r, s, o), T = "", A = 0, R = !1;
37
+ return a.forEach((i) => {
38
+ T += e.slice(A, i.index), i.id === null ? (c += 1, T += M(i.tag, i.attrMatch, c), R = !0) : T += i.tag, A = i.index + i.tag.length;
39
+ }), T += e.slice(A), c > 0 && r !== c && (T = D(T, c), R = !0), { html: T, changed: R, nextSeq: c };
40
40
  }
41
41
  export {
42
- l as TRACK_ID_ATTRIBUTE,
43
- $ as TRACK_SEQ_ATTRIBUTE,
42
+ $ as TRACK_ID_ATTRIBUTE,
43
+ l as TRACK_SEQ_ATTRIBUTE,
44
44
  P as assignTrackingIds,
45
- q as readTrackSeq
45
+ k as readTrackSeq
46
46
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.14.0-beta.8d5df20",
3
+ "version": "3.14.0-beta.98ecc9b",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",