@floegence/floe-webapp-core 0.86.27 → 0.86.31

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.
@@ -0,0 +1,130 @@
1
+ const d = "\\u1100-\\u11ff\\u20a9\\u2329-\\u232a\\u2630-\\u2637\\u268a-\\u268f\\u2e80-\\u2e99\\u2e9b-\\u2ef3\\u2f00-\\u2fd5\\u2ff0-\\u303e\\u3041-\\u3096\\u3099-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u3190-\\u31e5\\u31ef-\\u321e\\u3220-\\u3247\\u3250-\\ua48c\\ua490-\\ua4c6\\ua960-\\ua97c\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufaff\\ufe10-\\ufe19\\ufe30-\\ufe52\\ufe54-\\ufe66\\ufe68-\\ufe6b\\uff01-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\\uffe0-\\uffe6\\uffe8-\\uffee\\u{16fe0}-\\u{16fe4}\\u{16ff0}-\\u{16ff6}\\u{17000}-\\u{18cda}\\u{18cff}-\\u{18d20}\\u{18d80}-\\u{18df2}\\u{18e00}-\\u{19191}\\u{191a0}-\\u{191d2}\\u{1aff0}-\\u{1aff3}\\u{1aff5}-\\u{1affb}\\u{1affd}-\\u{1affe}\\u{1b000}-\\u{1b128}\\u{1b132}\\u{1b150}-\\u{1b152}\\u{1b155}\\u{1b164}-\\u{1b168}\\u{1b170}-\\u{1b2fb}\\u{1d300}-\\u{1d356}\\u{1d360}-\\u{1d376}\\u{1f1ae}\\u{1f200}\\u{1f202}\\u{1f210}-\\u{1f219}\\u{1f21b}-\\u{1f22e}\\u{1f230}-\\u{1f231}\\u{1f237}\\u{1f23b}\\u{1f240}-\\u{1f248}\\u{1f260}-\\u{1f265}\\u{1f7da}\\u{20000}-\\u{3fffd}", k = new RegExp(`[${d}]`, "u"), I = new RegExp(`^((?![*_])[\\s\\p{P}\\p{S}${d}])`, "u");
2
+ function L(e, t, n) {
3
+ return new RegExp(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)${e}(\\*+)(?=[\\s]|$)|${n}(\\*+)(?!\\*)(?=${t}|$)|(?!\\*)${t}(\\*+)(?=${n})|[\\s](\\*+)(?!\\*)(?=${e})|(?!\\*)${e}(\\*+)(?!\\*)(?=${e})|${n}(\\*+)(?=${n})`, "gu");
4
+ }
5
+ function G(e, t, n) {
6
+ return new RegExp(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)${e}(_+)(?=[\\s]|$)|${n}(_+)(?!_)(?=${t}|$)|(?!_)${t}(_+)(?=${n})|[\\s](_+)(?!_)(?=${e})|(?!_)${e}(_+)(?!_)(?=${e})`, "gu");
7
+ }
8
+ function N(e, t, n) {
9
+ return new RegExp(`^[^~]+(?=[^~])|(?!~)${e}(~~?)(?=[\\s]|$)|${n}(~~?)(?!~)(?=${t}|$)|(?!~)${t}(~~?)(?=${n})|[\\s](~~?)(?!~)(?=${e})|(?!~)${e}(~~?)(?!~)(?=${e})|${n}(~~?)(?=${n})`, "gu");
10
+ }
11
+ const E = `[\\p{P}\\p{S}${d}]`, w = `[\\s\\p{P}\\p{S}${d}]`, T = `[^\\s\\p{P}\\p{S}${d}]`, U = `(?![*_])[\\p{P}\\p{S}${d}]`, O = `(?![*_])[\\s\\p{P}\\p{S}${d}]`, z = `(?:[^\\s\\p{P}\\p{S}${d}]|[*_])`, F = `(?!~)[\\p{P}\\p{S}${d}]`, J = `(?!~)[\\s\\p{P}\\p{S}${d}]`, K = `(?:[^\\s\\p{P}\\p{S}${d}]|~)`, M = L(E, w, T), W = L(F, J, K), q = G(E, w, T), S = N(U, O, z);
12
+ function A(e, t, n) {
13
+ let f = I.test(e);
14
+ if (!f && e) {
15
+ const u = t.length - n.length;
16
+ if (u >= 1) {
17
+ let c = u - 1, a = t.charCodeAt(c);
18
+ if (a >= 65024 && a <= 65038 && c >= 1 && (c--, a = t.charCodeAt(c)), (a & 64512) === 56320 && c >= 1) {
19
+ const s = t.codePointAt(c - 1);
20
+ s !== void 0 && s > 65535 && (s >= 917760 && s <= 917999 ? f = !0 : f = k.test(String.fromCodePoint(s)));
21
+ } else f = k.test(String.fromCharCode(a));
22
+ }
23
+ }
24
+ return f;
25
+ }
26
+ function R(e, t) {
27
+ if (!(e[1] || e[2] || e[3] || e[4])) return !1;
28
+ const n = String.fromCodePoint(e[0].codePointAt(0)), f = e.index + e[0].length, u = f < t.length ? String.fromCodePoint(t.codePointAt(f)) : "";
29
+ return k.test(n) || k.test(u);
30
+ }
31
+ function P(e) {
32
+ return e.length >= 5;
33
+ }
34
+ function v(e) {
35
+ return !!(e[1] || e[2] || e[3] || e[4]);
36
+ }
37
+ function H(e) {
38
+ return P(e) ? !!e[4] : !!e[3];
39
+ }
40
+ function Q(e) {
41
+ return P(e) ? e[1] || e[3] || "" : e[1] || e[2] || "";
42
+ }
43
+ function V() {
44
+ return { tokenizer: {
45
+ emStrong(e, t, n = "") {
46
+ const { rules: f } = this, u = f.inline.emStrongLDelim.exec(e);
47
+ if (!u) return !1;
48
+ const c = P(u);
49
+ if (c && !v(u)) return;
50
+ if (H(u) && n.match(f.other.unicodeAlphaNumeric)) return !1;
51
+ const a = Q(u), s = A(n, t, e);
52
+ if (!a || !n || f.inline.punctuation.exec(n) || s || k.test(a)) {
53
+ const $ = [...u[0]].length - 1;
54
+ let r, o, g = $, i = 0;
55
+ const j = c && n === u[0][0], b = f.inline.emStrongRDelimAst.source.includes("(?!~)");
56
+ let m;
57
+ u[0][0] === "*" ? m = b ? W : M : m = q, m.lastIndex = 0;
58
+ const _ = t.slice(-1 * e.length + $);
59
+ let l;
60
+ for (; (l = m.exec(_)) != null; ) {
61
+ if (r = l[1] || l[2] || l[3] || l[4] || l[5] || l[6], !r) continue;
62
+ o = [...r].length;
63
+ const C = R(l, _), y = !!(l[3] || l[4]), h = !!(l[5] || l[6]);
64
+ if (y && !C) {
65
+ g += o;
66
+ continue;
67
+ }
68
+ if (h || C) {
69
+ if ($ % 3 && !(($ + o) % 3)) {
70
+ i += o;
71
+ continue;
72
+ }
73
+ if (j && h) break;
74
+ }
75
+ if (g -= o, g > 0) continue;
76
+ o = Math.min(o, o + g + i);
77
+ const B = l[0].codePointAt(0) > 65535 ? 2 : 1, x = e.slice(0, $ + l.index + B + o);
78
+ if (Math.min($, o) % 2) {
79
+ const D = x.slice(1, -1);
80
+ return {
81
+ type: "em",
82
+ raw: x,
83
+ text: D,
84
+ tokens: this.lexer.inlineTokens(D)
85
+ };
86
+ }
87
+ const p = x.slice(2, -2);
88
+ return {
89
+ type: "strong",
90
+ raw: x,
91
+ text: p,
92
+ tokens: this.lexer.inlineTokens(p)
93
+ };
94
+ }
95
+ }
96
+ },
97
+ del(e, t, n = "") {
98
+ const { rules: f } = this, u = f.inline.delLDelim.exec(e);
99
+ if (!u) return !1;
100
+ const c = u[1] || "", a = A(n, t, e);
101
+ if (!c || !n || f.inline.punctuation.exec(n) || a || k.test(c)) {
102
+ const s = [...u[0]].length - 1;
103
+ let $, r, o = s;
104
+ S.lastIndex = 0;
105
+ const g = t.slice(-1 * e.length + s);
106
+ let i;
107
+ for (; (i = S.exec(g)) != null; ) {
108
+ if ($ = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !$ || (r = [...$].length, r !== s)) continue;
109
+ const j = R(i, g);
110
+ if ((i[3] || i[4]) && !j) {
111
+ o += r;
112
+ continue;
113
+ }
114
+ if (o -= r, o > 0) continue;
115
+ r = Math.min(r, r + o);
116
+ const b = i[0].codePointAt(0) > 65535 ? 2 : 1, m = e.slice(0, s + i.index + b + r), _ = m.slice(s, -s);
117
+ return {
118
+ type: "del",
119
+ raw: m,
120
+ text: _,
121
+ tokens: this.lexer.inlineTokens(_)
122
+ };
123
+ }
124
+ }
125
+ }
126
+ } };
127
+ }
128
+ export {
129
+ V as default
130
+ };