vee-validate 4.14.6 → 4.15.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vee-validate v4.14.6
2
+ * vee-validate v4.15.0
3
3
  * (c) 2024 Abdelrahman Awad
4
4
  * @license MIT
5
5
  */
@@ -1166,4494 +1166,6 @@ function createFieldErrors() {
1166
1166
  };
1167
1167
  }
1168
1168
 
1169
- var __create$1 = Object.create;
1170
- var __defProp$1 = Object.defineProperty;
1171
- var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
1172
- var __getOwnPropNames$1 = Object.getOwnPropertyNames;
1173
- var __getProtoOf$1 = Object.getPrototypeOf;
1174
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
1175
- var __esm$1 = (fn, res) => function __init() {
1176
- return fn && (res = (0, fn[__getOwnPropNames$1(fn)[0]])(fn = 0)), res;
1177
- };
1178
- var __commonJS$1 = (cb, mod) => function __require() {
1179
- return mod || (0, cb[__getOwnPropNames$1(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1180
- };
1181
- var __copyProps$1 = (to, from, except, desc) => {
1182
- if (from && typeof from === "object" || typeof from === "function") {
1183
- for (let key of __getOwnPropNames$1(from))
1184
- if (!__hasOwnProp$1.call(to, key) && key !== except)
1185
- __defProp$1(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc$1(from, key)) || desc.enumerable });
1186
- }
1187
- return to;
1188
- };
1189
- var __toESM$1 = (mod, isNodeMode, target2) => (target2 = mod != null ? __create$1(__getProtoOf$1(mod)) : {}, __copyProps$1(
1190
- // If the importer is in node compatibility mode or this is not an ESM
1191
- // file that has been converted to a CommonJS file using a Babel-
1192
- // compatible transform (i.e. "__esModule" has not been set), then set
1193
- // "default" to the CommonJS "module.exports" for node compatibility.
1194
- __defProp$1(target2, "default", { value: mod, enumerable: true }) ,
1195
- mod
1196
- ));
1197
-
1198
- // ../../node_modules/.pnpm/tsup@8.3.0_@microsoft+api-extractor@7.43.0_@types+node@20.16.11__@swc+core@1.5.29_jiti@2.0.0__khi6fwhekjxtif3xyxfitrs5gq/node_modules/tsup/assets/esm_shims.js
1199
- var init_esm_shims$1 = __esm$1({
1200
- "../../node_modules/.pnpm/tsup@8.3.0_@microsoft+api-extractor@7.43.0_@types+node@20.16.11__@swc+core@1.5.29_jiti@2.0.0__khi6fwhekjxtif3xyxfitrs5gq/node_modules/tsup/assets/esm_shims.js"() {
1201
- }
1202
- });
1203
-
1204
- // ../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js
1205
- var require_rfdc = __commonJS$1({
1206
- "../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js"(exports, module) {
1207
- init_esm_shims$1();
1208
- module.exports = rfdc2;
1209
- function copyBuffer(cur) {
1210
- if (cur instanceof Buffer) {
1211
- return Buffer.from(cur);
1212
- }
1213
- return new cur.constructor(cur.buffer.slice(), cur.byteOffset, cur.length);
1214
- }
1215
- function rfdc2(opts) {
1216
- opts = opts || {};
1217
- if (opts.circles) return rfdcCircles(opts);
1218
- const constructorHandlers = /* @__PURE__ */ new Map();
1219
- constructorHandlers.set(Date, (o) => new Date(o));
1220
- constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
1221
- constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
1222
- if (opts.constructorHandlers) {
1223
- for (const handler2 of opts.constructorHandlers) {
1224
- constructorHandlers.set(handler2[0], handler2[1]);
1225
- }
1226
- }
1227
- let handler = null;
1228
- return opts.proto ? cloneProto : clone;
1229
- function cloneArray(a, fn) {
1230
- const keys = Object.keys(a);
1231
- const a2 = new Array(keys.length);
1232
- for (let i = 0; i < keys.length; i++) {
1233
- const k = keys[i];
1234
- const cur = a[k];
1235
- if (typeof cur !== "object" || cur === null) {
1236
- a2[k] = cur;
1237
- } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
1238
- a2[k] = handler(cur, fn);
1239
- } else if (ArrayBuffer.isView(cur)) {
1240
- a2[k] = copyBuffer(cur);
1241
- } else {
1242
- a2[k] = fn(cur);
1243
- }
1244
- }
1245
- return a2;
1246
- }
1247
- function clone(o) {
1248
- if (typeof o !== "object" || o === null) return o;
1249
- if (Array.isArray(o)) return cloneArray(o, clone);
1250
- if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
1251
- return handler(o, clone);
1252
- }
1253
- const o2 = {};
1254
- for (const k in o) {
1255
- if (Object.hasOwnProperty.call(o, k) === false) continue;
1256
- const cur = o[k];
1257
- if (typeof cur !== "object" || cur === null) {
1258
- o2[k] = cur;
1259
- } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
1260
- o2[k] = handler(cur, clone);
1261
- } else if (ArrayBuffer.isView(cur)) {
1262
- o2[k] = copyBuffer(cur);
1263
- } else {
1264
- o2[k] = clone(cur);
1265
- }
1266
- }
1267
- return o2;
1268
- }
1269
- function cloneProto(o) {
1270
- if (typeof o !== "object" || o === null) return o;
1271
- if (Array.isArray(o)) return cloneArray(o, cloneProto);
1272
- if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
1273
- return handler(o, cloneProto);
1274
- }
1275
- const o2 = {};
1276
- for (const k in o) {
1277
- const cur = o[k];
1278
- if (typeof cur !== "object" || cur === null) {
1279
- o2[k] = cur;
1280
- } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
1281
- o2[k] = handler(cur, cloneProto);
1282
- } else if (ArrayBuffer.isView(cur)) {
1283
- o2[k] = copyBuffer(cur);
1284
- } else {
1285
- o2[k] = cloneProto(cur);
1286
- }
1287
- }
1288
- return o2;
1289
- }
1290
- }
1291
- function rfdcCircles(opts) {
1292
- const refs = [];
1293
- const refsNew = [];
1294
- const constructorHandlers = /* @__PURE__ */ new Map();
1295
- constructorHandlers.set(Date, (o) => new Date(o));
1296
- constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
1297
- constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
1298
- if (opts.constructorHandlers) {
1299
- for (const handler2 of opts.constructorHandlers) {
1300
- constructorHandlers.set(handler2[0], handler2[1]);
1301
- }
1302
- }
1303
- let handler = null;
1304
- return opts.proto ? cloneProto : clone;
1305
- function cloneArray(a, fn) {
1306
- const keys = Object.keys(a);
1307
- const a2 = new Array(keys.length);
1308
- for (let i = 0; i < keys.length; i++) {
1309
- const k = keys[i];
1310
- const cur = a[k];
1311
- if (typeof cur !== "object" || cur === null) {
1312
- a2[k] = cur;
1313
- } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
1314
- a2[k] = handler(cur, fn);
1315
- } else if (ArrayBuffer.isView(cur)) {
1316
- a2[k] = copyBuffer(cur);
1317
- } else {
1318
- const index = refs.indexOf(cur);
1319
- if (index !== -1) {
1320
- a2[k] = refsNew[index];
1321
- } else {
1322
- a2[k] = fn(cur);
1323
- }
1324
- }
1325
- }
1326
- return a2;
1327
- }
1328
- function clone(o) {
1329
- if (typeof o !== "object" || o === null) return o;
1330
- if (Array.isArray(o)) return cloneArray(o, clone);
1331
- if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
1332
- return handler(o, clone);
1333
- }
1334
- const o2 = {};
1335
- refs.push(o);
1336
- refsNew.push(o2);
1337
- for (const k in o) {
1338
- if (Object.hasOwnProperty.call(o, k) === false) continue;
1339
- const cur = o[k];
1340
- if (typeof cur !== "object" || cur === null) {
1341
- o2[k] = cur;
1342
- } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
1343
- o2[k] = handler(cur, clone);
1344
- } else if (ArrayBuffer.isView(cur)) {
1345
- o2[k] = copyBuffer(cur);
1346
- } else {
1347
- const i = refs.indexOf(cur);
1348
- if (i !== -1) {
1349
- o2[k] = refsNew[i];
1350
- } else {
1351
- o2[k] = clone(cur);
1352
- }
1353
- }
1354
- }
1355
- refs.pop();
1356
- refsNew.pop();
1357
- return o2;
1358
- }
1359
- function cloneProto(o) {
1360
- if (typeof o !== "object" || o === null) return o;
1361
- if (Array.isArray(o)) return cloneArray(o, cloneProto);
1362
- if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
1363
- return handler(o, cloneProto);
1364
- }
1365
- const o2 = {};
1366
- refs.push(o);
1367
- refsNew.push(o2);
1368
- for (const k in o) {
1369
- const cur = o[k];
1370
- if (typeof cur !== "object" || cur === null) {
1371
- o2[k] = cur;
1372
- } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
1373
- o2[k] = handler(cur, cloneProto);
1374
- } else if (ArrayBuffer.isView(cur)) {
1375
- o2[k] = copyBuffer(cur);
1376
- } else {
1377
- const i = refs.indexOf(cur);
1378
- if (i !== -1) {
1379
- o2[k] = refsNew[i];
1380
- } else {
1381
- o2[k] = cloneProto(cur);
1382
- }
1383
- }
1384
- }
1385
- refs.pop();
1386
- refsNew.pop();
1387
- return o2;
1388
- }
1389
- }
1390
- }
1391
- });
1392
-
1393
- // src/index.ts
1394
- init_esm_shims$1();
1395
-
1396
- // src/constants.ts
1397
- init_esm_shims$1();
1398
-
1399
- // src/env.ts
1400
- init_esm_shims$1();
1401
- var isBrowser = typeof navigator !== "undefined";
1402
- var target = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : {};
1403
- typeof target.chrome !== "undefined" && !!target.chrome.devtools;
1404
- isBrowser && target.self !== target.top;
1405
- var _a$1;
1406
- typeof navigator !== "undefined" && ((_a$1 = navigator.userAgent) == null ? void 0 : _a$1.toLowerCase().includes("electron"));
1407
-
1408
- // src/general.ts
1409
- init_esm_shims$1();
1410
- var import_rfdc = __toESM$1(require_rfdc());
1411
- var classifyRE = /(?:^|[-_/])(\w)/g;
1412
- function toUpper(_, c) {
1413
- return c ? c.toUpperCase() : "";
1414
- }
1415
- function classify(str) {
1416
- return str && `${str}`.replace(classifyRE, toUpper);
1417
- }
1418
- function basename(filename, ext) {
1419
- let normalizedFilename = filename.replace(/^[a-z]:/i, "").replace(/\\/g, "/");
1420
- if (normalizedFilename.endsWith(`index${ext}`)) {
1421
- normalizedFilename = normalizedFilename.replace(`/index${ext}`, ext);
1422
- }
1423
- const lastSlashIndex = normalizedFilename.lastIndexOf("/");
1424
- const baseNameWithExt = normalizedFilename.substring(lastSlashIndex + 1);
1425
- {
1426
- const extIndex = baseNameWithExt.lastIndexOf(ext);
1427
- return baseNameWithExt.substring(0, extIndex);
1428
- }
1429
- }
1430
- var deepClone = (0, import_rfdc.default)({ circles: true });
1431
-
1432
- const DEBOUNCE_DEFAULTS = {
1433
- trailing: true
1434
- };
1435
- function debounce(fn, wait = 25, options = {}) {
1436
- options = { ...DEBOUNCE_DEFAULTS, ...options };
1437
- if (!Number.isFinite(wait)) {
1438
- throw new TypeError("Expected `wait` to be a finite number");
1439
- }
1440
- let leadingValue;
1441
- let timeout;
1442
- let resolveList = [];
1443
- let currentPromise;
1444
- let trailingArgs;
1445
- const applyFn = (_this, args) => {
1446
- currentPromise = _applyPromised(fn, _this, args);
1447
- currentPromise.finally(() => {
1448
- currentPromise = null;
1449
- if (options.trailing && trailingArgs && !timeout) {
1450
- const promise = applyFn(_this, trailingArgs);
1451
- trailingArgs = null;
1452
- return promise;
1453
- }
1454
- });
1455
- return currentPromise;
1456
- };
1457
- return function(...args) {
1458
- if (currentPromise) {
1459
- if (options.trailing) {
1460
- trailingArgs = args;
1461
- }
1462
- return currentPromise;
1463
- }
1464
- return new Promise((resolve) => {
1465
- const shouldCallNow = !timeout && options.leading;
1466
- clearTimeout(timeout);
1467
- timeout = setTimeout(() => {
1468
- timeout = null;
1469
- const promise = options.leading ? leadingValue : applyFn(this, args);
1470
- for (const _resolve of resolveList) {
1471
- _resolve(promise);
1472
- }
1473
- resolveList = [];
1474
- }, wait);
1475
- if (shouldCallNow) {
1476
- leadingValue = applyFn(this, args);
1477
- resolve(leadingValue);
1478
- } else {
1479
- resolveList.push(resolve);
1480
- }
1481
- });
1482
- };
1483
- }
1484
- async function _applyPromised(fn, _this, args) {
1485
- return await fn.apply(_this, args);
1486
- }
1487
-
1488
- function flatHooks(configHooks, hooks = {}, parentName) {
1489
- for (const key in configHooks) {
1490
- const subHook = configHooks[key];
1491
- const name = parentName ? `${parentName}:${key}` : key;
1492
- if (typeof subHook === "object" && subHook !== null) {
1493
- flatHooks(subHook, hooks, name);
1494
- } else if (typeof subHook === "function") {
1495
- hooks[name] = subHook;
1496
- }
1497
- }
1498
- return hooks;
1499
- }
1500
- const defaultTask = { run: (function_) => function_() };
1501
- const _createTask = () => defaultTask;
1502
- const createTask = typeof console.createTask !== "undefined" ? console.createTask : _createTask;
1503
- function serialTaskCaller(hooks, args) {
1504
- const name = args.shift();
1505
- const task = createTask(name);
1506
- return hooks.reduce(
1507
- (promise, hookFunction) => promise.then(() => task.run(() => hookFunction(...args))),
1508
- Promise.resolve()
1509
- );
1510
- }
1511
- function parallelTaskCaller(hooks, args) {
1512
- const name = args.shift();
1513
- const task = createTask(name);
1514
- return Promise.all(hooks.map((hook) => task.run(() => hook(...args))));
1515
- }
1516
- function callEachWith(callbacks, arg0) {
1517
- for (const callback of [...callbacks]) {
1518
- callback(arg0);
1519
- }
1520
- }
1521
-
1522
- class Hookable {
1523
- constructor() {
1524
- this._hooks = {};
1525
- this._before = void 0;
1526
- this._after = void 0;
1527
- this._deprecatedMessages = void 0;
1528
- this._deprecatedHooks = {};
1529
- this.hook = this.hook.bind(this);
1530
- this.callHook = this.callHook.bind(this);
1531
- this.callHookWith = this.callHookWith.bind(this);
1532
- }
1533
- hook(name, function_, options = {}) {
1534
- if (!name || typeof function_ !== "function") {
1535
- return () => {
1536
- };
1537
- }
1538
- const originalName = name;
1539
- let dep;
1540
- while (this._deprecatedHooks[name]) {
1541
- dep = this._deprecatedHooks[name];
1542
- name = dep.to;
1543
- }
1544
- if (dep && !options.allowDeprecated) {
1545
- let message = dep.message;
1546
- if (!message) {
1547
- message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : "");
1548
- }
1549
- if (!this._deprecatedMessages) {
1550
- this._deprecatedMessages = /* @__PURE__ */ new Set();
1551
- }
1552
- if (!this._deprecatedMessages.has(message)) {
1553
- console.warn(message);
1554
- this._deprecatedMessages.add(message);
1555
- }
1556
- }
1557
- if (!function_.name) {
1558
- try {
1559
- Object.defineProperty(function_, "name", {
1560
- get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb",
1561
- configurable: true
1562
- });
1563
- } catch {
1564
- }
1565
- }
1566
- this._hooks[name] = this._hooks[name] || [];
1567
- this._hooks[name].push(function_);
1568
- return () => {
1569
- if (function_) {
1570
- this.removeHook(name, function_);
1571
- function_ = void 0;
1572
- }
1573
- };
1574
- }
1575
- hookOnce(name, function_) {
1576
- let _unreg;
1577
- let _function = (...arguments_) => {
1578
- if (typeof _unreg === "function") {
1579
- _unreg();
1580
- }
1581
- _unreg = void 0;
1582
- _function = void 0;
1583
- return function_(...arguments_);
1584
- };
1585
- _unreg = this.hook(name, _function);
1586
- return _unreg;
1587
- }
1588
- removeHook(name, function_) {
1589
- if (this._hooks[name]) {
1590
- const index = this._hooks[name].indexOf(function_);
1591
- if (index !== -1) {
1592
- this._hooks[name].splice(index, 1);
1593
- }
1594
- if (this._hooks[name].length === 0) {
1595
- delete this._hooks[name];
1596
- }
1597
- }
1598
- }
1599
- deprecateHook(name, deprecated) {
1600
- this._deprecatedHooks[name] = typeof deprecated === "string" ? { to: deprecated } : deprecated;
1601
- const _hooks = this._hooks[name] || [];
1602
- delete this._hooks[name];
1603
- for (const hook of _hooks) {
1604
- this.hook(name, hook);
1605
- }
1606
- }
1607
- deprecateHooks(deprecatedHooks) {
1608
- Object.assign(this._deprecatedHooks, deprecatedHooks);
1609
- for (const name in deprecatedHooks) {
1610
- this.deprecateHook(name, deprecatedHooks[name]);
1611
- }
1612
- }
1613
- addHooks(configHooks) {
1614
- const hooks = flatHooks(configHooks);
1615
- const removeFns = Object.keys(hooks).map(
1616
- (key) => this.hook(key, hooks[key])
1617
- );
1618
- return () => {
1619
- for (const unreg of removeFns.splice(0, removeFns.length)) {
1620
- unreg();
1621
- }
1622
- };
1623
- }
1624
- removeHooks(configHooks) {
1625
- const hooks = flatHooks(configHooks);
1626
- for (const key in hooks) {
1627
- this.removeHook(key, hooks[key]);
1628
- }
1629
- }
1630
- removeAllHooks() {
1631
- for (const key in this._hooks) {
1632
- delete this._hooks[key];
1633
- }
1634
- }
1635
- callHook(name, ...arguments_) {
1636
- arguments_.unshift(name);
1637
- return this.callHookWith(serialTaskCaller, name, ...arguments_);
1638
- }
1639
- callHookParallel(name, ...arguments_) {
1640
- arguments_.unshift(name);
1641
- return this.callHookWith(parallelTaskCaller, name, ...arguments_);
1642
- }
1643
- callHookWith(caller, name, ...arguments_) {
1644
- const event = this._before || this._after ? { name, args: arguments_, context: {} } : void 0;
1645
- if (this._before) {
1646
- callEachWith(this._before, event);
1647
- }
1648
- const result = caller(
1649
- name in this._hooks ? [...this._hooks[name]] : [],
1650
- arguments_
1651
- );
1652
- if (result instanceof Promise) {
1653
- return result.finally(() => {
1654
- if (this._after && event) {
1655
- callEachWith(this._after, event);
1656
- }
1657
- });
1658
- }
1659
- if (this._after && event) {
1660
- callEachWith(this._after, event);
1661
- }
1662
- return result;
1663
- }
1664
- beforeEach(function_) {
1665
- this._before = this._before || [];
1666
- this._before.push(function_);
1667
- return () => {
1668
- if (this._before !== void 0) {
1669
- const index = this._before.indexOf(function_);
1670
- if (index !== -1) {
1671
- this._before.splice(index, 1);
1672
- }
1673
- }
1674
- };
1675
- }
1676
- afterEach(function_) {
1677
- this._after = this._after || [];
1678
- this._after.push(function_);
1679
- return () => {
1680
- if (this._after !== void 0) {
1681
- const index = this._after.indexOf(function_);
1682
- if (index !== -1) {
1683
- this._after.splice(index, 1);
1684
- }
1685
- }
1686
- };
1687
- }
1688
- }
1689
- function createHooks() {
1690
- return new Hookable();
1691
- }
1692
-
1693
- var __create = Object.create;
1694
- var __defProp = Object.defineProperty;
1695
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1696
- var __getOwnPropNames = Object.getOwnPropertyNames;
1697
- var __getProtoOf = Object.getPrototypeOf;
1698
- var __hasOwnProp = Object.prototype.hasOwnProperty;
1699
- var __esm = (fn, res) => function __init() {
1700
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
1701
- };
1702
- var __commonJS = (cb, mod) => function __require() {
1703
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1704
- };
1705
- var __copyProps = (to, from, except, desc) => {
1706
- if (from && typeof from === "object" || typeof from === "function") {
1707
- for (let key of __getOwnPropNames(from))
1708
- if (!__hasOwnProp.call(to, key) && key !== except)
1709
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
1710
- }
1711
- return to;
1712
- };
1713
- var __toESM = (mod, isNodeMode, target22) => (target22 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
1714
- // If the importer is in node compatibility mode or this is not an ESM
1715
- // file that has been converted to a CommonJS file using a Babel-
1716
- // compatible transform (i.e. "__esModule" has not been set), then set
1717
- // "default" to the CommonJS "module.exports" for node compatibility.
1718
- __defProp(target22, "default", { value: mod, enumerable: true }) ,
1719
- mod
1720
- ));
1721
-
1722
- // ../../node_modules/.pnpm/tsup@8.3.0_@microsoft+api-extractor@7.43.0_@types+node@20.16.11__@swc+core@1.5.29_jiti@2.0.0__khi6fwhekjxtif3xyxfitrs5gq/node_modules/tsup/assets/esm_shims.js
1723
- var init_esm_shims = __esm({
1724
- "../../node_modules/.pnpm/tsup@8.3.0_@microsoft+api-extractor@7.43.0_@types+node@20.16.11__@swc+core@1.5.29_jiti@2.0.0__khi6fwhekjxtif3xyxfitrs5gq/node_modules/tsup/assets/esm_shims.js"() {
1725
- }
1726
- });
1727
-
1728
- // ../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js
1729
- var require_speakingurl = __commonJS({
1730
- "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js"(exports, module) {
1731
- init_esm_shims();
1732
- (function(root) {
1733
- var charMap = {
1734
- // latin
1735
- "\xC0": "A",
1736
- "\xC1": "A",
1737
- "\xC2": "A",
1738
- "\xC3": "A",
1739
- "\xC4": "Ae",
1740
- "\xC5": "A",
1741
- "\xC6": "AE",
1742
- "\xC7": "C",
1743
- "\xC8": "E",
1744
- "\xC9": "E",
1745
- "\xCA": "E",
1746
- "\xCB": "E",
1747
- "\xCC": "I",
1748
- "\xCD": "I",
1749
- "\xCE": "I",
1750
- "\xCF": "I",
1751
- "\xD0": "D",
1752
- "\xD1": "N",
1753
- "\xD2": "O",
1754
- "\xD3": "O",
1755
- "\xD4": "O",
1756
- "\xD5": "O",
1757
- "\xD6": "Oe",
1758
- "\u0150": "O",
1759
- "\xD8": "O",
1760
- "\xD9": "U",
1761
- "\xDA": "U",
1762
- "\xDB": "U",
1763
- "\xDC": "Ue",
1764
- "\u0170": "U",
1765
- "\xDD": "Y",
1766
- "\xDE": "TH",
1767
- "\xDF": "ss",
1768
- "\xE0": "a",
1769
- "\xE1": "a",
1770
- "\xE2": "a",
1771
- "\xE3": "a",
1772
- "\xE4": "ae",
1773
- "\xE5": "a",
1774
- "\xE6": "ae",
1775
- "\xE7": "c",
1776
- "\xE8": "e",
1777
- "\xE9": "e",
1778
- "\xEA": "e",
1779
- "\xEB": "e",
1780
- "\xEC": "i",
1781
- "\xED": "i",
1782
- "\xEE": "i",
1783
- "\xEF": "i",
1784
- "\xF0": "d",
1785
- "\xF1": "n",
1786
- "\xF2": "o",
1787
- "\xF3": "o",
1788
- "\xF4": "o",
1789
- "\xF5": "o",
1790
- "\xF6": "oe",
1791
- "\u0151": "o",
1792
- "\xF8": "o",
1793
- "\xF9": "u",
1794
- "\xFA": "u",
1795
- "\xFB": "u",
1796
- "\xFC": "ue",
1797
- "\u0171": "u",
1798
- "\xFD": "y",
1799
- "\xFE": "th",
1800
- "\xFF": "y",
1801
- "\u1E9E": "SS",
1802
- // language specific
1803
- // Arabic
1804
- "\u0627": "a",
1805
- "\u0623": "a",
1806
- "\u0625": "i",
1807
- "\u0622": "aa",
1808
- "\u0624": "u",
1809
- "\u0626": "e",
1810
- "\u0621": "a",
1811
- "\u0628": "b",
1812
- "\u062A": "t",
1813
- "\u062B": "th",
1814
- "\u062C": "j",
1815
- "\u062D": "h",
1816
- "\u062E": "kh",
1817
- "\u062F": "d",
1818
- "\u0630": "th",
1819
- "\u0631": "r",
1820
- "\u0632": "z",
1821
- "\u0633": "s",
1822
- "\u0634": "sh",
1823
- "\u0635": "s",
1824
- "\u0636": "dh",
1825
- "\u0637": "t",
1826
- "\u0638": "z",
1827
- "\u0639": "a",
1828
- "\u063A": "gh",
1829
- "\u0641": "f",
1830
- "\u0642": "q",
1831
- "\u0643": "k",
1832
- "\u0644": "l",
1833
- "\u0645": "m",
1834
- "\u0646": "n",
1835
- "\u0647": "h",
1836
- "\u0648": "w",
1837
- "\u064A": "y",
1838
- "\u0649": "a",
1839
- "\u0629": "h",
1840
- "\uFEFB": "la",
1841
- "\uFEF7": "laa",
1842
- "\uFEF9": "lai",
1843
- "\uFEF5": "laa",
1844
- // Persian additional characters than Arabic
1845
- "\u06AF": "g",
1846
- "\u0686": "ch",
1847
- "\u067E": "p",
1848
- "\u0698": "zh",
1849
- "\u06A9": "k",
1850
- "\u06CC": "y",
1851
- // Arabic diactrics
1852
- "\u064E": "a",
1853
- "\u064B": "an",
1854
- "\u0650": "e",
1855
- "\u064D": "en",
1856
- "\u064F": "u",
1857
- "\u064C": "on",
1858
- "\u0652": "",
1859
- // Arabic numbers
1860
- "\u0660": "0",
1861
- "\u0661": "1",
1862
- "\u0662": "2",
1863
- "\u0663": "3",
1864
- "\u0664": "4",
1865
- "\u0665": "5",
1866
- "\u0666": "6",
1867
- "\u0667": "7",
1868
- "\u0668": "8",
1869
- "\u0669": "9",
1870
- // Persian numbers
1871
- "\u06F0": "0",
1872
- "\u06F1": "1",
1873
- "\u06F2": "2",
1874
- "\u06F3": "3",
1875
- "\u06F4": "4",
1876
- "\u06F5": "5",
1877
- "\u06F6": "6",
1878
- "\u06F7": "7",
1879
- "\u06F8": "8",
1880
- "\u06F9": "9",
1881
- // Burmese consonants
1882
- "\u1000": "k",
1883
- "\u1001": "kh",
1884
- "\u1002": "g",
1885
- "\u1003": "ga",
1886
- "\u1004": "ng",
1887
- "\u1005": "s",
1888
- "\u1006": "sa",
1889
- "\u1007": "z",
1890
- "\u1005\u103B": "za",
1891
- "\u100A": "ny",
1892
- "\u100B": "t",
1893
- "\u100C": "ta",
1894
- "\u100D": "d",
1895
- "\u100E": "da",
1896
- "\u100F": "na",
1897
- "\u1010": "t",
1898
- "\u1011": "ta",
1899
- "\u1012": "d",
1900
- "\u1013": "da",
1901
- "\u1014": "n",
1902
- "\u1015": "p",
1903
- "\u1016": "pa",
1904
- "\u1017": "b",
1905
- "\u1018": "ba",
1906
- "\u1019": "m",
1907
- "\u101A": "y",
1908
- "\u101B": "ya",
1909
- "\u101C": "l",
1910
- "\u101D": "w",
1911
- "\u101E": "th",
1912
- "\u101F": "h",
1913
- "\u1020": "la",
1914
- "\u1021": "a",
1915
- // consonant character combos
1916
- "\u103C": "y",
1917
- "\u103B": "ya",
1918
- "\u103D": "w",
1919
- "\u103C\u103D": "yw",
1920
- "\u103B\u103D": "ywa",
1921
- "\u103E": "h",
1922
- // independent vowels
1923
- "\u1027": "e",
1924
- "\u104F": "-e",
1925
- "\u1023": "i",
1926
- "\u1024": "-i",
1927
- "\u1009": "u",
1928
- "\u1026": "-u",
1929
- "\u1029": "aw",
1930
- "\u101E\u103C\u1031\u102C": "aw",
1931
- "\u102A": "aw",
1932
- // numbers
1933
- "\u1040": "0",
1934
- "\u1041": "1",
1935
- "\u1042": "2",
1936
- "\u1043": "3",
1937
- "\u1044": "4",
1938
- "\u1045": "5",
1939
- "\u1046": "6",
1940
- "\u1047": "7",
1941
- "\u1048": "8",
1942
- "\u1049": "9",
1943
- // virama and tone marks which are silent in transliteration
1944
- "\u1039": "",
1945
- "\u1037": "",
1946
- "\u1038": "",
1947
- // Czech
1948
- "\u010D": "c",
1949
- "\u010F": "d",
1950
- "\u011B": "e",
1951
- "\u0148": "n",
1952
- "\u0159": "r",
1953
- "\u0161": "s",
1954
- "\u0165": "t",
1955
- "\u016F": "u",
1956
- "\u017E": "z",
1957
- "\u010C": "C",
1958
- "\u010E": "D",
1959
- "\u011A": "E",
1960
- "\u0147": "N",
1961
- "\u0158": "R",
1962
- "\u0160": "S",
1963
- "\u0164": "T",
1964
- "\u016E": "U",
1965
- "\u017D": "Z",
1966
- // Dhivehi
1967
- "\u0780": "h",
1968
- "\u0781": "sh",
1969
- "\u0782": "n",
1970
- "\u0783": "r",
1971
- "\u0784": "b",
1972
- "\u0785": "lh",
1973
- "\u0786": "k",
1974
- "\u0787": "a",
1975
- "\u0788": "v",
1976
- "\u0789": "m",
1977
- "\u078A": "f",
1978
- "\u078B": "dh",
1979
- "\u078C": "th",
1980
- "\u078D": "l",
1981
- "\u078E": "g",
1982
- "\u078F": "gn",
1983
- "\u0790": "s",
1984
- "\u0791": "d",
1985
- "\u0792": "z",
1986
- "\u0793": "t",
1987
- "\u0794": "y",
1988
- "\u0795": "p",
1989
- "\u0796": "j",
1990
- "\u0797": "ch",
1991
- "\u0798": "tt",
1992
- "\u0799": "hh",
1993
- "\u079A": "kh",
1994
- "\u079B": "th",
1995
- "\u079C": "z",
1996
- "\u079D": "sh",
1997
- "\u079E": "s",
1998
- "\u079F": "d",
1999
- "\u07A0": "t",
2000
- "\u07A1": "z",
2001
- "\u07A2": "a",
2002
- "\u07A3": "gh",
2003
- "\u07A4": "q",
2004
- "\u07A5": "w",
2005
- "\u07A6": "a",
2006
- "\u07A7": "aa",
2007
- "\u07A8": "i",
2008
- "\u07A9": "ee",
2009
- "\u07AA": "u",
2010
- "\u07AB": "oo",
2011
- "\u07AC": "e",
2012
- "\u07AD": "ey",
2013
- "\u07AE": "o",
2014
- "\u07AF": "oa",
2015
- "\u07B0": "",
2016
- // Georgian https://en.wikipedia.org/wiki/Romanization_of_Georgian
2017
- // National system (2002)
2018
- "\u10D0": "a",
2019
- "\u10D1": "b",
2020
- "\u10D2": "g",
2021
- "\u10D3": "d",
2022
- "\u10D4": "e",
2023
- "\u10D5": "v",
2024
- "\u10D6": "z",
2025
- "\u10D7": "t",
2026
- "\u10D8": "i",
2027
- "\u10D9": "k",
2028
- "\u10DA": "l",
2029
- "\u10DB": "m",
2030
- "\u10DC": "n",
2031
- "\u10DD": "o",
2032
- "\u10DE": "p",
2033
- "\u10DF": "zh",
2034
- "\u10E0": "r",
2035
- "\u10E1": "s",
2036
- "\u10E2": "t",
2037
- "\u10E3": "u",
2038
- "\u10E4": "p",
2039
- "\u10E5": "k",
2040
- "\u10E6": "gh",
2041
- "\u10E7": "q",
2042
- "\u10E8": "sh",
2043
- "\u10E9": "ch",
2044
- "\u10EA": "ts",
2045
- "\u10EB": "dz",
2046
- "\u10EC": "ts",
2047
- "\u10ED": "ch",
2048
- "\u10EE": "kh",
2049
- "\u10EF": "j",
2050
- "\u10F0": "h",
2051
- // Greek
2052
- "\u03B1": "a",
2053
- "\u03B2": "v",
2054
- "\u03B3": "g",
2055
- "\u03B4": "d",
2056
- "\u03B5": "e",
2057
- "\u03B6": "z",
2058
- "\u03B7": "i",
2059
- "\u03B8": "th",
2060
- "\u03B9": "i",
2061
- "\u03BA": "k",
2062
- "\u03BB": "l",
2063
- "\u03BC": "m",
2064
- "\u03BD": "n",
2065
- "\u03BE": "ks",
2066
- "\u03BF": "o",
2067
- "\u03C0": "p",
2068
- "\u03C1": "r",
2069
- "\u03C3": "s",
2070
- "\u03C4": "t",
2071
- "\u03C5": "y",
2072
- "\u03C6": "f",
2073
- "\u03C7": "x",
2074
- "\u03C8": "ps",
2075
- "\u03C9": "o",
2076
- "\u03AC": "a",
2077
- "\u03AD": "e",
2078
- "\u03AF": "i",
2079
- "\u03CC": "o",
2080
- "\u03CD": "y",
2081
- "\u03AE": "i",
2082
- "\u03CE": "o",
2083
- "\u03C2": "s",
2084
- "\u03CA": "i",
2085
- "\u03B0": "y",
2086
- "\u03CB": "y",
2087
- "\u0390": "i",
2088
- "\u0391": "A",
2089
- "\u0392": "B",
2090
- "\u0393": "G",
2091
- "\u0394": "D",
2092
- "\u0395": "E",
2093
- "\u0396": "Z",
2094
- "\u0397": "I",
2095
- "\u0398": "TH",
2096
- "\u0399": "I",
2097
- "\u039A": "K",
2098
- "\u039B": "L",
2099
- "\u039C": "M",
2100
- "\u039D": "N",
2101
- "\u039E": "KS",
2102
- "\u039F": "O",
2103
- "\u03A0": "P",
2104
- "\u03A1": "R",
2105
- "\u03A3": "S",
2106
- "\u03A4": "T",
2107
- "\u03A5": "Y",
2108
- "\u03A6": "F",
2109
- "\u03A7": "X",
2110
- "\u03A8": "PS",
2111
- "\u03A9": "O",
2112
- "\u0386": "A",
2113
- "\u0388": "E",
2114
- "\u038A": "I",
2115
- "\u038C": "O",
2116
- "\u038E": "Y",
2117
- "\u0389": "I",
2118
- "\u038F": "O",
2119
- "\u03AA": "I",
2120
- "\u03AB": "Y",
2121
- // Latvian
2122
- "\u0101": "a",
2123
- // 'č': 'c', // duplicate
2124
- "\u0113": "e",
2125
- "\u0123": "g",
2126
- "\u012B": "i",
2127
- "\u0137": "k",
2128
- "\u013C": "l",
2129
- "\u0146": "n",
2130
- // 'š': 's', // duplicate
2131
- "\u016B": "u",
2132
- // 'ž': 'z', // duplicate
2133
- "\u0100": "A",
2134
- // 'Č': 'C', // duplicate
2135
- "\u0112": "E",
2136
- "\u0122": "G",
2137
- "\u012A": "I",
2138
- "\u0136": "k",
2139
- "\u013B": "L",
2140
- "\u0145": "N",
2141
- // 'Š': 'S', // duplicate
2142
- "\u016A": "U",
2143
- // 'Ž': 'Z', // duplicate
2144
- // Macedonian
2145
- "\u040C": "Kj",
2146
- "\u045C": "kj",
2147
- "\u0409": "Lj",
2148
- "\u0459": "lj",
2149
- "\u040A": "Nj",
2150
- "\u045A": "nj",
2151
- "\u0422\u0441": "Ts",
2152
- "\u0442\u0441": "ts",
2153
- // Polish
2154
- "\u0105": "a",
2155
- "\u0107": "c",
2156
- "\u0119": "e",
2157
- "\u0142": "l",
2158
- "\u0144": "n",
2159
- // 'ó': 'o', // duplicate
2160
- "\u015B": "s",
2161
- "\u017A": "z",
2162
- "\u017C": "z",
2163
- "\u0104": "A",
2164
- "\u0106": "C",
2165
- "\u0118": "E",
2166
- "\u0141": "L",
2167
- "\u0143": "N",
2168
- "\u015A": "S",
2169
- "\u0179": "Z",
2170
- "\u017B": "Z",
2171
- // Ukranian
2172
- "\u0404": "Ye",
2173
- "\u0406": "I",
2174
- "\u0407": "Yi",
2175
- "\u0490": "G",
2176
- "\u0454": "ye",
2177
- "\u0456": "i",
2178
- "\u0457": "yi",
2179
- "\u0491": "g",
2180
- // Romanian
2181
- "\u0103": "a",
2182
- "\u0102": "A",
2183
- "\u0219": "s",
2184
- "\u0218": "S",
2185
- // 'ş': 's', // duplicate
2186
- // 'Ş': 'S', // duplicate
2187
- "\u021B": "t",
2188
- "\u021A": "T",
2189
- "\u0163": "t",
2190
- "\u0162": "T",
2191
- // Russian https://en.wikipedia.org/wiki/Romanization_of_Russian
2192
- // ICAO
2193
- "\u0430": "a",
2194
- "\u0431": "b",
2195
- "\u0432": "v",
2196
- "\u0433": "g",
2197
- "\u0434": "d",
2198
- "\u0435": "e",
2199
- "\u0451": "yo",
2200
- "\u0436": "zh",
2201
- "\u0437": "z",
2202
- "\u0438": "i",
2203
- "\u0439": "i",
2204
- "\u043A": "k",
2205
- "\u043B": "l",
2206
- "\u043C": "m",
2207
- "\u043D": "n",
2208
- "\u043E": "o",
2209
- "\u043F": "p",
2210
- "\u0440": "r",
2211
- "\u0441": "s",
2212
- "\u0442": "t",
2213
- "\u0443": "u",
2214
- "\u0444": "f",
2215
- "\u0445": "kh",
2216
- "\u0446": "c",
2217
- "\u0447": "ch",
2218
- "\u0448": "sh",
2219
- "\u0449": "sh",
2220
- "\u044A": "",
2221
- "\u044B": "y",
2222
- "\u044C": "",
2223
- "\u044D": "e",
2224
- "\u044E": "yu",
2225
- "\u044F": "ya",
2226
- "\u0410": "A",
2227
- "\u0411": "B",
2228
- "\u0412": "V",
2229
- "\u0413": "G",
2230
- "\u0414": "D",
2231
- "\u0415": "E",
2232
- "\u0401": "Yo",
2233
- "\u0416": "Zh",
2234
- "\u0417": "Z",
2235
- "\u0418": "I",
2236
- "\u0419": "I",
2237
- "\u041A": "K",
2238
- "\u041B": "L",
2239
- "\u041C": "M",
2240
- "\u041D": "N",
2241
- "\u041E": "O",
2242
- "\u041F": "P",
2243
- "\u0420": "R",
2244
- "\u0421": "S",
2245
- "\u0422": "T",
2246
- "\u0423": "U",
2247
- "\u0424": "F",
2248
- "\u0425": "Kh",
2249
- "\u0426": "C",
2250
- "\u0427": "Ch",
2251
- "\u0428": "Sh",
2252
- "\u0429": "Sh",
2253
- "\u042A": "",
2254
- "\u042B": "Y",
2255
- "\u042C": "",
2256
- "\u042D": "E",
2257
- "\u042E": "Yu",
2258
- "\u042F": "Ya",
2259
- // Serbian
2260
- "\u0452": "dj",
2261
- "\u0458": "j",
2262
- // 'љ': 'lj', // duplicate
2263
- // 'њ': 'nj', // duplicate
2264
- "\u045B": "c",
2265
- "\u045F": "dz",
2266
- "\u0402": "Dj",
2267
- "\u0408": "j",
2268
- // 'Љ': 'Lj', // duplicate
2269
- // 'Њ': 'Nj', // duplicate
2270
- "\u040B": "C",
2271
- "\u040F": "Dz",
2272
- // Slovak
2273
- "\u013E": "l",
2274
- "\u013A": "l",
2275
- "\u0155": "r",
2276
- "\u013D": "L",
2277
- "\u0139": "L",
2278
- "\u0154": "R",
2279
- // Turkish
2280
- "\u015F": "s",
2281
- "\u015E": "S",
2282
- "\u0131": "i",
2283
- "\u0130": "I",
2284
- // 'ç': 'c', // duplicate
2285
- // 'Ç': 'C', // duplicate
2286
- // 'ü': 'u', // duplicate, see langCharMap
2287
- // 'Ü': 'U', // duplicate, see langCharMap
2288
- // 'ö': 'o', // duplicate, see langCharMap
2289
- // 'Ö': 'O', // duplicate, see langCharMap
2290
- "\u011F": "g",
2291
- "\u011E": "G",
2292
- // Vietnamese
2293
- "\u1EA3": "a",
2294
- "\u1EA2": "A",
2295
- "\u1EB3": "a",
2296
- "\u1EB2": "A",
2297
- "\u1EA9": "a",
2298
- "\u1EA8": "A",
2299
- "\u0111": "d",
2300
- "\u0110": "D",
2301
- "\u1EB9": "e",
2302
- "\u1EB8": "E",
2303
- "\u1EBD": "e",
2304
- "\u1EBC": "E",
2305
- "\u1EBB": "e",
2306
- "\u1EBA": "E",
2307
- "\u1EBF": "e",
2308
- "\u1EBE": "E",
2309
- "\u1EC1": "e",
2310
- "\u1EC0": "E",
2311
- "\u1EC7": "e",
2312
- "\u1EC6": "E",
2313
- "\u1EC5": "e",
2314
- "\u1EC4": "E",
2315
- "\u1EC3": "e",
2316
- "\u1EC2": "E",
2317
- "\u1ECF": "o",
2318
- "\u1ECD": "o",
2319
- "\u1ECC": "o",
2320
- "\u1ED1": "o",
2321
- "\u1ED0": "O",
2322
- "\u1ED3": "o",
2323
- "\u1ED2": "O",
2324
- "\u1ED5": "o",
2325
- "\u1ED4": "O",
2326
- "\u1ED9": "o",
2327
- "\u1ED8": "O",
2328
- "\u1ED7": "o",
2329
- "\u1ED6": "O",
2330
- "\u01A1": "o",
2331
- "\u01A0": "O",
2332
- "\u1EDB": "o",
2333
- "\u1EDA": "O",
2334
- "\u1EDD": "o",
2335
- "\u1EDC": "O",
2336
- "\u1EE3": "o",
2337
- "\u1EE2": "O",
2338
- "\u1EE1": "o",
2339
- "\u1EE0": "O",
2340
- "\u1EDE": "o",
2341
- "\u1EDF": "o",
2342
- "\u1ECB": "i",
2343
- "\u1ECA": "I",
2344
- "\u0129": "i",
2345
- "\u0128": "I",
2346
- "\u1EC9": "i",
2347
- "\u1EC8": "i",
2348
- "\u1EE7": "u",
2349
- "\u1EE6": "U",
2350
- "\u1EE5": "u",
2351
- "\u1EE4": "U",
2352
- "\u0169": "u",
2353
- "\u0168": "U",
2354
- "\u01B0": "u",
2355
- "\u01AF": "U",
2356
- "\u1EE9": "u",
2357
- "\u1EE8": "U",
2358
- "\u1EEB": "u",
2359
- "\u1EEA": "U",
2360
- "\u1EF1": "u",
2361
- "\u1EF0": "U",
2362
- "\u1EEF": "u",
2363
- "\u1EEE": "U",
2364
- "\u1EED": "u",
2365
- "\u1EEC": "\u01B0",
2366
- "\u1EF7": "y",
2367
- "\u1EF6": "y",
2368
- "\u1EF3": "y",
2369
- "\u1EF2": "Y",
2370
- "\u1EF5": "y",
2371
- "\u1EF4": "Y",
2372
- "\u1EF9": "y",
2373
- "\u1EF8": "Y",
2374
- "\u1EA1": "a",
2375
- "\u1EA0": "A",
2376
- "\u1EA5": "a",
2377
- "\u1EA4": "A",
2378
- "\u1EA7": "a",
2379
- "\u1EA6": "A",
2380
- "\u1EAD": "a",
2381
- "\u1EAC": "A",
2382
- "\u1EAB": "a",
2383
- "\u1EAA": "A",
2384
- // 'ă': 'a', // duplicate
2385
- // 'Ă': 'A', // duplicate
2386
- "\u1EAF": "a",
2387
- "\u1EAE": "A",
2388
- "\u1EB1": "a",
2389
- "\u1EB0": "A",
2390
- "\u1EB7": "a",
2391
- "\u1EB6": "A",
2392
- "\u1EB5": "a",
2393
- "\u1EB4": "A",
2394
- "\u24EA": "0",
2395
- "\u2460": "1",
2396
- "\u2461": "2",
2397
- "\u2462": "3",
2398
- "\u2463": "4",
2399
- "\u2464": "5",
2400
- "\u2465": "6",
2401
- "\u2466": "7",
2402
- "\u2467": "8",
2403
- "\u2468": "9",
2404
- "\u2469": "10",
2405
- "\u246A": "11",
2406
- "\u246B": "12",
2407
- "\u246C": "13",
2408
- "\u246D": "14",
2409
- "\u246E": "15",
2410
- "\u246F": "16",
2411
- "\u2470": "17",
2412
- "\u2471": "18",
2413
- "\u2472": "18",
2414
- "\u2473": "18",
2415
- "\u24F5": "1",
2416
- "\u24F6": "2",
2417
- "\u24F7": "3",
2418
- "\u24F8": "4",
2419
- "\u24F9": "5",
2420
- "\u24FA": "6",
2421
- "\u24FB": "7",
2422
- "\u24FC": "8",
2423
- "\u24FD": "9",
2424
- "\u24FE": "10",
2425
- "\u24FF": "0",
2426
- "\u24EB": "11",
2427
- "\u24EC": "12",
2428
- "\u24ED": "13",
2429
- "\u24EE": "14",
2430
- "\u24EF": "15",
2431
- "\u24F0": "16",
2432
- "\u24F1": "17",
2433
- "\u24F2": "18",
2434
- "\u24F3": "19",
2435
- "\u24F4": "20",
2436
- "\u24B6": "A",
2437
- "\u24B7": "B",
2438
- "\u24B8": "C",
2439
- "\u24B9": "D",
2440
- "\u24BA": "E",
2441
- "\u24BB": "F",
2442
- "\u24BC": "G",
2443
- "\u24BD": "H",
2444
- "\u24BE": "I",
2445
- "\u24BF": "J",
2446
- "\u24C0": "K",
2447
- "\u24C1": "L",
2448
- "\u24C2": "M",
2449
- "\u24C3": "N",
2450
- "\u24C4": "O",
2451
- "\u24C5": "P",
2452
- "\u24C6": "Q",
2453
- "\u24C7": "R",
2454
- "\u24C8": "S",
2455
- "\u24C9": "T",
2456
- "\u24CA": "U",
2457
- "\u24CB": "V",
2458
- "\u24CC": "W",
2459
- "\u24CD": "X",
2460
- "\u24CE": "Y",
2461
- "\u24CF": "Z",
2462
- "\u24D0": "a",
2463
- "\u24D1": "b",
2464
- "\u24D2": "c",
2465
- "\u24D3": "d",
2466
- "\u24D4": "e",
2467
- "\u24D5": "f",
2468
- "\u24D6": "g",
2469
- "\u24D7": "h",
2470
- "\u24D8": "i",
2471
- "\u24D9": "j",
2472
- "\u24DA": "k",
2473
- "\u24DB": "l",
2474
- "\u24DC": "m",
2475
- "\u24DD": "n",
2476
- "\u24DE": "o",
2477
- "\u24DF": "p",
2478
- "\u24E0": "q",
2479
- "\u24E1": "r",
2480
- "\u24E2": "s",
2481
- "\u24E3": "t",
2482
- "\u24E4": "u",
2483
- "\u24E6": "v",
2484
- "\u24E5": "w",
2485
- "\u24E7": "x",
2486
- "\u24E8": "y",
2487
- "\u24E9": "z",
2488
- // symbols
2489
- "\u201C": '"',
2490
- "\u201D": '"',
2491
- "\u2018": "'",
2492
- "\u2019": "'",
2493
- "\u2202": "d",
2494
- "\u0192": "f",
2495
- "\u2122": "(TM)",
2496
- "\xA9": "(C)",
2497
- "\u0153": "oe",
2498
- "\u0152": "OE",
2499
- "\xAE": "(R)",
2500
- "\u2020": "+",
2501
- "\u2120": "(SM)",
2502
- "\u2026": "...",
2503
- "\u02DA": "o",
2504
- "\xBA": "o",
2505
- "\xAA": "a",
2506
- "\u2022": "*",
2507
- "\u104A": ",",
2508
- "\u104B": ".",
2509
- // currency
2510
- "$": "USD",
2511
- "\u20AC": "EUR",
2512
- "\u20A2": "BRN",
2513
- "\u20A3": "FRF",
2514
- "\xA3": "GBP",
2515
- "\u20A4": "ITL",
2516
- "\u20A6": "NGN",
2517
- "\u20A7": "ESP",
2518
- "\u20A9": "KRW",
2519
- "\u20AA": "ILS",
2520
- "\u20AB": "VND",
2521
- "\u20AD": "LAK",
2522
- "\u20AE": "MNT",
2523
- "\u20AF": "GRD",
2524
- "\u20B1": "ARS",
2525
- "\u20B2": "PYG",
2526
- "\u20B3": "ARA",
2527
- "\u20B4": "UAH",
2528
- "\u20B5": "GHS",
2529
- "\xA2": "cent",
2530
- "\xA5": "CNY",
2531
- "\u5143": "CNY",
2532
- "\u5186": "YEN",
2533
- "\uFDFC": "IRR",
2534
- "\u20A0": "EWE",
2535
- "\u0E3F": "THB",
2536
- "\u20A8": "INR",
2537
- "\u20B9": "INR",
2538
- "\u20B0": "PF",
2539
- "\u20BA": "TRY",
2540
- "\u060B": "AFN",
2541
- "\u20BC": "AZN",
2542
- "\u043B\u0432": "BGN",
2543
- "\u17DB": "KHR",
2544
- "\u20A1": "CRC",
2545
- "\u20B8": "KZT",
2546
- "\u0434\u0435\u043D": "MKD",
2547
- "z\u0142": "PLN",
2548
- "\u20BD": "RUB",
2549
- "\u20BE": "GEL"
2550
- };
2551
- var lookAheadCharArray = [
2552
- // burmese
2553
- "\u103A",
2554
- // Dhivehi
2555
- "\u07B0"
2556
- ];
2557
- var diatricMap = {
2558
- // Burmese
2559
- // dependent vowels
2560
- "\u102C": "a",
2561
- "\u102B": "a",
2562
- "\u1031": "e",
2563
- "\u1032": "e",
2564
- "\u102D": "i",
2565
- "\u102E": "i",
2566
- "\u102D\u102F": "o",
2567
- "\u102F": "u",
2568
- "\u1030": "u",
2569
- "\u1031\u102B\u1004\u103A": "aung",
2570
- "\u1031\u102C": "aw",
2571
- "\u1031\u102C\u103A": "aw",
2572
- "\u1031\u102B": "aw",
2573
- "\u1031\u102B\u103A": "aw",
2574
- "\u103A": "\u103A",
2575
- // this is special case but the character will be converted to latin in the code
2576
- "\u1000\u103A": "et",
2577
- "\u102D\u102F\u1000\u103A": "aik",
2578
- "\u1031\u102C\u1000\u103A": "auk",
2579
- "\u1004\u103A": "in",
2580
- "\u102D\u102F\u1004\u103A": "aing",
2581
- "\u1031\u102C\u1004\u103A": "aung",
2582
- "\u1005\u103A": "it",
2583
- "\u100A\u103A": "i",
2584
- "\u1010\u103A": "at",
2585
- "\u102D\u1010\u103A": "eik",
2586
- "\u102F\u1010\u103A": "ok",
2587
- "\u103D\u1010\u103A": "ut",
2588
- "\u1031\u1010\u103A": "it",
2589
- "\u1012\u103A": "d",
2590
- "\u102D\u102F\u1012\u103A": "ok",
2591
- "\u102F\u1012\u103A": "ait",
2592
- "\u1014\u103A": "an",
2593
- "\u102C\u1014\u103A": "an",
2594
- "\u102D\u1014\u103A": "ein",
2595
- "\u102F\u1014\u103A": "on",
2596
- "\u103D\u1014\u103A": "un",
2597
- "\u1015\u103A": "at",
2598
- "\u102D\u1015\u103A": "eik",
2599
- "\u102F\u1015\u103A": "ok",
2600
- "\u103D\u1015\u103A": "ut",
2601
- "\u1014\u103A\u102F\u1015\u103A": "nub",
2602
- "\u1019\u103A": "an",
2603
- "\u102D\u1019\u103A": "ein",
2604
- "\u102F\u1019\u103A": "on",
2605
- "\u103D\u1019\u103A": "un",
2606
- "\u101A\u103A": "e",
2607
- "\u102D\u102F\u101C\u103A": "ol",
2608
- "\u1009\u103A": "in",
2609
- "\u1036": "an",
2610
- "\u102D\u1036": "ein",
2611
- "\u102F\u1036": "on",
2612
- // Dhivehi
2613
- "\u07A6\u0787\u07B0": "ah",
2614
- "\u07A6\u0781\u07B0": "ah"
2615
- };
2616
- var langCharMap = {
2617
- "en": {},
2618
- // default language
2619
- "az": {
2620
- // Azerbaijani
2621
- "\xE7": "c",
2622
- "\u0259": "e",
2623
- "\u011F": "g",
2624
- "\u0131": "i",
2625
- "\xF6": "o",
2626
- "\u015F": "s",
2627
- "\xFC": "u",
2628
- "\xC7": "C",
2629
- "\u018F": "E",
2630
- "\u011E": "G",
2631
- "\u0130": "I",
2632
- "\xD6": "O",
2633
- "\u015E": "S",
2634
- "\xDC": "U"
2635
- },
2636
- "cs": {
2637
- // Czech
2638
- "\u010D": "c",
2639
- "\u010F": "d",
2640
- "\u011B": "e",
2641
- "\u0148": "n",
2642
- "\u0159": "r",
2643
- "\u0161": "s",
2644
- "\u0165": "t",
2645
- "\u016F": "u",
2646
- "\u017E": "z",
2647
- "\u010C": "C",
2648
- "\u010E": "D",
2649
- "\u011A": "E",
2650
- "\u0147": "N",
2651
- "\u0158": "R",
2652
- "\u0160": "S",
2653
- "\u0164": "T",
2654
- "\u016E": "U",
2655
- "\u017D": "Z"
2656
- },
2657
- "fi": {
2658
- // Finnish
2659
- // 'å': 'a', duplicate see charMap/latin
2660
- // 'Å': 'A', duplicate see charMap/latin
2661
- "\xE4": "a",
2662
- // ok
2663
- "\xC4": "A",
2664
- // ok
2665
- "\xF6": "o",
2666
- // ok
2667
- "\xD6": "O"
2668
- // ok
2669
- },
2670
- "hu": {
2671
- // Hungarian
2672
- "\xE4": "a",
2673
- // ok
2674
- "\xC4": "A",
2675
- // ok
2676
- // 'á': 'a', duplicate see charMap/latin
2677
- // 'Á': 'A', duplicate see charMap/latin
2678
- "\xF6": "o",
2679
- // ok
2680
- "\xD6": "O",
2681
- // ok
2682
- // 'ő': 'o', duplicate see charMap/latin
2683
- // 'Ő': 'O', duplicate see charMap/latin
2684
- "\xFC": "u",
2685
- "\xDC": "U",
2686
- "\u0171": "u",
2687
- "\u0170": "U"
2688
- },
2689
- "lt": {
2690
- // Lithuanian
2691
- "\u0105": "a",
2692
- "\u010D": "c",
2693
- "\u0119": "e",
2694
- "\u0117": "e",
2695
- "\u012F": "i",
2696
- "\u0161": "s",
2697
- "\u0173": "u",
2698
- "\u016B": "u",
2699
- "\u017E": "z",
2700
- "\u0104": "A",
2701
- "\u010C": "C",
2702
- "\u0118": "E",
2703
- "\u0116": "E",
2704
- "\u012E": "I",
2705
- "\u0160": "S",
2706
- "\u0172": "U",
2707
- "\u016A": "U"
2708
- },
2709
- "lv": {
2710
- // Latvian
2711
- "\u0101": "a",
2712
- "\u010D": "c",
2713
- "\u0113": "e",
2714
- "\u0123": "g",
2715
- "\u012B": "i",
2716
- "\u0137": "k",
2717
- "\u013C": "l",
2718
- "\u0146": "n",
2719
- "\u0161": "s",
2720
- "\u016B": "u",
2721
- "\u017E": "z",
2722
- "\u0100": "A",
2723
- "\u010C": "C",
2724
- "\u0112": "E",
2725
- "\u0122": "G",
2726
- "\u012A": "i",
2727
- "\u0136": "k",
2728
- "\u013B": "L",
2729
- "\u0145": "N",
2730
- "\u0160": "S",
2731
- "\u016A": "u",
2732
- "\u017D": "Z"
2733
- },
2734
- "pl": {
2735
- // Polish
2736
- "\u0105": "a",
2737
- "\u0107": "c",
2738
- "\u0119": "e",
2739
- "\u0142": "l",
2740
- "\u0144": "n",
2741
- "\xF3": "o",
2742
- "\u015B": "s",
2743
- "\u017A": "z",
2744
- "\u017C": "z",
2745
- "\u0104": "A",
2746
- "\u0106": "C",
2747
- "\u0118": "e",
2748
- "\u0141": "L",
2749
- "\u0143": "N",
2750
- "\xD3": "O",
2751
- "\u015A": "S",
2752
- "\u0179": "Z",
2753
- "\u017B": "Z"
2754
- },
2755
- "sv": {
2756
- // Swedish
2757
- // 'å': 'a', duplicate see charMap/latin
2758
- // 'Å': 'A', duplicate see charMap/latin
2759
- "\xE4": "a",
2760
- // ok
2761
- "\xC4": "A",
2762
- // ok
2763
- "\xF6": "o",
2764
- // ok
2765
- "\xD6": "O"
2766
- // ok
2767
- },
2768
- "sk": {
2769
- // Slovak
2770
- "\xE4": "a",
2771
- "\xC4": "A"
2772
- },
2773
- "sr": {
2774
- // Serbian
2775
- "\u0459": "lj",
2776
- "\u045A": "nj",
2777
- "\u0409": "Lj",
2778
- "\u040A": "Nj",
2779
- "\u0111": "dj",
2780
- "\u0110": "Dj"
2781
- },
2782
- "tr": {
2783
- // Turkish
2784
- "\xDC": "U",
2785
- "\xD6": "O",
2786
- "\xFC": "u",
2787
- "\xF6": "o"
2788
- }
2789
- };
2790
- var symbolMap = {
2791
- "ar": {
2792
- "\u2206": "delta",
2793
- "\u221E": "la-nihaya",
2794
- "\u2665": "hob",
2795
- "&": "wa",
2796
- "|": "aw",
2797
- "<": "aqal-men",
2798
- ">": "akbar-men",
2799
- "\u2211": "majmou",
2800
- "\xA4": "omla"
2801
- },
2802
- "az": {},
2803
- "ca": {
2804
- "\u2206": "delta",
2805
- "\u221E": "infinit",
2806
- "\u2665": "amor",
2807
- "&": "i",
2808
- "|": "o",
2809
- "<": "menys que",
2810
- ">": "mes que",
2811
- "\u2211": "suma dels",
2812
- "\xA4": "moneda"
2813
- },
2814
- "cs": {
2815
- "\u2206": "delta",
2816
- "\u221E": "nekonecno",
2817
- "\u2665": "laska",
2818
- "&": "a",
2819
- "|": "nebo",
2820
- "<": "mensi nez",
2821
- ">": "vetsi nez",
2822
- "\u2211": "soucet",
2823
- "\xA4": "mena"
2824
- },
2825
- "de": {
2826
- "\u2206": "delta",
2827
- "\u221E": "unendlich",
2828
- "\u2665": "Liebe",
2829
- "&": "und",
2830
- "|": "oder",
2831
- "<": "kleiner als",
2832
- ">": "groesser als",
2833
- "\u2211": "Summe von",
2834
- "\xA4": "Waehrung"
2835
- },
2836
- "dv": {
2837
- "\u2206": "delta",
2838
- "\u221E": "kolunulaa",
2839
- "\u2665": "loabi",
2840
- "&": "aai",
2841
- "|": "noonee",
2842
- "<": "ah vure kuda",
2843
- ">": "ah vure bodu",
2844
- "\u2211": "jumula",
2845
- "\xA4": "faisaa"
2846
- },
2847
- "en": {
2848
- "\u2206": "delta",
2849
- "\u221E": "infinity",
2850
- "\u2665": "love",
2851
- "&": "and",
2852
- "|": "or",
2853
- "<": "less than",
2854
- ">": "greater than",
2855
- "\u2211": "sum",
2856
- "\xA4": "currency"
2857
- },
2858
- "es": {
2859
- "\u2206": "delta",
2860
- "\u221E": "infinito",
2861
- "\u2665": "amor",
2862
- "&": "y",
2863
- "|": "u",
2864
- "<": "menos que",
2865
- ">": "mas que",
2866
- "\u2211": "suma de los",
2867
- "\xA4": "moneda"
2868
- },
2869
- "fa": {
2870
- "\u2206": "delta",
2871
- "\u221E": "bi-nahayat",
2872
- "\u2665": "eshgh",
2873
- "&": "va",
2874
- "|": "ya",
2875
- "<": "kamtar-az",
2876
- ">": "bishtar-az",
2877
- "\u2211": "majmooe",
2878
- "\xA4": "vahed"
2879
- },
2880
- "fi": {
2881
- "\u2206": "delta",
2882
- "\u221E": "aarettomyys",
2883
- "\u2665": "rakkaus",
2884
- "&": "ja",
2885
- "|": "tai",
2886
- "<": "pienempi kuin",
2887
- ">": "suurempi kuin",
2888
- "\u2211": "summa",
2889
- "\xA4": "valuutta"
2890
- },
2891
- "fr": {
2892
- "\u2206": "delta",
2893
- "\u221E": "infiniment",
2894
- "\u2665": "Amour",
2895
- "&": "et",
2896
- "|": "ou",
2897
- "<": "moins que",
2898
- ">": "superieure a",
2899
- "\u2211": "somme des",
2900
- "\xA4": "monnaie"
2901
- },
2902
- "ge": {
2903
- "\u2206": "delta",
2904
- "\u221E": "usasruloba",
2905
- "\u2665": "siqvaruli",
2906
- "&": "da",
2907
- "|": "an",
2908
- "<": "naklebi",
2909
- ">": "meti",
2910
- "\u2211": "jami",
2911
- "\xA4": "valuta"
2912
- },
2913
- "gr": {},
2914
- "hu": {
2915
- "\u2206": "delta",
2916
- "\u221E": "vegtelen",
2917
- "\u2665": "szerelem",
2918
- "&": "es",
2919
- "|": "vagy",
2920
- "<": "kisebb mint",
2921
- ">": "nagyobb mint",
2922
- "\u2211": "szumma",
2923
- "\xA4": "penznem"
2924
- },
2925
- "it": {
2926
- "\u2206": "delta",
2927
- "\u221E": "infinito",
2928
- "\u2665": "amore",
2929
- "&": "e",
2930
- "|": "o",
2931
- "<": "minore di",
2932
- ">": "maggiore di",
2933
- "\u2211": "somma",
2934
- "\xA4": "moneta"
2935
- },
2936
- "lt": {
2937
- "\u2206": "delta",
2938
- "\u221E": "begalybe",
2939
- "\u2665": "meile",
2940
- "&": "ir",
2941
- "|": "ar",
2942
- "<": "maziau nei",
2943
- ">": "daugiau nei",
2944
- "\u2211": "suma",
2945
- "\xA4": "valiuta"
2946
- },
2947
- "lv": {
2948
- "\u2206": "delta",
2949
- "\u221E": "bezgaliba",
2950
- "\u2665": "milestiba",
2951
- "&": "un",
2952
- "|": "vai",
2953
- "<": "mazak neka",
2954
- ">": "lielaks neka",
2955
- "\u2211": "summa",
2956
- "\xA4": "valuta"
2957
- },
2958
- "my": {
2959
- "\u2206": "kwahkhyaet",
2960
- "\u221E": "asaonasme",
2961
- "\u2665": "akhyait",
2962
- "&": "nhin",
2963
- "|": "tho",
2964
- "<": "ngethaw",
2965
- ">": "kyithaw",
2966
- "\u2211": "paungld",
2967
- "\xA4": "ngwekye"
2968
- },
2969
- "mk": {},
2970
- "nl": {
2971
- "\u2206": "delta",
2972
- "\u221E": "oneindig",
2973
- "\u2665": "liefde",
2974
- "&": "en",
2975
- "|": "of",
2976
- "<": "kleiner dan",
2977
- ">": "groter dan",
2978
- "\u2211": "som",
2979
- "\xA4": "valuta"
2980
- },
2981
- "pl": {
2982
- "\u2206": "delta",
2983
- "\u221E": "nieskonczonosc",
2984
- "\u2665": "milosc",
2985
- "&": "i",
2986
- "|": "lub",
2987
- "<": "mniejsze niz",
2988
- ">": "wieksze niz",
2989
- "\u2211": "suma",
2990
- "\xA4": "waluta"
2991
- },
2992
- "pt": {
2993
- "\u2206": "delta",
2994
- "\u221E": "infinito",
2995
- "\u2665": "amor",
2996
- "&": "e",
2997
- "|": "ou",
2998
- "<": "menor que",
2999
- ">": "maior que",
3000
- "\u2211": "soma",
3001
- "\xA4": "moeda"
3002
- },
3003
- "ro": {
3004
- "\u2206": "delta",
3005
- "\u221E": "infinit",
3006
- "\u2665": "dragoste",
3007
- "&": "si",
3008
- "|": "sau",
3009
- "<": "mai mic ca",
3010
- ">": "mai mare ca",
3011
- "\u2211": "suma",
3012
- "\xA4": "valuta"
3013
- },
3014
- "ru": {
3015
- "\u2206": "delta",
3016
- "\u221E": "beskonechno",
3017
- "\u2665": "lubov",
3018
- "&": "i",
3019
- "|": "ili",
3020
- "<": "menshe",
3021
- ">": "bolshe",
3022
- "\u2211": "summa",
3023
- "\xA4": "valjuta"
3024
- },
3025
- "sk": {
3026
- "\u2206": "delta",
3027
- "\u221E": "nekonecno",
3028
- "\u2665": "laska",
3029
- "&": "a",
3030
- "|": "alebo",
3031
- "<": "menej ako",
3032
- ">": "viac ako",
3033
- "\u2211": "sucet",
3034
- "\xA4": "mena"
3035
- },
3036
- "sr": {},
3037
- "tr": {
3038
- "\u2206": "delta",
3039
- "\u221E": "sonsuzluk",
3040
- "\u2665": "ask",
3041
- "&": "ve",
3042
- "|": "veya",
3043
- "<": "kucuktur",
3044
- ">": "buyuktur",
3045
- "\u2211": "toplam",
3046
- "\xA4": "para birimi"
3047
- },
3048
- "uk": {
3049
- "\u2206": "delta",
3050
- "\u221E": "bezkinechnist",
3051
- "\u2665": "lubov",
3052
- "&": "i",
3053
- "|": "abo",
3054
- "<": "menshe",
3055
- ">": "bilshe",
3056
- "\u2211": "suma",
3057
- "\xA4": "valjuta"
3058
- },
3059
- "vn": {
3060
- "\u2206": "delta",
3061
- "\u221E": "vo cuc",
3062
- "\u2665": "yeu",
3063
- "&": "va",
3064
- "|": "hoac",
3065
- "<": "nho hon",
3066
- ">": "lon hon",
3067
- "\u2211": "tong",
3068
- "\xA4": "tien te"
3069
- }
3070
- };
3071
- var uricChars = [";", "?", ":", "@", "&", "=", "+", "$", ",", "/"].join("");
3072
- var uricNoSlashChars = [";", "?", ":", "@", "&", "=", "+", "$", ","].join("");
3073
- var markChars = [".", "!", "~", "*", "'", "(", ")"].join("");
3074
- var getSlug = function getSlug2(input, opts) {
3075
- var separator = "-";
3076
- var result = "";
3077
- var diatricString = "";
3078
- var convertSymbols = true;
3079
- var customReplacements = {};
3080
- var maintainCase;
3081
- var titleCase;
3082
- var truncate;
3083
- var uricFlag;
3084
- var uricNoSlashFlag;
3085
- var markFlag;
3086
- var symbol;
3087
- var langChar;
3088
- var lucky;
3089
- var i;
3090
- var ch;
3091
- var l;
3092
- var lastCharWasSymbol;
3093
- var lastCharWasDiatric;
3094
- var allowedChars = "";
3095
- if (typeof input !== "string") {
3096
- return "";
3097
- }
3098
- if (typeof opts === "string") {
3099
- separator = opts;
3100
- }
3101
- symbol = symbolMap.en;
3102
- langChar = langCharMap.en;
3103
- if (typeof opts === "object") {
3104
- maintainCase = opts.maintainCase || false;
3105
- customReplacements = opts.custom && typeof opts.custom === "object" ? opts.custom : customReplacements;
3106
- truncate = +opts.truncate > 1 && opts.truncate || false;
3107
- uricFlag = opts.uric || false;
3108
- uricNoSlashFlag = opts.uricNoSlash || false;
3109
- markFlag = opts.mark || false;
3110
- convertSymbols = opts.symbols === false || opts.lang === false ? false : true;
3111
- separator = opts.separator || separator;
3112
- if (uricFlag) {
3113
- allowedChars += uricChars;
3114
- }
3115
- if (uricNoSlashFlag) {
3116
- allowedChars += uricNoSlashChars;
3117
- }
3118
- if (markFlag) {
3119
- allowedChars += markChars;
3120
- }
3121
- symbol = opts.lang && symbolMap[opts.lang] && convertSymbols ? symbolMap[opts.lang] : convertSymbols ? symbolMap.en : {};
3122
- langChar = opts.lang && langCharMap[opts.lang] ? langCharMap[opts.lang] : opts.lang === false || opts.lang === true ? {} : langCharMap.en;
3123
- if (opts.titleCase && typeof opts.titleCase.length === "number" && Array.prototype.toString.call(opts.titleCase)) {
3124
- opts.titleCase.forEach(function(v) {
3125
- customReplacements[v + ""] = v + "";
3126
- });
3127
- titleCase = true;
3128
- } else {
3129
- titleCase = !!opts.titleCase;
3130
- }
3131
- if (opts.custom && typeof opts.custom.length === "number" && Array.prototype.toString.call(opts.custom)) {
3132
- opts.custom.forEach(function(v) {
3133
- customReplacements[v + ""] = v + "";
3134
- });
3135
- }
3136
- Object.keys(customReplacements).forEach(function(v) {
3137
- var r;
3138
- if (v.length > 1) {
3139
- r = new RegExp("\\b" + escapeChars(v) + "\\b", "gi");
3140
- } else {
3141
- r = new RegExp(escapeChars(v), "gi");
3142
- }
3143
- input = input.replace(r, customReplacements[v]);
3144
- });
3145
- for (ch in customReplacements) {
3146
- allowedChars += ch;
3147
- }
3148
- }
3149
- allowedChars += separator;
3150
- allowedChars = escapeChars(allowedChars);
3151
- input = input.replace(/(^\s+|\s+$)/g, "");
3152
- lastCharWasSymbol = false;
3153
- lastCharWasDiatric = false;
3154
- for (i = 0, l = input.length; i < l; i++) {
3155
- ch = input[i];
3156
- if (isReplacedCustomChar(ch, customReplacements)) {
3157
- lastCharWasSymbol = false;
3158
- } else if (langChar[ch]) {
3159
- ch = lastCharWasSymbol && langChar[ch].match(/[A-Za-z0-9]/) ? " " + langChar[ch] : langChar[ch];
3160
- lastCharWasSymbol = false;
3161
- } else if (ch in charMap) {
3162
- if (i + 1 < l && lookAheadCharArray.indexOf(input[i + 1]) >= 0) {
3163
- diatricString += ch;
3164
- ch = "";
3165
- } else if (lastCharWasDiatric === true) {
3166
- ch = diatricMap[diatricString] + charMap[ch];
3167
- diatricString = "";
3168
- } else {
3169
- ch = lastCharWasSymbol && charMap[ch].match(/[A-Za-z0-9]/) ? " " + charMap[ch] : charMap[ch];
3170
- }
3171
- lastCharWasSymbol = false;
3172
- lastCharWasDiatric = false;
3173
- } else if (ch in diatricMap) {
3174
- diatricString += ch;
3175
- ch = "";
3176
- if (i === l - 1) {
3177
- ch = diatricMap[diatricString];
3178
- }
3179
- lastCharWasDiatric = true;
3180
- } else if (
3181
- // process symbol chars
3182
- symbol[ch] && !(uricFlag && uricChars.indexOf(ch) !== -1) && !(uricNoSlashFlag && uricNoSlashChars.indexOf(ch) !== -1)
3183
- ) {
3184
- ch = lastCharWasSymbol || result.substr(-1).match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch];
3185
- ch += input[i + 1] !== void 0 && input[i + 1].match(/[A-Za-z0-9]/) ? separator : "";
3186
- lastCharWasSymbol = true;
3187
- } else {
3188
- if (lastCharWasDiatric === true) {
3189
- ch = diatricMap[diatricString] + ch;
3190
- diatricString = "";
3191
- lastCharWasDiatric = false;
3192
- } else if (lastCharWasSymbol && (/[A-Za-z0-9]/.test(ch) || result.substr(-1).match(/A-Za-z0-9]/))) {
3193
- ch = " " + ch;
3194
- }
3195
- lastCharWasSymbol = false;
3196
- }
3197
- result += ch.replace(new RegExp("[^\\w\\s" + allowedChars + "_-]", "g"), separator);
3198
- }
3199
- if (titleCase) {
3200
- result = result.replace(/(\w)(\S*)/g, function(_, i2, r) {
3201
- var j = i2.toUpperCase() + (r !== null ? r : "");
3202
- return Object.keys(customReplacements).indexOf(j.toLowerCase()) < 0 ? j : j.toLowerCase();
3203
- });
3204
- }
3205
- result = result.replace(/\s+/g, separator).replace(new RegExp("\\" + separator + "+", "g"), separator).replace(new RegExp("(^\\" + separator + "+|\\" + separator + "+$)", "g"), "");
3206
- if (truncate && result.length > truncate) {
3207
- lucky = result.charAt(truncate) === separator;
3208
- result = result.slice(0, truncate);
3209
- if (!lucky) {
3210
- result = result.slice(0, result.lastIndexOf(separator));
3211
- }
3212
- }
3213
- if (!maintainCase && !titleCase) {
3214
- result = result.toLowerCase();
3215
- }
3216
- return result;
3217
- };
3218
- var createSlug = function createSlug2(opts) {
3219
- return function getSlugWithConfig(input) {
3220
- return getSlug(input, opts);
3221
- };
3222
- };
3223
- var escapeChars = function escapeChars2(input) {
3224
- return input.replace(/[-\\^$*+?.()|[\]{}\/]/g, "\\$&");
3225
- };
3226
- var isReplacedCustomChar = function(ch, customReplacements) {
3227
- for (var c in customReplacements) {
3228
- if (customReplacements[c] === ch) {
3229
- return true;
3230
- }
3231
- }
3232
- };
3233
- if (typeof module !== "undefined" && module.exports) {
3234
- module.exports = getSlug;
3235
- module.exports.createSlug = createSlug;
3236
- } else if (typeof define !== "undefined" && define.amd) {
3237
- define([], function() {
3238
- return getSlug;
3239
- });
3240
- } else {
3241
- try {
3242
- if (root.getSlug || root.createSlug) {
3243
- throw "speakingurl: globals exists /(getSlug|createSlug)/";
3244
- } else {
3245
- root.getSlug = getSlug;
3246
- root.createSlug = createSlug;
3247
- }
3248
- } catch (e) {
3249
- }
3250
- }
3251
- })(exports);
3252
- }
3253
- });
3254
-
3255
- // ../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js
3256
- var require_speakingurl2 = __commonJS({
3257
- "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js"(exports, module) {
3258
- init_esm_shims();
3259
- module.exports = require_speakingurl();
3260
- }
3261
- });
3262
-
3263
- // src/index.ts
3264
- init_esm_shims();
3265
-
3266
- // src/core/index.ts
3267
- init_esm_shims();
3268
-
3269
- // src/compat/index.ts
3270
- init_esm_shims();
3271
-
3272
- // src/ctx/index.ts
3273
- init_esm_shims();
3274
-
3275
- // src/ctx/api.ts
3276
- init_esm_shims();
3277
-
3278
- // src/core/component/state/editor.ts
3279
- init_esm_shims();
3280
-
3281
- // src/shared/stub-vue.ts
3282
- init_esm_shims();
3283
- function isReadonly(value) {
3284
- return !!(value && value["__v_isReadonly" /* IS_READONLY */]);
3285
- }
3286
- function isReactive(value) {
3287
- if (isReadonly(value)) {
3288
- return isReactive(value["__v_raw" /* RAW */]);
3289
- }
3290
- return !!(value && value["__v_isReactive" /* IS_REACTIVE */]);
3291
- }
3292
- function isRef(r) {
3293
- return !!(r && r.__v_isRef === true);
3294
- }
3295
- function toRaw(observed) {
3296
- const raw = observed && observed["__v_raw" /* RAW */];
3297
- return raw ? toRaw(raw) : observed;
3298
- }
3299
- var Fragment = Symbol.for("v-fgt");
3300
-
3301
- // src/core/component/utils/index.ts
3302
- init_esm_shims();
3303
- function getComponentTypeName(options) {
3304
- var _a25;
3305
- const name = options.name || options._componentTag || options.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ || options.__name;
3306
- if (name === "index" && ((_a25 = options.__file) == null ? void 0 : _a25.endsWith("index.vue"))) {
3307
- return "";
3308
- }
3309
- return name;
3310
- }
3311
- function getComponentFileName(options) {
3312
- const file = options.__file;
3313
- if (file)
3314
- return classify(basename(file, ".vue"));
3315
- }
3316
- function saveComponentGussedName(instance, name) {
3317
- instance.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ = name;
3318
- return name;
3319
- }
3320
- function getAppRecord(instance) {
3321
- if (instance.__VUE_DEVTOOLS_NEXT_APP_RECORD__)
3322
- return instance.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
3323
- else if (instance.root)
3324
- return instance.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
3325
- }
3326
- async function getComponentId(options) {
3327
- const { app, uid, instance } = options;
3328
- try {
3329
- if (instance.__VUE_DEVTOOLS_NEXT_UID__)
3330
- return instance.__VUE_DEVTOOLS_NEXT_UID__;
3331
- const appRecord = await getAppRecord(app);
3332
- if (!appRecord)
3333
- return null;
3334
- const isRoot = appRecord.rootInstance === instance;
3335
- return `${appRecord.id}:${isRoot ? "root" : uid}`;
3336
- } catch (e) {
3337
- }
3338
- }
3339
- function isFragment(instance) {
3340
- var _a25;
3341
- const subTreeType = (_a25 = instance.subTree) == null ? void 0 : _a25.type;
3342
- return subTreeType === Fragment;
3343
- }
3344
- function getInstanceName(instance) {
3345
- var _a25, _b25, _c;
3346
- const name = getComponentTypeName((instance == null ? void 0 : instance.type) || {});
3347
- if (name)
3348
- return name;
3349
- if ((instance == null ? void 0 : instance.root) === instance)
3350
- return "Root";
3351
- for (const key in (_b25 = (_a25 = instance.parent) == null ? void 0 : _a25.type) == null ? void 0 : _b25.components) {
3352
- if (instance.parent.type.components[key] === (instance == null ? void 0 : instance.type))
3353
- return saveComponentGussedName(instance, key);
3354
- }
3355
- for (const key in (_c = instance.appContext) == null ? void 0 : _c.components) {
3356
- if (instance.appContext.components[key] === (instance == null ? void 0 : instance.type))
3357
- return saveComponentGussedName(instance, key);
3358
- }
3359
- const fileName = getComponentFileName((instance == null ? void 0 : instance.type) || {});
3360
- if (fileName)
3361
- return fileName;
3362
- return "Anonymous Component";
3363
- }
3364
- function getComponentInstance(appRecord, instanceId) {
3365
- instanceId = instanceId || `${appRecord.id}:root`;
3366
- const instance = appRecord.instanceMap.get(instanceId);
3367
- return instance || appRecord.instanceMap.get(":root");
3368
- }
3369
-
3370
- // src/core/component/state/editor.ts
3371
- var StateEditor = class {
3372
- constructor() {
3373
- this.refEditor = new RefStateEditor();
3374
- }
3375
- set(object, path, value, cb) {
3376
- const sections = Array.isArray(path) ? path : path.split(".");
3377
- while (sections.length > 1) {
3378
- const section = sections.shift();
3379
- if (object instanceof Map)
3380
- object = object.get(section);
3381
- if (object instanceof Set)
3382
- object = Array.from(object.values())[section];
3383
- else object = object[section];
3384
- if (this.refEditor.isRef(object))
3385
- object = this.refEditor.get(object);
3386
- }
3387
- const field = sections[0];
3388
- const item = this.refEditor.get(object)[field];
3389
- if (cb) {
3390
- cb(object, field, value);
3391
- } else {
3392
- if (this.refEditor.isRef(item))
3393
- this.refEditor.set(item, value);
3394
- else object[field] = value;
3395
- }
3396
- }
3397
- get(object, path) {
3398
- const sections = Array.isArray(path) ? path : path.split(".");
3399
- for (let i = 0; i < sections.length; i++) {
3400
- if (object instanceof Map)
3401
- object = object.get(sections[i]);
3402
- else
3403
- object = object[sections[i]];
3404
- if (this.refEditor.isRef(object))
3405
- object = this.refEditor.get(object);
3406
- if (!object)
3407
- return void 0;
3408
- }
3409
- return object;
3410
- }
3411
- has(object, path, parent = false) {
3412
- if (typeof object === "undefined")
3413
- return false;
3414
- const sections = Array.isArray(path) ? path.slice() : path.split(".");
3415
- const size = !parent ? 1 : 2;
3416
- while (object && sections.length > size) {
3417
- const section = sections.shift();
3418
- object = object[section];
3419
- if (this.refEditor.isRef(object))
3420
- object = this.refEditor.get(object);
3421
- }
3422
- return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
3423
- }
3424
- createDefaultSetCallback(state) {
3425
- return (object, field, value) => {
3426
- if (state.remove || state.newKey) {
3427
- if (Array.isArray(object))
3428
- object.splice(field, 1);
3429
- else if (toRaw(object) instanceof Map)
3430
- object.delete(field);
3431
- else if (toRaw(object) instanceof Set)
3432
- object.delete(Array.from(object.values())[field]);
3433
- else Reflect.deleteProperty(object, field);
3434
- }
3435
- if (!state.remove) {
3436
- const target22 = object[state.newKey || field];
3437
- if (this.refEditor.isRef(target22))
3438
- this.refEditor.set(target22, value);
3439
- else if (toRaw(object) instanceof Map)
3440
- object.set(state.newKey || field, value);
3441
- else if (toRaw(object) instanceof Set)
3442
- object.add(value);
3443
- else
3444
- object[state.newKey || field] = value;
3445
- }
3446
- };
3447
- }
3448
- };
3449
- var RefStateEditor = class {
3450
- set(ref, value) {
3451
- if (isRef(ref)) {
3452
- ref.value = value;
3453
- } else {
3454
- if (ref instanceof Set && Array.isArray(value)) {
3455
- ref.clear();
3456
- value.forEach((v) => ref.add(v));
3457
- return;
3458
- }
3459
- const currentKeys = Object.keys(value);
3460
- if (ref instanceof Map) {
3461
- const previousKeysSet2 = new Set(ref.keys());
3462
- currentKeys.forEach((key) => {
3463
- ref.set(key, Reflect.get(value, key));
3464
- previousKeysSet2.delete(key);
3465
- });
3466
- previousKeysSet2.forEach((key) => ref.delete(key));
3467
- return;
3468
- }
3469
- const previousKeysSet = new Set(Object.keys(ref));
3470
- currentKeys.forEach((key) => {
3471
- Reflect.set(ref, key, Reflect.get(value, key));
3472
- previousKeysSet.delete(key);
3473
- });
3474
- previousKeysSet.forEach((key) => Reflect.deleteProperty(ref, key));
3475
- }
3476
- }
3477
- get(ref) {
3478
- return isRef(ref) ? ref.value : ref;
3479
- }
3480
- isRef(ref) {
3481
- return isRef(ref) || isReactive(ref);
3482
- }
3483
- };
3484
-
3485
- // src/core/component/tree/el.ts
3486
- init_esm_shims();
3487
- function getRootElementsFromComponentInstance(instance) {
3488
- if (isFragment(instance))
3489
- return getFragmentRootElements(instance.subTree);
3490
- if (!instance.subTree)
3491
- return [];
3492
- return [instance.subTree.el];
3493
- }
3494
- function getFragmentRootElements(vnode) {
3495
- if (!vnode.children)
3496
- return [];
3497
- const list = [];
3498
- vnode.children.forEach((childVnode) => {
3499
- if (childVnode.component)
3500
- list.push(...getRootElementsFromComponentInstance(childVnode.component));
3501
- else if (childVnode == null ? void 0 : childVnode.el)
3502
- list.push(childVnode.el);
3503
- });
3504
- return list;
3505
- }
3506
-
3507
- // src/core/component-highlighter/index.ts
3508
- init_esm_shims();
3509
-
3510
- // src/core/component/state/bounding-rect.ts
3511
- init_esm_shims();
3512
- function createRect() {
3513
- const rect = {
3514
- top: 0,
3515
- bottom: 0,
3516
- left: 0,
3517
- right: 0,
3518
- get width() {
3519
- return rect.right - rect.left;
3520
- },
3521
- get height() {
3522
- return rect.bottom - rect.top;
3523
- }
3524
- };
3525
- return rect;
3526
- }
3527
- var range;
3528
- function getTextRect(node) {
3529
- if (!range)
3530
- range = document.createRange();
3531
- range.selectNode(node);
3532
- return range.getBoundingClientRect();
3533
- }
3534
- function getFragmentRect(vnode) {
3535
- const rect = createRect();
3536
- if (!vnode.children)
3537
- return rect;
3538
- for (let i = 0, l = vnode.children.length; i < l; i++) {
3539
- const childVnode = vnode.children[i];
3540
- let childRect;
3541
- if (childVnode.component) {
3542
- childRect = getComponentBoundingRect(childVnode.component);
3543
- } else if (childVnode.el) {
3544
- const el = childVnode.el;
3545
- if (el.nodeType === 1 || el.getBoundingClientRect)
3546
- childRect = el.getBoundingClientRect();
3547
- else if (el.nodeType === 3 && el.data.trim())
3548
- childRect = getTextRect(el);
3549
- }
3550
- if (childRect)
3551
- mergeRects(rect, childRect);
3552
- }
3553
- return rect;
3554
- }
3555
- function mergeRects(a, b) {
3556
- if (!a.top || b.top < a.top)
3557
- a.top = b.top;
3558
- if (!a.bottom || b.bottom > a.bottom)
3559
- a.bottom = b.bottom;
3560
- if (!a.left || b.left < a.left)
3561
- a.left = b.left;
3562
- if (!a.right || b.right > a.right)
3563
- a.right = b.right;
3564
- return a;
3565
- }
3566
- var DEFAULT_RECT = {
3567
- top: 0,
3568
- left: 0,
3569
- right: 0,
3570
- bottom: 0,
3571
- width: 0,
3572
- height: 0
3573
- };
3574
- function getComponentBoundingRect(instance) {
3575
- const el = instance.subTree.el;
3576
- if (typeof window === "undefined") {
3577
- return DEFAULT_RECT;
3578
- }
3579
- if (isFragment(instance))
3580
- return getFragmentRect(instance.subTree);
3581
- else if ((el == null ? void 0 : el.nodeType) === 1)
3582
- return el == null ? void 0 : el.getBoundingClientRect();
3583
- else if (instance.subTree.component)
3584
- return getComponentBoundingRect(instance.subTree.component);
3585
- else
3586
- return DEFAULT_RECT;
3587
- }
3588
-
3589
- // src/core/component-highlighter/index.ts
3590
- var CONTAINER_ELEMENT_ID = "__vue-devtools-component-inspector__";
3591
- var CARD_ELEMENT_ID = "__vue-devtools-component-inspector__card__";
3592
- var COMPONENT_NAME_ELEMENT_ID = "__vue-devtools-component-inspector__name__";
3593
- var INDICATOR_ELEMENT_ID = "__vue-devtools-component-inspector__indicator__";
3594
- var containerStyles = {
3595
- display: "block",
3596
- zIndex: 2147483640,
3597
- position: "fixed",
3598
- backgroundColor: "#42b88325",
3599
- border: "1px solid #42b88350",
3600
- borderRadius: "5px",
3601
- transition: "all 0.1s ease-in",
3602
- pointerEvents: "none"
3603
- };
3604
- var cardStyles = {
3605
- fontFamily: "Arial, Helvetica, sans-serif",
3606
- padding: "5px 8px",
3607
- borderRadius: "4px",
3608
- textAlign: "left",
3609
- position: "absolute",
3610
- left: 0,
3611
- color: "#e9e9e9",
3612
- fontSize: "14px",
3613
- fontWeight: 600,
3614
- lineHeight: "24px",
3615
- backgroundColor: "#42b883",
3616
- boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)"
3617
- };
3618
- var indicatorStyles = {
3619
- display: "inline-block",
3620
- fontWeight: 400,
3621
- fontStyle: "normal",
3622
- fontSize: "12px",
3623
- opacity: 0.7
3624
- };
3625
- function getContainerElement() {
3626
- return document.getElementById(CONTAINER_ELEMENT_ID);
3627
- }
3628
- function getCardElement() {
3629
- return document.getElementById(CARD_ELEMENT_ID);
3630
- }
3631
- function getIndicatorElement() {
3632
- return document.getElementById(INDICATOR_ELEMENT_ID);
3633
- }
3634
- function getNameElement() {
3635
- return document.getElementById(COMPONENT_NAME_ELEMENT_ID);
3636
- }
3637
- function getStyles(bounds) {
3638
- return {
3639
- left: `${Math.round(bounds.left * 100) / 100}px`,
3640
- top: `${Math.round(bounds.top * 100) / 100}px`,
3641
- width: `${Math.round(bounds.width * 100) / 100}px`,
3642
- height: `${Math.round(bounds.height * 100) / 100}px`
3643
- };
3644
- }
3645
- function create(options) {
3646
- var _a25;
3647
- const containerEl = document.createElement("div");
3648
- containerEl.id = (_a25 = options.elementId) != null ? _a25 : CONTAINER_ELEMENT_ID;
3649
- Object.assign(containerEl.style, {
3650
- ...containerStyles,
3651
- ...getStyles(options.bounds),
3652
- ...options.style
3653
- });
3654
- const cardEl = document.createElement("span");
3655
- cardEl.id = CARD_ELEMENT_ID;
3656
- Object.assign(cardEl.style, {
3657
- ...cardStyles,
3658
- top: options.bounds.top < 35 ? 0 : "-35px"
3659
- });
3660
- const nameEl = document.createElement("span");
3661
- nameEl.id = COMPONENT_NAME_ELEMENT_ID;
3662
- nameEl.innerHTML = `&lt;${options.name}&gt;&nbsp;&nbsp;`;
3663
- const indicatorEl = document.createElement("i");
3664
- indicatorEl.id = INDICATOR_ELEMENT_ID;
3665
- indicatorEl.innerHTML = `${Math.round(options.bounds.width * 100) / 100} x ${Math.round(options.bounds.height * 100) / 100}`;
3666
- Object.assign(indicatorEl.style, indicatorStyles);
3667
- cardEl.appendChild(nameEl);
3668
- cardEl.appendChild(indicatorEl);
3669
- containerEl.appendChild(cardEl);
3670
- document.body.appendChild(containerEl);
3671
- return containerEl;
3672
- }
3673
- function update(options) {
3674
- const containerEl = getContainerElement();
3675
- const cardEl = getCardElement();
3676
- const nameEl = getNameElement();
3677
- const indicatorEl = getIndicatorElement();
3678
- if (containerEl) {
3679
- Object.assign(containerEl.style, {
3680
- ...containerStyles,
3681
- ...getStyles(options.bounds)
3682
- });
3683
- Object.assign(cardEl.style, {
3684
- top: options.bounds.top < 35 ? 0 : "-35px"
3685
- });
3686
- nameEl.innerHTML = `&lt;${options.name}&gt;&nbsp;&nbsp;`;
3687
- indicatorEl.innerHTML = `${Math.round(options.bounds.width * 100) / 100} x ${Math.round(options.bounds.height * 100) / 100}`;
3688
- }
3689
- }
3690
- function highlight(instance) {
3691
- const bounds = getComponentBoundingRect(instance);
3692
- const name = getInstanceName(instance);
3693
- const container = getContainerElement();
3694
- container ? update({ bounds, name }) : create({ bounds, name });
3695
- }
3696
- function unhighlight() {
3697
- const el = getContainerElement();
3698
- if (el)
3699
- el.style.display = "none";
3700
- }
3701
- var inspectInstance = null;
3702
- function inspectFn(e) {
3703
- const target22 = e.target;
3704
- if (target22) {
3705
- const instance = target22.__vueParentComponent;
3706
- if (instance) {
3707
- inspectInstance = instance;
3708
- const el = instance.vnode.el;
3709
- if (el) {
3710
- const bounds = getComponentBoundingRect(instance);
3711
- const name = getInstanceName(instance);
3712
- const container = getContainerElement();
3713
- container ? update({ bounds, name }) : create({ bounds, name });
3714
- }
3715
- }
3716
- }
3717
- }
3718
- function selectComponentFn(e, cb) {
3719
- var _a25;
3720
- e.preventDefault();
3721
- e.stopPropagation();
3722
- if (inspectInstance) {
3723
- const app = (_a25 = activeAppRecord.value) == null ? void 0 : _a25.app;
3724
- getComponentId({
3725
- app,
3726
- uid: app.uid,
3727
- instance: inspectInstance
3728
- }).then((id) => {
3729
- cb(id);
3730
- });
3731
- }
3732
- }
3733
- var inspectComponentHighLighterSelectFn = null;
3734
- function cancelInspectComponentHighLighter() {
3735
- unhighlight();
3736
- window.removeEventListener("mouseover", inspectFn);
3737
- window.removeEventListener("click", inspectComponentHighLighterSelectFn, true);
3738
- inspectComponentHighLighterSelectFn = null;
3739
- }
3740
- function inspectComponentHighLighter() {
3741
- window.addEventListener("mouseover", inspectFn);
3742
- return new Promise((resolve) => {
3743
- function onSelect(e) {
3744
- e.preventDefault();
3745
- e.stopPropagation();
3746
- selectComponentFn(e, (id) => {
3747
- window.removeEventListener("click", onSelect, true);
3748
- inspectComponentHighLighterSelectFn = null;
3749
- window.removeEventListener("mouseover", inspectFn);
3750
- const el = getContainerElement();
3751
- if (el)
3752
- el.style.display = "none";
3753
- resolve(JSON.stringify({ id }));
3754
- });
3755
- }
3756
- inspectComponentHighLighterSelectFn = onSelect;
3757
- window.addEventListener("click", onSelect, true);
3758
- });
3759
- }
3760
- function scrollToComponent(options) {
3761
- const instance = getComponentInstance(activeAppRecord.value, options.id);
3762
- if (instance) {
3763
- const [el] = getRootElementsFromComponentInstance(instance);
3764
- if (typeof el.scrollIntoView === "function") {
3765
- el.scrollIntoView({
3766
- behavior: "smooth"
3767
- });
3768
- } else {
3769
- const bounds = getComponentBoundingRect(instance);
3770
- const scrollTarget = document.createElement("div");
3771
- const styles = {
3772
- ...getStyles(bounds),
3773
- position: "absolute"
3774
- };
3775
- Object.assign(scrollTarget.style, styles);
3776
- document.body.appendChild(scrollTarget);
3777
- scrollTarget.scrollIntoView({
3778
- behavior: "smooth"
3779
- });
3780
- setTimeout(() => {
3781
- document.body.removeChild(scrollTarget);
3782
- }, 2e3);
3783
- }
3784
- setTimeout(() => {
3785
- const bounds = getComponentBoundingRect(instance);
3786
- if (bounds.width || bounds.height) {
3787
- const name = getInstanceName(instance);
3788
- const el2 = getContainerElement();
3789
- el2 ? update({ ...options, name, bounds }) : create({ ...options, name, bounds });
3790
- setTimeout(() => {
3791
- if (el2)
3792
- el2.style.display = "none";
3793
- }, 1500);
3794
- }
3795
- }, 1200);
3796
- }
3797
- }
3798
-
3799
- // src/core/component-inspector/index.ts
3800
- init_esm_shims();
3801
- var _a, _b;
3802
- (_b = (_a = target).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__) != null ? _b : _a.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = true;
3803
- function waitForInspectorInit(cb) {
3804
- let total = 0;
3805
- const timer = setInterval(() => {
3806
- if (target.__VUE_INSPECTOR__) {
3807
- clearInterval(timer);
3808
- total += 30;
3809
- cb();
3810
- }
3811
- if (total >= /* 5s */
3812
- 5e3)
3813
- clearInterval(timer);
3814
- }, 30);
3815
- }
3816
- function setupInspector() {
3817
- const inspector = target.__VUE_INSPECTOR__;
3818
- const _openInEditor = inspector.openInEditor;
3819
- inspector.openInEditor = async (...params) => {
3820
- inspector.disable();
3821
- _openInEditor(...params);
3822
- };
3823
- }
3824
- function getComponentInspector() {
3825
- return new Promise((resolve) => {
3826
- function setup() {
3827
- setupInspector();
3828
- resolve(target.__VUE_INSPECTOR__);
3829
- }
3830
- if (!target.__VUE_INSPECTOR__) {
3831
- waitForInspectorInit(() => {
3832
- setup();
3833
- });
3834
- } else {
3835
- setup();
3836
- }
3837
- });
3838
- }
3839
-
3840
- // src/core/open-in-editor/index.ts
3841
- init_esm_shims();
3842
-
3843
- // src/ctx/state.ts
3844
- init_esm_shims();
3845
-
3846
- // src/core/timeline/storage.ts
3847
- init_esm_shims();
3848
- var TIMELINE_LAYERS_STATE_STORAGE_ID = "__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__";
3849
- function getTimelineLayersStateFromStorage() {
3850
- if (!isBrowser || typeof localStorage === "undefined") {
3851
- return {
3852
- recordingState: false,
3853
- mouseEventEnabled: false,
3854
- keyboardEventEnabled: false,
3855
- componentEventEnabled: false,
3856
- performanceEventEnabled: false,
3857
- selected: ""
3858
- };
3859
- }
3860
- const state = localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID);
3861
- return state ? JSON.parse(state) : {
3862
- recordingState: false,
3863
- mouseEventEnabled: false,
3864
- keyboardEventEnabled: false,
3865
- componentEventEnabled: false,
3866
- performanceEventEnabled: false,
3867
- selected: ""
3868
- };
3869
- }
3870
-
3871
- // src/ctx/hook.ts
3872
- init_esm_shims();
3873
-
3874
- // src/ctx/inspector.ts
3875
- init_esm_shims();
3876
-
3877
- // src/ctx/timeline.ts
3878
- init_esm_shims();
3879
- var _a2, _b2;
3880
- (_b2 = (_a2 = target).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS) != null ? _b2 : _a2.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS = [];
3881
- var devtoolsTimelineLayers = new Proxy(target.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS, {
3882
- get(target22, prop, receiver) {
3883
- return Reflect.get(target22, prop, receiver);
3884
- }
3885
- });
3886
- function addTimelineLayer(options, descriptor) {
3887
- devtoolsTimelineLayers.push({
3888
- ...options,
3889
- descriptorId: descriptor.id,
3890
- appRecord: getAppRecord(descriptor.app)
3891
- });
3892
- }
3893
-
3894
- // src/ctx/inspector.ts
3895
- var _a3, _b3;
3896
- (_b3 = (_a3 = target).__VUE_DEVTOOLS_KIT_INSPECTOR__) != null ? _b3 : _a3.__VUE_DEVTOOLS_KIT_INSPECTOR__ = [];
3897
- var devtoolsInspector = new Proxy(target.__VUE_DEVTOOLS_KIT_INSPECTOR__, {
3898
- get(target22, prop, receiver) {
3899
- return Reflect.get(target22, prop, receiver);
3900
- }
3901
- });
3902
- var callInspectorUpdatedHook = debounce(() => {
3903
- devtoolsContext.hooks.callHook("sendInspectorToClient" /* SEND_INSPECTOR_TO_CLIENT */, getActiveInspectors());
3904
- });
3905
- function addInspector(inspector, descriptor) {
3906
- devtoolsInspector.push({
3907
- options: inspector,
3908
- descriptor,
3909
- treeFilter: "",
3910
- selectedNodeId: "",
3911
- appRecord: getAppRecord(descriptor.app)
3912
- });
3913
- callInspectorUpdatedHook();
3914
- }
3915
- function getActiveInspectors() {
3916
- return devtoolsInspector.filter((inspector) => inspector.descriptor.app === activeAppRecord.value.app).filter((inspector) => inspector.descriptor.id !== "components").map((inspector) => {
3917
- var _a25;
3918
- const descriptor = inspector.descriptor;
3919
- const options = inspector.options;
3920
- return {
3921
- id: options.id,
3922
- label: options.label,
3923
- logo: descriptor.logo,
3924
- icon: `custom-ic-baseline-${(_a25 = options == null ? void 0 : options.icon) == null ? void 0 : _a25.replace(/_/g, "-")}`,
3925
- packageName: descriptor.packageName,
3926
- homepage: descriptor.homepage,
3927
- pluginId: descriptor.id
3928
- };
3929
- });
3930
- }
3931
- function getInspector(id, app) {
3932
- return devtoolsInspector.find((inspector) => inspector.options.id === id && (app ? inspector.descriptor.app === app : true));
3933
- }
3934
- function createDevToolsCtxHooks() {
3935
- const hooks2 = createHooks();
3936
- hooks2.hook("addInspector" /* ADD_INSPECTOR */, ({ inspector, plugin }) => {
3937
- addInspector(inspector, plugin.descriptor);
3938
- });
3939
- hooks2.hook("sendInspectorTree" /* SEND_INSPECTOR_TREE */, async ({ inspectorId, plugin }) => {
3940
- var _a25;
3941
- if (!inspectorId || !((_a25 = plugin == null ? void 0 : plugin.descriptor) == null ? void 0 : _a25.app))
3942
- return;
3943
- const inspector = getInspector(inspectorId, plugin.descriptor.app);
3944
- const _payload = {
3945
- app: plugin.descriptor.app,
3946
- inspectorId,
3947
- filter: (inspector == null ? void 0 : inspector.treeFilter) || "",
3948
- rootNodes: []
3949
- };
3950
- await new Promise((resolve) => {
3951
- hooks2.callHookWith(async (callbacks) => {
3952
- await Promise.all(callbacks.map((cb) => cb(_payload)));
3953
- resolve();
3954
- }, "getInspectorTree" /* GET_INSPECTOR_TREE */);
3955
- });
3956
- hooks2.callHookWith(async (callbacks) => {
3957
- await Promise.all(callbacks.map((cb) => cb({
3958
- inspectorId,
3959
- rootNodes: _payload.rootNodes
3960
- })));
3961
- }, "sendInspectorTreeToClient" /* SEND_INSPECTOR_TREE_TO_CLIENT */);
3962
- });
3963
- hooks2.hook("sendInspectorState" /* SEND_INSPECTOR_STATE */, async ({ inspectorId, plugin }) => {
3964
- var _a25;
3965
- if (!inspectorId || !((_a25 = plugin == null ? void 0 : plugin.descriptor) == null ? void 0 : _a25.app))
3966
- return;
3967
- const inspector = getInspector(inspectorId, plugin.descriptor.app);
3968
- const _payload = {
3969
- app: plugin.descriptor.app,
3970
- inspectorId,
3971
- nodeId: (inspector == null ? void 0 : inspector.selectedNodeId) || "",
3972
- state: null
3973
- };
3974
- const ctx = {
3975
- currentTab: `custom-inspector:${inspectorId}`
3976
- };
3977
- if (_payload.nodeId) {
3978
- await new Promise((resolve) => {
3979
- hooks2.callHookWith(async (callbacks) => {
3980
- await Promise.all(callbacks.map((cb) => cb(_payload, ctx)));
3981
- resolve();
3982
- }, "getInspectorState" /* GET_INSPECTOR_STATE */);
3983
- });
3984
- }
3985
- hooks2.callHookWith(async (callbacks) => {
3986
- await Promise.all(callbacks.map((cb) => cb({
3987
- inspectorId,
3988
- nodeId: _payload.nodeId,
3989
- state: _payload.state
3990
- })));
3991
- }, "sendInspectorStateToClient" /* SEND_INSPECTOR_STATE_TO_CLIENT */);
3992
- });
3993
- hooks2.hook("customInspectorSelectNode" /* CUSTOM_INSPECTOR_SELECT_NODE */, ({ inspectorId, nodeId, plugin }) => {
3994
- const inspector = getInspector(inspectorId, plugin.descriptor.app);
3995
- if (!inspector)
3996
- return;
3997
- inspector.selectedNodeId = nodeId;
3998
- });
3999
- hooks2.hook("timelineLayerAdded" /* TIMELINE_LAYER_ADDED */, ({ options, plugin }) => {
4000
- addTimelineLayer(options, plugin.descriptor);
4001
- });
4002
- hooks2.hook("timelineEventAdded" /* TIMELINE_EVENT_ADDED */, ({ options, plugin }) => {
4003
- hooks2.callHookWith(async (callbacks) => {
4004
- await Promise.all(callbacks.map((cb) => cb(options)));
4005
- }, "sendTimelineEventToClient" /* SEND_TIMELINE_EVENT_TO_CLIENT */);
4006
- });
4007
- hooks2.hook("getComponentInstances" /* GET_COMPONENT_INSTANCES */, async ({ app }) => {
4008
- const appRecord = app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
4009
- if (!appRecord)
4010
- return null;
4011
- const appId = appRecord.id.toString();
4012
- const instances = [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
4013
- return instances;
4014
- });
4015
- hooks2.hook("getComponentBounds" /* GET_COMPONENT_BOUNDS */, async ({ instance }) => {
4016
- const bounds = getComponentBoundingRect(instance);
4017
- return bounds;
4018
- });
4019
- hooks2.hook("getComponentName" /* GET_COMPONENT_NAME */, ({ instance }) => {
4020
- const name = getInstanceName(instance);
4021
- return name;
4022
- });
4023
- hooks2.hook("componentHighlight" /* COMPONENT_HIGHLIGHT */, ({ uid }) => {
4024
- const instance = activeAppRecord.value.instanceMap.get(uid);
4025
- if (instance) {
4026
- highlight(instance);
4027
- }
4028
- });
4029
- hooks2.hook("componentUnhighlight" /* COMPONENT_UNHIGHLIGHT */, () => {
4030
- unhighlight();
4031
- });
4032
- return hooks2;
4033
- }
4034
-
4035
- // src/ctx/state.ts
4036
- var _a4, _b4;
4037
- (_b4 = (_a4 = target).__VUE_DEVTOOLS_KIT_APP_RECORDS__) != null ? _b4 : _a4.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [];
4038
- var _a5, _b5;
4039
- (_b5 = (_a5 = target).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__) != null ? _b5 : _a5.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = {};
4040
- var _a6, _b6;
4041
- (_b6 = (_a6 = target).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__) != null ? _b6 : _a6.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = "";
4042
- var _a7, _b7;
4043
- (_b7 = (_a7 = target).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__) != null ? _b7 : _a7.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__ = [];
4044
- var _a8, _b8;
4045
- (_b8 = (_a8 = target).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__) != null ? _b8 : _a8.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__ = [];
4046
- var STATE_KEY = "__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";
4047
- function initStateFactory() {
4048
- return {
4049
- connected: false,
4050
- clientConnected: false,
4051
- vitePluginDetected: true,
4052
- appRecords: [],
4053
- activeAppRecordId: "",
4054
- tabs: [],
4055
- commands: [],
4056
- highPerfModeEnabled: true,
4057
- devtoolsClientDetected: {},
4058
- perfUniqueGroupId: 0,
4059
- timelineLayersState: getTimelineLayersStateFromStorage()
4060
- };
4061
- }
4062
- var _a9, _b9;
4063
- (_b9 = (_a9 = target)[STATE_KEY]) != null ? _b9 : _a9[STATE_KEY] = initStateFactory();
4064
- var callStateUpdatedHook = debounce((state) => {
4065
- devtoolsContext.hooks.callHook("devtoolsStateUpdated" /* DEVTOOLS_STATE_UPDATED */, { state });
4066
- });
4067
- debounce((state, oldState) => {
4068
- devtoolsContext.hooks.callHook("devtoolsConnectedUpdated" /* DEVTOOLS_CONNECTED_UPDATED */, { state, oldState });
4069
- });
4070
- var devtoolsAppRecords = new Proxy(target.__VUE_DEVTOOLS_KIT_APP_RECORDS__, {
4071
- get(_target, prop, receiver) {
4072
- if (prop === "value")
4073
- return target.__VUE_DEVTOOLS_KIT_APP_RECORDS__;
4074
- return target.__VUE_DEVTOOLS_KIT_APP_RECORDS__[prop];
4075
- }
4076
- });
4077
- var activeAppRecord = new Proxy(target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__, {
4078
- get(_target, prop, receiver) {
4079
- if (prop === "value")
4080
- return target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__;
4081
- else if (prop === "id")
4082
- return target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__;
4083
- return target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[prop];
4084
- }
4085
- });
4086
- function updateAllStates() {
4087
- callStateUpdatedHook({
4088
- ...target[STATE_KEY],
4089
- appRecords: devtoolsAppRecords.value,
4090
- activeAppRecordId: activeAppRecord.id,
4091
- tabs: target.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,
4092
- commands: target.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__
4093
- });
4094
- }
4095
- function setActiveAppRecord(app) {
4096
- target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = app;
4097
- updateAllStates();
4098
- }
4099
- function setActiveAppRecordId(id) {
4100
- target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = id;
4101
- updateAllStates();
4102
- }
4103
- var devtoolsState = new Proxy(target[STATE_KEY], {
4104
- get(target22, property) {
4105
- if (property === "appRecords") {
4106
- return devtoolsAppRecords;
4107
- } else if (property === "activeAppRecordId") {
4108
- return activeAppRecord.id;
4109
- } else if (property === "tabs") {
4110
- return target.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
4111
- } else if (property === "commands") {
4112
- return target.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
4113
- }
4114
- return target[STATE_KEY][property];
4115
- },
4116
- deleteProperty(target22, property) {
4117
- delete target22[property];
4118
- return true;
4119
- },
4120
- set(target22, property, value) {
4121
- ({ ...target[STATE_KEY] });
4122
- target22[property] = value;
4123
- target[STATE_KEY][property] = value;
4124
- return true;
4125
- }
4126
- });
4127
- function openInEditor(options = {}) {
4128
- var _a25, _b25, _c;
4129
- const { file, host, baseUrl = window.location.origin, line = 0, column = 0 } = options;
4130
- if (file) {
4131
- if (host === "chrome-extension") {
4132
- const fileName = file.replace(/\\/g, "\\\\");
4133
- const _baseUrl = (_b25 = (_a25 = window.VUE_DEVTOOLS_CONFIG) == null ? void 0 : _a25.openInEditorHost) != null ? _b25 : "/";
4134
- fetch(`${_baseUrl}__open-in-editor?file=${encodeURI(file)}`).then((response) => {
4135
- if (!response.ok) {
4136
- const msg = `Opening component ${fileName} failed`;
4137
- console.log(`%c${msg}`, "color:red");
4138
- }
4139
- });
4140
- } else if (devtoolsState.vitePluginDetected) {
4141
- const _baseUrl = (_c = target.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__) != null ? _c : baseUrl;
4142
- target.__VUE_INSPECTOR__.openInEditor(_baseUrl, file, line, column);
4143
- }
4144
- }
4145
- }
4146
-
4147
- // src/core/plugin/index.ts
4148
- init_esm_shims();
4149
-
4150
- // src/api/index.ts
4151
- init_esm_shims();
4152
-
4153
- // src/api/v6/index.ts
4154
- init_esm_shims();
4155
-
4156
- // src/core/plugin/plugin-settings.ts
4157
- init_esm_shims();
4158
-
4159
- // src/ctx/plugin.ts
4160
- init_esm_shims();
4161
- var _a10, _b10;
4162
- (_b10 = (_a10 = target).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__) != null ? _b10 : _a10.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__ = [];
4163
- var devtoolsPluginBuffer = new Proxy(target.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__, {
4164
- get(target22, prop, receiver) {
4165
- return Reflect.get(target22, prop, receiver);
4166
- }
4167
- });
4168
-
4169
- // src/core/plugin/plugin-settings.ts
4170
- function _getSettings(settings) {
4171
- const _settings = {};
4172
- Object.keys(settings).forEach((key) => {
4173
- _settings[key] = settings[key].defaultValue;
4174
- });
4175
- return _settings;
4176
- }
4177
- function getPluginLocalKey(pluginId) {
4178
- return `__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${pluginId}__`;
4179
- }
4180
- function getPluginSettingsOptions(pluginId) {
4181
- var _a25, _b25, _c;
4182
- const item = (_b25 = (_a25 = devtoolsPluginBuffer.find((item2) => {
4183
- var _a26;
4184
- return item2[0].id === pluginId && !!((_a26 = item2[0]) == null ? void 0 : _a26.settings);
4185
- })) == null ? void 0 : _a25[0]) != null ? _b25 : null;
4186
- return (_c = item == null ? void 0 : item.settings) != null ? _c : null;
4187
- }
4188
- function getPluginSettings(pluginId, fallbackValue) {
4189
- var _a25, _b25, _c;
4190
- const localKey = getPluginLocalKey(pluginId);
4191
- if (localKey) {
4192
- const localSettings = localStorage.getItem(localKey);
4193
- if (localSettings) {
4194
- return JSON.parse(localSettings);
4195
- }
4196
- }
4197
- if (pluginId) {
4198
- const item = (_b25 = (_a25 = devtoolsPluginBuffer.find((item2) => item2[0].id === pluginId)) == null ? void 0 : _a25[0]) != null ? _b25 : null;
4199
- return _getSettings((_c = item == null ? void 0 : item.settings) != null ? _c : {});
4200
- }
4201
- return _getSettings(fallbackValue);
4202
- }
4203
- function initPluginSettings(pluginId, settings) {
4204
- const localKey = getPluginLocalKey(pluginId);
4205
- const localSettings = localStorage.getItem(localKey);
4206
- if (!localSettings) {
4207
- localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));
4208
- }
4209
- }
4210
- function setPluginSettings(pluginId, key, value) {
4211
- const localKey = getPluginLocalKey(pluginId);
4212
- const localSettings = localStorage.getItem(localKey);
4213
- const parsedLocalSettings = JSON.parse(localSettings || "{}");
4214
- const updated = {
4215
- ...parsedLocalSettings,
4216
- [key]: value
4217
- };
4218
- localStorage.setItem(localKey, JSON.stringify(updated));
4219
- devtoolsContext.hooks.callHookWith((callbacks) => {
4220
- callbacks.forEach((cb) => cb({
4221
- pluginId,
4222
- key,
4223
- oldValue: parsedLocalSettings[key],
4224
- newValue: value,
4225
- settings: updated
4226
- }));
4227
- }, "setPluginSettings" /* SET_PLUGIN_SETTINGS */);
4228
- }
4229
-
4230
- // src/hook/index.ts
4231
- init_esm_shims();
4232
-
4233
- // src/types/index.ts
4234
- init_esm_shims();
4235
-
4236
- // src/types/app.ts
4237
- init_esm_shims();
4238
-
4239
- // src/types/command.ts
4240
- init_esm_shims();
4241
-
4242
- // src/types/component.ts
4243
- init_esm_shims();
4244
-
4245
- // src/types/hook.ts
4246
- init_esm_shims();
4247
-
4248
- // src/types/inspector.ts
4249
- init_esm_shims();
4250
-
4251
- // src/types/plugin.ts
4252
- init_esm_shims();
4253
-
4254
- // src/types/router.ts
4255
- init_esm_shims();
4256
-
4257
- // src/types/tab.ts
4258
- init_esm_shims();
4259
-
4260
- // src/types/timeline.ts
4261
- init_esm_shims();
4262
-
4263
- // src/hook/index.ts
4264
- var _a11, _b11;
4265
- var devtoolsHooks = (_b11 = (_a11 = target).__VUE_DEVTOOLS_HOOK) != null ? _b11 : _a11.__VUE_DEVTOOLS_HOOK = createHooks();
4266
- var on = {
4267
- vueAppInit(fn) {
4268
- devtoolsHooks.hook("app:init" /* APP_INIT */, fn);
4269
- },
4270
- vueAppUnmount(fn) {
4271
- devtoolsHooks.hook("app:unmount" /* APP_UNMOUNT */, fn);
4272
- },
4273
- vueAppConnected(fn) {
4274
- devtoolsHooks.hook("app:connected" /* APP_CONNECTED */, fn);
4275
- },
4276
- componentAdded(fn) {
4277
- return devtoolsHooks.hook("component:added" /* COMPONENT_ADDED */, fn);
4278
- },
4279
- componentEmit(fn) {
4280
- return devtoolsHooks.hook("component:emit" /* COMPONENT_EMIT */, fn);
4281
- },
4282
- componentUpdated(fn) {
4283
- return devtoolsHooks.hook("component:updated" /* COMPONENT_UPDATED */, fn);
4284
- },
4285
- componentRemoved(fn) {
4286
- return devtoolsHooks.hook("component:removed" /* COMPONENT_REMOVED */, fn);
4287
- },
4288
- setupDevtoolsPlugin(fn) {
4289
- devtoolsHooks.hook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, fn);
4290
- },
4291
- perfStart(fn) {
4292
- return devtoolsHooks.hook("perf:start" /* PERFORMANCE_START */, fn);
4293
- },
4294
- perfEnd(fn) {
4295
- return devtoolsHooks.hook("perf:end" /* PERFORMANCE_END */, fn);
4296
- }
4297
- };
4298
- var hook = {
4299
- on,
4300
- setupDevToolsPlugin(pluginDescriptor, setupFn) {
4301
- return devtoolsHooks.callHook("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);
4302
- }
4303
- };
4304
-
4305
- // src/api/v6/index.ts
4306
- var DevToolsV6PluginAPI = class {
4307
- constructor({ plugin, ctx }) {
4308
- this.hooks = ctx.hooks;
4309
- this.plugin = plugin;
4310
- }
4311
- get on() {
4312
- return {
4313
- // component inspector
4314
- visitComponentTree: (handler) => {
4315
- this.hooks.hook("visitComponentTree" /* VISIT_COMPONENT_TREE */, handler);
4316
- },
4317
- inspectComponent: (handler) => {
4318
- this.hooks.hook("inspectComponent" /* INSPECT_COMPONENT */, handler);
4319
- },
4320
- editComponentState: (handler) => {
4321
- this.hooks.hook("editComponentState" /* EDIT_COMPONENT_STATE */, handler);
4322
- },
4323
- // custom inspector
4324
- getInspectorTree: (handler) => {
4325
- this.hooks.hook("getInspectorTree" /* GET_INSPECTOR_TREE */, handler);
4326
- },
4327
- getInspectorState: (handler) => {
4328
- this.hooks.hook("getInspectorState" /* GET_INSPECTOR_STATE */, handler);
4329
- },
4330
- editInspectorState: (handler) => {
4331
- this.hooks.hook("editInspectorState" /* EDIT_INSPECTOR_STATE */, handler);
4332
- },
4333
- // timeline
4334
- inspectTimelineEvent: (handler) => {
4335
- this.hooks.hook("inspectTimelineEvent" /* INSPECT_TIMELINE_EVENT */, handler);
4336
- },
4337
- timelineCleared: (handler) => {
4338
- this.hooks.hook("timelineCleared" /* TIMELINE_CLEARED */, handler);
4339
- },
4340
- // settings
4341
- setPluginSettings: (handler) => {
4342
- this.hooks.hook("setPluginSettings" /* SET_PLUGIN_SETTINGS */, handler);
4343
- }
4344
- };
4345
- }
4346
- // component inspector
4347
- notifyComponentUpdate(instance) {
4348
- var _a25;
4349
- const inspector = getActiveInspectors().find((i) => i.packageName === this.plugin.descriptor.packageName);
4350
- if (inspector == null ? void 0 : inspector.id) {
4351
- if (instance) {
4352
- const args = [
4353
- instance.appContext.app,
4354
- instance.uid,
4355
- (_a25 = instance.parent) == null ? void 0 : _a25.uid,
4356
- instance
4357
- ];
4358
- devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */, ...args);
4359
- } else {
4360
- devtoolsHooks.callHook("component:updated" /* COMPONENT_UPDATED */);
4361
- }
4362
- this.hooks.callHook("sendInspectorState" /* SEND_INSPECTOR_STATE */, { inspectorId: inspector.id, plugin: this.plugin });
4363
- }
4364
- }
4365
- // custom inspector
4366
- addInspector(options) {
4367
- this.hooks.callHook("addInspector" /* ADD_INSPECTOR */, { inspector: options, plugin: this.plugin });
4368
- if (this.plugin.descriptor.settings) {
4369
- initPluginSettings(options.id, this.plugin.descriptor.settings);
4370
- }
4371
- }
4372
- sendInspectorTree(inspectorId) {
4373
- this.hooks.callHook("sendInspectorTree" /* SEND_INSPECTOR_TREE */, { inspectorId, plugin: this.plugin });
4374
- }
4375
- sendInspectorState(inspectorId) {
4376
- this.hooks.callHook("sendInspectorState" /* SEND_INSPECTOR_STATE */, { inspectorId, plugin: this.plugin });
4377
- }
4378
- selectInspectorNode(inspectorId, nodeId) {
4379
- this.hooks.callHook("customInspectorSelectNode" /* CUSTOM_INSPECTOR_SELECT_NODE */, { inspectorId, nodeId, plugin: this.plugin });
4380
- }
4381
- // timeline
4382
- now() {
4383
- return Date.now();
4384
- }
4385
- addTimelineLayer(options) {
4386
- this.hooks.callHook("timelineLayerAdded" /* TIMELINE_LAYER_ADDED */, { options, plugin: this.plugin });
4387
- }
4388
- addTimelineEvent(options) {
4389
- this.hooks.callHook("timelineEventAdded" /* TIMELINE_EVENT_ADDED */, { options, plugin: this.plugin });
4390
- }
4391
- // settings
4392
- getSettings(pluginId) {
4393
- return getPluginSettings(pluginId != null ? pluginId : this.plugin.descriptor.id, this.plugin.descriptor.settings);
4394
- }
4395
- // utilities
4396
- getComponentInstances(app) {
4397
- return this.hooks.callHook("getComponentInstances" /* GET_COMPONENT_INSTANCES */, { app });
4398
- }
4399
- getComponentBounds(instance) {
4400
- return this.hooks.callHook("getComponentBounds" /* GET_COMPONENT_BOUNDS */, { instance });
4401
- }
4402
- getComponentName(instance) {
4403
- return this.hooks.callHook("getComponentName" /* GET_COMPONENT_NAME */, { instance });
4404
- }
4405
- highlightElement(instance) {
4406
- const uid = instance.__VUE_DEVTOOLS_NEXT_UID__;
4407
- return this.hooks.callHook("componentHighlight" /* COMPONENT_HIGHLIGHT */, { uid });
4408
- }
4409
- unhighlightElement() {
4410
- return this.hooks.callHook("componentUnhighlight" /* COMPONENT_UNHIGHLIGHT */);
4411
- }
4412
- };
4413
-
4414
- // src/api/index.ts
4415
- var DevToolsPluginAPI = DevToolsV6PluginAPI;
4416
-
4417
- // src/core/plugin/components.ts
4418
- init_esm_shims();
4419
-
4420
- // src/core/component/state/index.ts
4421
- init_esm_shims();
4422
-
4423
- // src/core/component/state/process.ts
4424
- init_esm_shims();
4425
-
4426
- // src/core/component/state/constants.ts
4427
- init_esm_shims();
4428
- var UNDEFINED = "__vue_devtool_undefined__";
4429
- var INFINITY = "__vue_devtool_infinity__";
4430
- var NEGATIVE_INFINITY = "__vue_devtool_negative_infinity__";
4431
- var NAN = "__vue_devtool_nan__";
4432
-
4433
- // src/core/component/state/util.ts
4434
- init_esm_shims();
4435
-
4436
- // src/core/component/state/is.ts
4437
- init_esm_shims();
4438
-
4439
- // src/core/component/state/util.ts
4440
- var tokenMap = {
4441
- [UNDEFINED]: "undefined",
4442
- [NAN]: "NaN",
4443
- [INFINITY]: "Infinity",
4444
- [NEGATIVE_INFINITY]: "-Infinity"
4445
- };
4446
- Object.entries(tokenMap).reduce((acc, [key, value]) => {
4447
- acc[value] = key;
4448
- return acc;
4449
- }, {});
4450
-
4451
- // src/core/component/tree/walker.ts
4452
- init_esm_shims();
4453
-
4454
- // src/core/component/tree/filter.ts
4455
- init_esm_shims();
4456
-
4457
- // src/core/timeline/index.ts
4458
- init_esm_shims();
4459
-
4460
- // src/core/timeline/perf.ts
4461
- init_esm_shims();
4462
-
4463
- // src/core/vm/index.ts
4464
- init_esm_shims();
4465
-
4466
- // src/core/plugin/index.ts
4467
- var _a12, _b12;
4468
- (_b12 = (_a12 = target).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__) != null ? _b12 : _a12.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__ = /* @__PURE__ */ new Set();
4469
- function callDevToolsPluginSetupFn(plugin, app) {
4470
- const [pluginDescriptor, setupFn] = plugin;
4471
- if (pluginDescriptor.app !== app)
4472
- return;
4473
- const api = new DevToolsPluginAPI({
4474
- plugin: {
4475
- setupFn,
4476
- descriptor: pluginDescriptor
4477
- },
4478
- ctx: devtoolsContext
4479
- });
4480
- if (pluginDescriptor.packageName === "vuex") {
4481
- api.on.editInspectorState((payload) => {
4482
- api.sendInspectorState(payload.inspectorId);
4483
- });
4484
- }
4485
- setupFn(api);
4486
- }
4487
- function registerDevToolsPlugin(app) {
4488
- if (target.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(app))
4489
- return;
4490
- target.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(app);
4491
- devtoolsPluginBuffer.forEach((plugin) => {
4492
- callDevToolsPluginSetupFn(plugin, app);
4493
- });
4494
- }
4495
-
4496
- // src/core/router/index.ts
4497
- init_esm_shims();
4498
-
4499
- // src/ctx/router.ts
4500
- init_esm_shims();
4501
- var ROUTER_KEY = "__VUE_DEVTOOLS_ROUTER__";
4502
- var ROUTER_INFO_KEY = "__VUE_DEVTOOLS_ROUTER_INFO__";
4503
- var _a13, _b13;
4504
- (_b13 = (_a13 = target)[ROUTER_INFO_KEY]) != null ? _b13 : _a13[ROUTER_INFO_KEY] = {
4505
- currentRoute: null,
4506
- routes: []
4507
- };
4508
- var _a14, _b14;
4509
- (_b14 = (_a14 = target)[ROUTER_KEY]) != null ? _b14 : _a14[ROUTER_KEY] = {};
4510
- new Proxy(target[ROUTER_INFO_KEY], {
4511
- get(target22, property) {
4512
- return target[ROUTER_INFO_KEY][property];
4513
- }
4514
- });
4515
- new Proxy(target[ROUTER_KEY], {
4516
- get(target22, property) {
4517
- if (property === "value") {
4518
- return target[ROUTER_KEY];
4519
- }
4520
- }
4521
- });
4522
-
4523
- // src/core/router/index.ts
4524
- function getRoutes(router) {
4525
- const routesMap = /* @__PURE__ */ new Map();
4526
- return ((router == null ? void 0 : router.getRoutes()) || []).filter((i) => !routesMap.has(i.path) && routesMap.set(i.path, 1));
4527
- }
4528
- function filterRoutes(routes) {
4529
- return routes.map((item) => {
4530
- let { path, name, children, meta } = item;
4531
- if (children == null ? void 0 : children.length)
4532
- children = filterRoutes(children);
4533
- return {
4534
- path,
4535
- name,
4536
- children,
4537
- meta
4538
- };
4539
- });
4540
- }
4541
- function filterCurrentRoute(route) {
4542
- if (route) {
4543
- const { fullPath, hash, href, path, name, matched, params, query } = route;
4544
- return {
4545
- fullPath,
4546
- hash,
4547
- href,
4548
- path,
4549
- name,
4550
- params,
4551
- query,
4552
- matched: filterRoutes(matched)
4553
- };
4554
- }
4555
- return route;
4556
- }
4557
- function normalizeRouterInfo(appRecord, activeAppRecord2) {
4558
- function init() {
4559
- var _a25;
4560
- const router = (_a25 = appRecord.app) == null ? void 0 : _a25.config.globalProperties.$router;
4561
- const currentRoute = filterCurrentRoute(router == null ? void 0 : router.currentRoute.value);
4562
- const routes = filterRoutes(getRoutes(router));
4563
- const c = console.warn;
4564
- console.warn = () => {
4565
- };
4566
- target[ROUTER_INFO_KEY] = {
4567
- currentRoute: currentRoute ? deepClone(currentRoute) : {},
4568
- routes: deepClone(routes)
4569
- };
4570
- target[ROUTER_KEY] = router;
4571
- console.warn = c;
4572
- }
4573
- init();
4574
- hook.on.componentUpdated(debounce(() => {
4575
- var _a25;
4576
- if (((_a25 = activeAppRecord2.value) == null ? void 0 : _a25.app) !== appRecord.app)
4577
- return;
4578
- init();
4579
- devtoolsContext.hooks.callHook("routerInfoUpdated" /* ROUTER_INFO_UPDATED */, { state: target[ROUTER_INFO_KEY] });
4580
- }, 200));
4581
- }
4582
-
4583
- // src/ctx/api.ts
4584
- function createDevToolsApi(hooks2) {
4585
- return {
4586
- // get inspector tree
4587
- async getInspectorTree(payload) {
4588
- const _payload = {
4589
- ...payload,
4590
- app: activeAppRecord.value.app,
4591
- rootNodes: []
4592
- };
4593
- await new Promise((resolve) => {
4594
- hooks2.callHookWith(async (callbacks) => {
4595
- await Promise.all(callbacks.map((cb) => cb(_payload)));
4596
- resolve();
4597
- }, "getInspectorTree" /* GET_INSPECTOR_TREE */);
4598
- });
4599
- return _payload.rootNodes;
4600
- },
4601
- // get inspector state
4602
- async getInspectorState(payload) {
4603
- const _payload = {
4604
- ...payload,
4605
- app: activeAppRecord.value.app,
4606
- state: null
4607
- };
4608
- const ctx = {
4609
- currentTab: `custom-inspector:${payload.inspectorId}`
4610
- };
4611
- await new Promise((resolve) => {
4612
- hooks2.callHookWith(async (callbacks) => {
4613
- await Promise.all(callbacks.map((cb) => cb(_payload, ctx)));
4614
- resolve();
4615
- }, "getInspectorState" /* GET_INSPECTOR_STATE */);
4616
- });
4617
- return _payload.state;
4618
- },
4619
- // edit inspector state
4620
- editInspectorState(payload) {
4621
- const stateEditor2 = new StateEditor();
4622
- const _payload = {
4623
- ...payload,
4624
- app: activeAppRecord.value.app,
4625
- set: (obj, path = payload.path, value = payload.state.value, cb) => {
4626
- stateEditor2.set(obj, path, value, cb || stateEditor2.createDefaultSetCallback(payload.state));
4627
- }
4628
- };
4629
- hooks2.callHookWith((callbacks) => {
4630
- callbacks.forEach((cb) => cb(_payload));
4631
- }, "editInspectorState" /* EDIT_INSPECTOR_STATE */);
4632
- },
4633
- // send inspector state
4634
- sendInspectorState(inspectorId) {
4635
- const inspector = getInspector(inspectorId);
4636
- hooks2.callHook("sendInspectorState" /* SEND_INSPECTOR_STATE */, { inspectorId, plugin: {
4637
- descriptor: inspector.descriptor,
4638
- setupFn: () => ({})
4639
- } });
4640
- },
4641
- // inspect component inspector
4642
- inspectComponentInspector() {
4643
- return inspectComponentHighLighter();
4644
- },
4645
- // cancel inspect component inspector
4646
- cancelInspectComponentInspector() {
4647
- return cancelInspectComponentHighLighter();
4648
- },
4649
- // get component render code
4650
- getComponentRenderCode(id) {
4651
- const instance = getComponentInstance(activeAppRecord.value, id);
4652
- if (instance)
4653
- return !((instance == null ? void 0 : instance.type) instanceof Function) ? instance.render.toString() : instance.type.toString();
4654
- },
4655
- // scroll to component
4656
- scrollToComponent(id) {
4657
- return scrollToComponent({ id });
4658
- },
4659
- // open in editor
4660
- openInEditor,
4661
- // get vue inspector
4662
- getVueInspector: getComponentInspector,
4663
- // toggle app
4664
- toggleApp(id) {
4665
- const appRecord = devtoolsAppRecords.value.find((record) => record.id === id);
4666
- if (appRecord) {
4667
- setActiveAppRecordId(id);
4668
- setActiveAppRecord(appRecord);
4669
- normalizeRouterInfo(appRecord, activeAppRecord);
4670
- callInspectorUpdatedHook();
4671
- registerDevToolsPlugin(appRecord.app);
4672
- }
4673
- },
4674
- // inspect dom
4675
- inspectDOM(instanceId) {
4676
- const instance = getComponentInstance(activeAppRecord.value, instanceId);
4677
- if (instance) {
4678
- const [el] = getRootElementsFromComponentInstance(instance);
4679
- if (el) {
4680
- target.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__ = el;
4681
- }
4682
- }
4683
- },
4684
- updatePluginSettings(pluginId, key, value) {
4685
- setPluginSettings(pluginId, key, value);
4686
- },
4687
- getPluginSettings(pluginId) {
4688
- return {
4689
- options: getPluginSettingsOptions(pluginId),
4690
- values: getPluginSettings(pluginId)
4691
- };
4692
- }
4693
- };
4694
- }
4695
-
4696
- // src/ctx/env.ts
4697
- init_esm_shims();
4698
- var _a15, _b15;
4699
- (_b15 = (_a15 = target).__VUE_DEVTOOLS_ENV__) != null ? _b15 : _a15.__VUE_DEVTOOLS_ENV__ = {
4700
- vitePluginDetected: false
4701
- };
4702
-
4703
- // src/ctx/index.ts
4704
- var hooks = createDevToolsCtxHooks();
4705
- var _a16, _b16;
4706
- (_b16 = (_a16 = target).__VUE_DEVTOOLS_KIT_CONTEXT__) != null ? _b16 : _a16.__VUE_DEVTOOLS_KIT_CONTEXT__ = {
4707
- hooks,
4708
- get state() {
4709
- return {
4710
- ...devtoolsState,
4711
- activeAppRecordId: activeAppRecord.id,
4712
- activeAppRecord: activeAppRecord.value,
4713
- appRecords: devtoolsAppRecords.value
4714
- };
4715
- },
4716
- api: createDevToolsApi(hooks)
4717
- };
4718
- var devtoolsContext = target.__VUE_DEVTOOLS_KIT_CONTEXT__;
4719
-
4720
- // src/core/app/index.ts
4721
- init_esm_shims();
4722
- __toESM(require_speakingurl2());
4723
- var _a17, _b17;
4724
- (_b17 = (_a17 = target).__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__) != null ? _b17 : _a17.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__ = {
4725
- id: 0,
4726
- appIds: /* @__PURE__ */ new Set()
4727
- };
4728
-
4729
- // src/core/high-perf-mode/index.ts
4730
- init_esm_shims();
4731
- function toggleHighPerfMode(state) {
4732
- devtoolsState.highPerfModeEnabled = state != null ? state : !devtoolsState.highPerfModeEnabled;
4733
- }
4734
-
4735
- // src/core/component/state/format.ts
4736
- init_esm_shims();
4737
-
4738
- // src/core/component/state/reviver.ts
4739
- init_esm_shims();
4740
-
4741
- // src/core/devtools-client/detected.ts
4742
- init_esm_shims();
4743
- function updateDevToolsClientDetected(params) {
4744
- devtoolsState.devtoolsClientDetected = {
4745
- ...devtoolsState.devtoolsClientDetected,
4746
- ...params
4747
- };
4748
- const devtoolsClientVisible = Object.values(devtoolsState.devtoolsClientDetected).some(Boolean);
4749
- toggleHighPerfMode(!devtoolsClientVisible);
4750
- }
4751
- var _a18, _b18;
4752
- (_b18 = (_a18 = target).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__) != null ? _b18 : _a18.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ = updateDevToolsClientDetected;
4753
-
4754
- // src/messaging/index.ts
4755
- init_esm_shims();
4756
-
4757
- // src/messaging/presets/index.ts
4758
- init_esm_shims();
4759
-
4760
- // src/messaging/presets/broadcast-channel/index.ts
4761
- init_esm_shims();
4762
-
4763
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/index.js
4764
- init_esm_shims();
4765
-
4766
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/class-registry.js
4767
- init_esm_shims();
4768
-
4769
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/registry.js
4770
- init_esm_shims();
4771
-
4772
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/double-indexed-kv.js
4773
- init_esm_shims();
4774
- var DoubleIndexedKV = class {
4775
- constructor() {
4776
- this.keyToValue = /* @__PURE__ */ new Map();
4777
- this.valueToKey = /* @__PURE__ */ new Map();
4778
- }
4779
- set(key, value) {
4780
- this.keyToValue.set(key, value);
4781
- this.valueToKey.set(value, key);
4782
- }
4783
- getByKey(key) {
4784
- return this.keyToValue.get(key);
4785
- }
4786
- getByValue(value) {
4787
- return this.valueToKey.get(value);
4788
- }
4789
- clear() {
4790
- this.keyToValue.clear();
4791
- this.valueToKey.clear();
4792
- }
4793
- };
4794
-
4795
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/registry.js
4796
- var Registry = class {
4797
- constructor(generateIdentifier) {
4798
- this.generateIdentifier = generateIdentifier;
4799
- this.kv = new DoubleIndexedKV();
4800
- }
4801
- register(value, identifier) {
4802
- if (this.kv.getByValue(value)) {
4803
- return;
4804
- }
4805
- if (!identifier) {
4806
- identifier = this.generateIdentifier(value);
4807
- }
4808
- this.kv.set(identifier, value);
4809
- }
4810
- clear() {
4811
- this.kv.clear();
4812
- }
4813
- getIdentifier(value) {
4814
- return this.kv.getByValue(value);
4815
- }
4816
- getValue(identifier) {
4817
- return this.kv.getByKey(identifier);
4818
- }
4819
- };
4820
-
4821
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/class-registry.js
4822
- var ClassRegistry = class extends Registry {
4823
- constructor() {
4824
- super((c) => c.name);
4825
- this.classToAllowedProps = /* @__PURE__ */ new Map();
4826
- }
4827
- register(value, options) {
4828
- if (typeof options === "object") {
4829
- if (options.allowProps) {
4830
- this.classToAllowedProps.set(value, options.allowProps);
4831
- }
4832
- super.register(value, options.identifier);
4833
- } else {
4834
- super.register(value, options);
4835
- }
4836
- }
4837
- getAllowedProps(value) {
4838
- return this.classToAllowedProps.get(value);
4839
- }
4840
- };
4841
-
4842
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/custom-transformer-registry.js
4843
- init_esm_shims();
4844
-
4845
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/util.js
4846
- init_esm_shims();
4847
- function valuesOfObj(record) {
4848
- if ("values" in Object) {
4849
- return Object.values(record);
4850
- }
4851
- const values = [];
4852
- for (const key in record) {
4853
- if (record.hasOwnProperty(key)) {
4854
- values.push(record[key]);
4855
- }
4856
- }
4857
- return values;
4858
- }
4859
- function find(record, predicate) {
4860
- const values = valuesOfObj(record);
4861
- if ("find" in values) {
4862
- return values.find(predicate);
4863
- }
4864
- const valuesNotNever = values;
4865
- for (let i = 0; i < valuesNotNever.length; i++) {
4866
- const value = valuesNotNever[i];
4867
- if (predicate(value)) {
4868
- return value;
4869
- }
4870
- }
4871
- return void 0;
4872
- }
4873
- function forEach(record, run) {
4874
- Object.entries(record).forEach(([key, value]) => run(value, key));
4875
- }
4876
- function includes(arr, value) {
4877
- return arr.indexOf(value) !== -1;
4878
- }
4879
- function findArr(record, predicate) {
4880
- for (let i = 0; i < record.length; i++) {
4881
- const value = record[i];
4882
- if (predicate(value)) {
4883
- return value;
4884
- }
4885
- }
4886
- return void 0;
4887
- }
4888
-
4889
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/custom-transformer-registry.js
4890
- var CustomTransformerRegistry = class {
4891
- constructor() {
4892
- this.transfomers = {};
4893
- }
4894
- register(transformer) {
4895
- this.transfomers[transformer.name] = transformer;
4896
- }
4897
- findApplicable(v) {
4898
- return find(this.transfomers, (transformer) => transformer.isApplicable(v));
4899
- }
4900
- findByName(name) {
4901
- return this.transfomers[name];
4902
- }
4903
- };
4904
-
4905
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/plainer.js
4906
- init_esm_shims();
4907
-
4908
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/is.js
4909
- init_esm_shims();
4910
- var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
4911
- var isUndefined = (payload) => typeof payload === "undefined";
4912
- var isNull = (payload) => payload === null;
4913
- var isPlainObject2 = (payload) => {
4914
- if (typeof payload !== "object" || payload === null)
4915
- return false;
4916
- if (payload === Object.prototype)
4917
- return false;
4918
- if (Object.getPrototypeOf(payload) === null)
4919
- return true;
4920
- return Object.getPrototypeOf(payload) === Object.prototype;
4921
- };
4922
- var isEmptyObject = (payload) => isPlainObject2(payload) && Object.keys(payload).length === 0;
4923
- var isArray = (payload) => Array.isArray(payload);
4924
- var isString = (payload) => typeof payload === "string";
4925
- var isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
4926
- var isBoolean = (payload) => typeof payload === "boolean";
4927
- var isRegExp = (payload) => payload instanceof RegExp;
4928
- var isMap = (payload) => payload instanceof Map;
4929
- var isSet = (payload) => payload instanceof Set;
4930
- var isSymbol = (payload) => getType(payload) === "Symbol";
4931
- var isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
4932
- var isError = (payload) => payload instanceof Error;
4933
- var isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
4934
- var isPrimitive2 = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
4935
- var isBigint = (payload) => typeof payload === "bigint";
4936
- var isInfinite = (payload) => payload === Infinity || payload === -Infinity;
4937
- var isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
4938
- var isURL = (payload) => payload instanceof URL;
4939
-
4940
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/pathstringifier.js
4941
- init_esm_shims();
4942
- var escapeKey = (key) => key.replace(/\./g, "\\.");
4943
- var stringifyPath = (path) => path.map(String).map(escapeKey).join(".");
4944
- var parsePath = (string) => {
4945
- const result = [];
4946
- let segment = "";
4947
- for (let i = 0; i < string.length; i++) {
4948
- let char = string.charAt(i);
4949
- const isEscapedDot = char === "\\" && string.charAt(i + 1) === ".";
4950
- if (isEscapedDot) {
4951
- segment += ".";
4952
- i++;
4953
- continue;
4954
- }
4955
- const isEndOfSegment = char === ".";
4956
- if (isEndOfSegment) {
4957
- result.push(segment);
4958
- segment = "";
4959
- continue;
4960
- }
4961
- segment += char;
4962
- }
4963
- const lastSegment = segment;
4964
- result.push(lastSegment);
4965
- return result;
4966
- };
4967
-
4968
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/transformer.js
4969
- init_esm_shims();
4970
- function simpleTransformation(isApplicable, annotation, transform, untransform) {
4971
- return {
4972
- isApplicable,
4973
- annotation,
4974
- transform,
4975
- untransform
4976
- };
4977
- }
4978
- var simpleRules = [
4979
- simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
4980
- simpleTransformation(isBigint, "bigint", (v) => v.toString(), (v) => {
4981
- if (typeof BigInt !== "undefined") {
4982
- return BigInt(v);
4983
- }
4984
- console.error("Please add a BigInt polyfill.");
4985
- return v;
4986
- }),
4987
- simpleTransformation(isDate, "Date", (v) => v.toISOString(), (v) => new Date(v)),
4988
- simpleTransformation(isError, "Error", (v, superJson) => {
4989
- const baseError = {
4990
- name: v.name,
4991
- message: v.message
4992
- };
4993
- superJson.allowedErrorProps.forEach((prop) => {
4994
- baseError[prop] = v[prop];
4995
- });
4996
- return baseError;
4997
- }, (v, superJson) => {
4998
- const e = new Error(v.message);
4999
- e.name = v.name;
5000
- e.stack = v.stack;
5001
- superJson.allowedErrorProps.forEach((prop) => {
5002
- e[prop] = v[prop];
5003
- });
5004
- return e;
5005
- }),
5006
- simpleTransformation(isRegExp, "regexp", (v) => "" + v, (regex) => {
5007
- const body = regex.slice(1, regex.lastIndexOf("/"));
5008
- const flags = regex.slice(regex.lastIndexOf("/") + 1);
5009
- return new RegExp(body, flags);
5010
- }),
5011
- simpleTransformation(
5012
- isSet,
5013
- "set",
5014
- // (sets only exist in es6+)
5015
- // eslint-disable-next-line es5/no-es6-methods
5016
- (v) => [...v.values()],
5017
- (v) => new Set(v)
5018
- ),
5019
- simpleTransformation(isMap, "map", (v) => [...v.entries()], (v) => new Map(v)),
5020
- simpleTransformation((v) => isNaNValue(v) || isInfinite(v), "number", (v) => {
5021
- if (isNaNValue(v)) {
5022
- return "NaN";
5023
- }
5024
- if (v > 0) {
5025
- return "Infinity";
5026
- } else {
5027
- return "-Infinity";
5028
- }
5029
- }, Number),
5030
- simpleTransformation((v) => v === 0 && 1 / v === -Infinity, "number", () => {
5031
- return "-0";
5032
- }, Number),
5033
- simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
5034
- ];
5035
- function compositeTransformation(isApplicable, annotation, transform, untransform) {
5036
- return {
5037
- isApplicable,
5038
- annotation,
5039
- transform,
5040
- untransform
5041
- };
5042
- }
5043
- var symbolRule = compositeTransformation((s, superJson) => {
5044
- if (isSymbol(s)) {
5045
- const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
5046
- return isRegistered;
5047
- }
5048
- return false;
5049
- }, (s, superJson) => {
5050
- const identifier = superJson.symbolRegistry.getIdentifier(s);
5051
- return ["symbol", identifier];
5052
- }, (v) => v.description, (_, a, superJson) => {
5053
- const value = superJson.symbolRegistry.getValue(a[1]);
5054
- if (!value) {
5055
- throw new Error("Trying to deserialize unknown symbol");
5056
- }
5057
- return value;
5058
- });
5059
- var constructorToName = [
5060
- Int8Array,
5061
- Uint8Array,
5062
- Int16Array,
5063
- Uint16Array,
5064
- Int32Array,
5065
- Uint32Array,
5066
- Float32Array,
5067
- Float64Array,
5068
- Uint8ClampedArray
5069
- ].reduce((obj, ctor) => {
5070
- obj[ctor.name] = ctor;
5071
- return obj;
5072
- }, {});
5073
- var typedArrayRule = compositeTransformation(isTypedArray, (v) => ["typed-array", v.constructor.name], (v) => [...v], (v, a) => {
5074
- const ctor = constructorToName[a[1]];
5075
- if (!ctor) {
5076
- throw new Error("Trying to deserialize unknown typed array");
5077
- }
5078
- return new ctor(v);
5079
- });
5080
- function isInstanceOfRegisteredClass(potentialClass, superJson) {
5081
- if (potentialClass == null ? void 0 : potentialClass.constructor) {
5082
- const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
5083
- return isRegistered;
5084
- }
5085
- return false;
5086
- }
5087
- var classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
5088
- const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
5089
- return ["class", identifier];
5090
- }, (clazz, superJson) => {
5091
- const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
5092
- if (!allowedProps) {
5093
- return { ...clazz };
5094
- }
5095
- const result = {};
5096
- allowedProps.forEach((prop) => {
5097
- result[prop] = clazz[prop];
5098
- });
5099
- return result;
5100
- }, (v, a, superJson) => {
5101
- const clazz = superJson.classRegistry.getValue(a[1]);
5102
- if (!clazz) {
5103
- throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");
5104
- }
5105
- return Object.assign(Object.create(clazz.prototype), v);
5106
- });
5107
- var customRule = compositeTransformation((value, superJson) => {
5108
- return !!superJson.customTransformerRegistry.findApplicable(value);
5109
- }, (value, superJson) => {
5110
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
5111
- return ["custom", transformer.name];
5112
- }, (value, superJson) => {
5113
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
5114
- return transformer.serialize(value);
5115
- }, (v, a, superJson) => {
5116
- const transformer = superJson.customTransformerRegistry.findByName(a[1]);
5117
- if (!transformer) {
5118
- throw new Error("Trying to deserialize unknown custom value");
5119
- }
5120
- return transformer.deserialize(v);
5121
- });
5122
- var compositeRules = [classRule, symbolRule, customRule, typedArrayRule];
5123
- var transformValue = (value, superJson) => {
5124
- const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));
5125
- if (applicableCompositeRule) {
5126
- return {
5127
- value: applicableCompositeRule.transform(value, superJson),
5128
- type: applicableCompositeRule.annotation(value, superJson)
5129
- };
5130
- }
5131
- const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));
5132
- if (applicableSimpleRule) {
5133
- return {
5134
- value: applicableSimpleRule.transform(value, superJson),
5135
- type: applicableSimpleRule.annotation
5136
- };
5137
- }
5138
- return void 0;
5139
- };
5140
- var simpleRulesByAnnotation = {};
5141
- simpleRules.forEach((rule) => {
5142
- simpleRulesByAnnotation[rule.annotation] = rule;
5143
- });
5144
- var untransformValue = (json, type, superJson) => {
5145
- if (isArray(type)) {
5146
- switch (type[0]) {
5147
- case "symbol":
5148
- return symbolRule.untransform(json, type, superJson);
5149
- case "class":
5150
- return classRule.untransform(json, type, superJson);
5151
- case "custom":
5152
- return customRule.untransform(json, type, superJson);
5153
- case "typed-array":
5154
- return typedArrayRule.untransform(json, type, superJson);
5155
- default:
5156
- throw new Error("Unknown transformation: " + type);
5157
- }
5158
- } else {
5159
- const transformation = simpleRulesByAnnotation[type];
5160
- if (!transformation) {
5161
- throw new Error("Unknown transformation: " + type);
5162
- }
5163
- return transformation.untransform(json, superJson);
5164
- }
5165
- };
5166
-
5167
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/accessDeep.js
5168
- init_esm_shims();
5169
- var getNthKey = (value, n) => {
5170
- const keys = value.keys();
5171
- while (n > 0) {
5172
- keys.next();
5173
- n--;
5174
- }
5175
- return keys.next().value;
5176
- };
5177
- function validatePath(path) {
5178
- if (includes(path, "__proto__")) {
5179
- throw new Error("__proto__ is not allowed as a property");
5180
- }
5181
- if (includes(path, "prototype")) {
5182
- throw new Error("prototype is not allowed as a property");
5183
- }
5184
- if (includes(path, "constructor")) {
5185
- throw new Error("constructor is not allowed as a property");
5186
- }
5187
- }
5188
- var getDeep = (object, path) => {
5189
- validatePath(path);
5190
- for (let i = 0; i < path.length; i++) {
5191
- const key = path[i];
5192
- if (isSet(object)) {
5193
- object = getNthKey(object, +key);
5194
- } else if (isMap(object)) {
5195
- const row = +key;
5196
- const type = +path[++i] === 0 ? "key" : "value";
5197
- const keyOfRow = getNthKey(object, row);
5198
- switch (type) {
5199
- case "key":
5200
- object = keyOfRow;
5201
- break;
5202
- case "value":
5203
- object = object.get(keyOfRow);
5204
- break;
5205
- }
5206
- } else {
5207
- object = object[key];
5208
- }
5209
- }
5210
- return object;
5211
- };
5212
- var setDeep = (object, path, mapper) => {
5213
- validatePath(path);
5214
- if (path.length === 0) {
5215
- return mapper(object);
5216
- }
5217
- let parent = object;
5218
- for (let i = 0; i < path.length - 1; i++) {
5219
- const key = path[i];
5220
- if (isArray(parent)) {
5221
- const index = +key;
5222
- parent = parent[index];
5223
- } else if (isPlainObject2(parent)) {
5224
- parent = parent[key];
5225
- } else if (isSet(parent)) {
5226
- const row = +key;
5227
- parent = getNthKey(parent, row);
5228
- } else if (isMap(parent)) {
5229
- const isEnd = i === path.length - 2;
5230
- if (isEnd) {
5231
- break;
5232
- }
5233
- const row = +key;
5234
- const type = +path[++i] === 0 ? "key" : "value";
5235
- const keyOfRow = getNthKey(parent, row);
5236
- switch (type) {
5237
- case "key":
5238
- parent = keyOfRow;
5239
- break;
5240
- case "value":
5241
- parent = parent.get(keyOfRow);
5242
- break;
5243
- }
5244
- }
5245
- }
5246
- const lastKey = path[path.length - 1];
5247
- if (isArray(parent)) {
5248
- parent[+lastKey] = mapper(parent[+lastKey]);
5249
- } else if (isPlainObject2(parent)) {
5250
- parent[lastKey] = mapper(parent[lastKey]);
5251
- }
5252
- if (isSet(parent)) {
5253
- const oldValue = getNthKey(parent, +lastKey);
5254
- const newValue = mapper(oldValue);
5255
- if (oldValue !== newValue) {
5256
- parent.delete(oldValue);
5257
- parent.add(newValue);
5258
- }
5259
- }
5260
- if (isMap(parent)) {
5261
- const row = +path[path.length - 2];
5262
- const keyToRow = getNthKey(parent, row);
5263
- const type = +lastKey === 0 ? "key" : "value";
5264
- switch (type) {
5265
- case "key": {
5266
- const newKey = mapper(keyToRow);
5267
- parent.set(newKey, parent.get(keyToRow));
5268
- if (newKey !== keyToRow) {
5269
- parent.delete(keyToRow);
5270
- }
5271
- break;
5272
- }
5273
- case "value": {
5274
- parent.set(keyToRow, mapper(parent.get(keyToRow)));
5275
- break;
5276
- }
5277
- }
5278
- }
5279
- return object;
5280
- };
5281
-
5282
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/plainer.js
5283
- function traverse(tree, walker2, origin = []) {
5284
- if (!tree) {
5285
- return;
5286
- }
5287
- if (!isArray(tree)) {
5288
- forEach(tree, (subtree, key) => traverse(subtree, walker2, [...origin, ...parsePath(key)]));
5289
- return;
5290
- }
5291
- const [nodeValue, children] = tree;
5292
- if (children) {
5293
- forEach(children, (child, key) => {
5294
- traverse(child, walker2, [...origin, ...parsePath(key)]);
5295
- });
5296
- }
5297
- walker2(nodeValue, origin);
5298
- }
5299
- function applyValueAnnotations(plain, annotations, superJson) {
5300
- traverse(annotations, (type, path) => {
5301
- plain = setDeep(plain, path, (v) => untransformValue(v, type, superJson));
5302
- });
5303
- return plain;
5304
- }
5305
- function applyReferentialEqualityAnnotations(plain, annotations) {
5306
- function apply(identicalPaths, path) {
5307
- const object = getDeep(plain, parsePath(path));
5308
- identicalPaths.map(parsePath).forEach((identicalObjectPath) => {
5309
- plain = setDeep(plain, identicalObjectPath, () => object);
5310
- });
5311
- }
5312
- if (isArray(annotations)) {
5313
- const [root, other] = annotations;
5314
- root.forEach((identicalPath) => {
5315
- plain = setDeep(plain, parsePath(identicalPath), () => plain);
5316
- });
5317
- if (other) {
5318
- forEach(other, apply);
5319
- }
5320
- } else {
5321
- forEach(annotations, apply);
5322
- }
5323
- return plain;
5324
- }
5325
- var isDeep = (object, superJson) => isPlainObject2(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson);
5326
- function addIdentity(object, path, identities) {
5327
- const existingSet = identities.get(object);
5328
- if (existingSet) {
5329
- existingSet.push(path);
5330
- } else {
5331
- identities.set(object, [path]);
5332
- }
5333
- }
5334
- function generateReferentialEqualityAnnotations(identitites, dedupe) {
5335
- const result = {};
5336
- let rootEqualityPaths = void 0;
5337
- identitites.forEach((paths) => {
5338
- if (paths.length <= 1) {
5339
- return;
5340
- }
5341
- if (!dedupe) {
5342
- paths = paths.map((path) => path.map(String)).sort((a, b) => a.length - b.length);
5343
- }
5344
- const [representativePath, ...identicalPaths] = paths;
5345
- if (representativePath.length === 0) {
5346
- rootEqualityPaths = identicalPaths.map(stringifyPath);
5347
- } else {
5348
- result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
5349
- }
5350
- });
5351
- if (rootEqualityPaths) {
5352
- if (isEmptyObject(result)) {
5353
- return [rootEqualityPaths];
5354
- } else {
5355
- return [rootEqualityPaths, result];
5356
- }
5357
- } else {
5358
- return isEmptyObject(result) ? void 0 : result;
5359
- }
5360
- }
5361
- var walker = (object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
5362
- var _a25;
5363
- const primitive = isPrimitive2(object);
5364
- if (!primitive) {
5365
- addIdentity(object, path, identities);
5366
- const seen = seenObjects.get(object);
5367
- if (seen) {
5368
- return dedupe ? {
5369
- transformedValue: null
5370
- } : seen;
5371
- }
5372
- }
5373
- if (!isDeep(object, superJson)) {
5374
- const transformed2 = transformValue(object, superJson);
5375
- const result2 = transformed2 ? {
5376
- transformedValue: transformed2.value,
5377
- annotations: [transformed2.type]
5378
- } : {
5379
- transformedValue: object
5380
- };
5381
- if (!primitive) {
5382
- seenObjects.set(object, result2);
5383
- }
5384
- return result2;
5385
- }
5386
- if (includes(objectsInThisPath, object)) {
5387
- return {
5388
- transformedValue: null
5389
- };
5390
- }
5391
- const transformationResult = transformValue(object, superJson);
5392
- const transformed = (_a25 = transformationResult == null ? void 0 : transformationResult.value) != null ? _a25 : object;
5393
- const transformedValue = isArray(transformed) ? [] : {};
5394
- const innerAnnotations = {};
5395
- forEach(transformed, (value, index) => {
5396
- if (index === "__proto__" || index === "constructor" || index === "prototype") {
5397
- throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);
5398
- }
5399
- const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index], [...objectsInThisPath, object], seenObjects);
5400
- transformedValue[index] = recursiveResult.transformedValue;
5401
- if (isArray(recursiveResult.annotations)) {
5402
- innerAnnotations[index] = recursiveResult.annotations;
5403
- } else if (isPlainObject2(recursiveResult.annotations)) {
5404
- forEach(recursiveResult.annotations, (tree, key) => {
5405
- innerAnnotations[escapeKey(index) + "." + key] = tree;
5406
- });
5407
- }
5408
- });
5409
- const result = isEmptyObject(innerAnnotations) ? {
5410
- transformedValue,
5411
- annotations: !!transformationResult ? [transformationResult.type] : void 0
5412
- } : {
5413
- transformedValue,
5414
- annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
5415
- };
5416
- if (!primitive) {
5417
- seenObjects.set(object, result);
5418
- }
5419
- return result;
5420
- };
5421
-
5422
- // ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
5423
- init_esm_shims();
5424
-
5425
- // ../../node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.js
5426
- init_esm_shims();
5427
- function getType2(payload) {
5428
- return Object.prototype.toString.call(payload).slice(8, -1);
5429
- }
5430
- function isArray2(payload) {
5431
- return getType2(payload) === "Array";
5432
- }
5433
- function isPlainObject3(payload) {
5434
- if (getType2(payload) !== "Object")
5435
- return false;
5436
- const prototype = Object.getPrototypeOf(payload);
5437
- return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
5438
- }
5439
-
5440
- // ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
5441
- function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
5442
- const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
5443
- if (propType === "enumerable")
5444
- carry[key] = newVal;
5445
- if (includeNonenumerable && propType === "nonenumerable") {
5446
- Object.defineProperty(carry, key, {
5447
- value: newVal,
5448
- enumerable: false,
5449
- writable: true,
5450
- configurable: true
5451
- });
5452
- }
5453
- }
5454
- function copy(target22, options = {}) {
5455
- if (isArray2(target22)) {
5456
- return target22.map((item) => copy(item, options));
5457
- }
5458
- if (!isPlainObject3(target22)) {
5459
- return target22;
5460
- }
5461
- const props = Object.getOwnPropertyNames(target22);
5462
- const symbols = Object.getOwnPropertySymbols(target22);
5463
- return [...props, ...symbols].reduce((carry, key) => {
5464
- if (isArray2(options.props) && !options.props.includes(key)) {
5465
- return carry;
5466
- }
5467
- const val = target22[key];
5468
- const newVal = copy(val, options);
5469
- assignProp(carry, key, newVal, target22, options.nonenumerable);
5470
- return carry;
5471
- }, {});
5472
- }
5473
-
5474
- // ../../node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/index.js
5475
- var SuperJSON = class {
5476
- /**
5477
- * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
5478
- */
5479
- constructor({ dedupe = false } = {}) {
5480
- this.classRegistry = new ClassRegistry();
5481
- this.symbolRegistry = new Registry((s) => {
5482
- var _a25;
5483
- return (_a25 = s.description) != null ? _a25 : "";
5484
- });
5485
- this.customTransformerRegistry = new CustomTransformerRegistry();
5486
- this.allowedErrorProps = [];
5487
- this.dedupe = dedupe;
5488
- }
5489
- serialize(object) {
5490
- const identities = /* @__PURE__ */ new Map();
5491
- const output = walker(object, identities, this, this.dedupe);
5492
- const res = {
5493
- json: output.transformedValue
5494
- };
5495
- if (output.annotations) {
5496
- res.meta = {
5497
- ...res.meta,
5498
- values: output.annotations
5499
- };
5500
- }
5501
- const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
5502
- if (equalityAnnotations) {
5503
- res.meta = {
5504
- ...res.meta,
5505
- referentialEqualities: equalityAnnotations
5506
- };
5507
- }
5508
- return res;
5509
- }
5510
- deserialize(payload) {
5511
- const { json, meta } = payload;
5512
- let result = copy(json);
5513
- if (meta == null ? void 0 : meta.values) {
5514
- result = applyValueAnnotations(result, meta.values, this);
5515
- }
5516
- if (meta == null ? void 0 : meta.referentialEqualities) {
5517
- result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
5518
- }
5519
- return result;
5520
- }
5521
- stringify(object) {
5522
- return JSON.stringify(this.serialize(object));
5523
- }
5524
- parse(string) {
5525
- return this.deserialize(JSON.parse(string));
5526
- }
5527
- registerClass(v, options) {
5528
- this.classRegistry.register(v, options);
5529
- }
5530
- registerSymbol(v, identifier) {
5531
- this.symbolRegistry.register(v, identifier);
5532
- }
5533
- registerCustom(transformer, name) {
5534
- this.customTransformerRegistry.register({
5535
- name,
5536
- ...transformer
5537
- });
5538
- }
5539
- allowErrorProps(...props) {
5540
- this.allowedErrorProps.push(...props);
5541
- }
5542
- };
5543
- SuperJSON.defaultInstance = new SuperJSON();
5544
- SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
5545
- SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
5546
- SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
5547
- SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
5548
- SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
5549
- SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
5550
- SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
5551
- SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
5552
-
5553
- // src/messaging/presets/broadcast-channel/context.ts
5554
- init_esm_shims();
5555
-
5556
- // src/messaging/presets/electron/index.ts
5557
- init_esm_shims();
5558
-
5559
- // src/messaging/presets/electron/client.ts
5560
- init_esm_shims();
5561
-
5562
- // src/messaging/presets/electron/context.ts
5563
- init_esm_shims();
5564
-
5565
- // src/messaging/presets/electron/proxy.ts
5566
- init_esm_shims();
5567
-
5568
- // src/messaging/presets/electron/server.ts
5569
- init_esm_shims();
5570
-
5571
- // src/messaging/presets/extension/index.ts
5572
- init_esm_shims();
5573
-
5574
- // src/messaging/presets/extension/client.ts
5575
- init_esm_shims();
5576
-
5577
- // src/messaging/presets/extension/context.ts
5578
- init_esm_shims();
5579
-
5580
- // src/messaging/presets/extension/proxy.ts
5581
- init_esm_shims();
5582
-
5583
- // src/messaging/presets/extension/server.ts
5584
- init_esm_shims();
5585
-
5586
- // src/messaging/presets/iframe/index.ts
5587
- init_esm_shims();
5588
-
5589
- // src/messaging/presets/iframe/client.ts
5590
- init_esm_shims();
5591
-
5592
- // src/messaging/presets/iframe/context.ts
5593
- init_esm_shims();
5594
-
5595
- // src/messaging/presets/iframe/server.ts
5596
- init_esm_shims();
5597
-
5598
- // src/messaging/presets/vite/index.ts
5599
- init_esm_shims();
5600
-
5601
- // src/messaging/presets/vite/client.ts
5602
- init_esm_shims();
5603
-
5604
- // src/messaging/presets/vite/context.ts
5605
- init_esm_shims();
5606
-
5607
- // src/messaging/presets/vite/server.ts
5608
- init_esm_shims();
5609
-
5610
- // src/messaging/presets/ws/index.ts
5611
- init_esm_shims();
5612
-
5613
- // src/messaging/presets/ws/client.ts
5614
- init_esm_shims();
5615
-
5616
- // src/messaging/presets/ws/context.ts
5617
- init_esm_shims();
5618
-
5619
- // src/messaging/presets/ws/server.ts
5620
- init_esm_shims();
5621
-
5622
- // src/messaging/index.ts
5623
- var _a19, _b19;
5624
- (_b19 = (_a19 = target).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__) != null ? _b19 : _a19.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__ = [];
5625
- var _a20, _b20;
5626
- (_b20 = (_a20 = target).__VUE_DEVTOOLS_KIT_RPC_CLIENT__) != null ? _b20 : _a20.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = null;
5627
- var _a21, _b21;
5628
- (_b21 = (_a21 = target).__VUE_DEVTOOLS_KIT_RPC_SERVER__) != null ? _b21 : _a21.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = null;
5629
- var _a22, _b22;
5630
- (_b22 = (_a22 = target).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__) != null ? _b22 : _a22.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = null;
5631
- var _a23, _b23;
5632
- (_b23 = (_a23 = target).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__) != null ? _b23 : _a23.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = null;
5633
- var _a24, _b24;
5634
- (_b24 = (_a24 = target).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__) != null ? _b24 : _a24.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__ = null;
5635
-
5636
- // src/shared/index.ts
5637
- init_esm_shims();
5638
-
5639
- // src/shared/env.ts
5640
- init_esm_shims();
5641
-
5642
- // src/shared/time.ts
5643
- init_esm_shims();
5644
-
5645
- // src/shared/util.ts
5646
- init_esm_shims();
5647
-
5648
- // src/core/component/state/replacer.ts
5649
- init_esm_shims();
5650
-
5651
- // src/core/component/state/custom.ts
5652
- init_esm_shims();
5653
-
5654
- // src/shared/transfer.ts
5655
- init_esm_shims();
5656
-
5657
1169
  /**
5658
1170
  * Creates a field composite.
5659
1171
  */
