@zinaid/str 0.0.3 → 0.0.5

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,58 +1,86 @@
1
- import { substr as x, ltrim as j, rtrim as T, plural as Y, randomInt as M, randomString as v, title as D, trim as tt, upper as nt } from "@zinaid/str";
2
- import { isArray as S, toLower as W, isString as N, isFunction as et } from "@zinaid/utils";
3
- import rt from "any-ascii";
4
- import { transliterate as st } from "transliteration";
5
- import { ulid as K } from "ulid";
6
- import { validate as ot, NIL as it, MAX as ct, version as lt, v4 as ft, v7 as ut } from "uuid";
1
+ import { substr as x, ltrim as j, rtrim as K, plural as Y, randomInt as I, randomString as tt, title as Z, trim as nt, upper as et } from "@zinaid/str";
2
+ import { isArray as S, toLower as q, isString as N, isFunction as rt, optionalRequire as M } from "@zinaid/utils";
3
+ function st() {
4
+ return M(
5
+ "any-ascii",
6
+ 'The "any-ascii" package is required for ASCII transliteration. Please install it: npm install any-ascii'
7
+ ).default;
8
+ }
9
+ function it() {
10
+ return M(
11
+ "transliteration",
12
+ 'The "transliteration" package is required for transliteration. Please install it: npm install transliteration'
13
+ ).transliterate;
14
+ }
15
+ function ot() {
16
+ return M(
17
+ "ulid",
18
+ 'The "ulid" package is required for ULID generation. Please install it: npm install ulid'
19
+ ).ulid;
20
+ }
21
+ function P() {
22
+ const t = M(
23
+ "uuid",
24
+ 'The "uuid" package is required for UUID functions. Please install it: npm install uuid'
25
+ );
26
+ return {
27
+ v4: t.v4,
28
+ v7: t.v7,
29
+ validate: t.validate,
30
+ version: t.version,
31
+ NIL: t.NIL,
32
+ MAX: t.MAX
33
+ };
34
+ }
7
35
  const E = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map();
8
36
  let $ = null, L = null, R = null;
