@tolki/str 1.5.0 → 1.7.0

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/str.js CHANGED
@@ -1,53 +1,53 @@
1
- import { isArray as x, toLower as M, isString as S, isFunction as Q, isNumber as X, isNull as Y, isUndefined as v } from "@tolki/utils";
2
- import { title as T, upper as D } from "./convertcase/index.js";
3
- import { randomInt as U, randomString as tt } from "./random/index.js";
4
- import { substr as $ } from "./replacer/index.js";
5
- import { ltrim as j, rtrim as G, trim as nt } from "./trimmer/index.js";
6
- import { createUlidsNormally as et } from "./ulid/index.js";
7
- import { createUuidsNormally as rt } from "./uuid/index.js";
1
+ import { isArray as x, phpStringCast as z, toLower as U, isString as S, isFunction as Y, isNumber as v, isNull as tt, isUndefined as nt } from "@tolki/utils";
2
+ import { title as G, upper as J } from "./convertcase/index.js";
3
+ import { randomInt as I, randomString as et } from "./random/index.js";
4
+ import { substr as A } from "./replacer/index.js";
5
+ import { ltrim as q, rtrim as B, trim as rt } from "./trimmer/index.js";
6
+ import { createUlidsNormally as st } from "./ulid/index.js";
7
+ import { createUuidsNormally as it } from "./uuid/index.js";
8
8
  const F = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
9
9
  let R = null;