@@ -6231,6 +1743,7 @@ function resolveInitialValues(opts) {
6231
1743
  function useForm(opts) {
6232
1744
  var _a;
6233
1745
  const formId = FORM_COUNTER++;
1746
+ const name = (opts === null || opts === void 0 ? void 0 : opts.name) || 'Form';
6234
1747
  // Prevents fields from double resetting their values, which causes checkboxes to toggle their initial value
6235
1748
  let FIELD_ID_COUNTER = 0;
6236
1749
  // If the form is currently submitting
@@ -6630,6 +2143,7 @@ function useForm(opts) {
6630
2143
  });
6631
2144
  }
6632
2145
  const formCtx = {
2146
+ name,
6633
2147
  formId,
6634
2148
  values: formValues,
6635
2149
  controlledValues,
@@ -7169,6 +2683,10 @@ const FormImpl = /** #__PURE__ */ vue.defineComponent({
7169
2683
  type: Boolean,
7170
2684
  default: false,
7171
2685
  },
2686
+ name: {
2687
+ type: String,
2688
+ default: 'Form',
2689
+ },
7172
2690
  },
7173
2691
  setup(props, ctx) {
7174
2692
  const validationSchema = vue.toRef(props, 'validationSchema');
@@ -7180,6 +2698,7 @@ const FormImpl = /** #__PURE__ */ vue.defineComponent({
7180
2698
  initialTouched: props.initialTouched,
7181
2699
  validateOnMount: props.validateOnMount,
7182
2700
  keepValuesOnUnmount: keepValues,
2701
+ name: props.name,
7183
2702
  });
7184
2703
  const submitForm = handleSubmit((_, { evt }) => {
7185
2704
  if (isFormSubmitEvent(evt)) {