9
- function Z(t, n) {
37
+ function J(t, n) {
10
38
  if (n === "")
11
39
  return t;
12
40
  const e = String(n), r = t.indexOf(e);
13
41
  return r === -1 ? t : t.slice(r + e.length);
14
42
  }
15
- function _t(t, n) {
43
+ function bt(t, n) {
16
44
  if (n === "")
17
45
  return t;
18
46
  const e = t.lastIndexOf(String(n));
19
47
  return e === -1 ? t : t.slice(e + String(n).length);
20
48
  }
21
- function at(t) {
22
- return st(t);
49
+ function ct(t) {
50
+ return it()(t);
23
51
  }
24
- function Ot(t) {
25
- return rt(t);
52
+ function Rt(t) {
53
+ return st()(t);
26
54
  }
27
- function pt(t, n) {
55
+ function lt(t, n) {
28
56
  if (n === "")
29
57
  return t;
30
58
  const e = t.indexOf(String(n));
31
59
  return e === -1 ? t : t.slice(0, e);
32
60
  }
33
- function gt(t, n) {
61
+ function at(t, n) {
34
62
  if (n === "")
35
63
  return t;
36
64
  const e = t.lastIndexOf(String(n));
37
65
  return e === -1 ? t : x(t, 0, e);
38
66
  }
39
- function Mt(t, n, e) {
40
- return n === "" || e === "" ? t : gt(Z(t, n), e);
67
+ function Ct(t, n, e) {
68
+ return n === "" || e === "" ? t : at(J(t, n), e);
41
69
  }
42
- function Wt(t, n, e) {
43
- return n === "" || e === "" ? t : pt(Z(t, n), e);
70
+ function Et(t, n, e) {
71
+ return n === "" || e === "" ? t : lt(J(t, n), e);
44
72
  }
45
- function It(t) {
73
+ function Ft(t) {
46
74
  if (F.has(t))
47
75
  return F.get(t);
48
- const n = $t(B(t));
76
+ const n = yt(v(t));
49
77
  return F.set(t, n), n;
50
78
  }
51
- function Pt(t, n) {
79
+ function Ut(t, n) {
52
80
  const e = t.length;
53
81
  return (n < 0 ? n < -e : n > e - 1) ? !1 : (n < 0 && (n += e), t.charAt(n));
54
82
  }
55
- function qt(t, n) {
83
+ function Nt(t, n) {
56
84
  for (const e of S(n) ? n : [n])
57
85
  if (t.startsWith(e)) {
58
86
  const r = [...t], s = [...e];
@@ -60,7 +88,7 @@ function qt(t, n) {
60
88
  }
61
89
  return t;
62
90
  }
63
- function Gt(t, n) {
91
+ function zt(t, n) {
64
92
  for (const e of S(n) ? n : [n])
65
93
  if (t.endsWith(e)) {
66
94
  const r = [...t], s = [...e];
@@ -68,7 +96,7 @@ function Gt(t, n) {
68
96
  }
69
97
  return t;
70
98
  }
71
- function J(t, n, e = !1) {
99
+ function X(t, n, e = !1) {
72
100
  e && (t = t.toLowerCase());
73
101
  let r;
74
102
  typeof n == "string" ? r = [n] : r = Array.from(n);
@@ -77,34 +105,34 @@ function J(t, n, e = !1) {
77
105
  return !0;
78
106
  return !1;
79
107
  }
80
- function jt(t, n = "", e = {}) {
81
- const r = e.radius ?? 100, s = e.omission ?? "...", o = String(t ?? ""), c = n ?? "", i = (w) => w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), f = new RegExp(`^(.*?)(${i(c)})(.*)$`, "iu").exec(o);
82
- if (!f)
108
+ function _t(t, n = "", e = {}) {
109
+ const r = e.radius ?? 100, s = e.omission ?? "...", i = String(t ?? ""), c = n ?? "", o = (w) => w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), a = new RegExp(`^(.*?)(${o(c)})(.*)$`, "iu").exec(i);
110
+ if (!a)
83
111
  return null;
84
- const m = j(f[1] ?? ""), a = Array.from(m).length, u = x(m, Math.max(a - r, 0), r);
112
+ const m = j(a[1] ?? ""), f = Array.from(m).length, u = x(m, Math.max(f - r, 0), r);
85
113
  let p = j(u);
86
114
  p !== m && (p = s + p);
87
- const g = T(f[3] ?? ""), h = x(g, 0, r);
88
- let d = T(h);
89
- d !== g && (d = d + s);
90
- const y = f[2] ?? "";
91
- return p + y + d;
115
+ const g = K(a[3] ?? ""), d = x(g, 0, r);
116
+ let h = K(d);
117
+ h !== g && (h = h + s);
118
+ const y = a[2] ?? "";
119
+ return p + y + h;
92
120
  }
93
- function Tt(t, n, e = !1) {
121
+ function Mt(t, n, e = !1) {
94
122
  for (const r of n)
95
- if (!J(t, r, e))
123
+ if (!X(t, r, e))
96
124
  return !1;
97
125
  return !0;
98
126
  }
99
- function Dt(t, n, e = !1) {
100
- return !J(t, n, e);
127
+ function Ot(t, n, e = !1) {
128
+ return !X(t, n, e);
101
129
  }
102
- function Kt(t, n = " ") {
130
+ function It(t, n = " ") {
103
131
  return S(n) ? (n.forEach((e) => {
104
132
  t = t.replace(new RegExp(`${e}+`, "g"), e);
105
133
  }), t) : t.replace(new RegExp(`${n}+`, "g"), n);
106
134
  }
107
- function I(t, n) {
135
+ function W(t, n) {
108
136
  if (t === null)
109
137
  return !1;
110
138
  t = String(t), S(n) ? n = Array.from(n) : n = [String(n)];
@@ -113,39 +141,39 @@ function I(t, n) {
113
141
  return !0;
114
142
  return !1;
115
143
  }
116
- function Zt(t, n) {
117
- return !I(t, n);
144
+ function qt(t, n) {
145
+ return !W(t, n);
118
146
  }
119
- function Jt(t, n) {
147
+ function Pt(t, n) {
120
148
  const e = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
121
149
  return t.replace(new RegExp(`(?:${e})+$`, "u"), "") + n;
122
150
  }
123
- function Bt(t, n, e = null) {
151
+ function Wt(t, n, e = null) {
124
152
  return n + t + (e ?? n);
125
153
  }
126
- function Ht(t, n, e = null) {
127
- return q(t, n) && (t = x(t, z(n))), I(t, e ??= n) && (t = x(t, 0, -z(e))), t;
154
+ function Tt(t, n, e = null) {
155
+ return D(t, n) && (t = x(t, z(n))), W(t, e ??= n) && (t = x(t, 0, -z(e))), t;
128
156
  }
129
- function Vt(t, n, e = !1) {
157
+ function Dt(t, n, e = !1) {
130
158
  n = String(n);
131
159
  let r;
132
160
  typeof t == "string" ? r = [t] : r = Array.from(t);
133
161
  for (let s of r) {
134
- if (s = String(s), s === n || e && W(s) === W(n))
162
+ if (s = String(s), s === n || e && q(s) === q(n))
135
163
  return !0;
136
164
  s = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = s.replace(/\\\*/g, ".*");
137
- const o = e ? "iu" : "u";
138
- if (new RegExp(`^${s}$`, o).test(n))
165
+ const i = e ? "iu" : "u";
166
+ if (new RegExp(`^${s}$`, i).test(n))
139
167
  return !0;
140
168
  }
141
169
  return !1;
142
170
  }
143
- function Xt(t) {
171
+ function Gt(t) {
144
172
  for (let n = 0; n < t.length; n++)
145
173
  if (t.charCodeAt(n) > 127) return !1;
146
174
  return !0;
147
175
  }
148
- function Qt(t) {
176
+ function jt(t) {
149
177
  if (!N(t))
150
178
  return !1;
151
179
  try {
@@ -155,10 +183,10 @@ function Qt(t) {
155
183
  }
156
184
  return !0;
157
185
  }
158
- function Yt(t, n = []) {
186
+ function Kt(t, n = []) {
159
187
  if (!N(t))
160
188
  return !1;
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((o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
189
+ 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("|");
162
190
  try {
163
191
  const c = new URL(t).protocol.replace(":", "");
164
192
  if (r.split("|").includes(c))
@@ -189,191 +217,194 @@ function Yt(t, n = []) {
189
217
  return !1;
190
218
  }
191
219
  }
192
- function vt(t, n = null) {
193
- return !N(t) || n !== null && !ot(t) ? !1 : n === null ? /^[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}$/.test(
220
+ function Zt(t, n = null) {
221
+ if (!N(t))
222
+ return !1;
223
+ const e = P();
224
+ return n !== null && !e.validate(t) ? !1 : n === null ? /^[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}$/.test(
194
225
  t
195
- ) : n === 0 || n === "nil" ? t.toLowerCase() === it : n === "max" ? t.toLowerCase() === ct : n < 1 || n > 8 ? !1 : lt(t) === n;
226
+ ) : n === 0 || n === "nil" ? t.toLowerCase() === e.NIL : n === "max" ? t.toLowerCase() === e.MAX : n < 1 || n > 8 ? !1 : e.version(t) === n;
196
227
  }
197
- function tn(t) {
228
+ function Jt(t) {
198
229
  if (!N(t))
199
230
  return !1;
200
231
  const n = t.toUpperCase();
201
232
  return /^[0-9A-HJKMNP-TV-Z]{26}$/.test(n);
202
233
  }
203
- function nn(t) {
204
- return St(t, "-");
234
+ function Xt(t) {
235
+ return ht(t, "-");
205
236
  }
206
237
  function z(t) {
207
238
  return t.length;
208
239
  }
209
- function en(t, n = 100, e = "...", r = !1) {
240
+ function vt(t, n = 100, e = "...", r = !1) {
210
241
  if (t.length <= n)
211
242
  return t;
212
243
  if (!r)
213
244
  return t.slice(0, n).replace(/\s+$/, "") + e;
214
- t = xt(t).replace(/[\n\r]+/g, " ").trim();
245
+ t = dt(t).replace(/[\n\r]+/g, " ").trim();
215
246
  const s = t.slice(0, n).replace(/\s+$/, "");
216
247
  return t.substring(n, n + 1) === " " ? s + e : s.replace(/(.*)\s.*/, "$1") + e;
217
248
  }
218
- function P(t) {
219
- return W(t);
249
+ function T(t) {
250
+ return q(t);
220
251
  }
221
- function rn(t, n = 100, e = "...") {
252
+ function Bt(t, n = 100, e = "...") {
222
253
  if (n <= 0)
223
254
  return t;
224
- const r = n, s = new RegExp(`^\\s*(?:\\S+\\s*){1,${r}}`, "u"), o = t.match(s);
225
- return !o || z(t) === z(o[0]) ? t : o[0].replace(/\s+$/, "") + e;
255
+ const r = n, s = new RegExp(`^\\s*(?:\\S+\\s*){1,${r}}`, "u"), i = t.match(s);
256
+ return !i || z(t) === z(i[0]) ? t : i[0].replace(/\s+$/, "") + e;
226
257
  }
227
- function sn(t, n, e, r = null) {
258
+ function Ht(t, n, e, r = null) {
228
259
  if (n === "")
229
260
  return t;
230
261
  const s = t.length;
231
- let o = e;
232
- e < 0 && (o = e < -s ? 0 : s + e);
262
+ let i = e;
263
+ e < 0 && (i = e < -s ? 0 : s + e);
233
264
  const c = t.slice(
234
- o,
235
- r !== null ? o + r : void 0
265
+ i,
266
+ r !== null ? i + r : void 0
236
267
  );
237
268
  if (c === "")
238
269
  return t;
239
- const i = t.slice(0, o), l = c.length, f = t.slice(o + l);
240
- return i + n.slice(0, 1).repeat(l) + f;
270
+ const o = t.slice(0, i), l = c.length, a = t.slice(i + l);
271
+ return o + n.slice(0, 1).repeat(l) + a;
241
272
  }
242
- function on(t, n) {
273
+ function Vt(t, n) {
243
274
  let e = "u", r = t;
244
275
  if (t.length >= 2 && t[0] === "/") {
245
276
  let s = -1;
246
- for (let o = t.length - 1; o > 0; o--)
247
- if (t[o] === "/") {
277
+ for (let i = t.length - 1; i > 0; i--)
278
+ if (t[i] === "/") {
248
279
  let c = 0;
249
- for (let i = o - 1; i >= 0 && t[i] === "\\"; i--)
280
+ for (let o = i - 1; o >= 0 && t[o] === "\\"; o--)
250
281
  c++;
251
282
  if (c % 2 === 0) {
252
- s = o;
283
+ s = i;
253
284
  break;
254
285
  }
255
286
  }
256
287
  if (s > 0) {
257
288
  r = t.slice(1, s);
258
- const o = t.slice(s + 1);
259
- if (o)
260
- for (const c of o)
289
+ const i = t.slice(s + 1);
290
+ if (i)
291
+ for (const c of i)
261
292
  /[imsuy]/.test(c) && !e.includes(c) && (e += c);
262
293
  }
263
294
  }
264
295
  try {
265
- const o = new RegExp(r, e).exec(n);
266
- return o ? o[1] !== void 0 ? o[1] : o[0] : "";
296
+ const i = new RegExp(r, e).exec(n);
297
+ return i ? i[1] !== void 0 ? i[1] : i[0] : "";
267
298
  } catch {
268
299
  return "";
269
300
  }
270
301
  }
271
- function cn(t, n) {
302
+ function Qt(t, n) {
272
303
  n = String(n);
273
304
  const e = typeof t == "string" ? [t] : Array.from(t);
274
305
  for (const r of e) {
275
306
  if (typeof r != "string" || r === "") continue;
276
- let s = "u", o = r;
307
+ let s = "u", i = r;
277
308
  if (r.length >= 2 && r[0] === "/") {
278
309
  let c = -1;
279
- for (let i = r.length - 1; i > 0; i--)
280
- if (r[i] === "/") {
310
+ for (let o = r.length - 1; o > 0; o--)
311
+ if (r[o] === "/") {
281
312
  let l = 0;
282
- for (let f = i - 1; f >= 0 && r[f] === "\\"; f--)
313
+ for (let a = o - 1; a >= 0 && r[a] === "\\"; a--)
283
314
  l++;
284
315
  if (l % 2 === 0) {
285
- c = i;
316
+ c = o;
286
317
  break;
287
318
  }
288
319
  }
289
320
  if (c > 0) {
290
- o = r.slice(1, c);
291
- const i = r.slice(c + 1);
292
- if (i)
293
- for (const l of i)
321
+ i = r.slice(1, c);
322
+ const o = r.slice(c + 1);
323
+ if (o)
324
+ for (const l of o)
294
325
  /[imsuy]/.test(l) && !s.includes(l) && (s += l);
295
326
  }
296
327
  }
297
328
  try {
298
- if (new RegExp(o, s).test(n))
329
+ if (new RegExp(i, s).test(n))
299
330
  return !0;
300
331
  } catch {
301
332
  }
302
333
  }
303
334
  return !1;
304
335
  }
305
- function ln(t, n) {
336
+ function Yt(t, n) {
306
337
  let e = "u", r = t;
307
338
  if (t.length >= 2 && t[0] === "/") {
308
- let o = -1;
339
+ let i = -1;
309
340
  for (let c = t.length - 1; c > 0; c--)
310
341
  if (t[c] === "/") {
311
- let i = 0;
342
+ let o = 0;
312
343
  for (let l = c - 1; l >= 0 && t[l] === "\\"; l--)
313
- i++;
314
- if (i % 2 === 0) {
315
- o = c;
344
+ o++;
345
+ if (o % 2 === 0) {
346
+ i = c;
316
347
  break;
317
348
  }
318
349
  }
319
- if (o > 0) {
320
- r = t.slice(1, o);
321
- const c = t.slice(o + 1);
350
+ if (i > 0) {
351
+ r = t.slice(1, i);
352
+ const c = t.slice(i + 1);
322
353
  if (c)
323
- for (const i of c)
324
- /[imsuy]/.test(i) && !e.includes(i) && (e += i);
354
+ for (const o of c)
355
+ /[imsuy]/.test(o) && !e.includes(o) && (e += o);
325
356
  }
326
357
  }
327
358
  e.includes("g") || (e += "g");
328
359
  let s = [];
329
360
  try {
330
- const o = new RegExp(r, e);
361
+ const i = new RegExp(r, e);
331
362
  let c;
332
- for (; (c = o.exec(n)) !== null; )
333
- s.push(c[1] !== void 0 ? c[1] : c[0]), c[0] === "" && o.lastIndex++;
363
+ for (; (c = i.exec(n)) !== null; )
364
+ s.push(c[1] !== void 0 ? c[1] : c[0]), c[0] === "" && i.lastIndex++;
334
365
  } catch {
335
366
  s = [];
336
367
  }
337
368
  return s;
338
369
  }
339
- function fn(t) {
370
+ function tn(t) {
340
371
  return S(t) ? t.map((n) => n.replace(/[^0-9]/g, "")) : t.replace(/[^0-9]/g, "");
341
372
  }
342
- function un(t, n, e = " ") {
373
+ function nn(t, n, e = " ") {
343
374
  const r = t.length;
344
375
  if (n <= r || e === "")
345
376
  return t;
346
- const s = n - r, o = Math.floor(s / 2), c = s - o;
347
- return _(e, o) + t + _(e, c);
377
+ const s = n - r, i = Math.floor(s / 2), c = s - i;
378
+ return _(e, i) + t + _(e, c);
348
379
  }
349
- function an(t, n, e = " ") {
380
+ function en(t, n, e = " ") {
350
381
  const r = t.length;
351
382
  if (n <= r || e === "")
352
383
  return t;
353
- const o = n - r;
354
- return _(e, o) + t;
384
+ const i = n - r;
385
+ return _(e, i) + t;
355
386
  }
356
- function pn(t, n, e = " ") {
387
+ function rn(t, n, e = " ") {
357
388
  const r = t.length;
358
389
  if (n <= r || e === "")
359
390
  return t;
360
- const o = n - r;
361
- return t + _(e, o);
391
+ const i = n - r;
392
+ return t + _(e, i);
362
393
  }
363
394
  function _(t, n) {
364
395
  if (n <= 0) return "";
365
396
  const e = Math.ceil(n / t.length);
366
397
  return t.repeat(e).slice(0, n);
367
398
  }
368
- function mt(t, n = 2) {
399
+ function ut(t, n = 2) {
369
400
  const e = t.split(/(?=[A-Z])/), r = String(e.pop());
370
401
  return e.join("") + Y(r, n);
371
402
  }
372
- function gn(t, n = 2) {
373
- return mt(t, n);
403
+ function sn(t, n = 2) {
404
+ return ut(t, n);
374
405
  }
375
- function mn(t = 32, n = !0, e = !0, r = !0, s = !1) {
376
- const f = [
406
+ function on(t = 32, n = !0, e = !0, r = !0, s = !1) {
407
+ const a = [
377
408
  n ? [
378
409
  "a",
379
410
  "b",
@@ -459,80 +490,80 @@ function mn(t = 32, n = !0, e = !0, r = !0, s = !1) {
459
490
  ] : null,
460
491
  s ? [" "] : null
461
492
  ].filter((p) => S(p));
462
- if (f.length === 0 || t <= 0)
493
+ if (a.length === 0 || t <= 0)
463
494
  return "";
464
495
  const m = [];
465
- for (const p of f) {
466
- const g = M(0, p.length - 1);
496
+ for (const p of a) {
497
+ const g = I(0, p.length - 1);
467
498
  m.push(p[g]);
468
499
  }
469
- const a = Math.max(0, t - m.length), u = f.flat();
470
- for (let p = 0; p < a; p++) {
471
- const g = M(0, u.length - 1);
500
+ const f = Math.max(0, t - m.length), u = a.flat();
501
+ for (let p = 0; p < f; p++) {
502
+ const g = I(0, u.length - 1);
472
503
  m.push(u[g]);
473
504
  }
474
505
  for (let p = m.length - 1; p > 0; p--) {
475
- const g = M(0, p), h = m[p];
476
- m[p] = m[g], m[g] = h;
506
+ const g = I(0, p), d = m[p];
507
+ m[p] = m[g], m[g] = d;
477
508
  }
478
509
  return m.join("");
479
510
  }
480
- function hn(t, n, e = 0) {
511
+ function cn(t, n, e = 0) {
481
512
  if (n === "")
482
513
  return !1;
483
514
  const r = Array.from(t), s = Array.from(n);
484
- let o = e >= 0 ? e : r.length + e;
485
- if (o < 0 && (o = 0), o >= r.length)
515
+ let i = e >= 0 ? e : r.length + e;
516
+ if (i < 0 && (i = 0), i >= r.length)
486
517
  return !1;
487
518
  const c = r.length - s.length;
488
- for (let i = o; i <= c; i++) {
519
+ for (let o = i; o <= c; o++) {
489
520
  let l = !0;
490
- for (let f = 0; f < s.length; f++)
491
- if (r[i + f] !== s[f]) {
521
+ for (let a = 0; a < s.length; a++)
522
+ if (r[o + a] !== s[a]) {
492
523
  l = !1;
493
524
  break;
494
525
  }
495
526
  if (l)
496
- return i;
527
+ return o;
497
528
  }
498
529
  return !1;
499
530
  }
500
- function ht(t = 16) {
501
- return (R ?? ((e) => v(e)))(t);
531
+ function ft(t = 16) {
532
+ return (R ?? ((e) => tt(e)))(t);
502
533
  }
503
- function dt(t) {
534
+ function pt(t) {
504
535
  R = t;
505
536
  }
506
- function dn(t, n) {
537
+ function ln(t, n) {
507
538
  let e = 0;
508
539
  const r = n ?? function(s) {
509
- const o = R;
540
+ const i = R;
510
541
  R = null;
511
- const c = ht(s);
512
- return R = o, e++, c;
542
+ const c = ft(s);
543
+ return R = i, e++, c;
513
544
  };
514
- dt((s) => e < t.length ? String(t[e++]) : r(s));
545
+ pt((s) => e < t.length ? String(t[e++]) : r(s));
515
546
  }
516
- function yn() {
547
+ function an() {
517
548
  R = null;
518
549
  }
519
- function wn(t, n) {
550
+ function un(t, n) {
520
551
  return n <= 0 ? "" : t.repeat(n);
521
552
  }
522
- function xn(t, n, e) {
553
+ function fn(t, n, e) {
523
554
  let r;
524
555
  typeof n == "object" && !S(n) ? r = Object.values(n) : r = S(n) ? [...n] : Array.from(n);
525
556
  const s = e.split(t);
526
557
  if (s.length === 1)
527
558
  return e;
528
- let o = s[0];
559
+ let i = s[0];
529
560
  for (let c = 1; c < s.length; c++) {
530
- const i = r.length ? r.shift() : t;
531
- o += i + s[c];
561
+ const o = r.length ? r.shift() : t;
562
+ i += o + s[c];
532
563
  }
533
- return String(o);
564
+ return String(i);
534
565
  }
535
- function Sn(t, n) {
566
+ function pn(t, n) {
536
567
  try {
537
568
  const e = String(t);
538
569
  if (e.length)
@@ -542,62 +573,62 @@ function Sn(t, n) {
542
573
  return n;
543
574
  }
544
575
  }
545
- function $n(t, n, e, r = !0) {
546
- const s = (f) => typeof f == "string" ? [f] : Array.from(f), o = s(t), c = s(n), i = (f) => f.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), l = (f) => o.reduce((m, a, u) => {
547
- if (a === "") return m;
576
+ function gn(t, n, e, r = !0) {
577
+ const s = (a) => typeof a == "string" ? [a] : Array.from(a), i = s(t), c = s(n), o = (a) => a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), l = (a) => i.reduce((m, f, u) => {
578
+ if (f === "") return m;
548
579
  const p = c[u] ?? "";
549
580
  if (!r)
550
- return m.split(a).join(p);
551
- const g = new RegExp(i(a), "gi");
581
+ return m.split(f).join(p);
582
+ const g = new RegExp(o(f), "gi");
552
583
  return m.replace(g, () => p);
553
- }, f);
584
+ }, a);
554
585
  return N(e) ? l(e) : Array.from(e).map(l);
555
586
  }
556
- function yt(t, n, e) {
587
+ function gt(t, n, e) {
557
588
  if (t = String(t), t === "")
558
589
  return e;
559
590
  const r = e.indexOf(t);
560
591
  return r !== -1 ? e.slice(0, r) + n + e.slice(r + t.length) : e;
561
592
  }
562
- function An(t, n, e) {
563
- return t = String(t), t === "" ? e : q(e, t) ? yt(t, n, e) : e;
593
+ function mn(t, n, e) {
594
+ return t = String(t), t === "" ? e : D(e, t) ? gt(t, n, e) : e;
564
595
  }
565
- function wt(t, n, e) {
596
+ function mt(t, n, e) {
566
597
  if (t = String(t), t === "")
567
598
  return e;
568
599
  const r = e.lastIndexOf(t);
569
600
  return r !== -1 ? e.slice(0, r) + n + e.slice(r + t.length) : e;
570
601
  }
571
- function kn(t, n, e) {
572
- return t = String(t), t === "" ? e : I(e, t) ? wt(t, n, e) : e;
602
+ function dn(t, n, e) {
603
+ return t = String(t), t === "" ? e : W(e, t) ? mt(t, n, e) : e;
573
604
  }
574
- function Ln(t, n, e, r = -1) {
575
- const s = (a) => S(a) ? a : [a], o = s(t);
576
- function c(a) {
605
+ function hn(t, n, e, r = -1) {
606
+ const s = (f) => S(f) ? f : [f], i = s(t);
607
+ function c(f) {
577
608
  try {
578
- if (a instanceof RegExp) {
579
- let g = a.flags;
580
- return g.includes("g") || (g += "g"), g.includes("u") || (g += "u"), new RegExp(a.source, g);
609
+ if (f instanceof RegExp) {
610
+ let g = f.flags;
611
+ return g.includes("g") || (g += "g"), g.includes("u") || (g += "u"), new RegExp(f.source, g);
581
612
  }
582
- let u = a, p = "gu";
583
- if (a.length >= 2 && a[0] === "/") {
613
+ let u = f, p = "gu";
614
+ if (f.length >= 2 && f[0] === "/") {
584
615
  let g = -1;
585
- for (let h = a.length - 1; h > 0; h--)
586
- if (a[h] === "/") {
587
- let d = 0;
588
- for (let y = h - 1; y >= 0 && a[y] === "\\"; y--)
589
- d++;
590
- if (d % 2 === 0) {
591
- g = h;
616
+ for (let d = f.length - 1; d > 0; d--)
617
+ if (f[d] === "/") {
618
+ let h = 0;
619
+ for (let y = d - 1; y >= 0 && f[y] === "\\"; y--)
620
+ h++;
621
+ if (h % 2 === 0) {
622
+ g = d;
592
623
  break;
593
624
  }
594
625
  }
595
626
  if (g > 1) {
596
- u = a.slice(1, g);
597
- const h = a.slice(g + 1);
598
- if (h)
599
- for (const d of h)
600
- /[imsuy]/.test(d) && !p.includes(d) && (p += d);
627
+ u = f.slice(1, g);
628
+ const d = f.slice(g + 1);
629
+ if (d)
630
+ for (const h of d)
631
+ /[imsuy]/.test(h) && !p.includes(h) && (p += h);
601
632
  p.includes("g") || (p += "g"), p.includes("u") || (p += "u");
602
633
  }
603
634
  }
@@ -609,48 +640,48 @@ function Ln(t, n, e, r = -1) {
609
640
  return null;
610
641
  }
611
642
  }
612
- const i = [];
613
- for (const a of o) {
614
- const u = c(a);
643
+ const o = [];
644
+ for (const f of i) {
645
+ const u = c(f);
615
646
  if (!u) return null;
616
- i.push(u);
647
+ o.push(u);
617
648
  }
618
- const l = et(n), f = l ? [] : s(n), m = (a) => {
619
- let u = a;
620
- for (let p = 0; p < i.length; p++) {
621
- const g = i[p];
649
+ const l = rt(n), a = l ? [] : s(n), m = (f) => {
650
+ let u = f;
651
+ for (let p = 0; p < o.length; p++) {
652
+ const g = o[p];
622
653
  if (l) {
623
- let h = 0;
624
- const d = n;
654
+ let d = 0;
655
+ const h = n;
625
656
  u = u.replace(
626
657
  g,
627
658
  (y, ...w) => {
628
- if (r >= 0 && h >= r) return y;
629
- h++;
659
+ if (r >= 0 && d >= r) return y;
660
+ d++;
630
661
  const C = typeof w[w.length - 1] == "object" && typeof w[w.length - 2] == "number" ? w.length - 3 : w.length - 2, A = [];
631
662
  for (let k = 0; k < C; k++)
632
663
  A.push(w[k]);
633
664
  const b = [y, ...A];
634
- return d(b);
665
+ return h(b);
635
666
  }
636
667
  );
637
668
  } else {
638
- const h = f[p] ?? (f.length === 1 ? f[0] : "");
669
+ const d = a[p] ?? (a.length === 1 ? a[0] : "");
639
670
  if (r < 0)
640
- u = u.replace(g, (d, ...y) => {
671
+ u = u.replace(g, (h, ...y) => {
641
672
  const O = typeof y[y.length - 1] == "object" && typeof y[y.length - 2] == "number" ? y.length - 3 : y.length - 2, C = y.slice(0, O).map((A) => String(A));
642
- return h.replace(/\$(\d{1,2})/g, (A, b) => {
673
+ return d.replace(/\$(\d{1,2})/g, (A, b) => {
643
674
  const k = parseInt(b, 10);
644
675
  return (C[k - 1] ?? "").toUpperCase();
645
676
  });
646
677
  });
647
678
  else {
648
- let d = 0;
679
+ let h = 0;
649
680
  u = u.replace(g, (y, ...w) => {
650
- if (d >= r) return y;
651
- d++;
681
+ if (h >= r) return y;
682
+ h++;
652
683
  const C = typeof w[w.length - 1] == "object" && typeof w[w.length - 2] == "number" ? w.length - 3 : w.length - 2, A = w.slice(0, C).map((b) => String(b));
653
- return h.replace(/\$(\d{1,2})/g, (b, k) => {
684
+ return d.replace(/\$(\d{1,2})/g, (b, k) => {
654
685
  const G = parseInt(k, 10);
655
686
  return (A[G - 1] ?? "").toUpperCase();
656
687
  });
@@ -662,39 +693,39 @@ function Ln(t, n, e, r = -1) {
662
693
  };
663
694
  return S(e) ? e.map(m) : m(e);
664
695
  }
665
- function xt(t) {
696
+ function dt(t) {
666
697
  return t.replace(/<\/?[^>]+(>|$)/g, "");
667
698
  }
668
- function bn(t, n, e = !0) {
669
- const r = typeof t == "string" ? [t] : Array.from(t), s = (c) => c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = (c) => {
670
- let i = c;
699
+ function yn(t, n, e = !0) {
700
+ const r = typeof t == "string" ? [t] : Array.from(t), s = (c) => c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), i = (c) => {
701
+ let o = c;
671
702
  for (const l of r)
672
703
  if (l !== "")
673
704
  if (e)
674
- i = i.split(l).join("");
705
+ o = o.split(l).join("");
675
706
  else {
676
- const f = new RegExp(s(l), "gi");
677
- i = i.replace(f, "");
707
+ const a = new RegExp(s(l), "gi");
708
+ o = o.replace(a, "");
678
709
  }
679
- return i;
710
+ return o;
680
711
  };
681
- return typeof n == "string" ? o(n) : Array.from(n, (c) => o(String(c)));
712
+ return typeof n == "string" ? i(n) : Array.from(n, (c) => i(String(c)));
682
713
  }
683
- function Rn(t) {
714
+ function wn(t) {
684
715
  return Array.from(t).reverse().join("");
685
716
  }
686
- function Cn(t, n) {
717
+ function xn(t, n) {
687
718
  const e = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
688
719
  return n + t.replace(new RegExp(`^(?:${e})+`, "u"), "");
689
720
  }
690
- function En(t) {
721
+ function Sn(t) {
691
722
  const n = String(t).trim();
692
723
  if (n === "")
693
724
  return "";
694
725
  let e = n.split(/\s+/u);
695
- return e.length > 1 ? e = e.map((s) => D(s)) : e = At(e.join("_")).map((s) => D(s)), e.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((s) => s.length > 0).join(" ");
726
+ return e.length > 1 ? e = e.map((s) => Z(s)) : e = wt(e.join("_")).map((s) => Z(s)), e.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((s) => s.length > 0).join(" ");
696
727
  }
697
- function Fn(t) {
728
+ function $n(t) {
698
729
  if (t.trim() === "")
699
730
  return t;
700
731
  const n = /* @__PURE__ */ new Set([
@@ -733,26 +764,26 @@ function Fn(t) {
733
764
  "des",
734
765
  "par",
735
766
  "à"
736
- ]), e = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u), s = (o) => {
737
- if (!o) return o;
738
- const c = Array.from(o), i = c[0].toLocaleUpperCase(), l = c.slice(1).join("");
739
- return i + l;
767
+ ]), e = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u), s = (i) => {
768
+ if (!i) return i;
769
+ const c = Array.from(i), o = c[0].toLocaleUpperCase(), l = c.slice(1).join("");
770
+ return o + l;
740
771
  };
741
- for (let o = 0; o < r.length; o++) {
742
- const c = r[o].toLocaleLowerCase();
772
+ for (let i = 0; i < r.length; i++) {
773
+ const c = r[i].toLocaleLowerCase();
743
774
  if (c.includes("-")) {
744
- const l = c.split("-").map((f) => n.has(f) && f.length <= 3 ? f : s(f));
745
- r[o] = l.join("-");
775
+ const l = c.split("-").map((a) => n.has(a) && a.length <= 3 ? a : s(a));
776
+ r[i] = l.join("-");
746
777
  } else {
747
- const i = o > 0 ? r[o - 1] : "", l = i ? Array.from(i).slice(-1)[0] : void 0, f = o === 0 || l !== void 0 && e.has(l);
748
- n.has(c) && c.length <= 3 && !f ? r[o] = c : r[o] = s(c);
778
+ const o = i > 0 ? r[i - 1] : "", l = o ? Array.from(o).slice(-1)[0] : void 0, a = i === 0 || l !== void 0 && e.has(l);
779
+ n.has(c) && c.length <= 3 && !a ? r[i] = c : r[i] = s(c);
749
780
  }
750
781
  }
751
782
  return r.join(" ");
752
783
  }
753
- function Un(t, n = "-", e = { "@": "at" }) {
754
- const r = n, s = (a) => a.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), o = (a) => a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), c = (a) => {
755
- let u = a;
784
+ function An(t, n = "-", e = { "@": "at" }) {
785
+ const r = n, s = (f) => f.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), i = (f) => f.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), c = (f) => {
786
+ let u = f;
756
787
  const p = r === "-" ? "_" : "-";
757
788
  {
758
789
  const g = new RegExp(`[${s(p)}]+`, "gu");
@@ -760,12 +791,12 @@ function Un(t, n = "-", e = { "@": "at" }) {
760
791
  }
761
792
  if (e && typeof e == "object") {
762
793
  const g = {};
763
- for (const [h, d] of Object.entries(e))
764
- g[h] = (r ?? "") + d + (r ?? "");
765
- for (const [h, d] of Object.entries(g))
766
- h !== "" && (u = u.split(h).join(d));
794
+ for (const [d, h] of Object.entries(e))
795
+ g[d] = (r ?? "") + h + (r ?? "");
796
+ for (const [d, h] of Object.entries(g))
797
+ d !== "" && (u = u.split(d).join(h));
767
798
  }
768
- if (u = P(u), r === "")
799
+ if (u = T(u), r === "")
769
800
  return u = u.replace(/[^\p{L}\p{N}\s]+/gu, ""), u = u.replace(/[\s]+/gu, ""), u;
770
801
  {
771
802
  const g = new RegExp(
@@ -773,31 +804,31 @@ function Un(t, n = "-", e = { "@": "at" }) {
773
804
  "gu"
774
805
  );
775
806
  u = u.replace(g, "");
776
- const h = new RegExp(
807
+ const d = new RegExp(
777
808
  `[${s(r)}\\s]+`,
778
809
  "gu"
779
810
  );
780
- u = u.replace(h, r);
781
- const d = new RegExp(
782
- `^${o(r)}+|${o(r)}+$`,
811
+ u = u.replace(d, r);
812
+ const h = new RegExp(
813
+ `^${i(r)}+|${i(r)}+$`,
783
814
  "gu"
784
815
  );
785
- return u = u.replace(d, ""), u;
816
+ return u = u.replace(h, ""), u;
786
817
  }
787
- }, i = c(t), l = c(at(t));
788
- return Object.keys(e || {}).some((a) => /[A-Za-z0-9]/.test(a)) ? l : i;
818
+ }, o = c(t), l = c(ct(t));
819
+ return Object.keys(e || {}).some((f) => /[A-Za-z0-9]/.test(f)) ? l : o;
789
820
  }
790
- function St(t, n = "_") {
821
+ function ht(t, n = "_") {
791
822
  const r = `${t}|${n}`;
792
823
  if (E.has(r))
793
824
  return E.get(r);
794
825
  let s = t;
795
- return /^[a-z]+$/.test(t) || (s = kt(t).replace(/\s+/gu, ""), s = s.replace(/(.)(?=[A-Z])/g, `$1${n}`), s = P(s)), E.set(r, s), s;
826
+ return /^[a-z]+$/.test(t) || (s = xt(t).replace(/\s+/gu, ""), s = s.replace(/(.)(?=[A-Z])/g, `$1${n}`), s = T(s)), E.set(r, s), s;
796
827
  }
797
- function Nn(t) {
798
- return tt(t).replace(/[\s\u3164\u1160]+/gu, " ");
828
+ function kn(t) {
829
+ return nt(t).replace(/[\s\u3164\u1160]+/gu, " ");
799
830
  }
800
- function q(t, n) {
831
+ function D(t, n) {
801
832
  if (t == null || n == null)
802
833
  return !1;
803
834
  let e = [
@@ -808,289 +839,290 @@ function q(t, n) {
808
839
  for (const s of e) {
809
840
  if (s == null)
810
841
  continue;
811
- const o = String(s);
812
- if (o !== "" && r.startsWith(o))
842
+ const i = String(s);
843
+ if (i !== "" && r.startsWith(i))
813
844
  return !0;
814
845
  }
815
846
  return !1;
816
847
  }
817
- function zn(t, n) {
818
- return !q(t, n);
848
+ function Ln(t, n) {
849
+ return !D(t, n);
819
850
  }
820
- function B(t) {
851
+ function v(t) {
821
852
  const n = t;
822
853
  if (U.has(n))
823
854
  return U.get(n);
824
855
  const e = String(t).replace(/[-_]+/g, " "), r = e.trim() === "" ? [] : e.split(/\s+/u), s = (c) => {
825
856
  if (!c) return c;
826
- const i = Array.from(c), l = i[0].toUpperCase(), f = i.slice(1).join("");
827
- return l + f;
828
- }, o = r.map(s).join("");
829
- return U.set(n, o), o;
857
+ const o = Array.from(c), l = o[0].toUpperCase(), a = o.slice(1).join("");
858
+ return l + a;
859
+ }, i = r.map(s).join("");
860
+ return U.set(n, i), i;
830
861
  }
831
- function _n(t) {
832
- return B(t);
862
+ function bn(t) {
863
+ return v(t);
833
864
  }
834
- function On(t, n) {
865
+ function Rn(t, n) {
835
866
  if (!t || Object.keys(t).length === 0)
836
867
  return n;
837
- const e = Object.keys(t).filter((o) => o !== "");
868
+ const e = Object.keys(t).filter((i) => i !== "");
838
869
  if (e.length === 0)
839
870
  return n;
840
- e.sort((o, c) => c.length - o.length);
841
- const r = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = new RegExp(e.map(r).join("|"), "gu");
842
- return n.replace(s, (o) => t[o] ?? o);
871
+ e.sort((i, c) => c.length - i.length);
872
+ const r = (i) => i.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = new RegExp(e.map(r).join("|"), "gu");
873
+ return n.replace(s, (i) => t[i] ?? i);
843
874
  }
844
- function Mn(t, n) {
875
+ function Cn(t, n) {
845
876
  return n < 0 ? x(t, n) : x(t, 0, n);
846
877
  }
847
- function $t(t) {
848
- return P(x(t, 0, 1)) + x(t, 1);
878
+ function yt(t) {
879
+ return T(x(t, 0, 1)) + x(t, 1);
849
880
  }
850
- function Wn(t) {
851
- return nt(x(t, 0, 1)) + x(t, 1);
881
+ function En(t) {
882
+ return et(x(t, 0, 1)) + x(t, 1);
852
883
  }
853
- function At(t) {
884
+ function wt(t) {
854
885
  return t.split(new RegExp("(?=\\p{Lu})", "u")).filter(Boolean);
855
886
  }
856
- function kt(t, n = ` \r
887
+ function xt(t, n = ` \r
857
888
  \f\v`) {
858
- const e = S(n) ? n.join("") : n, r = (i) => i.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), s = e.length ? r(e) : "", o = s.length ? `(?:\\s|[${s}])` : "\\s", c = new RegExp(`(^|${o})(\\p{Ll})`, "gu");
859
- return t.replace(c, (i, l, f) => l + f.toUpperCase());
889
+ const e = S(n) ? n.join("") : n, r = (o) => o.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), s = e.length ? r(e) : "", i = s.length ? `(?:\\s|[${s}])` : "\\s", c = new RegExp(`(^|${i})(\\p{Ll})`, "gu");
890
+ return t.replace(c, (o, l, a) => l + a.toUpperCase());
860
891
  }
861
- function In(t, n = null) {
892
+ function Fn(t, n = null) {
862
893
  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);
863
894
  return s ? s.length : 0;
864
895
  }
865
- function Pn(t, n = 75, e = `
896
+ function Un(t, n = 75, e = `
866
897
  `, r = !1) {
867
898
  if (t.length === 0 || n < 1 || e === "")
868
899
  return t;
869
- const s = t.split(/\r\n|\n|\r/), o = [];
900
+ const s = t.split(/\r\n|\n|\r/), i = [];
870
901
  for (const c of s) {
871
- let i = c;
872
- if (i.length === 0) {
873
- o.push("");
902
+ let o = c;
903
+ if (o.length === 0) {
904
+ i.push("");
874
905
  continue;
875
906
  }
876
907
  if (r) {
877
- for (; i.length > 0 && !(/^\s/u.test(i) && (i = i.replace(/^\s+/u, ""), i.length === 0)); ) {
878
- if (i.length <= n) {
879
- o.push(i), i = "";
908
+ for (; o.length > 0 && !(/^\s/u.test(o) && (o = o.replace(/^\s+/u, ""), o.length === 0)); ) {
909
+ if (o.length <= n) {
910
+ i.push(o), o = "";
880
911
  break;
881
912
  }
882
- let l = i.slice(0, n);
883
- l = l.replace(/\s+$/u, ""), o.push(l), i = i.slice(n).replace(/^\s+/u, "");
913
+ let l = o.slice(0, n);
914
+ l = l.replace(/\s+$/u, ""), i.push(l), o = o.slice(n).replace(/^\s+/u, "");
884
915
  }
885
916
  continue;
886
917
  }
887
- for (; i.length > n; ) {
888
- const l = i.replace(/^\s+/u, "");
889
- if (l.length !== i.length && (i = l, i.length <= n))
918
+ for (; o.length > n; ) {
919
+ const l = o.replace(/^\s+/u, "");
920
+ if (l.length !== o.length && (o = l, o.length <= n))
890
921
  break;
891
- const f = i.slice(0, n + 1);
922
+ const a = o.slice(0, n + 1);
892
923
  let m = -1;
893
- for (let u = f.length - 1; u >= 0; u--)
894
- if (/\s/u.test(f[u])) {
924
+ for (let u = a.length - 1; u >= 0; u--)
925
+ if (/\s/u.test(a[u])) {
895
926
  m = u;
896
927
  break;
897
928
  }
898
929
  if (m > 0) {
899
- o.push(i.slice(0, m)), i = i.slice(m + 1);
930
+ i.push(o.slice(0, m)), o = o.slice(m + 1);
900
931
  continue;
901
932
  }
902
- const a = i.search(/\s/u);
903
- if (a >= 0) {
904
- o.push(i.slice(0, a)), i = i.slice(a + 1);
933
+ const f = o.search(/\s/u);
934
+ if (f >= 0) {
935
+ i.push(o.slice(0, f)), o = o.slice(f + 1);
905
936
  continue;
906
937
  }
907
- o.push(i), i = "";
938
+ i.push(o), o = "";
908
939
  break;
909
940
  }
910
- i.length > 0 && o.push(i);
941
+ o.length > 0 && i.push(o);
911
942
  }
912
- return o.join(e);
943
+ return i.join(e);
913
944
  }
914
- function H() {
915
- return $ ? $() : ft();
945
+ function B() {
946
+ return $ ? $() : P().v4();
916
947
  }
917
- function qn() {
918
- return $ ? $() : ut();
948
+ function Nn() {
949
+ return $ ? $() : P().v7();
919
950
  }
920
- function V(t = null) {
951
+ function H(t = null) {
921
952
  $ = t;
922
953
  }
923
- function Gn(t, n = null) {
954
+ function zn(t, n = null) {
924
955
  let e = 0;
925
956
  n ??= function() {
926
957
  const r = $;
927
958
  $ = null;
928
- const s = H();
959
+ const s = B();
929
960
  return $ = r, e++, s;
930
- }, V(function() {
961
+ }, H(function() {
931
962
  return e < t.length ? t[e++] : n();
932
963
  });
933
964
  }
934
- function jn(t = null) {
935
- const n = H();
936
- if (V(() => n), t !== null)
965
+ function _n(t = null) {
966
+ const n = B();
967
+ if (H(() => n), t !== null)
937
968
  try {
938
969
  t(n);
939
970
  } finally {
940
- Lt();
971
+ St();
941
972
  }
942
973
  return n;
943
974
  }
944
- function Lt() {
975
+ function St() {
945
976
  $ = null;
946
977
  }
947
- function X(t = null) {
978
+ function V(t = null) {
948
979
  if (L)
949
980
  return L();
981
+ const n = ot();
950
982
  if (t == null)
951
- return K();
952
- let n;
953
- t instanceof Date ? n = t.getTime() : n = t;
954
- const e = Date.now;
983
+ return n();
984
+ let e;
985
+ t instanceof Date ? e = t.getTime() : e = t;
986
+ const r = Date.now;
955
987
  try {
956
- return Date.now = () => n, K();
988
+ return Date.now = () => e, n();
957
989
  } finally {
958
- Date.now = e;
990
+ Date.now = r;
959
991
  }
960
992
  }
961
- function bt() {
993
+ function $t() {
962
994
  L = null;
963
995
  }
964
996
  function Q(t = null) {
965
997
  L = t;
966
998
  }
967
- function Tn(t, n = null) {
999
+ function Mn(t, n = null) {
968
1000
  let e = 0;
969
1001
  n ??= function() {
970
1002
  const r = L;
971
1003
  L = null;
972
- const s = X();
1004
+ const s = V();
973
1005
  return L = r, e++, s;
974
1006
  }, Q(function() {
975
1007
  return e < t.length ? t[e++] : n();
976
1008
  });
977
1009
  }
978
- function Dn(t = null) {
979
- const n = X();
1010
+ function On(t = null) {
1011
+ const n = V();
980
1012
  if (Q(() => n), t !== null)
981
1013
  try {
982
1014
  t(n);
983
1015
  } finally {
984
- bt();
1016
+ $t();
985
1017
  }
986
1018
  return n;
987
1019
  }
988
- function Kn() {
1020
+ function In() {
989
1021
  return E.size;
990
1022
  }
991
- function Zn() {
1023
+ function qn() {
992
1024
  return F.size;
993
1025
  }
994
- function Jn() {
1026
+ function Pn() {
995
1027
  return U.size;
996
1028
  }
997
- function Bn() {
1029
+ function Wn() {
998
1030
  E.clear(), F.clear(), U.clear();
999
1031
  }
1000
1032
  export {
1001
- Z as after,
1002
- _t as afterLast,
1003
- Fn as apa,
1004
- at as ascii,
1005
- pt as before,
1006
- gt as beforeLast,
1007
- Mt as between,
1008
- Wt as betweenFirst,
1009
- It as camel,
1010
- Zn as camelCacheSize,
1011
- Pt as charAt,
1012
- Gt as chopEnd,
1013
- qt as chopStart,
1014
- J as contains,
1015
- Tt as containsAll,
1016
- yn as createRandomStringsNormally,
1017
- dt as createRandomStringsUsing,
1018
- dn as createRandomStringsUsingSequence,
1019
- bt as createUlidsNormally,
1033
+ J as after,
1034
+ bt as afterLast,
1035
+ $n as apa,
1036
+ ct as ascii,
1037
+ lt as before,
1038
+ at as beforeLast,
1039
+ Ct as between,
1040
+ Et as betweenFirst,
1041
+ Ft as camel,
1042
+ qn as camelCacheSize,
1043
+ Ut as charAt,
1044
+ zt as chopEnd,
1045
+ Nt as chopStart,
1046
+ X as contains,
1047
+ Mt as containsAll,
1048
+ an as createRandomStringsNormally,
1049
+ pt as createRandomStringsUsing,
1050
+ ln as createRandomStringsUsingSequence,
1051
+ $t as createUlidsNormally,
1020
1052
  Q as createUlidsUsing,
1021
- Tn as createUlidsUsingSequence,
1022
- Lt as createUuidsNormally,
1023
- V as createUuidsUsing,
1024
- Gn as createUuidsUsingSequence,
1025
- Kt as deduplicate,
1026
- Dt as doesntContain,
1027
- Zt as doesntEndWith,
1028
- zn as doesntStartWith,
1029
- I as endsWith,
1030
- jt as excerpt,
1031
- Jt as finish,
1032
- Bn as flushCache,
1033
- Dn as freezeUlids,
1034
- jn as freezeUuids,
1035
- En as headline,
1036
- Vt as is,
1037
- Xt as isAscii,
1038
- Qt as isJson,
1039
- cn as isMatch,
1040
- tn as isUlid,
1041
- Yt as isUrl,
1042
- vt as isUuid,
1043
- nn as kebab,
1044
- $t as lcfirst,
1053
+ Mn as createUlidsUsingSequence,
1054
+ St as createUuidsNormally,
1055
+ H as createUuidsUsing,
1056
+ zn as createUuidsUsingSequence,
1057
+ It as deduplicate,
1058
+ Ot as doesntContain,
1059
+ qt as doesntEndWith,
1060
+ Ln as doesntStartWith,
1061
+ W as endsWith,
1062
+ _t as excerpt,
1063
+ Pt as finish,
1064
+ Wn as flushCache,
1065
+ On as freezeUlids,
1066
+ _n as freezeUuids,
1067
+ Sn as headline,
1068
+ Dt as is,
1069
+ Gt as isAscii,
1070
+ jt as isJson,
1071
+ Qt as isMatch,
1072
+ Jt as isUlid,
1073
+ Kt as isUrl,
1074
+ Zt as isUuid,
1075
+ Xt as kebab,
1076
+ yt as lcfirst,
1045
1077
  z as length,
1046
- en as limit,
1047
- P as lower,
1078
+ vt as limit,
1079
+ T as lower,
1048
1080
  _ as makePad,
1049
- sn as mask,
1050
- on as match,
1051
- ln as matchAll,
1052
- fn as numbers,
1053
- un as padBoth,
1054
- an as padLeft,
1055
- pn as padRight,
1056
- _n as pascal,
1057
- mn as password,
1058
- gn as pluralPascal,
1059
- mt as pluralStudly,
1060
- hn as position,
1061
- ht as random,
1062
- bn as remove,
1063
- wn as repeat,
1064
- $n as replace,
1065
- xn as replaceArray,
1066
- kn as replaceEnd,
1067
- yt as replaceFirst,
1068
- wt as replaceLast,
1069
- Ln as replaceMatches,
1070
- An as replaceStart,
1071
- Rn as reverse,
1072
- Un as slug,
1073
- St as snake,
1074
- Kn as snakeCacheSize,
1075
- Nn as squish,
1076
- Cn as start,
1077
- q as startsWith,
1078
- xt as stripTags,
1079
- B as studly,
1080
- Jn as studlyCacheSize,
1081
- On as swap,
1082
- Mn as take,
1083
- Sn as toStringOr,
1084
- Ot as transliterate,
1085
- Wn as ucfirst,
1086
- At as ucsplit,
1087
- kt as ucwords,
1088
- X as ulid,
1089
- Ht as unwrap,
1090
- H as uuid,
1091
- qn as uuid7,
1092
- In as wordCount,
1093
- Pn as wordWrap,
1094
- rn as words,
1095
- Bt as wrap
1081
+ Ht as mask,
1082
+ Vt as match,
1083
+ Yt as matchAll,
1084
+ tn as numbers,
1085
+ nn as padBoth,
1086
+ en as padLeft,
1087
+ rn as padRight,
1088
+ bn as pascal,
1089
+ on as password,
1090
+ sn as pluralPascal,
1091
+ ut as pluralStudly,
1092
+ cn as position,
1093
+ ft as random,
1094
+ yn as remove,
1095
+ un as repeat,
1096
+ gn as replace,
1097
+ fn as replaceArray,
1098
+ dn as replaceEnd,
1099
+ gt as replaceFirst,
1100
+ mt as replaceLast,
1101
+ hn as replaceMatches,
1102
+ mn as replaceStart,
1103
+ wn as reverse,
1104
+ An as slug,
1105
+ ht as snake,
1106
+ In as snakeCacheSize,
1107
+ kn as squish,
1108
+ xn as start,
1109
+ D as startsWith,
1110
+ dt as stripTags,
1111
+ v as studly,
1112
+ Pn as studlyCacheSize,
1113
+ Rn as swap,
1114
+ Cn as take,
1115
+ pn as toStringOr,
1116
+ Rt as transliterate,
1117
+ En as ucfirst,
1118
+ wt as ucsplit,
1119
+ xt as ucwords,
1120
+ V as ulid,
1121
+ Tt as unwrap,
1122
+ B as uuid,
1123
+ Nn as uuid7,
1124
+ Fn as wordCount,
1125
+ Un as wordWrap,
1126
+ Bt as words,
1127
+ Wt as wrap
1096
1128
  };