10
- function H(t, n) {
10
+ function Z(t, n) {
11
11
  if (n === "")
12
12
  return t;
13
13
  const e = String(n), r = t.indexOf(e);
14
14
  return r === -1 ? t : t.slice(r + e.length);
15
15
  }
16
- function Et(t, n) {
16
+ function Rt(t, n) {
17
17
  if (n === "")
18
18
  return t;
19
19
  const e = t.lastIndexOf(String(n));
20
20
  return e === -1 ? t : t.slice(e + String(n).length);
21
21
  }
22
- function st(t, n) {
22
+ function ot(t, n) {
23
23
  if (n === "")
24
24
  return t;
25
25
  const e = t.indexOf(String(n));
26
26
  return e === -1 ? t : t.slice(0, e);
27
27
  }
28
- function ot(t, n) {
28
+ function ct(t, n) {
29
29
  if (n === "")
30
30
  return t;
31
31
  const e = t.lastIndexOf(String(n));
32
- return e === -1 ? t : $(t, 0, e);
32
+ return e === -1 ? t : A(t, 0, e);
33
33
  }
34
- function Ct(t, n, e) {
35
- return n === "" || e === "" ? t : ot(H(t, n), e);
34
+ function Ft(t, n, e) {
35
+ return n === "" || e === "" ? t : ct(Z(t, n), e);
36
36
  }
37
- function Rt(t, n, e) {
38
- return n === "" || e === "" ? t : st(H(t, n), e);
37
+ function Nt(t, n, e) {
38
+ return n === "" || e === "" ? t : ot(Z(t, n), e);
39
39
  }
40
- function Ft(t) {
40
+ function _t(t) {
41
41
  if (N.has(t))
42
42
  return N.get(t);
43
- const n = gt(V(t));
43
+ const n = dt(X(t));
44
44
  return N.set(t, n), n;
45
45
  }
46
- function Nt(t, n) {
46
+ function zt(t, n) {
47
47
  const e = t.length;
48
48
  return (n < 0 ? n < -e : n > e - 1) ? !1 : (n < 0 && (n += e), t.charAt(n));
49
49
  }
50
- function _t(t, n) {
50
+ function Wt(t, n) {
51
51
  for (const e of x(n) ? n : [n])
52
52
  if (e !== "" && t.startsWith(e)) {
53
53
  const r = [...t], s = [...e];
@@ -55,7 +55,7 @@ function _t(t, n) {
55
55
  }
56
56
  return t;
57
57
  }
58
- function zt(t, n) {
58
+ function Ot(t, n) {
59
59
  for (const e of x(n) ? n : [n])
60
60
  if (e !== "" && t.endsWith(e)) {
61
61
  const r = [...t], s = [...e];
@@ -63,7 +63,7 @@ function zt(t, n) {
63
63
  }
64
64
  return t;
65
65
  }
66
- function J(t, n, e = !1) {
66
+ function K(t, n, e = !1) {
67
67
  e && (t = t.toLowerCase());
68
68
  let r;
69
69
  typeof n == "string" ? r = [n] : r = Array.from(n);
@@ -72,33 +72,33 @@ function J(t, n, e = !1) {
72
72
  return !0;
73
73
  return !1;
74
74
  }
75
- function Wt(t, n = "", e = {}) {
76
- const { radius: r = 100, omission: s = "..." } = e, o = String(t ?? ""), i = n ?? "", c = (k) => k.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), l = new RegExp(`^(.*?)(${c(i)})(.*)$`, "iu").exec(o);
75
+ function Mt(t, n = "", e = {}) {
76
+ const { radius: r = 100, omission: s = "..." } = e, i = String(t ?? ""), o = n ?? "", c = (k) => k.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), l = new RegExp(`^(.*?)(${c(o)})(.*)$`, "iu").exec(i);
77
77
  if (!l)
78
78
  return null;
79
- const m = String(l[1]), a = String(l[2]), g = String(l[3]), p = j(m), u = Array.from(p).length, y = $(p, Math.max(u - r, 0), r);
80
- let w = j(y);
81
- w !== p && (w = s + w);
82
- const h = G(g), d = $(h, 0, r);
83
- let A = G(d);
84
- return A !== h && (A = A + s), w + a + A;
85
- }
86
- function Ot(t, n, e = !1) {
79
+ const m = String(l[1]), a = String(l[2]), p = String(l[3]), g = q(m), u = Array.from(g).length, w = A(g, Math.max(u - r, 0), r);
80
+ let y = q(w);
81
+ y !== g && (y = s + y);
82
+ const h = B(p), d = A(h, 0, r);
83
+ let $ = B(d);
84
+ return $ !== h && ($ = $ + s), y + a + $;
85
+ }
86
+ function Ut(t, n, e = !1) {
87
87
  let r = !1;
88
88
  for (const s of n)
89
- if (r = !0, !J(t, s, e))
89
+ if (r = !0, !K(t, s, e))
90
90
  return !1;
91
91
  return r;
92
92
  }
93
- function Ut(t, n, e = !1) {
94
- return !J(t, n, e);
93
+ function It(t, n, e = !1) {
94
+ return !K(t, n, e);
95
95
  }
96
- function Mt(t, n = " ") {
96
+ function Pt(t, n = " ") {
97
97
  return x(n) ? (n.forEach((e) => {
98
98
  t = t.replace(new RegExp(`${e}+`, "g"), e);
99
99
  }), t) : t.replace(new RegExp(`${n}+`, "g"), n);
100
100
  }
101
- function I(t, n) {
101
+ function P(t, n) {
102
102
  if (t === null)
103
103
  return !1;
104
104
  t = String(t), x(n) ? n = Array.from(n) : n = [String(n)];
@@ -107,40 +107,45 @@ function I(t, n) {
107
107
  return !0;
108
108
  return !1;
109
109
  }
110
- function It(t, n) {
111
- return !I(t, n);
110
+ function jt(t, n) {
111
+ return !P(t, n);
112
112
  }
113
- function Pt(t, n) {
114
- const e = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
115
- return t.replace(new RegExp(`(?:${e})+$`, "u"), "") + n;
113
+ function Tt(t, n) {
114
+ const e = z(t), r = z(n);
115
+ if (r === "")
116
+ return e;
117
+ let s = e.length;
118
+ for (; e.endsWith(r, s); )
119
+ s -= r.length;
120
+ return `${e.slice(0, s)}${r}`;
116
121
  }
117
- function qt(t, n, e = null) {
122
+ function Gt(t, n, e = null) {
118
123
  return n + t + (e ?? n);
119
124
  }
120
- function Tt(t, n, e = null) {
121
- return P(t, n) && (t = $(t, z(n))), I(t, e ??= n) && (t = $(t, 0, -z(e))), t;
125
+ function qt(t, n, e = null) {
126
+ return j(t, n) && (t = A(t, W(n))), P(t, e ??= n) && (t = A(t, 0, -W(e))), t;
122
127
  }
123
- function jt(t, n, e = !1) {
128
+ function Bt(t, n, e = !1) {
124
129
  n = String(n);
125
130
  let r;
126
131
  typeof t == "string" ? r = [t] : r = Array.from(t);
127
132
  for (let s of r) {
128
- if (s = String(s), s === n || e && M(s) === M(n))
133
+ if (s = String(s), s === n || e && U(s) === U(n))
129
134
  return !0;
130
135
  s = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = s.replace(/\\\*/g, ".*");
131
- const o = e ? "iu" : "u";
132
- if (new RegExp(`^${s}$`, o).test(n))
136
+ const i = e ? "iu" : "u";
137
+ if (new RegExp(`^${s}$`, i).test(n))
133
138
  return !0;
134
139
  }
135
140
  return !1;
136
141
  }
137
- function it(t) {
142
+ function lt(t) {
138
143
  for (let n = 0; n < t.length; n++)
139
144
  if (t.charCodeAt(n) > 127)
140
145
  return !1;
141
146
  return !0;
142
147
  }
143
- function Gt(t) {
148
+ function Dt(t) {
144
149
  if (!S(t))
145
150
  return !1;
146
151
  try {
@@ -150,13 +155,13 @@ function Gt(t) {
150
155
  }
151
156
  return !0;
152
157
  }
153
- function Bt(t, n = []) {
158
+ function Ht(t, n = []) {
154
159
  if (!S(t))
155
160
  return !1;
156
- const r = (n.length === 0 ? "aaa|aaas|about|acap|acct|acd|acr|adiumxtra|adt|afp|afs|aim|amss|android|appdata|apt|ark|attachment|aw|barion|beshare|bitcoin|bitcoincash|blob|bolo|browserext|calculator|callto|cap|cast|casts|chrome|chrome-extension|cid|coap|coap+tcp|coap+ws|coaps|coaps+tcp|coaps+ws|com-eventbrite-attendee|content|conti|crid|cvs|dab|data|dav|diaspora|dict|did|dis|dlna-playcontainer|dlna-playsingle|dns|dntp|dpp|drm|drop|dtn|dvb|ed2k|elsi|example|facetime|fax|feed|feedready|file|filesystem|finger|first-run-pen-experience|fish|fm|ftp|fuchsia-pkg|geo|gg|git|gizmoproject|go|gopher|graph|gtalk|h323|ham|hcap|hcp|http|https|hxxp|hxxps|hydrazone|iax|icap|icon|im|imap|info|iotdisco|ipn|ipp|ipps|irc|irc6|ircs|iris|iris.beep|iris.lwz|iris.xpc|iris.xpcs|isostore|itms|jabber|jar|jms|keyparc|lastfm|ldap|ldaps|leaptofrogans|lorawan|lvlt|magnet|mailserver|mailto|maps|market|message|mid|mms|modem|mongodb|moz|ms-access|ms-browser-extension|ms-calculator|ms-drive-to|ms-enrollment|ms-excel|ms-eyecontrolspeech|ms-gamebarservices|ms-gamingoverlay|ms-getoffice|ms-help|ms-infopath|ms-inputapp|ms-lockscreencomponent-config|ms-media-stream-id|ms-mixedrealitycapture|ms-mobileplans|ms-officeapp|ms-people|ms-project|ms-powerpoint|ms-publisher|ms-restoretabcompanion|ms-screenclip|ms-screensketch|ms-search|ms-search-repair|ms-secondary-screen-controller|ms-secondary-screen-setup|ms-settings|ms-settings-airplanemode|ms-settings-bluetooth|ms-settings-camera|ms-settings-cellular|ms-settings-cloudstorage|ms-settings-connectabledevices|ms-settings-displays-topology|ms-settings-emailandaccounts|ms-settings-language|ms-settings-location|ms-settings-lock|ms-settings-nfctransactions|ms-settings-notifications|ms-settings-power|ms-settings-privacy|ms-settings-proximity|ms-settings-screenrotation|ms-settings-wifi|ms-settings-workplace|ms-spd|ms-sttoverlay|ms-transit-to|ms-useractivityset|ms-virtualtouchpad|ms-visio|ms-walk-to|ms-whiteboard|ms-whiteboard-cmd|ms-word|msnim|msrp|msrps|mss|mtqp|mumble|mupdate|mvn|news|nfs|ni|nih|nntp|notes|ocf|oid|onenote|onenote-cmd|opaquelocktoken|openpgp4fpr|pack|palm|paparazzi|payto|pkcs11|platform|pop|pres|prospero|proxy|pwid|psyc|pttp|qb|query|redis|rediss|reload|res|resource|rmi|rsync|rtmfp|rtmp|rtsp|rtsps|rtspu|s3|secondlife|service|session|sftp|sgn|shttp|sieve|simpleledger|sip|sips|skype|smb|sms|smtp|snews|snmp|soap.beep|soap.beeps|soldat|spiffe|spotify|ssh|steam|stun|stuns|submit|svn|tag|teamspeak|tel|teliaeid|telnet|tftp|tg|things|thismessage|tip|tn3270|tool|ts3server|turn|turns|tv|udp|unreal|urn|ut2004|v-event|vemmi|ventrilo|videotex|vnc|view-source|wais|webcal|wpid|ws|wss|wtai|wyciwyg|xcon|xcon-userid|xfire|xmlrpc.beep|xmlrpc.beeps|xmpp|xri|ymsgr|z39.50|z39.50r|z39.50s" : n.join("|")).split("|").map((o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
161
+ const r = (n.length === 0 ? "aaa|aaas|about|acap|acct|acd|acr|adiumxtra|adt|afp|afs|aim|amss|android|appdata|apt|ark|attachment|aw|barion|beshare|bitcoin|bitcoincash|blob|bolo|browserext|calculator|callto|cap|cast|casts|chrome|chrome-extension|cid|coap|coap+tcp|coap+ws|coaps|coaps+tcp|coaps+ws|com-eventbrite-attendee|content|conti|crid|cvs|dab|data|dav|diaspora|dict|did|dis|dlna-playcontainer|dlna-playsingle|dns|dntp|dpp|drm|drop|dtn|dvb|ed2k|elsi|example|facetime|fax|feed|feedready|file|filesystem|finger|first-run-pen-experience|fish|fm|ftp|fuchsia-pkg|geo|gg|git|gizmoproject|go|gopher|graph|gtalk|h323|ham|hcap|hcp|http|https|hxxp|hxxps|hydrazone|iax|icap|icon|im|imap|info|iotdisco|ipn|ipp|ipps|irc|irc6|ircs|iris|iris.beep|iris.lwz|iris.xpc|iris.xpcs|isostore|itms|jabber|jar|jms|keyparc|lastfm|ldap|ldaps|leaptofrogans|lorawan|lvlt|magnet|mailserver|mailto|maps|market|message|mid|mms|modem|mongodb|moz|ms-access|ms-browser-extension|ms-calculator|ms-drive-to|ms-enrollment|ms-excel|ms-eyecontrolspeech|ms-gamebarservices|ms-gamingoverlay|ms-getoffice|ms-help|ms-infopath|ms-inputapp|ms-lockscreencomponent-config|ms-media-stream-id|ms-mixedrealitycapture|ms-mobileplans|ms-officeapp|ms-people|ms-project|ms-powerpoint|ms-publisher|ms-restoretabcompanion|ms-screenclip|ms-screensketch|ms-search|ms-search-repair|ms-secondary-screen-controller|ms-secondary-screen-setup|ms-settings|ms-settings-airplanemode|ms-settings-bluetooth|ms-settings-camera|ms-settings-cellular|ms-settings-cloudstorage|ms-settings-connectabledevices|ms-settings-displays-topology|ms-settings-emailandaccounts|ms-settings-language|ms-settings-location|ms-settings-lock|ms-settings-nfctransactions|ms-settings-notifications|ms-settings-power|ms-settings-privacy|ms-settings-proximity|ms-settings-screenrotation|ms-settings-wifi|ms-settings-workplace|ms-spd|ms-sttoverlay|ms-transit-to|ms-useractivityset|ms-virtualtouchpad|ms-visio|ms-walk-to|ms-whiteboard|ms-whiteboard-cmd|ms-word|msnim|msrp|msrps|mss|mtqp|mumble|mupdate|mvn|news|nfs|ni|nih|nntp|notes|ocf|oid|onenote|onenote-cmd|opaquelocktoken|openpgp4fpr|pack|palm|paparazzi|payto|pkcs11|platform|pop|pres|prospero|proxy|pwid|psyc|pttp|qb|query|redis|rediss|reload|res|resource|rmi|rsync|rtmfp|rtmp|rtsp|rtsps|rtspu|s3|secondlife|service|session|sftp|sgn|shttp|sieve|simpleledger|sip|sips|skype|smb|sms|smtp|snews|snmp|soap.beep|soap.beeps|soldat|spiffe|spotify|ssh|steam|stun|stuns|submit|svn|tag|teamspeak|tel|teliaeid|telnet|tftp|tg|things|thismessage|tip|tn3270|tool|ts3server|turn|turns|tv|udp|unreal|urn|ut2004|v-event|vemmi|ventrilo|videotex|vnc|view-source|wais|webcal|wpid|ws|wss|wtai|wyciwyg|xcon|xcon-userid|xfire|xmlrpc.beep|xmlrpc.beeps|xmpp|xri|ymsgr|z39.50|z39.50r|z39.50s" : n.join("|")).split("|").map((i) => i.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
157
162
  try {
158
- const o = new URL(t), i = o.protocol.replace(":", ""), c = o.hostname, l = t.slice(t.indexOf("://") + 3).startsWith("/"), m = c.length > 0 && !/^\.+$/.test(c) && !l, a = i === "file" && l;
159
- if (r.split("|").includes(i) && (m || a))
163
+ const i = new URL(t), o = i.protocol.replace(":", ""), c = i.hostname, l = t.slice(t.indexOf("://") + 3).startsWith("/"), m = c.length > 0 && !/^\.+$/.test(c) && !l, a = o === "file" && l;
164
+ if (r.split("|").includes(o) && (m || a))
160
165
  return !0;
161
166
  } catch {
162
167
  }
@@ -180,173 +185,173 @@ function Bt(t, n = []) {
180
185
  ].join("");
181
186
  return new RegExp(s, "iu").test(t);
182
187
  }
183
- function Dt(t) {
184
- return mt(t, "-");
188
+ function Jt(t) {
189
+ return ht(t, "-");
185
190
  }
186
- function z(t) {
191
+ function W(t) {
187
192
  return t.length;
188
193
  }
189
- function Ht(t, n = 100, e = "...", r = !1) {
194
+ function Zt(t, n = 100, e = "...", r = !1) {
190
195
  if (t.length <= n)
191
196
  return t;
192
197
  if (!r)
193
- return t.slice(0, n).replace(/\s+$/, "") + e;
194
- t = pt(t).replace(/[\n\r]+/g, " ").trim();
195
- const s = t.slice(0, n).replace(/\s+$/, "");
196
- return t.substring(n, n + 1) === " " ? s + e : s.replace(/(.*)\s.*/, "$1") + e;
198
+ return t.slice(0, n).trimEnd() + e;
199
+ t = gt(t).replace(/[\n\r]+/g, " ").trim();
200
+ const s = t.slice(0, n).trimEnd();
201
+ return t.substring(n, n + 1) === " " || !/\s/.test(s) ? s + e : s.replace(/(.*)\s.*/, "$1") + e;
197
202
  }
198
- function Z(t) {
199
- return M(t);
203
+ function V(t) {
204
+ return U(t);
200
205
  }
201
- function Jt(t, n = 100, e = "...") {
206
+ function Kt(t, n = 100, e = "...") {
202
207
  if (n <= 0)
203
208
  return t;
204
- const r = n, s = new RegExp(`^\\s*(?:\\S+\\s*){1,${r}}`, "u"), o = t.match(s);
205
- return !o || z(t) === z(o[0]) ? t : o[0].trimEnd() + e;
209
+ const r = n, s = new RegExp(`^\\s*(?:\\S+\\s*){1,${r}}`, "u"), i = t.match(s);
210
+ return !i || W(t) === W(i[0]) ? t : i[0].trimEnd() + e;
206
211
  }
207
- function Zt(t, n, e, r = null) {
212
+ function Vt(t, n, e, r = null) {
208
213
  if (n === "")
209
214
  return t;
210
215
  const s = t.length;
211
- let o = e;
212
- e < 0 && (o = e < -s ? 0 : s + e);
213
- const i = t.slice(
214
- o,
215
- r !== null ? o + r : void 0
216
+ let i = e;
217
+ e < 0 && (i = e < -s ? 0 : s + e);
218
+ const o = t.slice(
219
+ i,
220
+ r !== null ? i + r : void 0
216
221
  );
217
- if (i === "")
222
+ if (o === "")
218
223
  return t;
219
- const c = t.slice(0, o), f = i.length, l = t.slice(o + f);
224
+ const c = t.slice(0, i), f = o.length, l = t.slice(i + f);
220
225
  return c + n.slice(0, 1).repeat(f) + l;
221
226
  }
222
- function Kt(t, n) {
227
+ function Qt(t, n) {
223
228
  let e = "u", r = t;
224
229
  if (t.length >= 2 && t[0] === "/") {
225
230
  let s = -1;
226
- for (let o = t.length - 1; o > 0; o--)
227
- if (t[o] === "/") {
228
- let i = 0;
229
- for (let c = o - 1; c >= 0 && t[c] === "\\"; c--)
230
- i++;
231
- if (i % 2 === 0) {
232
- s = o;
231
+ for (let i = t.length - 1; i > 0; i--)
232
+ if (t[i] === "/") {
233
+ let o = 0;
234
+ for (let c = i - 1; c >= 0 && t[c] === "\\"; c--)
235
+ o++;
236
+ if (o % 2 === 0) {
237
+ s = i;
233
238
  break;
234
239
  }
235
240
  }
236
241
  if (s > 0) {
237
242
  r = t.slice(1, s);
238
- const o = t.slice(s + 1);
239
- if (o)
240
- for (const i of o)
241
- /[imsuy]/.test(i) && !e.includes(i) && (e += i);
243
+ const i = t.slice(s + 1);
244
+ if (i)
245
+ for (const o of i)
246
+ /[imsuy]/.test(o) && !e.includes(o) && (e += o);
242
247
  }
243
248
  }
244
249
  try {
245
- const o = new RegExp(r, e).exec(n);
246
- return o ? o[1] !== void 0 ? o[1] : o[0] : "";
250
+ const i = new RegExp(r, e).exec(n);
251
+ return i ? i[1] !== void 0 ? i[1] : i[0] : "";
247
252
  } catch {
248
253
  return "";
249
254
  }
250
255
  }
251
- function Vt(t, n) {
256
+ function Xt(t, n) {
252
257
  n = String(n);
253
258
  const e = typeof t == "string" ? [t] : Array.from(t);
254
259
  for (const r of e) {
255
260
  if (typeof r != "string" || r === "") continue;
256
- let s = "u", o = r;
261
+ let s = "u", i = r;
257
262
  if (r.length >= 2 && r[0] === "/") {
258
- let i = -1;
263
+ let o = -1;
259
264
  for (let c = r.length - 1; c > 0; c--)
260
265
  if (r[c] === "/") {
261
266
  let f = 0;
262
267
  for (let l = c - 1; l >= 0 && r[l] === "\\"; l--)
263
268
  f++;
264
269
  if (f % 2 === 0) {
265
- i = c;
270
+ o = c;
266
271
  break;
267
272
  }
268
273
  }
269
- if (i > 0) {
270
- o = r.slice(1, i);
271
- const c = r.slice(i + 1);
274
+ if (o > 0) {
275
+ i = r.slice(1, o);
276
+ const c = r.slice(o + 1);
272
277
  if (c)
273
278
  for (const f of c)
274
279
  /[imsuy]/.test(f) && !s.includes(f) && (s += f);
275
280
  }
276
281
  }
277
282
  try {
278
- if (new RegExp(o, s).test(n))
283
+ if (new RegExp(i, s).test(n))
279
284
  return !0;
280
285
  } catch {
281
286
  }
282
287
  }
283
288
  return !1;
284
289
  }
285
- function Qt(t, n) {
290
+ function Yt(t, n) {
286
291
  let e = "u", r = t;
287
292
  if (t.length >= 2 && t[0] === "/") {
288
- let o = -1;
289
- for (let i = t.length - 1; i > 0; i--)
290
- if (t[i] === "/") {
293
+ let i = -1;
294
+ for (let o = t.length - 1; o > 0; o--)
295
+ if (t[o] === "/") {
291
296
  let c = 0;
292
- for (let f = i - 1; f >= 0 && t[f] === "\\"; f--)
297
+ for (let f = o - 1; f >= 0 && t[f] === "\\"; f--)
293
298
  c++;
294
299
  if (c % 2 === 0) {
295
- o = i;
300
+ i = o;
296
301
  break;
297
302
  }
298
303
  }
299
- if (o > 0) {
300
- r = t.slice(1, o);
301
- const i = t.slice(o + 1);
302
- if (i)
303
- for (const c of i)
304
+ if (i > 0) {
305
+ r = t.slice(1, i);
306
+ const o = t.slice(i + 1);
307
+ if (o)
308
+ for (const c of o)
304
309
  /[gimsuy]/.test(c) && !e.includes(c) && (e += c);
305
310
  }
306
311
  }
307
312
  e.includes("g") || (e += "g");
308
313
  let s = [];
309
314
  try {
310
- const o = new RegExp(r, e);
311
- let i;
312
- for (; (i = o.exec(n)) !== null; )
313
- s.push(i[1] !== void 0 ? i[1] : i[0]), i[0] === "" && o.lastIndex++;
315
+ const i = new RegExp(r, e);
316
+ let o;
317
+ for (; (o = i.exec(n)) !== null; )
318
+ s.push(o[1] !== void 0 ? o[1] : o[0]), o[0] === "" && i.lastIndex++;
314
319
  } catch {
315
320
  s = [];
316
321
  }
317
322
  return s;
318
323
  }
319
- function Xt(t) {
324
+ function vt(t) {
320
325
  return x(t) ? t.map((n) => n.replace(/\D/g, "")) : t.replace(/\D/g, "");
321
326
  }
322
- function Yt(t, n, e = " ") {
327
+ function tn(t, n, e = " ") {
323
328
  const r = t.length;
324
329
  if (n <= r || e === "")
325
330
  return t;
326
- const s = n - r, o = Math.floor(s / 2), i = s - o;
327
- return W(e, o) + t + W(e, i);
331
+ const s = n - r, i = Math.floor(s / 2), o = s - i;
332
+ return O(e, i) + t + O(e, o);
328
333
  }
329
- function vt(t, n, e = " ") {
334
+ function nn(t, n, e = " ") {
330
335
  const r = t.length;
331
336
  if (n <= r || e === "")
332
337
  return t;
333
- const o = n - r;
334
- return W(e, o) + t;
338
+ const i = n - r;
339
+ return O(e, i) + t;
335
340
  }
336
- function tn(t, n, e = " ") {
341
+ function en(t, n, e = " ") {
337
342
  const r = t.length;
338
343
  if (n <= r || e === "")
339
344
  return t;
340
- const o = n - r;
341
- return t + W(e, o);
345
+ const i = n - r;
346
+ return t + O(e, i);
342
347
  }
343
- function W(t, n) {
348
+ function O(t, n) {
344
349
  if (n <= 0 || t.length === 0)
345
350
  return "";
346
351
  const e = Math.ceil(n / t.length);
347
352
  return t.repeat(e).slice(0, n);
348
353
  }
349
- function nn(t = 32, n = !0, e = !0, r = !0, s = !1) {
354
+ function rn(t = 32, n = !0, e = !0, r = !0, s = !1) {
350
355
  const l = [
351
356
  n ? [
352
357
  "a",
@@ -432,34 +437,32 @@ function nn(t = 32, n = !0, e = !0, r = !0, s = !1) {
432
437
  ";"
433
438
  ] : null,
434
439
  s ? [" "] : null
435
- ].filter((p) => x(p));
436
- if (l.length === 0 || t <= 0)
437
- return "";
438
- const m = [];
439
- for (const p of l) {
440
- const u = U(0, p.length - 1);
441
- m.push(p[u]);
442
- }
443
- const a = Math.max(0, t - m.length), g = l.flat();
444
- for (let p = 0; p < a; p++) {
445
- const u = U(0, g.length - 1);
446
- m.push(g[u]);
447
- }
448
- for (let p = m.length - 1; p > 0; p--) {
449
- const u = U(0, p), y = m[p];
450
- m[p] = m[u], m[u] = y;
440
+ ].filter((g) => x(g));
441
+ if (l.length === 0)
442
+ throw new Error("At least one character pool must be enabled.");
443
+ const m = l.flat(), a = D(l).slice(0, Math.max(0, t)).map((g) => g[I(0, g.length - 1)]), p = Array.from(
444
+ { length: Math.max(0, t - a.length) },
445
+ () => m[I(0, m.length - 1)]
446
+ );
447
+ return D([...a, ...p]).join("");
448
+ }
449
+ function D(t) {
450
+ const n = [...t];
451
+ for (let e = n.length - 1; e > 0; e--) {
452
+ const r = I(0, e);
453
+ [n[e], n[r]] = [n[r], n[e]];
451
454
  }
452
- return m.join("");
455
+ return n;
453
456
  }
454
- function en(t, n, e = 0) {
457
+ function sn(t, n, e = 0) {
455
458
  if (n === "")
456
459
  return !1;
457
460
  const r = Array.from(t), s = Array.from(n);
458
- let o = e >= 0 ? e : r.length + e;
459
- if (o < 0 && (o = 0), o >= r.length)
461
+ let i = e >= 0 ? e : r.length + e;
462
+ if (i < 0 && (i = 0), i >= r.length)
460
463
  return !1;
461
- const i = r.length - s.length;
462
- for (let c = o; c <= i; c++) {
464
+ const o = r.length - s.length;
465
+ for (let c = i; c <= o; c++) {
463
466
  let f = !0;
464
467
  for (let l = 0; l < s.length; l++)
465
468
  if (r[c + l] !== s[l]) {
@@ -471,42 +474,42 @@ function en(t, n, e = 0) {
471
474
  }
472
475
  return !1;
473
476
  }
474
- function ct(t = 16) {
475
- return (R ?? ((e) => tt(e)))(t);
477
+ function ft(t = 16) {
478
+ return (R ?? ((e) => et(e)))(t);
476
479
  }
477
- function lt(t) {
480
+ function at(t) {
478
481
  R = t;
479
482
  }
480
- function rn(t, n) {
483
+ function on(t, n) {
481
484
  let e = 0;
482
485
  const r = n ?? function(s) {
483
- const o = R;
486
+ const i = R;
484
487
  R = null;
485
- const i = ct(s);
486
- return R = o, e++, i;
488
+ const o = ft(s);
489
+ return R = i, e++, o;
487
490
  };
488
- lt((s) => e < t.length ? String(t[e++]) : r(s));
491
+ at((s) => e < t.length ? String(t[e++]) : r(s));
489
492
  }
490
- function ft() {
493
+ function ut() {
491
494
  R = null;
492
495
  }
493
- function sn(t, n) {
496
+ function cn(t, n) {
494
497
  return n <= 0 ? "" : t.repeat(n);
495
498
  }
496
- function on(t, n, e) {
499
+ function ln(t, n, e) {
497
500
  let r;
498
501
  typeof n == "object" && !x(n) ? r = Object.values(n) : r = x(n) ? [...n] : Array.from(n);
499
502
  const s = e.split(t);
500
503
  if (s.length === 1)
501
504
  return e;
502
- let o = s[0];
503
- for (let i = 1; i < s.length; i++) {
505
+ let i = s[0];
506
+ for (let o = 1; o < s.length; o++) {
504
507
  const c = r.length ? r.shift() : t;
505
- o += c + s[i];
508
+ i += c + s[o];
506
509
  }
507
- return String(o);
510
+ return String(i);
508
511
  }
509
- function cn(t, n) {
512
+ function fn(t, n) {
510
513
  try {
511
514
  const e = String(t);
512
515
  if (e.length)
@@ -516,145 +519,145 @@ function cn(t, n) {
516
519
  return n;
517
520
  }
518
521
  }
519
- function ln(t, n, e, r = !0) {
522
+ function an(t, n, e, r = !0) {
520
523
  if (S(t) && !S(n))
521
524
  throw new TypeError(
522
525
  "The replacement must be a string when the search term is a string."
523
526
  );
524
- const s = S(e) ? e : Array.from(e, (f) => L(f));
527
+ const s = S(e) ? e : Array.from(e, (f) => C(f));
525
528
  if (!r)
526
- return K(
529
+ return Q(
527
530
  t,
528
531
  n,
529
532
  s
530
533
  );
531
- const o = S(t) ? [t] : Array.from(t, (f) => L(f)), i = S(n) ? o.map(() => n) : Array.from(n, (f) => L(f)), c = (f) => o.reduce((l, m, a) => m === "" ? l : l.split(m).join(i[a] ?? ""), f);
534
+ const i = S(t) ? [t] : Array.from(t, (f) => C(f)), o = S(n) ? i.map(() => n) : Array.from(n, (f) => C(f)), c = (f) => i.reduce((l, m, a) => m === "" ? l : l.split(m).join(o[a] ?? ""), f);
532
535
  return S(s) ? c(s) : s.map(c);
533
536
  }
534
- function K(t, n, e) {
535
- const r = S(t) ? [t] : Array.from(t, (c) => L(c)), s = S(n) ? r.map(() => n) : Array.from(n, (c) => L(c)), o = (c) => c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), i = (c) => r.reduce((f, l, m) => {
537
+ function Q(t, n, e) {
538
+ const r = S(t) ? [t] : Array.from(t, (c) => C(c)), s = S(n) ? r.map(() => n) : Array.from(n, (c) => C(c)), i = (c) => c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = (c) => r.reduce((f, l, m) => {
536
539
  if (l === "")
537
540
  return f;
538
- const a = s[m] ?? "", g = new RegExp(
539
- o(l),
540
- it(l) ? "gi" : "giu"
541
+ const a = s[m] ?? "", p = new RegExp(
542
+ i(l),
543
+ lt(l) ? "gi" : "giu"
541
544
  );
542
- return f.replace(g, () => a);
545
+ return f.replace(p, () => a);
543
546
  }, c);
544
- return S(e) ? i(e) : e.map(i);
547
+ return S(e) ? o(e) : e.map(o);
545
548
  }
546
- function L(t) {
547
- return Y(t) || v(t) ? "" : String(t);
549
+ function C(t) {
550
+ return tt(t) || nt(t) ? "" : String(t);
548
551
  }
549
- function at(t, n, e) {
552
+ function pt(t, n, e) {
550
553
  if (t = String(t), t === "")
551
554
  return e;
552
555
  const r = e.indexOf(t);
553
556
  return r !== -1 ? e.slice(0, r) + n + e.slice(r + t.length) : e;
554
557
  }
555
- function fn(t, n, e) {
556
- return t = String(t), t === "" ? e : P(e, t) ? at(t, n, e) : e;
558
+ function un(t, n, e) {
559
+ return t = String(t), t === "" ? e : j(e, t) ? pt(t, n, e) : e;
557
560
  }
558
- function ut(t, n, e) {
561
+ function mt(t, n, e) {
559
562
  if (t = String(t), t === "")
560
563
  return e;
561
564
  const r = e.lastIndexOf(t);
562
565
  return r !== -1 ? e.slice(0, r) + n + e.slice(r + t.length) : e;
563
566
  }
564
- function an(t, n, e) {
565
- return t = String(t), t === "" ? e : I(e, t) ? ut(t, n, e) : e;
567
+ function pn(t, n, e) {
568
+ return t = String(t), t === "" ? e : P(e, t) ? mt(t, n, e) : e;
566
569
  }
567
- function un(t, n, e, r = -1) {
568
- const s = (a) => x(a) ? a : [a], o = s(t);
569
- function i(a) {
570
+ function mn(t, n, e, r = -1) {
571
+ const s = (a) => x(a) ? a : [a], i = s(t);
572
+ function o(a) {
570
573
  try {
571
574
  if (a instanceof RegExp) {
572
575
  let u = a.flags;
573
576
  return u.includes("g") || (u += "g"), u.includes("u") || (u += "u"), new RegExp(a.source, u);
574
577
  }
575
- let g = a, p = "gu";
578
+ let p = a, g = "gu";
576
579
  if (a.length >= 2 && a[0] === "/") {
577
580
  let u = -1;
578
- for (let y = a.length - 1; y > 0; y--)
579
- if (a[y] === "/") {
580
- let w = 0;
581
- for (let h = y - 1; h >= 0 && a[h] === "\\"; h--)
582
- w++;
583
- if (w % 2 === 0) {
584
- u = y;
581
+ for (let w = a.length - 1; w > 0; w--)
582
+ if (a[w] === "/") {
583
+ let y = 0;
584
+ for (let h = w - 1; h >= 0 && a[h] === "\\"; h--)
585
+ y++;
586
+ if (y % 2 === 0) {
587
+ u = w;
585
588
  break;
586
589
  }
587
590
  }
588
591
  if (u > 1) {
589
- g = a.slice(1, u);
590
- const y = a.slice(u + 1);
591
- if (y)
592
- for (const w of y)
593
- /[imsuy]/.test(w) && !p.includes(w) && (p += w);
592
+ p = a.slice(1, u);
593
+ const w = a.slice(u + 1);
594
+ if (w)
595
+ for (const y of w)
596
+ /[imsuy]/.test(y) && !g.includes(y) && (g += y);
594
597
  }
595
598
  }
596
599
  return new RegExp(
597
- g,
598
- Array.from(new Set(p.split(""))).join("")
600
+ p,
601
+ Array.from(new Set(g.split(""))).join("")
599
602
  );
600
603
  } catch {
601
604
  return null;
602
605
  }
603
606
  }
604
607
  const c = [];
605
- for (const a of o) {
606
- const g = i(a);
607
- if (!g) return null;
608
- c.push(g);
608
+ for (const a of i) {
609
+ const p = o(a);
610
+ if (!p) return null;
611
+ c.push(p);
609
612
  }
610
- const f = Q(n), l = f ? [] : s(n), m = (a) => {
611
- let g = a;
612
- for (let p = 0; p < c.length; p++) {
613
- const u = c[p];
613
+ const f = Y(n), l = f ? [] : s(n), m = (a) => {
614
+ let p = a;
615
+ for (let g = 0; g < c.length; g++) {
616
+ const u = c[g];
614
617
  if (f) {
615
- let y = 0;
616
- const w = n;
617
- g = g.replace(
618
+ let w = 0;
619
+ const y = n;
620
+ p = p.replace(
618
621
  u,
619
622
  (h, ...d) => {
620
- if (r >= 0 && y >= r) return h;
621
- y++;
623
+ if (r >= 0 && w >= r) return h;
624
+ w++;
622
625
  const E = d.length > 0 && d[d.length - 1] !== null && typeof d[d.length - 1] == "object" ? d.length - 3 : d.length - 2, k = [];
623
626
  for (let b = 0; b < E; b++)
624
627
  k.push(d[b]);
625
- const C = [h, ...k];
626
- return w(C);
628
+ const L = [h, ...k];
629
+ return y(L);
627
630
  }
628
631
  );
629
632
  } else {
630
- const y = l[p] ?? (l.length === 1 ? l[0] : "");
633
+ const w = l[g] ?? (l.length === 1 ? l[0] : "");
631
634
  if (r < 0)
632
- g = g.replace(u, (w, ...h) => {
633
- const A = h.length > 0 && h[h.length - 1] !== null && typeof h[h.length - 1] == "object" ? h.length - 3 : h.length - 2, E = h.slice(0, A).map((k) => String(k));
634
- return y.replace(/\$(\d{1,2})/g, (k, C) => {
635
- const b = parseInt(C, 10);
635
+ p = p.replace(u, (y, ...h) => {
636
+ const $ = h.length > 0 && h[h.length - 1] !== null && typeof h[h.length - 1] == "object" ? h.length - 3 : h.length - 2, E = h.slice(0, $).map((k) => String(k));
637
+ return w.replace(/\$(\d{1,2})/g, (k, L) => {
638
+ const b = parseInt(L, 10);
636
639
  return (E[b - 1] ?? "").toUpperCase();
637
640
  });
638
641
  });
639
642
  else {
640
- let w = 0;
641
- g = g.replace(u, (h, ...d) => {
642
- if (w >= r) return h;
643
- w++;
644
- const E = d.length > 0 && d[d.length - 1] !== null && typeof d[d.length - 1] == "object" ? d.length - 3 : d.length - 2, k = d.slice(0, E).map((C) => String(C));
645
- return y.replace(/\$(\d{1,2})/g, (C, b) => {
646
- const q = parseInt(b, 10);
647
- return (k[q - 1] ?? "").toUpperCase();
643
+ let y = 0;
644
+ p = p.replace(u, (h, ...d) => {
645
+ if (y >= r) return h;
646
+ y++;
647
+ const E = d.length > 0 && d[d.length - 1] !== null && typeof d[d.length - 1] == "object" ? d.length - 3 : d.length - 2, k = d.slice(0, E).map((L) => String(L));
648
+ return w.replace(/\$(\d{1,2})/g, (L, b) => {
649
+ const T = parseInt(b, 10);
650
+ return (k[T - 1] ?? "").toUpperCase();
648
651
  });
649
652
  });
650
653
  }
651
654
  }
652
655
  }
653
- return g;
656
+ return p;
654
657
  };
655
658
  return x(e) ? e.map(m) : m(e);
656
659
  }
657
- function pt(t) {
660
+ function gt(t) {
658
661
  let n = "", e = !1;
659
662
  for (let r = 0; r < t.length; r++) {
660
663
  const s = t[r];
@@ -662,37 +665,42 @@ function pt(t) {
662
665
  }
663
666
  return n;
664
667
  }
665
- function pn(t, n, e = !0) {
666
- const r = S(n) ? n : Array.from(n, (i) => L(i));
668
+ function gn(t, n, e = !0) {
669
+ const r = S(n) ? n : Array.from(n, (o) => C(o));
667
670
  if (!e)
668
- return K(t, "", r);
669
- const s = S(t) ? [t] : Array.from(t, (i) => L(i)), o = (i) => {
670
- let c = i;
671
+ return Q(t, "", r);
672
+ const s = S(t) ? [t] : Array.from(t, (o) => C(o)), i = (o) => {
673
+ let c = o;
671
674
  for (const f of s)
672
675
  f !== "" && (c = c.split(f).join(""));
673
676
  return c;
674
677
  };
675
- return S(r) ? o(r) : r.map(o);
678
+ return S(r) ? i(r) : r.map(i);
676
679
  }
677
- function mn(t) {
680
+ function hn(t) {
678
681
  return Array.from(t).reverse().join("");
679
682
  }
680
- function gn(t, n) {
681
- const e = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
682
- return n + t.replace(new RegExp(`^(?:${e})+`, "u"), "");
683
+ function dn(t, n) {
684
+ const e = z(t), r = z(n);
685
+ if (r === "")
686
+ return e;
687
+ let s = 0;
688
+ for (; e.startsWith(r, s); )
689
+ s += r.length;
690
+ return `${r}${e.slice(s)}`;
683
691
  }
684
- function hn(t) {
692
+ function yn(t) {
685
693
  const n = String(t).trim();
686
694
  if (n === "")
687
695
  return "";
688
696
  let e = n.split(/\s+/u);
689
- return e.length > 1 ? e = e.map((s) => T(s)) : e = ht(e.join("_")).map((s) => T(s)), e.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((s) => s.length > 0).join(" ");
697
+ return e.length > 1 ? e = e.map((s) => G(s)) : e = yt(e.join("_")).map((s) => G(s)), e.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((s) => s.length > 0).join(" ");
690
698
  }
691
- function dn(t, n = !1) {
699
+ function wn(t, n = !1) {
692
700
  const r = t.split(/\s+/u).filter((s) => s.length > 0).map((s) => [...s][0]).join("");
693
- return n ? D(r) : r;
701
+ return n ? J(r) : r;
694
702
  }
695
- function yn(t) {
703
+ function Sn(t) {
696
704
  if (t.trim() === "")
697
705
  return t;
698
706
  const n = /* @__PURE__ */ new Set([
@@ -731,52 +739,52 @@ function yn(t) {
731
739
  "des",
732
740
  "par",
733
741
  "à"
734
- ]), e = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u), s = (o) => {
735
- if (!o) return o;
736
- const i = Array.from(o), c = i[0].toLocaleUpperCase(), f = i.slice(1).join("");
742
+ ]), e = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u), s = (i) => {
743
+ if (!i) return i;
744
+ const o = Array.from(i), c = o[0].toLocaleUpperCase(), f = o.slice(1).join("");
737
745
  return c + f;
738
746
  };
739
- for (let o = 0; o < r.length; o++) {
740
- const i = r[o].toLocaleLowerCase();
741
- if (i.includes("-")) {
742
- const f = i.split("-").map((l) => n.has(l) && l.length <= 3 ? l : s(l));
743
- r[o] = f.join("-");
747
+ for (let i = 0; i < r.length; i++) {
748
+ const o = r[i].toLocaleLowerCase();
749
+ if (o.includes("-")) {
750
+ const f = o.split("-").map((l) => n.has(l) && l.length <= 3 ? l : s(l));
751
+ r[i] = f.join("-");
744
752
  } else {
745
- const c = o > 0 ? r[o - 1] : "", f = c ? Array.from(c).slice(-1)[0] : void 0, l = o === 0 || f !== void 0 && e.has(f);
746
- n.has(i) && i.length <= 3 && !l ? r[o] = i : r[o] = s(i);
753
+ const c = i > 0 ? r[i - 1] : "", f = c ? Array.from(c).slice(-1)[0] : void 0, l = i === 0 || f !== void 0 && e.has(f);
754
+ n.has(o) && o.length <= 3 && !l ? r[i] = o : r[i] = s(o);
747
755
  }
748
756
  }
749
757
  return r.join(" ");
750
758
  }
751
- function mt(t, n = "_") {
759
+ function ht(t, n = "_") {
752
760
  const r = `${t}|${n}`;
753
761
  if (F.has(r))
754
762
  return F.get(r);
755
763
  let s = t;
756
- return /^[a-z]+$/.test(t) || (s = dt(t).replace(/\s+/gu, ""), s = s.replace(/(.)(?=[A-Z])/g, `$1${n}`), s = Z(s)), F.set(r, s), s;
764
+ return /^[a-z]+$/.test(t) || (s = wt(t).replace(/\s+/gu, ""), s = s.replace(/(.)(?=[A-Z])/g, `$1${n}`), s = V(s)), F.set(r, s), s;
757
765
  }
758
- function wn(t) {
759
- return nt(t).replace(/[\s\u3164\u1160]+/gu, " ");
766
+ function xn(t) {
767
+ return rt(t).replace(/[\s\u3164\u1160]+/gu, " ");
760
768
  }
761
- function P(t, n) {
769
+ function j(t, n) {
762
770
  if (t == null || n == null)
763
771
  return !1;
764
772
  let e;
765
- S(n) || X(n) ? e = [n] : Symbol.iterator in Object(n) ? e = Array.from(n) : e = [n];
773
+ S(n) || v(n) ? e = [n] : Symbol.iterator in Object(n) ? e = Array.from(n) : e = [n];
766
774
  const r = String(t);
767
775
  for (const s of e) {
768
776
  if (s == null)
769
777
  continue;
770
- const o = String(s);
771
- if (o !== "" && r.startsWith(o))
778
+ const i = String(s);
779
+ if (i !== "" && r.startsWith(i))
772
780
  return !0;
773
781
  }
774
782
  return !1;
775
783
  }
776
- function Sn(t, n) {
777
- return !P(t, n);
784
+ function An(t, n) {
785
+ return !j(t, n);
778
786
  }
779
- function V(t, n = !1) {
787
+ function X(t, n = !1) {
780
788
  let e = t;
781
789
  n && (e = t.replace(
782
790
  /(^|[-_ \s])([A-Z]+)(?=[-_ \s]|$)/gu,
@@ -785,59 +793,59 @@ function V(t, n = !1) {
785
793
  const r = e;
786
794
  if (_.has(r))
787
795
  return _.get(r);
788
- const s = String(e).replace(/[-_]+/g, " "), o = s.trim() === "" ? [] : s.split(/\s+/u), i = (f) => {
796
+ const s = String(e).replace(/[-_]+/g, " "), i = s.trim() === "" ? [] : s.split(/\s+/u), o = (f) => {
789
797
  if (!f) return f;
790
798
  const l = Array.from(f), m = l[0].toUpperCase(), a = l.slice(1).join("");
791
799
  return m + a;
792
- }, c = o.map(i).join("");
800
+ }, c = i.map(o).join("");
793
801
  return _.set(r, c), c;
794
802
  }
795
- function xn(t, n = !1) {
796
- return V(t, n);
803
+ function kn(t, n = !1) {
804
+ return X(t, n);
797
805
  }
798
806
  function $n(t, n) {
799
807
  if (!t || Object.keys(t).length === 0)
800
808
  return n;
801
- const e = Object.keys(t).filter((o) => o !== "");
809
+ const e = Object.keys(t).filter((i) => i !== "");
802
810
  if (e.length === 0)
803
811
  return n;
804
- e.sort((o, i) => i.length - o.length);
805
- const r = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = new RegExp(e.map(r).join("|"), "gu");
806
- return n.replace(s, (o) => t[o]);
812
+ e.sort((i, o) => o.length - i.length);
813
+ const r = (i) => i.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = new RegExp(e.map(r).join("|"), "gu");
814
+ return n.replace(s, (i) => t[i]);
807
815
  }
808
- function kn(t, n) {
809
- return n < 0 ? $(t, n) : $(t, 0, n);
816
+ function bn(t, n) {
817
+ return n < 0 ? A(t, n) : A(t, 0, n);
810
818
  }
811
- function gt(t) {
812
- return Z($(t, 0, 1)) + $(t, 1);
819
+ function dt(t) {
820
+ return V(A(t, 0, 1)) + A(t, 1);
813
821
  }
814
- function An(t) {
815
- return D($(t, 0, 1)) + $(t, 1);
822
+ function Cn(t) {
823
+ return J(A(t, 0, 1)) + A(t, 1);
816
824
  }
817
- function ht(t) {
825
+ function yt(t) {
818
826
  return t.split(new RegExp("(?=\\p{Lu})", "u")).filter(Boolean);
819
827
  }
820
- function dt(t, n = ` \r
828
+ function wt(t, n = ` \r
821
829
  \f\v`) {
822
- const e = x(n) ? n.join("") : n, r = (c) => c.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), s = e.length ? r(e) : "", o = s.length ? `(?:\\s|[${s}])` : "\\s", i = new RegExp(`(^|${o})(\\p{Ll})`, "gu");
823
- return t.replace(i, (c, f, l) => f + l.toUpperCase());
830
+ const e = x(n) ? n.join("") : n, r = (c) => c.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), s = e.length ? r(e) : "", i = s.length ? `(?:\\s|[${s}])` : "\\s", o = new RegExp(`(^|${i})(\\p{Ll})`, "gu");
831
+ return t.replace(o, (c, f, l) => f + l.toUpperCase());
824
832
  }
825
- function bn(t, n = null) {
833
+ function En(t, n = null) {
826
834
  const e = n && n.length > 0 ? n.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&") : "", r = e.length > 0 ? new RegExp(`[\\p{L}\\p{N}${e}]+`, "gu") : /[\p{L}\p{N}]+/gu, s = t.match(r);
827
835
  return s ? s.length : 0;
828
836
  }
829
- function O(t) {
837
+ function M(t) {
830
838
  return t.trim() === "";
831
839
  }
832
- function B(t, n, e) {
840
+ function H(t, n, e) {
833
841
  let r = n;
834
- for (; r < e && O(t[r]); )
842
+ for (; r < e && M(t[r]); )
835
843
  r++;
836
844
  return r;
837
845
  }
838
- function yt(t, n, e) {
846
+ function St(t, n, e) {
839
847
  let r = e;
840
- for (; r > n && O(t[r - 1]); )
848
+ for (; r > n && M(t[r - 1]); )
841
849
  r--;
842
850
  return r;
843
851
  }
@@ -845,154 +853,154 @@ function Ln(t, n = 75, e = `
845
853
  `, r = !1) {
846
854
  if (t.length === 0 || n < 1 || e === "")
847
855
  return t;
848
- const s = t.split(/\r\n|\n|\r/), o = [];
849
- for (const i of s) {
850
- const c = [...i], f = c.length;
856
+ const s = t.split(/\r\n|\n|\r/), i = [];
857
+ for (const o of s) {
858
+ const c = [...o], f = c.length;
851
859
  if (f === 0) {
852
- o.push("");
860
+ i.push("");
853
861
  continue;
854
862
  }
855
863
  let l = 0;
856
864
  if (r) {
857
- for (; l < f && (l = B(c, l, f), l !== f); ) {
865
+ for (; l < f && (l = H(c, l, f), l !== f); ) {
858
866
  if (f - l <= n) {
859
- o.push(c.slice(l, f).join(""));
867
+ i.push(c.slice(l, f).join(""));
860
868
  break;
861
869
  }
862
- const m = yt(
870
+ const m = St(
863
871
  c,
864
872
  l,
865
873
  l + n
866
874
  );
867
- o.push(c.slice(l, m).join("")), l += n;
875
+ i.push(c.slice(l, m).join("")), l += n;
868
876
  }
869
877
  continue;
870
878
  }
871
879
  for (; f - l > n; ) {
872
- const m = B(c, l, f);
880
+ const m = H(c, l, f);
873
881
  if (m !== l && (l = m, f - l <= n))
874
882
  break;
875
883
  const a = Math.min(f, l + n + 1);
876
- let g = -1;
884
+ let p = -1;
877
885
  for (let u = a - 1; u >= l; u--)
878
- if (O(c[u])) {
879
- g = u;
886
+ if (M(c[u])) {
887
+ p = u;
880
888
  break;
881
889
  }
882
- if (g > l) {
883
- o.push(c.slice(l, g).join("")), l = g + 1;
890
+ if (p > l) {
891
+ i.push(c.slice(l, p).join("")), l = p + 1;
884
892
  continue;
885
893
  }
886
- let p = -1;
894
+ let g = -1;
887
895
  for (let u = l; u < f; u++)
888
- if (O(c[u])) {
889
- p = u;
896
+ if (M(c[u])) {
897
+ g = u;
890
898
  break;
891
899
  }
892
- if (p >= 0) {
893
- o.push(c.slice(l, p).join("")), l = p + 1;
900
+ if (g >= 0) {
901
+ i.push(c.slice(l, g).join("")), l = g + 1;
894
902
  continue;
895
903
  }
896
- o.push(c.slice(l, f).join("")), l = f;
904
+ i.push(c.slice(l, f).join("")), l = f;
897
905
  break;
898
906
  }
899
- f - l > 0 && o.push(c.slice(l, f).join(""));
907
+ f - l > 0 && i.push(c.slice(l, f).join(""));
900
908
  }
901
- return o.join(e);
909
+ return i.join(e);
902
910
  }
903
- function En() {
911
+ function Rn() {
904
912
  return F.size;
905
913
  }
906
- function Cn() {
914
+ function Fn() {
907
915
  return N.size;
908
916
  }
909
- function Rn() {
917
+ function Nn() {
910
918
  return _.size;
911
919
  }
912
- function Fn() {
920
+ function _n() {
913
921
  F.clear(), N.clear(), _.clear();
914
922
  }
915
- function Nn() {
916
- ft(), et(), rt();
923
+ function zn() {
924
+ ut(), st(), it();
917
925
  }
918
926
  export {
919
- H as after,
920
- Et as afterLast,
921
- yn as apa,
922
- st as before,
923
- ot as beforeLast,
924
- Ct as between,
925
- Rt as betweenFirst,
926
- Ft as camel,
927
- Cn as camelCacheSize,
928
- Nt as charAt,
929
- zt as chopEnd,
930
- _t as chopStart,
931
- J as contains,
932
- Ot as containsAll,
933
- ft as createRandomStringsNormally,
934
- lt as createRandomStringsUsing,
935
- rn as createRandomStringsUsingSequence,
936
- Mt as deduplicate,
937
- Ut as doesntContain,
938
- It as doesntEndWith,
939
- Sn as doesntStartWith,
940
- I as endsWith,
941
- Wt as excerpt,
942
- Pt as finish,
943
- Fn as flushCache,
944
- hn as headline,
945
- dn as initials,
946
- jt as is,
947
- it as isAscii,
948
- Gt as isJson,
949
- Vt as isMatch,
950
- Bt as isUrl,
951
- Dt as kebab,
952
- gt as lcfirst,
953
- z as length,
954
- Ht as limit,
955
- Z as lower,
956
- W as makePad,
957
- Zt as mask,
958
- Kt as match,
959
- Qt as matchAll,
960
- Xt as numbers,
961
- Yt as padBoth,
962
- vt as padLeft,
963
- tn as padRight,
964
- xn as pascal,
965
- nn as password,
966
- en as position,
967
- ct as random,
968
- pn as remove,
969
- sn as repeat,
970
- ln as replace,
971
- on as replaceArray,
972
- an as replaceEnd,
973
- at as replaceFirst,
974
- ut as replaceLast,
975
- un as replaceMatches,
976
- fn as replaceStart,
977
- Nn as resetFactoryState,
978
- mn as reverse,
979
- mt as snake,
980
- En as snakeCacheSize,
981
- wn as squish,
982
- gn as start,
983
- P as startsWith,
984
- pt as stripTags,
985
- V as studly,
986
- Rn as studlyCacheSize,
927
+ Z as after,
928
+ Rt as afterLast,
929
+ Sn as apa,
930
+ ot as before,
931
+ ct as beforeLast,
932
+ Ft as between,
933
+ Nt as betweenFirst,
934
+ _t as camel,
935
+ Fn as camelCacheSize,
936
+ zt as charAt,
937
+ Ot as chopEnd,
938
+ Wt as chopStart,
939
+ K as contains,
940
+ Ut as containsAll,
941
+ ut as createRandomStringsNormally,
942
+ at as createRandomStringsUsing,
943
+ on as createRandomStringsUsingSequence,
944
+ Pt as deduplicate,
945
+ It as doesntContain,
946
+ jt as doesntEndWith,
947
+ An as doesntStartWith,
948
+ P as endsWith,
949
+ Mt as excerpt,
950
+ Tt as finish,
951
+ _n as flushCache,
952
+ yn as headline,
953
+ wn as initials,
954
+ Bt as is,
955
+ lt as isAscii,
956
+ Dt as isJson,
957
+ Xt as isMatch,
958
+ Ht as isUrl,
959
+ Jt as kebab,
960
+ dt as lcfirst,
961
+ W as length,
962
+ Zt as limit,
963
+ V as lower,
964
+ O as makePad,
965
+ Vt as mask,
966
+ Qt as match,
967
+ Yt as matchAll,
968
+ vt as numbers,
969
+ tn as padBoth,
970
+ nn as padLeft,
971
+ en as padRight,
972
+ kn as pascal,
973
+ rn as password,
974
+ sn as position,
975
+ ft as random,
976
+ gn as remove,
977
+ cn as repeat,
978
+ an as replace,
979
+ ln as replaceArray,
980
+ pn as replaceEnd,
981
+ pt as replaceFirst,
982
+ mt as replaceLast,
983
+ mn as replaceMatches,
984
+ un as replaceStart,
985
+ zn as resetFactoryState,
986
+ hn as reverse,
987
+ ht as snake,
988
+ Rn as snakeCacheSize,
989
+ xn as squish,
990
+ dn as start,
991
+ j as startsWith,
992
+ gt as stripTags,
993
+ X as studly,
994
+ Nn as studlyCacheSize,
987
995
  $n as swap,
988
- kn as take,
989
- cn as toStringOr,
990
- An as ucfirst,
991
- ht as ucsplit,
992
- dt as ucwords,
993
- Tt as unwrap,
994
- bn as wordCount,
996
+ bn as take,
997
+ fn as toStringOr,
998
+ Cn as ucfirst,
999
+ yt as ucsplit,
1000
+ wt as ucwords,
1001
+ qt as unwrap,
1002
+ En as wordCount,
995
1003
  Ln as wordWrap,
996
- Jt as words,
997
- qt as wrap
1004
+ Kt as words,
1005
+ Gt as wrap
998
1006
  };