@tolki/str 1.6.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,19 +1,19 @@
1
- import { isArray as x, toLower as M, isString as S, isFunction as X, isNumber as Y, isNull as v, isUndefined as tt } from "@tolki/utils";
2
- import { title as T, upper as H } from "./convertcase/index.js";
3
- import { randomInt as U, randomString as nt } from "./random/index.js";
4
- import { substr as $ } from "./replacer/index.js";
5
- import { ltrim as j, rtrim as G, trim as et } from "./trimmer/index.js";
6
- import { createUlidsNormally as rt } from "./ulid/index.js";
7
- import { createUuidsNormally as st } 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 J(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 Ct(t, n) {
16
+ function Rt(t, n) {
17
17
  if (n === "")
18
18
  return t;
19
19
  const e = t.lastIndexOf(String(n));
@@ -25,29 +25,29 @@ function ot(t, n) {
25
25
  const e = t.indexOf(String(n));
26
26
  return e === -1 ? t : t.slice(0, e);
27
27
  }
28
- function it(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);
33
- }
34
- function Rt(t, n, e) {
35
- return n === "" || e === "" ? t : it(J(t, n), e);
32
+ return e === -1 ? t : A(t, 0, e);
36
33
  }
37
34
  function Ft(t, n, e) {
38
- return n === "" || e === "" ? t : ot(J(t, n), e);
35
+ return n === "" || e === "" ? t : ct(Z(t, n), e);
36
+ }
37
+ function Nt(t, n, e) {
38
+ return n === "" || e === "" ? t : ot(Z(t, n), e);
39
39
  }
40
- function Nt(t) {
40
+ function _t(t) {
41
41
  if (N.has(t))
42
42
  return N.get(t);
43
- const n = ht(Q(t));
43
+ const n = dt(X(t));
44
44
  return N.set(t, n), n;
45
45
  }
46
- function _t(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 zt(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 zt(t, n) {
55
55
  }
56
56
  return t;
57
57
  }
58
- function Wt(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 Wt(t, n) {
63
63
  }
64
64
  return t;
65
65
  }
66
- function Z(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 Z(t, n, e = !1) {
72
72
  return !0;
73
73
  return !1;
74
74
  }
75
- function Ot(t, n = "", e = {}) {
76
- const { radius: r = 100, omission: s = "..." } = e, o = String(t ?? ""), i = n ?? "", c = (A) => A.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]), p = String(l[3]), g = j(m), u = Array.from(g).length, w = $(g, Math.max(u - r, 0), r);
80
- let y = j(w);
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
81
  y !== g && (y = s + y);
82
- const h = G(p), d = $(h, 0, r);
83
- let k = G(d);
84
- return k !== h && (k = k + s), y + a + k;
82
+ const h = B(p), d = A(h, 0, r);
83
+ let $ = B(d);
84
+ return $ !== h && ($ = $ + s), y + a + $;
85
85
  }
86
- function Mt(t, n, e = !1) {
86
+ function Ut(t, n, e = !1) {
87
87
  let r = !1;
88
88
  for (const s of n)
89
- if (r = !0, !Z(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 !Z(t, n, e);
93
+ function It(t, n, e = !1) {
94
+ return !K(t, n, e);
95
95
  }
96
- function It(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 Pt(t, n) {
111
- return !I(t, n);
110
+ function jt(t, n) {
111
+ return !P(t, n);
112
112
  }
113
- function qt(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 Tt(t, n, e = null) {
122
+ function Gt(t, n, e = null) {
118
123
  return n + t + (e ?? n);
119
124
  }
120
- function jt(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 Gt(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 ct(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 Bt(t) {
148
+ function Dt(t) {
144
149
  if (!S(t))
145
150
  return !1;
146
151
  try {
@@ -150,13 +155,13 @@ function Bt(t) {
150
155
  }
151
156
  return !0;
152
157
  }
153
- function Dt(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 Dt(t, n = []) {
180
185
  ].join("");
181
186
  return new RegExp(s, "iu").test(t);
182
187
  }
183
- function Ht(t) {
184
- return gt(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 Jt(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 = mt(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 K(t) {
199
- return M(t);
203
+ function V(t) {
204
+ return U(t);
200
205
  }
201
- function Zt(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 Kt(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 Vt(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 Qt(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 Xt(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 Yt(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 vt(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 tn(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 nn(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 en(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",
@@ -435,29 +440,29 @@ function en(t = 32, n = !0, e = !0, r = !0, s = !1) {
435
440
  ].filter((g) => x(g));
436
441
  if (l.length === 0)
437
442
  throw new Error("At least one character pool must be enabled.");
438
- const m = l.flat(), a = B(l).slice(0, Math.max(0, t)).map((g) => g[U(0, g.length - 1)]), p = Array.from(
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(
439
444
  { length: Math.max(0, t - a.length) },
440
- () => m[U(0, m.length - 1)]
445
+ () => m[I(0, m.length - 1)]
441
446
  );
442
- return B([...a, ...p]).join("");
447
+ return D([...a, ...p]).join("");
443
448
  }
444
- function B(t) {
449
+ function D(t) {
445
450
  const n = [...t];
446
451
  for (let e = n.length - 1; e > 0; e--) {
447
- const r = U(0, e);
452
+ const r = I(0, e);
448
453
  [n[e], n[r]] = [n[r], n[e]];
449
454
  }
450
455
  return n;
451
456
  }
452
- function rn(t, n, e = 0) {
457
+ function sn(t, n, e = 0) {
453
458
  if (n === "")
454
459
  return !1;
455
460
  const r = Array.from(t), s = Array.from(n);
456
- let o = e >= 0 ? e : r.length + e;
457
- 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)
458
463
  return !1;
459
- const i = r.length - s.length;
460
- for (let c = o; c <= i; c++) {
464
+ const o = r.length - s.length;
465
+ for (let c = i; c <= o; c++) {
461
466
  let f = !0;
462
467
  for (let l = 0; l < s.length; l++)
463
468
  if (r[c + l] !== s[l]) {
@@ -469,42 +474,42 @@ function rn(t, n, e = 0) {
469
474
  }
470
475
  return !1;
471
476
  }
472
- function lt(t = 16) {
473
- return (R ?? ((e) => nt(e)))(t);
477
+ function ft(t = 16) {
478
+ return (R ?? ((e) => et(e)))(t);
474
479
  }
475
- function ft(t) {
480
+ function at(t) {
476
481
  R = t;
477
482
  }
478
- function sn(t, n) {
483
+ function on(t, n) {
479
484
  let e = 0;
480
485
  const r = n ?? function(s) {
481
- const o = R;
486
+ const i = R;
482
487
  R = null;
483
- const i = lt(s);
484
- return R = o, e++, i;
488
+ const o = ft(s);
489
+ return R = i, e++, o;
485
490
  };
486
- ft((s) => e < t.length ? String(t[e++]) : r(s));
491
+ at((s) => e < t.length ? String(t[e++]) : r(s));
487
492
  }
488
- function at() {
493
+ function ut() {
489
494
  R = null;
490
495
  }
491
- function on(t, n) {
496
+ function cn(t, n) {
492
497
  return n <= 0 ? "" : t.repeat(n);
493
498
  }
494
- function cn(t, n, e) {
499
+ function ln(t, n, e) {
495
500
  let r;
496
501
  typeof n == "object" && !x(n) ? r = Object.values(n) : r = x(n) ? [...n] : Array.from(n);
497
502
  const s = e.split(t);
498
503
  if (s.length === 1)
499
504
  return e;
500
- let o = s[0];
501
- for (let i = 1; i < s.length; i++) {
505
+ let i = s[0];
506
+ for (let o = 1; o < s.length; o++) {
502
507
  const c = r.length ? r.shift() : t;
503
- o += c + s[i];
508
+ i += c + s[o];
504
509
  }
505
- return String(o);
510
+ return String(i);
506
511
  }
507
- function ln(t, n) {
512
+ function fn(t, n) {
508
513
  try {
509
514
  const e = String(t);
510
515
  if (e.length)
@@ -514,57 +519,57 @@ function ln(t, n) {
514
519
  return n;
515
520
  }
516
521
  }
517
- function fn(t, n, e, r = !0) {
522
+ function an(t, n, e, r = !0) {
518
523
  if (S(t) && !S(n))
519
524
  throw new TypeError(
520
525
  "The replacement must be a string when the search term is a string."
521
526
  );
522
- const s = S(e) ? e : Array.from(e, (f) => E(f));
527
+ const s = S(e) ? e : Array.from(e, (f) => C(f));
523
528
  if (!r)
524
- return V(
529
+ return Q(
525
530
  t,
526
531
  n,
527
532
  s
528
533
  );
529
- const o = S(t) ? [t] : Array.from(t, (f) => E(f)), i = S(n) ? o.map(() => n) : Array.from(n, (f) => E(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);
530
535
  return S(s) ? c(s) : s.map(c);
531
536
  }
532
- function V(t, n, e) {
533
- const r = S(t) ? [t] : Array.from(t, (c) => E(c)), s = S(n) ? r.map(() => n) : Array.from(n, (c) => E(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) => {
534
539
  if (l === "")
535
540
  return f;
536
541
  const a = s[m] ?? "", p = new RegExp(
537
- o(l),
538
- ct(l) ? "gi" : "giu"
542
+ i(l),
543
+ lt(l) ? "gi" : "giu"
539
544
  );
540
545
  return f.replace(p, () => a);
541
546
  }, c);
542
- return S(e) ? i(e) : e.map(i);
547
+ return S(e) ? o(e) : e.map(o);
543
548
  }
544
- function E(t) {
545
- return v(t) || tt(t) ? "" : String(t);
549
+ function C(t) {
550
+ return tt(t) || nt(t) ? "" : String(t);
546
551
  }
547
- function ut(t, n, e) {
552
+ function pt(t, n, e) {
548
553
  if (t = String(t), t === "")
549
554
  return e;
550
555
  const r = e.indexOf(t);
551
556
  return r !== -1 ? e.slice(0, r) + n + e.slice(r + t.length) : e;
552
557
  }
553
- function an(t, n, e) {
554
- return t = String(t), t === "" ? e : P(e, t) ? ut(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;
555
560
  }
556
- function pt(t, n, e) {
561
+ function mt(t, n, e) {
557
562
  if (t = String(t), t === "")
558
563
  return e;
559
564
  const r = e.lastIndexOf(t);
560
565
  return r !== -1 ? e.slice(0, r) + n + e.slice(r + t.length) : e;
561
566
  }
562
- function un(t, n, e) {
563
- return t = String(t), t === "" ? e : I(e, t) ? pt(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;
564
569
  }
565
- function pn(t, n, e, r = -1) {
566
- const s = (a) => x(a) ? a : [a], o = s(t);
567
- 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) {
568
573
  try {
569
574
  if (a instanceof RegExp) {
570
575
  let u = a.flags;
@@ -600,12 +605,12 @@ function pn(t, n, e, r = -1) {
600
605
  }
601
606
  }
602
607
  const c = [];
603
- for (const a of o) {
604
- const p = i(a);
608
+ for (const a of i) {
609
+ const p = o(a);
605
610
  if (!p) return null;
606
611
  c.push(p);
607
612
  }
608
- const f = X(n), l = f ? [] : s(n), m = (a) => {
613
+ const f = Y(n), l = f ? [] : s(n), m = (a) => {
609
614
  let p = a;
610
615
  for (let g = 0; g < c.length; g++) {
611
616
  const u = c[g];
@@ -617,21 +622,21 @@ function pn(t, n, e, r = -1) {
617
622
  (h, ...d) => {
618
623
  if (r >= 0 && w >= r) return h;
619
624
  w++;
620
- const L = d.length > 0 && d[d.length - 1] !== null && typeof d[d.length - 1] == "object" ? d.length - 3 : d.length - 2, A = [];
621
- for (let b = 0; b < L; b++)
622
- A.push(d[b]);
623
- const C = [h, ...A];
624
- return y(C);
625
+ const E = d.length > 0 && d[d.length - 1] !== null && typeof d[d.length - 1] == "object" ? d.length - 3 : d.length - 2, k = [];
626
+ for (let b = 0; b < E; b++)
627
+ k.push(d[b]);
628
+ const L = [h, ...k];
629
+ return y(L);
625
630
  }
626
631
  );
627
632
  } else {
628
633
  const w = l[g] ?? (l.length === 1 ? l[0] : "");
629
634
  if (r < 0)
630
635
  p = p.replace(u, (y, ...h) => {
631
- const k = h.length > 0 && h[h.length - 1] !== null && typeof h[h.length - 1] == "object" ? h.length - 3 : h.length - 2, L = h.slice(0, k).map((A) => String(A));
632
- return w.replace(/\$(\d{1,2})/g, (A, C) => {
633
- const b = parseInt(C, 10);
634
- return (L[b - 1] ?? "").toUpperCase();
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);
639
+ return (E[b - 1] ?? "").toUpperCase();
635
640
  });
636
641
  });
637
642
  else {
@@ -639,10 +644,10 @@ function pn(t, n, e, r = -1) {
639
644
  p = p.replace(u, (h, ...d) => {
640
645
  if (y >= r) return h;
641
646
  y++;
642
- const L = d.length > 0 && d[d.length - 1] !== null && typeof d[d.length - 1] == "object" ? d.length - 3 : d.length - 2, A = d.slice(0, L).map((C) => String(C));
643
- return w.replace(/\$(\d{1,2})/g, (C, b) => {
644
- const q = parseInt(b, 10);
645
- return (A[q - 1] ?? "").toUpperCase();
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();
646
651
  });
647
652
  });
648
653
  }
@@ -652,7 +657,7 @@ function pn(t, n, e, r = -1) {
652
657
  };
653
658
  return x(e) ? e.map(m) : m(e);
654
659
  }
655
- function mt(t) {
660
+ function gt(t) {
656
661
  let n = "", e = !1;
657
662
  for (let r = 0; r < t.length; r++) {
658
663
  const s = t[r];
@@ -660,37 +665,42 @@ function mt(t) {
660
665
  }
661
666
  return n;
662
667
  }
663
- function mn(t, n, e = !0) {
664
- const r = S(n) ? n : Array.from(n, (i) => E(i));
668
+ function gn(t, n, e = !0) {
669
+ const r = S(n) ? n : Array.from(n, (o) => C(o));
665
670
  if (!e)
666
- return V(t, "", r);
667
- const s = S(t) ? [t] : Array.from(t, (i) => E(i)), o = (i) => {
668
- 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;
669
674
  for (const f of s)
670
675
  f !== "" && (c = c.split(f).join(""));
671
676
  return c;
672
677
  };
673
- return S(r) ? o(r) : r.map(o);
678
+ return S(r) ? i(r) : r.map(i);
674
679
  }
675
- function gn(t) {
680
+ function hn(t) {
676
681
  return Array.from(t).reverse().join("");
677
682
  }
678
- function hn(t, n) {
679
- const e = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
680
- 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)}`;
681
691
  }
682
- function dn(t) {
692
+ function yn(t) {
683
693
  const n = String(t).trim();
684
694
  if (n === "")
685
695
  return "";
686
696
  let e = n.split(/\s+/u);
687
- return e.length > 1 ? e = e.map((s) => T(s)) : e = dt(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(" ");
688
698
  }
689
- function yn(t, n = !1) {
699
+ function wn(t, n = !1) {
690
700
  const r = t.split(/\s+/u).filter((s) => s.length > 0).map((s) => [...s][0]).join("");
691
- return n ? H(r) : r;
701
+ return n ? J(r) : r;
692
702
  }
693
- function wn(t) {
703
+ function Sn(t) {
694
704
  if (t.trim() === "")
695
705
  return t;
696
706
  const n = /* @__PURE__ */ new Set([
@@ -729,52 +739,52 @@ function wn(t) {
729
739
  "des",
730
740
  "par",
731
741
  "à"
732
- ]), e = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u), s = (o) => {
733
- if (!o) return o;
734
- 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("");
735
745
  return c + f;
736
746
  };
737
- for (let o = 0; o < r.length; o++) {
738
- const i = r[o].toLocaleLowerCase();
739
- if (i.includes("-")) {
740
- const f = i.split("-").map((l) => n.has(l) && l.length <= 3 ? l : s(l));
741
- 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("-");
742
752
  } else {
743
- 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);
744
- 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);
745
755
  }
746
756
  }
747
757
  return r.join(" ");
748
758
  }
749
- function gt(t, n = "_") {
759
+ function ht(t, n = "_") {
750
760
  const r = `${t}|${n}`;
751
761
  if (F.has(r))
752
762
  return F.get(r);
753
763
  let s = t;
754
- return /^[a-z]+$/.test(t) || (s = yt(t).replace(/\s+/gu, ""), s = s.replace(/(.)(?=[A-Z])/g, `$1${n}`), s = K(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;
755
765
  }
756
- function Sn(t) {
757
- return et(t).replace(/[\s\u3164\u1160]+/gu, " ");
766
+ function xn(t) {
767
+ return rt(t).replace(/[\s\u3164\u1160]+/gu, " ");
758
768
  }
759
- function P(t, n) {
769
+ function j(t, n) {
760
770
  if (t == null || n == null)
761
771
  return !1;
762
772
  let e;
763
- S(n) || Y(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];
764
774
  const r = String(t);
765
775
  for (const s of e) {
766
776
  if (s == null)
767
777
  continue;
768
- const o = String(s);
769
- if (o !== "" && r.startsWith(o))
778
+ const i = String(s);
779
+ if (i !== "" && r.startsWith(i))
770
780
  return !0;
771
781
  }
772
782
  return !1;
773
783
  }
774
- function xn(t, n) {
775
- return !P(t, n);
784
+ function An(t, n) {
785
+ return !j(t, n);
776
786
  }
777
- function Q(t, n = !1) {
787
+ function X(t, n = !1) {
778
788
  let e = t;
779
789
  n && (e = t.replace(
780
790
  /(^|[-_ \s])([A-Z]+)(?=[-_ \s]|$)/gu,
@@ -783,59 +793,59 @@ function Q(t, n = !1) {
783
793
  const r = e;
784
794
  if (_.has(r))
785
795
  return _.get(r);
786
- 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) => {
787
797
  if (!f) return f;
788
798
  const l = Array.from(f), m = l[0].toUpperCase(), a = l.slice(1).join("");
789
799
  return m + a;
790
- }, c = o.map(i).join("");
800
+ }, c = i.map(o).join("");
791
801
  return _.set(r, c), c;
792
802
  }
793
- function $n(t, n = !1) {
794
- return Q(t, n);
803
+ function kn(t, n = !1) {
804
+ return X(t, n);
795
805
  }
796
- function An(t, n) {
806
+ function $n(t, n) {
797
807
  if (!t || Object.keys(t).length === 0)
798
808
  return n;
799
- const e = Object.keys(t).filter((o) => o !== "");
809
+ const e = Object.keys(t).filter((i) => i !== "");
800
810
  if (e.length === 0)
801
811
  return n;
802
- e.sort((o, i) => i.length - o.length);
803
- const r = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = new RegExp(e.map(r).join("|"), "gu");
804
- 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]);
805
815
  }
806
- function kn(t, n) {
807
- return n < 0 ? $(t, n) : $(t, 0, n);
816
+ function bn(t, n) {
817
+ return n < 0 ? A(t, n) : A(t, 0, n);
808
818
  }
809
- function ht(t) {
810
- return K($(t, 0, 1)) + $(t, 1);
819
+ function dt(t) {
820
+ return V(A(t, 0, 1)) + A(t, 1);
811
821
  }
812
- function bn(t) {
813
- return H($(t, 0, 1)) + $(t, 1);
822
+ function Cn(t) {
823
+ return J(A(t, 0, 1)) + A(t, 1);
814
824
  }
815
- function dt(t) {
825
+ function yt(t) {
816
826
  return t.split(new RegExp("(?=\\p{Lu})", "u")).filter(Boolean);
817
827
  }
818
- function yt(t, n = ` \r
828
+ function wt(t, n = ` \r
819
829
  \f\v`) {
820
- 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");
821
- 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());
822
832
  }
823
833
  function En(t, n = null) {
824
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);
825
835
  return s ? s.length : 0;
826
836
  }
827
- function O(t) {
837
+ function M(t) {
828
838
  return t.trim() === "";
829
839
  }
830
- function D(t, n, e) {
840
+ function H(t, n, e) {
831
841
  let r = n;
832
- for (; r < e && O(t[r]); )
842
+ for (; r < e && M(t[r]); )
833
843
  r++;
834
844
  return r;
835
845
  }
836
- function wt(t, n, e) {
846
+ function St(t, n, e) {
837
847
  let r = e;
838
- for (; r > n && O(t[r - 1]); )
848
+ for (; r > n && M(t[r - 1]); )
839
849
  r--;
840
850
  return r;
841
851
  }
@@ -843,154 +853,154 @@ function Ln(t, n = 75, e = `
843
853
  `, r = !1) {
844
854
  if (t.length === 0 || n < 1 || e === "")
845
855
  return t;
846
- const s = t.split(/\r\n|\n|\r/), o = [];
847
- for (const i of s) {
848
- 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;
849
859
  if (f === 0) {
850
- o.push("");
860
+ i.push("");
851
861
  continue;
852
862
  }
853
863
  let l = 0;
854
864
  if (r) {
855
- for (; l < f && (l = D(c, l, f), l !== f); ) {
865
+ for (; l < f && (l = H(c, l, f), l !== f); ) {
856
866
  if (f - l <= n) {
857
- o.push(c.slice(l, f).join(""));
867
+ i.push(c.slice(l, f).join(""));
858
868
  break;
859
869
  }
860
- const m = wt(
870
+ const m = St(
861
871
  c,
862
872
  l,
863
873
  l + n
864
874
  );
865
- o.push(c.slice(l, m).join("")), l += n;
875
+ i.push(c.slice(l, m).join("")), l += n;
866
876
  }
867
877
  continue;
868
878
  }
869
879
  for (; f - l > n; ) {
870
- const m = D(c, l, f);
880
+ const m = H(c, l, f);
871
881
  if (m !== l && (l = m, f - l <= n))
872
882
  break;
873
883
  const a = Math.min(f, l + n + 1);
874
884
  let p = -1;
875
885
  for (let u = a - 1; u >= l; u--)
876
- if (O(c[u])) {
886
+ if (M(c[u])) {
877
887
  p = u;
878
888
  break;
879
889
  }
880
890
  if (p > l) {
881
- o.push(c.slice(l, p).join("")), l = p + 1;
891
+ i.push(c.slice(l, p).join("")), l = p + 1;
882
892
  continue;
883
893
  }
884
894
  let g = -1;
885
895
  for (let u = l; u < f; u++)
886
- if (O(c[u])) {
896
+ if (M(c[u])) {
887
897
  g = u;
888
898
  break;
889
899
  }
890
900
  if (g >= 0) {
891
- o.push(c.slice(l, g).join("")), l = g + 1;
901
+ i.push(c.slice(l, g).join("")), l = g + 1;
892
902
  continue;
893
903
  }
894
- o.push(c.slice(l, f).join("")), l = f;
904
+ i.push(c.slice(l, f).join("")), l = f;
895
905
  break;
896
906
  }
897
- f - l > 0 && o.push(c.slice(l, f).join(""));
907
+ f - l > 0 && i.push(c.slice(l, f).join(""));
898
908
  }
899
- return o.join(e);
909
+ return i.join(e);
900
910
  }
901
- function Cn() {
911
+ function Rn() {
902
912
  return F.size;
903
913
  }
904
- function Rn() {
914
+ function Fn() {
905
915
  return N.size;
906
916
  }
907
- function Fn() {
917
+ function Nn() {
908
918
  return _.size;
909
919
  }
910
- function Nn() {
920
+ function _n() {
911
921
  F.clear(), N.clear(), _.clear();
912
922
  }
913
- function _n() {
914
- at(), rt(), st();
923
+ function zn() {
924
+ ut(), st(), it();
915
925
  }
916
926
  export {
917
- J as after,
918
- Ct as afterLast,
919
- wn as apa,
927
+ Z as after,
928
+ Rt as afterLast,
929
+ Sn as apa,
920
930
  ot as before,
921
- it as beforeLast,
922
- Rt as between,
923
- Ft as betweenFirst,
924
- Nt as camel,
925
- Rn as camelCacheSize,
926
- _t as charAt,
927
- Wt as chopEnd,
928
- zt as chopStart,
929
- Z as contains,
930
- Mt as containsAll,
931
- at as createRandomStringsNormally,
932
- ft as createRandomStringsUsing,
933
- sn as createRandomStringsUsingSequence,
934
- It as deduplicate,
935
- Ut as doesntContain,
936
- Pt as doesntEndWith,
937
- xn as doesntStartWith,
938
- I as endsWith,
939
- Ot as excerpt,
940
- qt as finish,
941
- Nn as flushCache,
942
- dn as headline,
943
- yn as initials,
944
- Gt as is,
945
- ct as isAscii,
946
- Bt as isJson,
947
- Qt as isMatch,
948
- Dt as isUrl,
949
- Ht as kebab,
950
- ht as lcfirst,
951
- z as length,
952
- Jt as limit,
953
- K as lower,
954
- W as makePad,
955
- Kt as mask,
956
- Vt as match,
957
- Xt as matchAll,
958
- Yt as numbers,
959
- vt as padBoth,
960
- tn as padLeft,
961
- nn as padRight,
962
- $n as pascal,
963
- en as password,
964
- rn as position,
965
- lt as random,
966
- mn as remove,
967
- on as repeat,
968
- fn as replace,
969
- cn as replaceArray,
970
- un as replaceEnd,
971
- ut as replaceFirst,
972
- pt as replaceLast,
973
- pn as replaceMatches,
974
- an as replaceStart,
975
- _n as resetFactoryState,
976
- gn as reverse,
977
- gt as snake,
978
- Cn as snakeCacheSize,
979
- Sn as squish,
980
- hn as start,
981
- P as startsWith,
982
- mt as stripTags,
983
- Q as studly,
984
- Fn as studlyCacheSize,
985
- An as swap,
986
- kn as take,
987
- ln as toStringOr,
988
- bn as ucfirst,
989
- dt as ucsplit,
990
- yt as ucwords,
991
- jt as unwrap,
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,
995
+ $n as swap,
996
+ bn as take,
997
+ fn as toStringOr,
998
+ Cn as ucfirst,
999
+ yt as ucsplit,
1000
+ wt as ucwords,
1001
+ qt as unwrap,
992
1002
  En as wordCount,
993
1003
  Ln as wordWrap,
994
- Zt as words,
995
- Tt as wrap
1004
+ Kt as words,
1005
+ Gt as wrap
996
1006
  };