@vingy/vuebugger 0.3.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs DELETED
@@ -1,3959 +0,0 @@
1
- import { effectScope, getCurrentInstance, getCurrentScope, isReadonly, onScopeDispose, toValue, watch } from "vue";
2
-
3
- //#region src/registry.ts
4
- const byUid = /* @__PURE__ */ new Map();
5
- const byGroupId = /* @__PURE__ */ new Map();
6
- const callbacks = [];
7
- const runCallbacks = (entry) => callbacks.forEach((cb) => cb(entry));
8
- const withCallbacks = (fn) => (entry) => {
9
- fn(entry);
10
- runCallbacks(entry);
11
- };
12
- const upsert = withCallbacks((entry) => {
13
- const { uid, groupId } = entry;
14
- byUid.set(uid, entry);
15
- const group = byGroupId.get(groupId);
16
- if (!group) byGroupId.set(groupId, new Set([uid]));
17
- else group.add(uid);
18
- });
19
- const remove = withCallbacks((entry) => {
20
- const { uid, groupId } = entry;
21
- byUid.delete(uid);
22
- const group = byGroupId.get(groupId);
23
- group?.delete(uid);
24
- if (group?.size === 0) byGroupId.delete(groupId);
25
- });
26
- const onUpdate = (fn) => {
27
- callbacks.push(fn);
28
- };
29
-
30
- //#endregion
31
- //#region src/debug.ts
32
- let getUid = () => Math.random().toString(36).slice(2, 9);
33
- const setUidGenerator = (fn) => {
34
- getUid = fn;
35
- };
36
- const debug = (groupId, state) => {
37
- if (!import.meta.env.DEV) return state;
38
- const instance = getCurrentInstance();
39
- const componentName = instance?.type.name || instance?.type.__name || "No component";
40
- const uid = `${componentName}/${groupId}-${getUid()}`;
41
- (getCurrentScope() ?? effectScope()).run(() => {
42
- onScopeDispose(() => remove({
43
- groupId,
44
- uid,
45
- componentName,
46
- componentInstance: instance,
47
- debugState: state
48
- }));
49
- watch(() => state, (value, _) => {
50
- upsert({
51
- groupId,
52
- uid,
53
- componentName,
54
- componentInstance: instance,
55
- debugState: value
56
- });
57
- }, {
58
- immediate: true,
59
- deep: true
60
- });
61
- });
62
- return state;
63
- };
64
-
65
- //#endregion
66
- //#region ../../node_modules/.pnpm/@vue+devtools-shared@8.0.6/node_modules/@vue/devtools-shared/dist/index.js
67
- var __create$1 = Object.create;
68
- var __defProp$1 = Object.defineProperty;
69
- var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
70
- var __getOwnPropNames$1 = Object.getOwnPropertyNames;
71
- var __getProtoOf$1 = Object.getPrototypeOf;
72
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
73
- var __commonJS$1 = (cb, mod) => function() {
74
- return mod || (0, cb[__getOwnPropNames$1(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
75
- };
76
- var __copyProps$1 = (to, from, except, desc) => {
77
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
78
- key = keys[i];
79
- if (!__hasOwnProp$1.call(to, key) && key !== except) __defProp$1(to, key, {
80
- get: ((k) => from[k]).bind(null, key),
81
- enumerable: !(desc = __getOwnPropDesc$1(from, key)) || desc.enumerable
82
- });
83
- }
84
- return to;
85
- };
86
- var __toESM$1 = (mod, isNodeMode, target$1) => (target$1 = mod != null ? __create$1(__getProtoOf$1(mod)) : {}, __copyProps$1(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target$1, "default", {
87
- value: mod,
88
- enumerable: true
89
- }) : target$1, mod));
90
- const isBrowser = typeof navigator !== "undefined";
91
- const target = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : {};
92
- const isInChromePanel = typeof target.chrome !== "undefined" && !!target.chrome.devtools;
93
- const isInIframe = isBrowser && target.self !== target.top;
94
- const isInElectron = typeof navigator !== "undefined" && navigator.userAgent?.toLowerCase().includes("electron");
95
- const isNuxtApp = typeof window !== "undefined" && !!window.__NUXT__;
96
- var import_rfdc = /* @__PURE__ */ __toESM$1((/* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js": ((exports, module) => {
97
- module.exports = rfdc$1;
98
- function copyBuffer(cur) {
99
- if (cur instanceof Buffer) return Buffer.from(cur);
100
- return new cur.constructor(cur.buffer.slice(), cur.byteOffset, cur.length);
101
- }
102
- function rfdc$1(opts) {
103
- opts = opts || {};
104
- if (opts.circles) return rfdcCircles(opts);
105
- const constructorHandlers = /* @__PURE__ */ new Map();
106
- constructorHandlers.set(Date, (o) => new Date(o));
107
- constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
108
- constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
109
- if (opts.constructorHandlers) for (const handler$1 of opts.constructorHandlers) constructorHandlers.set(handler$1[0], handler$1[1]);
110
- let handler = null;
111
- return opts.proto ? cloneProto : clone;
112
- function cloneArray(a, fn) {
113
- const keys = Object.keys(a);
114
- const a2 = new Array(keys.length);
115
- for (let i = 0; i < keys.length; i++) {
116
- const k = keys[i];
117
- const cur = a[k];
118
- if (typeof cur !== "object" || cur === null) a2[k] = cur;
119
- else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) a2[k] = handler(cur, fn);
120
- else if (ArrayBuffer.isView(cur)) a2[k] = copyBuffer(cur);
121
- else a2[k] = fn(cur);
122
- }
123
- return a2;
124
- }
125
- function clone(o) {
126
- if (typeof o !== "object" || o === null) return o;
127
- if (Array.isArray(o)) return cloneArray(o, clone);
128
- if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) return handler(o, clone);
129
- const o2 = {};
130
- for (const k in o) {
131
- if (Object.hasOwnProperty.call(o, k) === false) continue;
132
- const cur = o[k];
133
- if (typeof cur !== "object" || cur === null) o2[k] = cur;
134
- else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) o2[k] = handler(cur, clone);
135
- else if (ArrayBuffer.isView(cur)) o2[k] = copyBuffer(cur);
136
- else o2[k] = clone(cur);
137
- }
138
- return o2;
139
- }
140
- function cloneProto(o) {
141
- if (typeof o !== "object" || o === null) return o;
142
- if (Array.isArray(o)) return cloneArray(o, cloneProto);
143
- if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) return handler(o, cloneProto);
144
- const o2 = {};
145
- for (const k in o) {
146
- const cur = o[k];
147
- if (typeof cur !== "object" || cur === null) o2[k] = cur;
148
- else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) o2[k] = handler(cur, cloneProto);
149
- else if (ArrayBuffer.isView(cur)) o2[k] = copyBuffer(cur);
150
- else o2[k] = cloneProto(cur);
151
- }
152
- return o2;
153
- }
154
- }
155
- function rfdcCircles(opts) {
156
- const refs = [];
157
- const refsNew = [];
158
- const constructorHandlers = /* @__PURE__ */ new Map();
159
- constructorHandlers.set(Date, (o) => new Date(o));
160
- constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
161
- constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
162
- if (opts.constructorHandlers) for (const handler$1 of opts.constructorHandlers) constructorHandlers.set(handler$1[0], handler$1[1]);
163
- let handler = null;
164
- return opts.proto ? cloneProto : clone;
165
- function cloneArray(a, fn) {
166
- const keys = Object.keys(a);
167
- const a2 = new Array(keys.length);
168
- for (let i = 0; i < keys.length; i++) {
169
- const k = keys[i];
170
- const cur = a[k];
171
- if (typeof cur !== "object" || cur === null) a2[k] = cur;
172
- else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) a2[k] = handler(cur, fn);
173
- else if (ArrayBuffer.isView(cur)) a2[k] = copyBuffer(cur);
174
- else {
175
- const index = refs.indexOf(cur);
176
- if (index !== -1) a2[k] = refsNew[index];
177
- else a2[k] = fn(cur);
178
- }
179
- }
180
- return a2;
181
- }
182
- function clone(o) {
183
- if (typeof o !== "object" || o === null) return o;
184
- if (Array.isArray(o)) return cloneArray(o, clone);
185
- if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) return handler(o, clone);
186
- const o2 = {};
187
- refs.push(o);
188
- refsNew.push(o2);
189
- for (const k in o) {
190
- if (Object.hasOwnProperty.call(o, k) === false) continue;
191
- const cur = o[k];
192
- if (typeof cur !== "object" || cur === null) o2[k] = cur;
193
- else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) o2[k] = handler(cur, clone);
194
- else if (ArrayBuffer.isView(cur)) o2[k] = copyBuffer(cur);
195
- else {
196
- const i = refs.indexOf(cur);
197
- if (i !== -1) o2[k] = refsNew[i];
198
- else o2[k] = clone(cur);
199
- }
200
- }
201
- refs.pop();
202
- refsNew.pop();
203
- return o2;
204
- }
205
- function cloneProto(o) {
206
- if (typeof o !== "object" || o === null) return o;
207
- if (Array.isArray(o)) return cloneArray(o, cloneProto);
208
- if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) return handler(o, cloneProto);
209
- const o2 = {};
210
- refs.push(o);
211
- refsNew.push(o2);
212
- for (const k in o) {
213
- const cur = o[k];
214
- if (typeof cur !== "object" || cur === null) o2[k] = cur;
215
- else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) o2[k] = handler(cur, cloneProto);
216
- else if (ArrayBuffer.isView(cur)) o2[k] = copyBuffer(cur);
217
- else {
218
- const i = refs.indexOf(cur);
219
- if (i !== -1) o2[k] = refsNew[i];
220
- else o2[k] = cloneProto(cur);
221
- }
222
- }
223
- refs.pop();
224
- refsNew.pop();
225
- return o2;
226
- }
227
- }
228
- }) }))(), 1);
229
- const classifyRE = /(?:^|[-_/])(\w)/g;
230
- function toUpper(_, c) {
231
- return c ? c.toUpperCase() : "";
232
- }
233
- function classify(str) {
234
- return str && `${str}`.replace(classifyRE, toUpper);
235
- }
236
- function basename(filename, ext) {
237
- let normalizedFilename = filename.replace(/^[a-z]:/i, "").replace(/\\/g, "/");
238
- if (normalizedFilename.endsWith(`index${ext}`)) normalizedFilename = normalizedFilename.replace(`/index${ext}`, ext);
239
- const lastSlashIndex = normalizedFilename.lastIndexOf("/");
240
- const baseNameWithExt = normalizedFilename.substring(lastSlashIndex + 1);
241
- if (ext) {
242
- const extIndex = baseNameWithExt.lastIndexOf(ext);
243
- return baseNameWithExt.substring(0, extIndex);
244
- }
245
- return "";
246
- }
247
- /**
248
- * @copyright [rfdc](https://github.com/davidmarkclements/rfdc)
249
- * @description A really fast deep clone alternative
250
- */
251
- const deepClone = (0, import_rfdc.default)({ circles: true });
252
-
253
- //#endregion
254
- //#region ../../node_modules/.pnpm/perfect-debounce@2.1.0/node_modules/perfect-debounce/dist/index.mjs
255
- const DEBOUNCE_DEFAULTS = { trailing: true };
256
- /**
257
- Debounce functions
258
- @param fn - Promise-returning/async function to debounce.
259
- @param wait - Milliseconds to wait before calling `fn`. Default value is 25ms
260
- @returns A function that delays calling `fn` until after `wait` milliseconds have elapsed since the last time it was called.
261
- @example
262
- ```
263
- import { debounce } from 'perfect-debounce';
264
- const expensiveCall = async input => input;
265
- const debouncedFn = debounce(expensiveCall, 200);
266
- for (const number of [1, 2, 3]) {
267
- console.log(await debouncedFn(number));
268
- }
269
- //=> 1
270
- //=> 2
271
- //=> 3
272
- ```
273
- */
274
- function debounce(fn, wait = 25, options = {}) {
275
- options = {
276
- ...DEBOUNCE_DEFAULTS,
277
- ...options
278
- };
279
- if (!Number.isFinite(wait)) throw new TypeError("Expected `wait` to be a finite number");
280
- let leadingValue;
281
- let timeout;
282
- let resolveList = [];
283
- let currentPromise;
284
- let trailingArgs;
285
- const applyFn = (_this, args) => {
286
- currentPromise = _applyPromised(fn, _this, args);
287
- currentPromise.finally(() => {
288
- currentPromise = null;
289
- if (options.trailing && trailingArgs && !timeout) {
290
- const promise = applyFn(_this, trailingArgs);
291
- trailingArgs = null;
292
- return promise;
293
- }
294
- });
295
- return currentPromise;
296
- };
297
- const debounced = function(...args) {
298
- if (options.trailing) trailingArgs = args;
299
- if (currentPromise) return currentPromise;
300
- return new Promise((resolve) => {
301
- const shouldCallNow = !timeout && options.leading;
302
- clearTimeout(timeout);
303
- timeout = setTimeout(() => {
304
- timeout = null;
305
- const promise = options.leading ? leadingValue : applyFn(this, args);
306
- trailingArgs = null;
307
- for (const _resolve of resolveList) _resolve(promise);
308
- resolveList = [];
309
- }, wait);
310
- if (shouldCallNow) {
311
- leadingValue = applyFn(this, args);
312
- resolve(leadingValue);
313
- } else resolveList.push(resolve);
314
- });
315
- };
316
- const _clearTimeout = (timer) => {
317
- if (timer) {
318
- clearTimeout(timer);
319
- timeout = null;
320
- }
321
- };
322
- debounced.isPending = () => !!timeout;
323
- debounced.cancel = () => {
324
- _clearTimeout(timeout);
325
- resolveList = [];
326
- trailingArgs = null;
327
- };
328
- debounced.flush = () => {
329
- _clearTimeout(timeout);
330
- if (!trailingArgs || currentPromise) return;
331
- const args = trailingArgs;
332
- trailingArgs = null;
333
- return applyFn(this, args);
334
- };
335
- return debounced;
336
- }
337
- async function _applyPromised(fn, _this, args) {
338
- return await fn.apply(_this, args);
339
- }
340
-
341
- //#endregion
342
- //#region ../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs
343
- function flatHooks(configHooks, hooks = {}, parentName) {
344
- for (const key in configHooks) {
345
- const subHook = configHooks[key];
346
- const name = parentName ? `${parentName}:${key}` : key;
347
- if (typeof subHook === "object" && subHook !== null) flatHooks(subHook, hooks, name);
348
- else if (typeof subHook === "function") hooks[name] = subHook;
349
- }
350
- return hooks;
351
- }
352
- const defaultTask = { run: (function_) => function_() };
353
- const _createTask = () => defaultTask;
354
- const createTask = typeof console.createTask !== "undefined" ? console.createTask : _createTask;
355
- function serialTaskCaller(hooks, args) {
356
- const task = createTask(args.shift());
357
- return hooks.reduce((promise, hookFunction) => promise.then(() => task.run(() => hookFunction(...args))), Promise.resolve());
358
- }
359
- function parallelTaskCaller(hooks, args) {
360
- const task = createTask(args.shift());
361
- return Promise.all(hooks.map((hook) => task.run(() => hook(...args))));
362
- }
363
- function callEachWith(callbacks, arg0) {
364
- for (const callback of [...callbacks]) callback(arg0);
365
- }
366
- var Hookable = class {
367
- constructor() {
368
- this._hooks = {};
369
- this._before = void 0;
370
- this._after = void 0;
371
- this._deprecatedMessages = void 0;
372
- this._deprecatedHooks = {};
373
- this.hook = this.hook.bind(this);
374
- this.callHook = this.callHook.bind(this);
375
- this.callHookWith = this.callHookWith.bind(this);
376
- }
377
- hook(name, function_, options = {}) {
378
- if (!name || typeof function_ !== "function") return () => {};
379
- const originalName = name;
380
- let dep;
381
- while (this._deprecatedHooks[name]) {
382
- dep = this._deprecatedHooks[name];
383
- name = dep.to;
384
- }
385
- if (dep && !options.allowDeprecated) {
386
- let message = dep.message;
387
- if (!message) message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : "");
388
- if (!this._deprecatedMessages) this._deprecatedMessages = /* @__PURE__ */ new Set();
389
- if (!this._deprecatedMessages.has(message)) {
390
- console.warn(message);
391
- this._deprecatedMessages.add(message);
392
- }
393
- }
394
- if (!function_.name) try {
395
- Object.defineProperty(function_, "name", {
396
- get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb",
397
- configurable: true
398
- });
399
- } catch {}
400
- this._hooks[name] = this._hooks[name] || [];
401
- this._hooks[name].push(function_);
402
- return () => {
403
- if (function_) {
404
- this.removeHook(name, function_);
405
- function_ = void 0;
406
- }
407
- };
408
- }
409
- hookOnce(name, function_) {
410
- let _unreg;
411
- let _function = (...arguments_) => {
412
- if (typeof _unreg === "function") _unreg();
413
- _unreg = void 0;
414
- _function = void 0;
415
- return function_(...arguments_);
416
- };
417
- _unreg = this.hook(name, _function);
418
- return _unreg;
419
- }
420
- removeHook(name, function_) {
421
- if (this._hooks[name]) {
422
- const index = this._hooks[name].indexOf(function_);
423
- if (index !== -1) this._hooks[name].splice(index, 1);
424
- if (this._hooks[name].length === 0) delete this._hooks[name];
425
- }
426
- }
427
- deprecateHook(name, deprecated) {
428
- this._deprecatedHooks[name] = typeof deprecated === "string" ? { to: deprecated } : deprecated;
429
- const _hooks = this._hooks[name] || [];
430
- delete this._hooks[name];
431
- for (const hook of _hooks) this.hook(name, hook);
432
- }
433
- deprecateHooks(deprecatedHooks) {
434
- Object.assign(this._deprecatedHooks, deprecatedHooks);
435
- for (const name in deprecatedHooks) this.deprecateHook(name, deprecatedHooks[name]);
436
- }
437
- addHooks(configHooks) {
438
- const hooks = flatHooks(configHooks);
439
- const removeFns = Object.keys(hooks).map((key) => this.hook(key, hooks[key]));
440
- return () => {
441
- for (const unreg of removeFns.splice(0, removeFns.length)) unreg();
442
- };
443
- }
444
- removeHooks(configHooks) {
445
- const hooks = flatHooks(configHooks);
446
- for (const key in hooks) this.removeHook(key, hooks[key]);
447
- }
448
- removeAllHooks() {
449
- for (const key in this._hooks) delete this._hooks[key];
450
- }
451
- callHook(name, ...arguments_) {
452
- arguments_.unshift(name);
453
- return this.callHookWith(serialTaskCaller, name, ...arguments_);
454
- }
455
- callHookParallel(name, ...arguments_) {
456
- arguments_.unshift(name);
457
- return this.callHookWith(parallelTaskCaller, name, ...arguments_);
458
- }
459
- callHookWith(caller, name, ...arguments_) {
460
- const event = this._before || this._after ? {
461
- name,
462
- args: arguments_,
463
- context: {}
464
- } : void 0;
465
- if (this._before) callEachWith(this._before, event);
466
- const result = caller(name in this._hooks ? [...this._hooks[name]] : [], arguments_);
467
- if (result instanceof Promise) return result.finally(() => {
468
- if (this._after && event) callEachWith(this._after, event);
469
- });
470
- if (this._after && event) callEachWith(this._after, event);
471
- return result;
472
- }
473
- beforeEach(function_) {
474
- this._before = this._before || [];
475
- this._before.push(function_);
476
- return () => {
477
- if (this._before !== void 0) {
478
- const index = this._before.indexOf(function_);
479
- if (index !== -1) this._before.splice(index, 1);
480
- }
481
- };
482
- }
483
- afterEach(function_) {
484
- this._after = this._after || [];
485
- this._after.push(function_);
486
- return () => {
487
- if (this._after !== void 0) {
488
- const index = this._after.indexOf(function_);
489
- if (index !== -1) this._after.splice(index, 1);
490
- }
491
- };
492
- }
493
- };
494
- function createHooks() {
495
- return new Hookable();
496
- }
497
-
498
- //#endregion
499
- //#region ../../node_modules/.pnpm/@vue+devtools-kit@8.0.6/node_modules/@vue/devtools-kit/dist/index.js
500
- var __create = Object.create;
501
- var __defProp = Object.defineProperty;
502
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
503
- var __getOwnPropNames = Object.getOwnPropertyNames;
504
- var __getProtoOf = Object.getPrototypeOf;
505
- var __hasOwnProp = Object.prototype.hasOwnProperty;
506
- var __commonJS = (cb, mod) => function() {
507
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
508
- };
509
- var __copyProps = (to, from, except, desc) => {
510
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
511
- key = keys[i];
512
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
513
- get: ((k) => from[k]).bind(null, key),
514
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
515
- });
516
- }
517
- return to;
518
- };
519
- var __toESM = (mod, isNodeMode, target$1) => (target$1 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target$1, "default", {
520
- value: mod,
521
- enumerable: true
522
- }) : target$1, mod));
523
- function getComponentTypeName(options) {
524
- const name = options.name || options._componentTag || options.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ || options.__name;
525
- if (name === "index" && options.__file?.endsWith("index.vue")) return "";
526
- return name;
527
- }
528
- function getComponentFileName(options) {
529
- const file = options.__file;
530
- if (file) return classify(basename(file, ".vue"));
531
- }
532
- function saveComponentGussedName(instance, name) {
533
- instance.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ = name;
534
- return name;
535
- }
536
- function getAppRecord(instance) {
537
- if (instance.__VUE_DEVTOOLS_NEXT_APP_RECORD__) return instance.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
538
- else if (instance.root) return instance.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
539
- }
540
- function isFragment(instance) {
541
- const subTreeType = instance.subTree?.type;
542
- const appRecord = getAppRecord(instance);
543
- if (appRecord) return appRecord?.types?.Fragment === subTreeType;
544
- return false;
545
- }
546
- /**
547
- * Get the appropriate display name for an instance.
548
- *
549
- * @param {Vue} instance
550
- * @return {string}
551
- */
552
- function getInstanceName(instance) {
553
- const name = getComponentTypeName(instance?.type || {});
554
- if (name) return name;
555
- if (instance?.root === instance) return "Root";
556
- for (const key in instance.parent?.type?.components) if (instance.parent.type.components[key] === instance?.type) return saveComponentGussedName(instance, key);
557
- for (const key in instance.appContext?.components) if (instance.appContext.components[key] === instance?.type) return saveComponentGussedName(instance, key);
558
- const fileName = getComponentFileName(instance?.type || {});
559
- if (fileName) return fileName;
560
- return "Anonymous Component";
561
- }
562
- /**
563
- * Returns a devtools unique id for instance.
564
- * @param {Vue} instance
565
- */
566
- function getUniqueComponentId(instance) {
567
- return `${instance?.appContext?.app?.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ ?? 0}:${instance === instance?.root ? "root" : instance.uid}`;
568
- }
569
- function getComponentInstance(appRecord, instanceId) {
570
- instanceId = instanceId || `${appRecord.id}:root`;
571
- return appRecord.instanceMap.get(instanceId) || appRecord.instanceMap.get(":root");
572
- }
573
- function createRect() {
574
- const rect = {
575
- top: 0,
576
- bottom: 0,
577
- left: 0,
578
- right: 0,
579
- get width() {
580
- return rect.right - rect.left;
581
- },
582
- get height() {
583
- return rect.bottom - rect.top;
584
- }
585
- };
586
- return rect;
587
- }
588
- let range;
589
- function getTextRect(node) {
590
- if (!range) range = document.createRange();
591
- range.selectNode(node);
592
- return range.getBoundingClientRect();
593
- }
594
- function getFragmentRect(vnode) {
595
- const rect = createRect();
596
- if (!vnode.children) return rect;
597
- for (let i = 0, l = vnode.children.length; i < l; i++) {
598
- const childVnode = vnode.children[i];
599
- let childRect;
600
- if (childVnode.component) childRect = getComponentBoundingRect(childVnode.component);
601
- else if (childVnode.el) {
602
- const el = childVnode.el;
603
- if (el.nodeType === 1 || el.getBoundingClientRect) childRect = el.getBoundingClientRect();
604
- else if (el.nodeType === 3 && el.data.trim()) childRect = getTextRect(el);
605
- }
606
- if (childRect) mergeRects(rect, childRect);
607
- }
608
- return rect;
609
- }
610
- function mergeRects(a, b) {
611
- if (!a.top || b.top < a.top) a.top = b.top;
612
- if (!a.bottom || b.bottom > a.bottom) a.bottom = b.bottom;
613
- if (!a.left || b.left < a.left) a.left = b.left;
614
- if (!a.right || b.right > a.right) a.right = b.right;
615
- return a;
616
- }
617
- const DEFAULT_RECT = {
618
- top: 0,
619
- left: 0,
620
- right: 0,
621
- bottom: 0,
622
- width: 0,
623
- height: 0
624
- };
625
- function getComponentBoundingRect(instance) {
626
- const el = instance.subTree.el;
627
- if (typeof window === "undefined") return DEFAULT_RECT;
628
- if (isFragment(instance)) return getFragmentRect(instance.subTree);
629
- else if (el?.nodeType === 1) return el?.getBoundingClientRect();
630
- else if (instance.subTree.component) return getComponentBoundingRect(instance.subTree.component);
631
- else return DEFAULT_RECT;
632
- }
633
- function getRootElementsFromComponentInstance(instance) {
634
- if (isFragment(instance)) return getFragmentRootElements(instance.subTree);
635
- if (!instance.subTree) return [];
636
- return [instance.subTree.el];
637
- }
638
- function getFragmentRootElements(vnode) {
639
- if (!vnode.children) return [];
640
- const list = [];
641
- vnode.children.forEach((childVnode) => {
642
- if (childVnode.component) list.push(...getRootElementsFromComponentInstance(childVnode.component));
643
- else if (childVnode?.el) list.push(childVnode.el);
644
- });
645
- return list;
646
- }
647
- const CONTAINER_ELEMENT_ID = "__vue-devtools-component-inspector__";
648
- const CARD_ELEMENT_ID = "__vue-devtools-component-inspector__card__";
649
- const COMPONENT_NAME_ELEMENT_ID = "__vue-devtools-component-inspector__name__";
650
- const INDICATOR_ELEMENT_ID = "__vue-devtools-component-inspector__indicator__";
651
- const containerStyles = {
652
- display: "block",
653
- zIndex: 2147483640,
654
- position: "fixed",
655
- backgroundColor: "#42b88325",
656
- border: "1px solid #42b88350",
657
- borderRadius: "5px",
658
- transition: "all 0.1s ease-in",
659
- pointerEvents: "none"
660
- };
661
- const cardStyles = {
662
- fontFamily: "Arial, Helvetica, sans-serif",
663
- padding: "5px 8px",
664
- borderRadius: "4px",
665
- textAlign: "left",
666
- position: "absolute",
667
- left: 0,
668
- color: "#e9e9e9",
669
- fontSize: "14px",
670
- fontWeight: 600,
671
- lineHeight: "24px",
672
- backgroundColor: "#42b883",
673
- boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)"
674
- };
675
- const indicatorStyles = {
676
- display: "inline-block",
677
- fontWeight: 400,
678
- fontStyle: "normal",
679
- fontSize: "12px",
680
- opacity: .7
681
- };
682
- function getContainerElement() {
683
- return document.getElementById(CONTAINER_ELEMENT_ID);
684
- }
685
- function getCardElement() {
686
- return document.getElementById(CARD_ELEMENT_ID);
687
- }
688
- function getIndicatorElement() {
689
- return document.getElementById(INDICATOR_ELEMENT_ID);
690
- }
691
- function getNameElement() {
692
- return document.getElementById(COMPONENT_NAME_ELEMENT_ID);
693
- }
694
- function getStyles(bounds) {
695
- return {
696
- left: `${Math.round(bounds.left * 100) / 100}px`,
697
- top: `${Math.round(bounds.top * 100) / 100}px`,
698
- width: `${Math.round(bounds.width * 100) / 100}px`,
699
- height: `${Math.round(bounds.height * 100) / 100}px`
700
- };
701
- }
702
- function create(options) {
703
- const containerEl = document.createElement("div");
704
- containerEl.id = options.elementId ?? CONTAINER_ELEMENT_ID;
705
- Object.assign(containerEl.style, {
706
- ...containerStyles,
707
- ...getStyles(options.bounds),
708
- ...options.style
709
- });
710
- const cardEl = document.createElement("span");
711
- cardEl.id = CARD_ELEMENT_ID;
712
- Object.assign(cardEl.style, {
713
- ...cardStyles,
714
- top: options.bounds.top < 35 ? 0 : "-35px"
715
- });
716
- const nameEl = document.createElement("span");
717
- nameEl.id = COMPONENT_NAME_ELEMENT_ID;
718
- nameEl.innerHTML = `&lt;${options.name}&gt;&nbsp;&nbsp;`;
719
- const indicatorEl = document.createElement("i");
720
- indicatorEl.id = INDICATOR_ELEMENT_ID;
721
- indicatorEl.innerHTML = `${Math.round(options.bounds.width * 100) / 100} x ${Math.round(options.bounds.height * 100) / 100}`;
722
- Object.assign(indicatorEl.style, indicatorStyles);
723
- cardEl.appendChild(nameEl);
724
- cardEl.appendChild(indicatorEl);
725
- containerEl.appendChild(cardEl);
726
- document.body.appendChild(containerEl);
727
- return containerEl;
728
- }
729
- function update(options) {
730
- const containerEl = getContainerElement();
731
- const cardEl = getCardElement();
732
- const nameEl = getNameElement();
733
- const indicatorEl = getIndicatorElement();
734
- if (containerEl) {
735
- Object.assign(containerEl.style, {
736
- ...containerStyles,
737
- ...getStyles(options.bounds)
738
- });
739
- Object.assign(cardEl.style, { top: options.bounds.top < 35 ? 0 : "-35px" });
740
- nameEl.innerHTML = `&lt;${options.name}&gt;&nbsp;&nbsp;`;
741
- indicatorEl.innerHTML = `${Math.round(options.bounds.width * 100) / 100} x ${Math.round(options.bounds.height * 100) / 100}`;
742
- }
743
- }
744
- function highlight(instance) {
745
- const bounds = getComponentBoundingRect(instance);
746
- if (!bounds.width && !bounds.height) return;
747
- const name = getInstanceName(instance);
748
- getContainerElement() ? update({
749
- bounds,
750
- name
751
- }) : create({
752
- bounds,
753
- name
754
- });
755
- }
756
- function unhighlight() {
757
- const el = getContainerElement();
758
- if (el) el.style.display = "none";
759
- }
760
- let inspectInstance = null;
761
- function inspectFn(e) {
762
- const target$1 = e.target;
763
- if (target$1) {
764
- const instance = target$1.__vueParentComponent;
765
- if (instance) {
766
- inspectInstance = instance;
767
- if (instance.vnode.el) {
768
- const bounds = getComponentBoundingRect(instance);
769
- const name = getInstanceName(instance);
770
- getContainerElement() ? update({
771
- bounds,
772
- name
773
- }) : create({
774
- bounds,
775
- name
776
- });
777
- }
778
- }
779
- }
780
- }
781
- function selectComponentFn(e, cb) {
782
- e.preventDefault();
783
- e.stopPropagation();
784
- if (inspectInstance) cb(getUniqueComponentId(inspectInstance));
785
- }
786
- let inspectComponentHighLighterSelectFn = null;
787
- function cancelInspectComponentHighLighter() {
788
- unhighlight();
789
- window.removeEventListener("mouseover", inspectFn);
790
- window.removeEventListener("click", inspectComponentHighLighterSelectFn, true);
791
- inspectComponentHighLighterSelectFn = null;
792
- }
793
- function inspectComponentHighLighter() {
794
- window.addEventListener("mouseover", inspectFn);
795
- return new Promise((resolve) => {
796
- function onSelect(e) {
797
- e.preventDefault();
798
- e.stopPropagation();
799
- selectComponentFn(e, (id) => {
800
- window.removeEventListener("click", onSelect, true);
801
- inspectComponentHighLighterSelectFn = null;
802
- window.removeEventListener("mouseover", inspectFn);
803
- const el = getContainerElement();
804
- if (el) el.style.display = "none";
805
- resolve(JSON.stringify({ id }));
806
- });
807
- }
808
- inspectComponentHighLighterSelectFn = onSelect;
809
- window.addEventListener("click", onSelect, true);
810
- });
811
- }
812
- function scrollToComponent(options) {
813
- const instance = getComponentInstance(activeAppRecord.value, options.id);
814
- if (instance) {
815
- const [el] = getRootElementsFromComponentInstance(instance);
816
- if (typeof el.scrollIntoView === "function") el.scrollIntoView({ behavior: "smooth" });
817
- else {
818
- const bounds = getComponentBoundingRect(instance);
819
- const scrollTarget = document.createElement("div");
820
- const styles = {
821
- ...getStyles(bounds),
822
- position: "absolute"
823
- };
824
- Object.assign(scrollTarget.style, styles);
825
- document.body.appendChild(scrollTarget);
826
- scrollTarget.scrollIntoView({ behavior: "smooth" });
827
- setTimeout(() => {
828
- document.body.removeChild(scrollTarget);
829
- }, 2e3);
830
- }
831
- setTimeout(() => {
832
- const bounds = getComponentBoundingRect(instance);
833
- if (bounds.width || bounds.height) {
834
- const name = getInstanceName(instance);
835
- const el$1 = getContainerElement();
836
- el$1 ? update({
837
- ...options,
838
- name,
839
- bounds
840
- }) : create({
841
- ...options,
842
- name,
843
- bounds
844
- });
845
- setTimeout(() => {
846
- if (el$1) el$1.style.display = "none";
847
- }, 1500);
848
- }
849
- }, 1200);
850
- }
851
- }
852
- target.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ ??= true;
853
- function waitForInspectorInit(cb) {
854
- let total = 0;
855
- const timer = setInterval(() => {
856
- if (target.__VUE_INSPECTOR__) {
857
- clearInterval(timer);
858
- total += 30;
859
- cb();
860
- }
861
- if (total >= 5e3) clearInterval(timer);
862
- }, 30);
863
- }
864
- function setupInspector() {
865
- const inspector = target.__VUE_INSPECTOR__;
866
- const _openInEditor = inspector.openInEditor;
867
- inspector.openInEditor = async (...params) => {
868
- inspector.disable();
869
- _openInEditor(...params);
870
- };
871
- }
872
- function getComponentInspector() {
873
- return new Promise((resolve) => {
874
- function setup() {
875
- setupInspector();
876
- resolve(target.__VUE_INSPECTOR__);
877
- }
878
- if (!target.__VUE_INSPECTOR__) waitForInspectorInit(() => {
879
- setup();
880
- });
881
- else setup();
882
- });
883
- }
884
- /**
885
- * To prevent include a **HUGE** vue package in the final bundle of chrome ext / electron
886
- * we stub the necessary vue module.
887
- * This implementation is based on the 1c3327a0fa5983aa9078e3f7bb2330f572435425 commit
888
- */
889
- /**
890
- * @from [@vue/reactivity](https://github.com/vuejs/core/blob/1c3327a0fa5983aa9078e3f7bb2330f572435425/packages/reactivity/src/constants.ts#L17-L23)
891
- */
892
- let ReactiveFlags = /* @__PURE__ */ function(ReactiveFlags$1) {
893
- ReactiveFlags$1["SKIP"] = "__v_skip";
894
- ReactiveFlags$1["IS_REACTIVE"] = "__v_isReactive";
895
- ReactiveFlags$1["IS_READONLY"] = "__v_isReadonly";
896
- ReactiveFlags$1["IS_SHALLOW"] = "__v_isShallow";
897
- ReactiveFlags$1["RAW"] = "__v_raw";
898
- return ReactiveFlags$1;
899
- }({});
900
- /**
901
- * @from [@vue/reactivity](https://github.com/vuejs/core/blob/1c3327a0fa5983aa9078e3f7bb2330f572435425/packages/reactivity/src/reactive.ts#L330-L332)
902
- */
903
- function isReadonly$1(value) {
904
- return !!(value && value[ReactiveFlags.IS_READONLY]);
905
- }
906
- /**
907
- * @from [@vue/reactivity](https://github.com/vuejs/core/blob/1c3327a0fa5983aa9078e3f7bb2330f572435425/packages/reactivity/src/reactive.ts#L312-L317)
908
- */
909
- function isReactive$1(value) {
910
- if (isReadonly$1(value)) return isReactive$1(value[ReactiveFlags.RAW]);
911
- return !!(value && value[ReactiveFlags.IS_REACTIVE]);
912
- }
913
- function isRef$1(r) {
914
- return !!(r && r.__v_isRef === true);
915
- }
916
- /**
917
- * @from [@vue/reactivity](https://github.com/vuejs/core/blob/1c3327a0fa5983aa9078e3f7bb2330f572435425/packages/reactivity/src/reactive.ts#L372-L375)
918
- */
919
- function toRaw$1(observed) {
920
- const raw = observed && observed[ReactiveFlags.RAW];
921
- return raw ? toRaw$1(raw) : observed;
922
- }
923
- var StateEditor = class {
924
- constructor() {
925
- this.refEditor = new RefStateEditor();
926
- }
927
- set(object, path, value, cb) {
928
- const sections = Array.isArray(path) ? path : path.split(".");
929
- while (sections.length > 1) {
930
- const section = sections.shift();
931
- if (object instanceof Map) object = object.get(section);
932
- else if (object instanceof Set) object = Array.from(object.values())[section];
933
- else object = object[section];
934
- if (this.refEditor.isRef(object)) object = this.refEditor.get(object);
935
- }
936
- const field = sections[0];
937
- const item = this.refEditor.get(object)[field];
938
- if (cb) cb(object, field, value);
939
- else if (this.refEditor.isRef(item)) this.refEditor.set(item, value);
940
- else object[field] = value;
941
- }
942
- get(object, path) {
943
- const sections = Array.isArray(path) ? path : path.split(".");
944
- for (let i = 0; i < sections.length; i++) {
945
- if (object instanceof Map) object = object.get(sections[i]);
946
- else object = object[sections[i]];
947
- if (this.refEditor.isRef(object)) object = this.refEditor.get(object);
948
- if (!object) return void 0;
949
- }
950
- return object;
951
- }
952
- has(object, path, parent = false) {
953
- if (typeof object === "undefined") return false;
954
- const sections = Array.isArray(path) ? path.slice() : path.split(".");
955
- const size = !parent ? 1 : 2;
956
- while (object && sections.length > size) {
957
- const section = sections.shift();
958
- object = object[section];
959
- if (this.refEditor.isRef(object)) object = this.refEditor.get(object);
960
- }
961
- return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);
962
- }
963
- createDefaultSetCallback(state) {
964
- return (object, field, value) => {
965
- if (state.remove || state.newKey) if (Array.isArray(object)) object.splice(field, 1);
966
- else if (toRaw$1(object) instanceof Map) object.delete(field);
967
- else if (toRaw$1(object) instanceof Set) object.delete(Array.from(object.values())[field]);
968
- else Reflect.deleteProperty(object, field);
969
- if (!state.remove) {
970
- const target$1 = object[state.newKey || field];
971
- if (this.refEditor.isRef(target$1)) this.refEditor.set(target$1, value);
972
- else if (toRaw$1(object) instanceof Map) object.set(state.newKey || field, value);
973
- else if (toRaw$1(object) instanceof Set) object.add(value);
974
- else object[state.newKey || field] = value;
975
- }
976
- };
977
- }
978
- };
979
- var RefStateEditor = class {
980
- set(ref, value) {
981
- if (isRef$1(ref)) ref.value = value;
982
- else {
983
- if (ref instanceof Set && Array.isArray(value)) {
984
- ref.clear();
985
- value.forEach((v) => ref.add(v));
986
- return;
987
- }
988
- const currentKeys = Object.keys(value);
989
- if (ref instanceof Map) {
990
- const previousKeysSet$1 = new Set(ref.keys());
991
- currentKeys.forEach((key) => {
992
- ref.set(key, Reflect.get(value, key));
993
- previousKeysSet$1.delete(key);
994
- });
995
- previousKeysSet$1.forEach((key) => ref.delete(key));
996
- return;
997
- }
998
- const previousKeysSet = new Set(Object.keys(ref));
999
- currentKeys.forEach((key) => {
1000
- Reflect.set(ref, key, Reflect.get(value, key));
1001
- previousKeysSet.delete(key);
1002
- });
1003
- previousKeysSet.forEach((key) => Reflect.deleteProperty(ref, key));
1004
- }
1005
- }
1006
- get(ref) {
1007
- return isRef$1(ref) ? ref.value : ref;
1008
- }
1009
- isRef(ref) {
1010
- return isRef$1(ref) || isReactive$1(ref);
1011
- }
1012
- };
1013
- const stateEditor = new StateEditor();
1014
- const TIMELINE_LAYERS_STATE_STORAGE_ID = "__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__";
1015
- function getTimelineLayersStateFromStorage() {
1016
- if (typeof window === "undefined" || !isBrowser || typeof localStorage === "undefined" || localStorage === null) return {
1017
- recordingState: false,
1018
- mouseEventEnabled: false,
1019
- keyboardEventEnabled: false,
1020
- componentEventEnabled: false,
1021
- performanceEventEnabled: false,
1022
- selected: ""
1023
- };
1024
- const state = typeof localStorage.getItem !== "undefined" ? localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID) : null;
1025
- return state ? JSON.parse(state) : {
1026
- recordingState: false,
1027
- mouseEventEnabled: false,
1028
- keyboardEventEnabled: false,
1029
- componentEventEnabled: false,
1030
- performanceEventEnabled: false,
1031
- selected: ""
1032
- };
1033
- }
1034
- target.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS ??= [];
1035
- const devtoolsTimelineLayers = new Proxy(target.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS, { get(target$1, prop, receiver) {
1036
- return Reflect.get(target$1, prop, receiver);
1037
- } });
1038
- function addTimelineLayer(options, descriptor) {
1039
- devtoolsState.timelineLayersState[descriptor.id] = false;
1040
- devtoolsTimelineLayers.push({
1041
- ...options,
1042
- descriptorId: descriptor.id,
1043
- appRecord: getAppRecord(descriptor.app)
1044
- });
1045
- }
1046
- target.__VUE_DEVTOOLS_KIT_INSPECTOR__ ??= [];
1047
- const devtoolsInspector = new Proxy(target.__VUE_DEVTOOLS_KIT_INSPECTOR__, { get(target$1, prop, receiver) {
1048
- return Reflect.get(target$1, prop, receiver);
1049
- } });
1050
- const callInspectorUpdatedHook = debounce(() => {
1051
- devtoolsContext.hooks.callHook(DevToolsMessagingHookKeys.SEND_INSPECTOR_TO_CLIENT, getActiveInspectors());
1052
- });
1053
- function addInspector(inspector, descriptor) {
1054
- devtoolsInspector.push({
1055
- options: inspector,
1056
- descriptor,
1057
- treeFilterPlaceholder: inspector.treeFilterPlaceholder ?? "Search tree...",
1058
- stateFilterPlaceholder: inspector.stateFilterPlaceholder ?? "Search state...",
1059
- treeFilter: "",
1060
- selectedNodeId: "",
1061
- appRecord: getAppRecord(descriptor.app)
1062
- });
1063
- callInspectorUpdatedHook();
1064
- }
1065
- function getActiveInspectors() {
1066
- return devtoolsInspector.filter((inspector) => inspector.descriptor.app === activeAppRecord.value.app).filter((inspector) => inspector.descriptor.id !== "components").map((inspector) => {
1067
- const descriptor = inspector.descriptor;
1068
- const options = inspector.options;
1069
- return {
1070
- id: options.id,
1071
- label: options.label,
1072
- logo: descriptor.logo,
1073
- icon: `custom-ic-baseline-${options?.icon?.replace(/_/g, "-")}`,
1074
- packageName: descriptor.packageName,
1075
- homepage: descriptor.homepage,
1076
- pluginId: descriptor.id
1077
- };
1078
- });
1079
- }
1080
- function getInspector(id, app) {
1081
- return devtoolsInspector.find((inspector) => inspector.options.id === id && (app ? inspector.descriptor.app === app : true));
1082
- }
1083
- let DevToolsV6PluginAPIHookKeys = /* @__PURE__ */ function(DevToolsV6PluginAPIHookKeys$1) {
1084
- DevToolsV6PluginAPIHookKeys$1["VISIT_COMPONENT_TREE"] = "visitComponentTree";
1085
- DevToolsV6PluginAPIHookKeys$1["INSPECT_COMPONENT"] = "inspectComponent";
1086
- DevToolsV6PluginAPIHookKeys$1["EDIT_COMPONENT_STATE"] = "editComponentState";
1087
- DevToolsV6PluginAPIHookKeys$1["GET_INSPECTOR_TREE"] = "getInspectorTree";
1088
- DevToolsV6PluginAPIHookKeys$1["GET_INSPECTOR_STATE"] = "getInspectorState";
1089
- DevToolsV6PluginAPIHookKeys$1["EDIT_INSPECTOR_STATE"] = "editInspectorState";
1090
- DevToolsV6PluginAPIHookKeys$1["INSPECT_TIMELINE_EVENT"] = "inspectTimelineEvent";
1091
- DevToolsV6PluginAPIHookKeys$1["TIMELINE_CLEARED"] = "timelineCleared";
1092
- DevToolsV6PluginAPIHookKeys$1["SET_PLUGIN_SETTINGS"] = "setPluginSettings";
1093
- return DevToolsV6PluginAPIHookKeys$1;
1094
- }({});
1095
- let DevToolsContextHookKeys = /* @__PURE__ */ function(DevToolsContextHookKeys$1) {
1096
- DevToolsContextHookKeys$1["ADD_INSPECTOR"] = "addInspector";
1097
- DevToolsContextHookKeys$1["SEND_INSPECTOR_TREE"] = "sendInspectorTree";
1098
- DevToolsContextHookKeys$1["SEND_INSPECTOR_STATE"] = "sendInspectorState";
1099
- DevToolsContextHookKeys$1["CUSTOM_INSPECTOR_SELECT_NODE"] = "customInspectorSelectNode";
1100
- DevToolsContextHookKeys$1["TIMELINE_LAYER_ADDED"] = "timelineLayerAdded";
1101
- DevToolsContextHookKeys$1["TIMELINE_EVENT_ADDED"] = "timelineEventAdded";
1102
- DevToolsContextHookKeys$1["GET_COMPONENT_INSTANCES"] = "getComponentInstances";
1103
- DevToolsContextHookKeys$1["GET_COMPONENT_BOUNDS"] = "getComponentBounds";
1104
- DevToolsContextHookKeys$1["GET_COMPONENT_NAME"] = "getComponentName";
1105
- DevToolsContextHookKeys$1["COMPONENT_HIGHLIGHT"] = "componentHighlight";
1106
- DevToolsContextHookKeys$1["COMPONENT_UNHIGHLIGHT"] = "componentUnhighlight";
1107
- return DevToolsContextHookKeys$1;
1108
- }({});
1109
- let DevToolsMessagingHookKeys = /* @__PURE__ */ function(DevToolsMessagingHookKeys$1) {
1110
- DevToolsMessagingHookKeys$1["SEND_INSPECTOR_TREE_TO_CLIENT"] = "sendInspectorTreeToClient";
1111
- DevToolsMessagingHookKeys$1["SEND_INSPECTOR_STATE_TO_CLIENT"] = "sendInspectorStateToClient";
1112
- DevToolsMessagingHookKeys$1["SEND_TIMELINE_EVENT_TO_CLIENT"] = "sendTimelineEventToClient";
1113
- DevToolsMessagingHookKeys$1["SEND_INSPECTOR_TO_CLIENT"] = "sendInspectorToClient";
1114
- DevToolsMessagingHookKeys$1["SEND_ACTIVE_APP_UNMOUNTED_TO_CLIENT"] = "sendActiveAppUpdatedToClient";
1115
- DevToolsMessagingHookKeys$1["DEVTOOLS_STATE_UPDATED"] = "devtoolsStateUpdated";
1116
- DevToolsMessagingHookKeys$1["DEVTOOLS_CONNECTED_UPDATED"] = "devtoolsConnectedUpdated";
1117
- DevToolsMessagingHookKeys$1["ROUTER_INFO_UPDATED"] = "routerInfoUpdated";
1118
- return DevToolsMessagingHookKeys$1;
1119
- }({});
1120
- function createDevToolsCtxHooks() {
1121
- const hooks$1 = createHooks();
1122
- hooks$1.hook(DevToolsContextHookKeys.ADD_INSPECTOR, ({ inspector, plugin }) => {
1123
- addInspector(inspector, plugin.descriptor);
1124
- });
1125
- const debounceSendInspectorTree = debounce(async ({ inspectorId, plugin }) => {
1126
- if (!inspectorId || !plugin?.descriptor?.app || devtoolsState.highPerfModeEnabled) return;
1127
- const inspector = getInspector(inspectorId, plugin.descriptor.app);
1128
- const _payload = {
1129
- app: plugin.descriptor.app,
1130
- inspectorId,
1131
- filter: inspector?.treeFilter || "",
1132
- rootNodes: []
1133
- };
1134
- await new Promise((resolve) => {
1135
- hooks$1.callHookWith(async (callbacks) => {
1136
- await Promise.all(callbacks.map((cb) => cb(_payload)));
1137
- resolve();
1138
- }, DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_TREE);
1139
- });
1140
- hooks$1.callHookWith(async (callbacks) => {
1141
- await Promise.all(callbacks.map((cb) => cb({
1142
- inspectorId,
1143
- rootNodes: _payload.rootNodes
1144
- })));
1145
- }, DevToolsMessagingHookKeys.SEND_INSPECTOR_TREE_TO_CLIENT);
1146
- }, 120);
1147
- hooks$1.hook(DevToolsContextHookKeys.SEND_INSPECTOR_TREE, debounceSendInspectorTree);
1148
- const debounceSendInspectorState = debounce(async ({ inspectorId, plugin }) => {
1149
- if (!inspectorId || !plugin?.descriptor?.app || devtoolsState.highPerfModeEnabled) return;
1150
- const inspector = getInspector(inspectorId, plugin.descriptor.app);
1151
- const _payload = {
1152
- app: plugin.descriptor.app,
1153
- inspectorId,
1154
- nodeId: inspector?.selectedNodeId || "",
1155
- state: null
1156
- };
1157
- const ctx = { currentTab: `custom-inspector:${inspectorId}` };
1158
- if (_payload.nodeId) await new Promise((resolve) => {
1159
- hooks$1.callHookWith(async (callbacks) => {
1160
- await Promise.all(callbacks.map((cb) => cb(_payload, ctx)));
1161
- resolve();
1162
- }, DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_STATE);
1163
- });
1164
- hooks$1.callHookWith(async (callbacks) => {
1165
- await Promise.all(callbacks.map((cb) => cb({
1166
- inspectorId,
1167
- nodeId: _payload.nodeId,
1168
- state: _payload.state
1169
- })));
1170
- }, DevToolsMessagingHookKeys.SEND_INSPECTOR_STATE_TO_CLIENT);
1171
- }, 120);
1172
- hooks$1.hook(DevToolsContextHookKeys.SEND_INSPECTOR_STATE, debounceSendInspectorState);
1173
- hooks$1.hook(DevToolsContextHookKeys.CUSTOM_INSPECTOR_SELECT_NODE, ({ inspectorId, nodeId, plugin }) => {
1174
- const inspector = getInspector(inspectorId, plugin.descriptor.app);
1175
- if (!inspector) return;
1176
- inspector.selectedNodeId = nodeId;
1177
- });
1178
- hooks$1.hook(DevToolsContextHookKeys.TIMELINE_LAYER_ADDED, ({ options, plugin }) => {
1179
- addTimelineLayer(options, plugin.descriptor);
1180
- });
1181
- hooks$1.hook(DevToolsContextHookKeys.TIMELINE_EVENT_ADDED, ({ options, plugin }) => {
1182
- if (devtoolsState.highPerfModeEnabled || !devtoolsState.timelineLayersState?.[plugin.descriptor.id] && ![
1183
- "performance",
1184
- "component-event",
1185
- "keyboard",
1186
- "mouse"
1187
- ].includes(options.layerId)) return;
1188
- hooks$1.callHookWith(async (callbacks) => {
1189
- await Promise.all(callbacks.map((cb) => cb(options)));
1190
- }, DevToolsMessagingHookKeys.SEND_TIMELINE_EVENT_TO_CLIENT);
1191
- });
1192
- hooks$1.hook(DevToolsContextHookKeys.GET_COMPONENT_INSTANCES, async ({ app }) => {
1193
- const appRecord = app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;
1194
- if (!appRecord) return null;
1195
- const appId = appRecord.id.toString();
1196
- return [...appRecord.instanceMap].filter(([key]) => key.split(":")[0] === appId).map(([, instance]) => instance);
1197
- });
1198
- hooks$1.hook(DevToolsContextHookKeys.GET_COMPONENT_BOUNDS, async ({ instance }) => {
1199
- return getComponentBoundingRect(instance);
1200
- });
1201
- hooks$1.hook(DevToolsContextHookKeys.GET_COMPONENT_NAME, ({ instance }) => {
1202
- return getInstanceName(instance);
1203
- });
1204
- hooks$1.hook(DevToolsContextHookKeys.COMPONENT_HIGHLIGHT, ({ uid }) => {
1205
- const instance = activeAppRecord.value.instanceMap.get(uid);
1206
- if (instance) highlight(instance);
1207
- });
1208
- hooks$1.hook(DevToolsContextHookKeys.COMPONENT_UNHIGHLIGHT, () => {
1209
- unhighlight();
1210
- });
1211
- return hooks$1;
1212
- }
1213
- target.__VUE_DEVTOOLS_KIT_APP_RECORDS__ ??= [];
1214
- target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ ??= {};
1215
- target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ ??= "";
1216
- target.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__ ??= [];
1217
- target.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__ ??= [];
1218
- const STATE_KEY = "__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";
1219
- function initStateFactory() {
1220
- return {
1221
- connected: false,
1222
- clientConnected: false,
1223
- vitePluginDetected: true,
1224
- appRecords: [],
1225
- activeAppRecordId: "",
1226
- tabs: [],
1227
- commands: [],
1228
- highPerfModeEnabled: true,
1229
- devtoolsClientDetected: {},
1230
- perfUniqueGroupId: 0,
1231
- timelineLayersState: getTimelineLayersStateFromStorage()
1232
- };
1233
- }
1234
- target[STATE_KEY] ??= initStateFactory();
1235
- const callStateUpdatedHook = debounce((state) => {
1236
- devtoolsContext.hooks.callHook(DevToolsMessagingHookKeys.DEVTOOLS_STATE_UPDATED, { state });
1237
- });
1238
- const callConnectedUpdatedHook = debounce((state, oldState) => {
1239
- devtoolsContext.hooks.callHook(DevToolsMessagingHookKeys.DEVTOOLS_CONNECTED_UPDATED, {
1240
- state,
1241
- oldState
1242
- });
1243
- });
1244
- const devtoolsAppRecords = new Proxy(target.__VUE_DEVTOOLS_KIT_APP_RECORDS__, { get(_target, prop, receiver) {
1245
- if (prop === "value") return target.__VUE_DEVTOOLS_KIT_APP_RECORDS__;
1246
- return target.__VUE_DEVTOOLS_KIT_APP_RECORDS__[prop];
1247
- } });
1248
- const activeAppRecord = new Proxy(target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__, { get(_target, prop, receiver) {
1249
- if (prop === "value") return target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__;
1250
- else if (prop === "id") return target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__;
1251
- return target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[prop];
1252
- } });
1253
- function updateAllStates() {
1254
- callStateUpdatedHook({
1255
- ...target[STATE_KEY],
1256
- appRecords: devtoolsAppRecords.value,
1257
- activeAppRecordId: activeAppRecord.id,
1258
- tabs: target.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,
1259
- commands: target.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__
1260
- });
1261
- }
1262
- function setActiveAppRecord(app) {
1263
- target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = app;
1264
- updateAllStates();
1265
- }
1266
- function setActiveAppRecordId(id) {
1267
- target.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = id;
1268
- updateAllStates();
1269
- }
1270
- const devtoolsState = new Proxy(target[STATE_KEY], {
1271
- get(target$1, property) {
1272
- if (property === "appRecords") return devtoolsAppRecords;
1273
- else if (property === "activeAppRecordId") return activeAppRecord.id;
1274
- else if (property === "tabs") return target.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;
1275
- else if (property === "commands") return target.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;
1276
- return target[STATE_KEY][property];
1277
- },
1278
- deleteProperty(target$1, property) {
1279
- delete target$1[property];
1280
- return true;
1281
- },
1282
- set(target$1, property, value) {
1283
- ({ ...target[STATE_KEY] });
1284
- target$1[property] = value;
1285
- target[STATE_KEY][property] = value;
1286
- return true;
1287
- }
1288
- });
1289
- function openInEditor(options = {}) {
1290
- const { file, host, baseUrl = window.location.origin, line = 0, column = 0 } = options;
1291
- if (file) {
1292
- if (host === "chrome-extension") {
1293
- const fileName = file.replace(/\\/g, "\\\\");
1294
- const _baseUrl = window.VUE_DEVTOOLS_CONFIG?.openInEditorHost ?? "/";
1295
- fetch(`${_baseUrl}__open-in-editor?file=${encodeURI(file)}`).then((response) => {
1296
- if (!response.ok) {
1297
- const msg = `Opening component ${fileName} failed`;
1298
- console.log(`%c${msg}`, "color:red");
1299
- }
1300
- });
1301
- } else if (devtoolsState.vitePluginDetected) {
1302
- const _baseUrl = target.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__ ?? baseUrl;
1303
- target.__VUE_INSPECTOR__.openInEditor(_baseUrl, file, line, column);
1304
- }
1305
- }
1306
- }
1307
- target.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__ ??= [];
1308
- const devtoolsPluginBuffer = new Proxy(target.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__, { get(target$1, prop, receiver) {
1309
- return Reflect.get(target$1, prop, receiver);
1310
- } });
1311
- function _getSettings(settings) {
1312
- const _settings = {};
1313
- Object.keys(settings).forEach((key) => {
1314
- _settings[key] = settings[key].defaultValue;
1315
- });
1316
- return _settings;
1317
- }
1318
- function getPluginLocalKey(pluginId) {
1319
- return `__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${pluginId}__`;
1320
- }
1321
- function getPluginSettingsOptions(pluginId) {
1322
- return (devtoolsPluginBuffer.find((item) => item[0].id === pluginId && !!item[0]?.settings)?.[0] ?? null)?.settings ?? null;
1323
- }
1324
- function getPluginSettings(pluginId, fallbackValue) {
1325
- const localKey = getPluginLocalKey(pluginId);
1326
- if (localKey) {
1327
- const localSettings = localStorage.getItem(localKey);
1328
- if (localSettings) return JSON.parse(localSettings);
1329
- }
1330
- if (pluginId) return _getSettings((devtoolsPluginBuffer.find((item) => item[0].id === pluginId)?.[0] ?? null)?.settings ?? {});
1331
- return _getSettings(fallbackValue);
1332
- }
1333
- function initPluginSettings(pluginId, settings) {
1334
- const localKey = getPluginLocalKey(pluginId);
1335
- if (!localStorage.getItem(localKey)) localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));
1336
- }
1337
- function setPluginSettings(pluginId, key, value) {
1338
- const localKey = getPluginLocalKey(pluginId);
1339
- const localSettings = localStorage.getItem(localKey);
1340
- const parsedLocalSettings = JSON.parse(localSettings || "{}");
1341
- const updated = {
1342
- ...parsedLocalSettings,
1343
- [key]: value
1344
- };
1345
- localStorage.setItem(localKey, JSON.stringify(updated));
1346
- devtoolsContext.hooks.callHookWith((callbacks) => {
1347
- callbacks.forEach((cb) => cb({
1348
- pluginId,
1349
- key,
1350
- oldValue: parsedLocalSettings[key],
1351
- newValue: value,
1352
- settings: updated
1353
- }));
1354
- }, DevToolsV6PluginAPIHookKeys.SET_PLUGIN_SETTINGS);
1355
- }
1356
- let DevToolsHooks = /* @__PURE__ */ function(DevToolsHooks$1) {
1357
- DevToolsHooks$1["APP_INIT"] = "app:init";
1358
- DevToolsHooks$1["APP_UNMOUNT"] = "app:unmount";
1359
- DevToolsHooks$1["COMPONENT_UPDATED"] = "component:updated";
1360
- DevToolsHooks$1["COMPONENT_ADDED"] = "component:added";
1361
- DevToolsHooks$1["COMPONENT_REMOVED"] = "component:removed";
1362
- DevToolsHooks$1["COMPONENT_EMIT"] = "component:emit";
1363
- DevToolsHooks$1["PERFORMANCE_START"] = "perf:start";
1364
- DevToolsHooks$1["PERFORMANCE_END"] = "perf:end";
1365
- DevToolsHooks$1["ADD_ROUTE"] = "router:add-route";
1366
- DevToolsHooks$1["REMOVE_ROUTE"] = "router:remove-route";
1367
- DevToolsHooks$1["RENDER_TRACKED"] = "render:tracked";
1368
- DevToolsHooks$1["RENDER_TRIGGERED"] = "render:triggered";
1369
- DevToolsHooks$1["APP_CONNECTED"] = "app:connected";
1370
- DevToolsHooks$1["SETUP_DEVTOOLS_PLUGIN"] = "devtools-plugin:setup";
1371
- return DevToolsHooks$1;
1372
- }({});
1373
- const devtoolsHooks = target.__VUE_DEVTOOLS_HOOK ??= createHooks();
1374
- const on = {
1375
- vueAppInit(fn) {
1376
- devtoolsHooks.hook(DevToolsHooks.APP_INIT, fn);
1377
- },
1378
- vueAppUnmount(fn) {
1379
- devtoolsHooks.hook(DevToolsHooks.APP_UNMOUNT, fn);
1380
- },
1381
- vueAppConnected(fn) {
1382
- devtoolsHooks.hook(DevToolsHooks.APP_CONNECTED, fn);
1383
- },
1384
- componentAdded(fn) {
1385
- return devtoolsHooks.hook(DevToolsHooks.COMPONENT_ADDED, fn);
1386
- },
1387
- componentEmit(fn) {
1388
- return devtoolsHooks.hook(DevToolsHooks.COMPONENT_EMIT, fn);
1389
- },
1390
- componentUpdated(fn) {
1391
- return devtoolsHooks.hook(DevToolsHooks.COMPONENT_UPDATED, fn);
1392
- },
1393
- componentRemoved(fn) {
1394
- return devtoolsHooks.hook(DevToolsHooks.COMPONENT_REMOVED, fn);
1395
- },
1396
- setupDevtoolsPlugin(fn) {
1397
- devtoolsHooks.hook(DevToolsHooks.SETUP_DEVTOOLS_PLUGIN, fn);
1398
- },
1399
- perfStart(fn) {
1400
- return devtoolsHooks.hook(DevToolsHooks.PERFORMANCE_START, fn);
1401
- },
1402
- perfEnd(fn) {
1403
- return devtoolsHooks.hook(DevToolsHooks.PERFORMANCE_END, fn);
1404
- }
1405
- };
1406
- const hook = {
1407
- on,
1408
- setupDevToolsPlugin(pluginDescriptor, setupFn) {
1409
- return devtoolsHooks.callHook(DevToolsHooks.SETUP_DEVTOOLS_PLUGIN, pluginDescriptor, setupFn);
1410
- }
1411
- };
1412
- var DevToolsV6PluginAPI = class {
1413
- constructor({ plugin, ctx }) {
1414
- this.hooks = ctx.hooks;
1415
- this.plugin = plugin;
1416
- }
1417
- get on() {
1418
- return {
1419
- visitComponentTree: (handler) => {
1420
- this.hooks.hook(DevToolsV6PluginAPIHookKeys.VISIT_COMPONENT_TREE, handler);
1421
- },
1422
- inspectComponent: (handler) => {
1423
- this.hooks.hook(DevToolsV6PluginAPIHookKeys.INSPECT_COMPONENT, handler);
1424
- },
1425
- editComponentState: (handler) => {
1426
- this.hooks.hook(DevToolsV6PluginAPIHookKeys.EDIT_COMPONENT_STATE, handler);
1427
- },
1428
- getInspectorTree: (handler) => {
1429
- this.hooks.hook(DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_TREE, handler);
1430
- },
1431
- getInspectorState: (handler) => {
1432
- this.hooks.hook(DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_STATE, handler);
1433
- },
1434
- editInspectorState: (handler) => {
1435
- this.hooks.hook(DevToolsV6PluginAPIHookKeys.EDIT_INSPECTOR_STATE, handler);
1436
- },
1437
- inspectTimelineEvent: (handler) => {
1438
- this.hooks.hook(DevToolsV6PluginAPIHookKeys.INSPECT_TIMELINE_EVENT, handler);
1439
- },
1440
- timelineCleared: (handler) => {
1441
- this.hooks.hook(DevToolsV6PluginAPIHookKeys.TIMELINE_CLEARED, handler);
1442
- },
1443
- setPluginSettings: (handler) => {
1444
- this.hooks.hook(DevToolsV6PluginAPIHookKeys.SET_PLUGIN_SETTINGS, handler);
1445
- }
1446
- };
1447
- }
1448
- notifyComponentUpdate(instance) {
1449
- if (devtoolsState.highPerfModeEnabled) return;
1450
- const inspector = getActiveInspectors().find((i) => i.packageName === this.plugin.descriptor.packageName);
1451
- if (inspector?.id) {
1452
- if (instance) {
1453
- const args = [
1454
- instance.appContext.app,
1455
- instance.uid,
1456
- instance.parent?.uid,
1457
- instance
1458
- ];
1459
- devtoolsHooks.callHook(DevToolsHooks.COMPONENT_UPDATED, ...args);
1460
- } else devtoolsHooks.callHook(DevToolsHooks.COMPONENT_UPDATED);
1461
- this.hooks.callHook(DevToolsContextHookKeys.SEND_INSPECTOR_STATE, {
1462
- inspectorId: inspector.id,
1463
- plugin: this.plugin
1464
- });
1465
- }
1466
- }
1467
- addInspector(options) {
1468
- this.hooks.callHook(DevToolsContextHookKeys.ADD_INSPECTOR, {
1469
- inspector: options,
1470
- plugin: this.plugin
1471
- });
1472
- if (this.plugin.descriptor.settings) initPluginSettings(options.id, this.plugin.descriptor.settings);
1473
- }
1474
- sendInspectorTree(inspectorId) {
1475
- if (devtoolsState.highPerfModeEnabled) return;
1476
- this.hooks.callHook(DevToolsContextHookKeys.SEND_INSPECTOR_TREE, {
1477
- inspectorId,
1478
- plugin: this.plugin
1479
- });
1480
- }
1481
- sendInspectorState(inspectorId) {
1482
- if (devtoolsState.highPerfModeEnabled) return;
1483
- this.hooks.callHook(DevToolsContextHookKeys.SEND_INSPECTOR_STATE, {
1484
- inspectorId,
1485
- plugin: this.plugin
1486
- });
1487
- }
1488
- selectInspectorNode(inspectorId, nodeId) {
1489
- this.hooks.callHook(DevToolsContextHookKeys.CUSTOM_INSPECTOR_SELECT_NODE, {
1490
- inspectorId,
1491
- nodeId,
1492
- plugin: this.plugin
1493
- });
1494
- }
1495
- visitComponentTree(payload) {
1496
- return this.hooks.callHook(DevToolsV6PluginAPIHookKeys.VISIT_COMPONENT_TREE, payload);
1497
- }
1498
- now() {
1499
- if (devtoolsState.highPerfModeEnabled) return 0;
1500
- return Date.now();
1501
- }
1502
- addTimelineLayer(options) {
1503
- this.hooks.callHook(DevToolsContextHookKeys.TIMELINE_LAYER_ADDED, {
1504
- options,
1505
- plugin: this.plugin
1506
- });
1507
- }
1508
- addTimelineEvent(options) {
1509
- if (devtoolsState.highPerfModeEnabled) return;
1510
- this.hooks.callHook(DevToolsContextHookKeys.TIMELINE_EVENT_ADDED, {
1511
- options,
1512
- plugin: this.plugin
1513
- });
1514
- }
1515
- getSettings(pluginId) {
1516
- return getPluginSettings(pluginId ?? this.plugin.descriptor.id, this.plugin.descriptor.settings);
1517
- }
1518
- getComponentInstances(app) {
1519
- return this.hooks.callHook(DevToolsContextHookKeys.GET_COMPONENT_INSTANCES, { app });
1520
- }
1521
- getComponentBounds(instance) {
1522
- return this.hooks.callHook(DevToolsContextHookKeys.GET_COMPONENT_BOUNDS, { instance });
1523
- }
1524
- getComponentName(instance) {
1525
- return this.hooks.callHook(DevToolsContextHookKeys.GET_COMPONENT_NAME, { instance });
1526
- }
1527
- highlightElement(instance) {
1528
- const uid = instance.__VUE_DEVTOOLS_NEXT_UID__;
1529
- return this.hooks.callHook(DevToolsContextHookKeys.COMPONENT_HIGHLIGHT, { uid });
1530
- }
1531
- unhighlightElement() {
1532
- return this.hooks.callHook(DevToolsContextHookKeys.COMPONENT_UNHIGHLIGHT);
1533
- }
1534
- };
1535
- const DevToolsPluginAPI = DevToolsV6PluginAPI;
1536
- const UNDEFINED = "__vue_devtool_undefined__";
1537
- const INFINITY = "__vue_devtool_infinity__";
1538
- const NEGATIVE_INFINITY = "__vue_devtool_negative_infinity__";
1539
- const NAN = "__vue_devtool_nan__";
1540
- const tokenMap = {
1541
- [UNDEFINED]: "undefined",
1542
- [NAN]: "NaN",
1543
- [INFINITY]: "Infinity",
1544
- [NEGATIVE_INFINITY]: "-Infinity"
1545
- };
1546
- const reversedTokenMap = Object.entries(tokenMap).reduce((acc, [key, value]) => {
1547
- acc[value] = key;
1548
- return acc;
1549
- }, {});
1550
- target.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__ ??= /* @__PURE__ */ new Set();
1551
- function setupDevToolsPlugin(pluginDescriptor, setupFn) {
1552
- return hook.setupDevToolsPlugin(pluginDescriptor, setupFn);
1553
- }
1554
- function callDevToolsPluginSetupFn(plugin, app) {
1555
- const [pluginDescriptor, setupFn] = plugin;
1556
- if (pluginDescriptor.app !== app) return;
1557
- const api = new DevToolsPluginAPI({
1558
- plugin: {
1559
- setupFn,
1560
- descriptor: pluginDescriptor
1561
- },
1562
- ctx: devtoolsContext
1563
- });
1564
- if (pluginDescriptor.packageName === "vuex") api.on.editInspectorState((payload) => {
1565
- api.sendInspectorState(payload.inspectorId);
1566
- });
1567
- setupFn(api);
1568
- }
1569
- function registerDevToolsPlugin(app, options) {
1570
- if (target.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(app)) return;
1571
- if (devtoolsState.highPerfModeEnabled && !options?.inspectingComponent) return;
1572
- target.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(app);
1573
- devtoolsPluginBuffer.forEach((plugin) => {
1574
- callDevToolsPluginSetupFn(plugin, app);
1575
- });
1576
- }
1577
- const ROUTER_KEY = "__VUE_DEVTOOLS_ROUTER__";
1578
- const ROUTER_INFO_KEY = "__VUE_DEVTOOLS_ROUTER_INFO__";
1579
- target[ROUTER_INFO_KEY] ??= {
1580
- currentRoute: null,
1581
- routes: []
1582
- };
1583
- target[ROUTER_KEY] ??= {};
1584
- const devtoolsRouterInfo = new Proxy(target[ROUTER_INFO_KEY], { get(target$1, property) {
1585
- return target[ROUTER_INFO_KEY][property];
1586
- } });
1587
- const devtoolsRouter = new Proxy(target[ROUTER_KEY], { get(target$1, property) {
1588
- if (property === "value") return target[ROUTER_KEY];
1589
- } });
1590
- function getRoutes(router) {
1591
- const routesMap = /* @__PURE__ */ new Map();
1592
- return (router?.getRoutes() || []).filter((i) => !routesMap.has(i.path) && routesMap.set(i.path, 1));
1593
- }
1594
- function filterRoutes(routes) {
1595
- return routes.map((item) => {
1596
- let { path, name, children, meta } = item;
1597
- if (children?.length) children = filterRoutes(children);
1598
- return {
1599
- path,
1600
- name,
1601
- children,
1602
- meta
1603
- };
1604
- });
1605
- }
1606
- function filterCurrentRoute(route) {
1607
- if (route) {
1608
- const { fullPath, hash, href, path, name, matched, params, query } = route;
1609
- return {
1610
- fullPath,
1611
- hash,
1612
- href,
1613
- path,
1614
- name,
1615
- params,
1616
- query,
1617
- matched: filterRoutes(matched)
1618
- };
1619
- }
1620
- return route;
1621
- }
1622
- function normalizeRouterInfo(appRecord, activeAppRecord$1) {
1623
- function init() {
1624
- const router = appRecord.app?.config.globalProperties.$router;
1625
- const currentRoute = filterCurrentRoute(router?.currentRoute.value);
1626
- const routes = filterRoutes(getRoutes(router));
1627
- const c = console.warn;
1628
- console.warn = () => {};
1629
- target[ROUTER_INFO_KEY] = {
1630
- currentRoute: currentRoute ? deepClone(currentRoute) : {},
1631
- routes: deepClone(routes)
1632
- };
1633
- target[ROUTER_KEY] = router;
1634
- console.warn = c;
1635
- }
1636
- init();
1637
- hook.on.componentUpdated(debounce(() => {
1638
- if (activeAppRecord$1.value?.app !== appRecord.app) return;
1639
- init();
1640
- if (devtoolsState.highPerfModeEnabled) return;
1641
- devtoolsContext.hooks.callHook(DevToolsMessagingHookKeys.ROUTER_INFO_UPDATED, { state: target[ROUTER_INFO_KEY] });
1642
- }, 200));
1643
- }
1644
- function createDevToolsApi(hooks$1) {
1645
- return {
1646
- async getInspectorTree(payload) {
1647
- const _payload = {
1648
- ...payload,
1649
- app: activeAppRecord.value.app,
1650
- rootNodes: []
1651
- };
1652
- await new Promise((resolve) => {
1653
- hooks$1.callHookWith(async (callbacks) => {
1654
- await Promise.all(callbacks.map((cb) => cb(_payload)));
1655
- resolve();
1656
- }, DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_TREE);
1657
- });
1658
- return _payload.rootNodes;
1659
- },
1660
- async getInspectorState(payload) {
1661
- const _payload = {
1662
- ...payload,
1663
- app: activeAppRecord.value.app,
1664
- state: null
1665
- };
1666
- const ctx = { currentTab: `custom-inspector:${payload.inspectorId}` };
1667
- await new Promise((resolve) => {
1668
- hooks$1.callHookWith(async (callbacks) => {
1669
- await Promise.all(callbacks.map((cb) => cb(_payload, ctx)));
1670
- resolve();
1671
- }, DevToolsV6PluginAPIHookKeys.GET_INSPECTOR_STATE);
1672
- });
1673
- return _payload.state;
1674
- },
1675
- editInspectorState(payload) {
1676
- const stateEditor$1 = new StateEditor();
1677
- const _payload = {
1678
- ...payload,
1679
- app: activeAppRecord.value.app,
1680
- set: (obj, path = payload.path, value = payload.state.value, cb) => {
1681
- stateEditor$1.set(obj, path, value, cb || stateEditor$1.createDefaultSetCallback(payload.state));
1682
- }
1683
- };
1684
- hooks$1.callHookWith((callbacks) => {
1685
- callbacks.forEach((cb) => cb(_payload));
1686
- }, DevToolsV6PluginAPIHookKeys.EDIT_INSPECTOR_STATE);
1687
- },
1688
- sendInspectorState(inspectorId) {
1689
- const inspector = getInspector(inspectorId);
1690
- hooks$1.callHook(DevToolsContextHookKeys.SEND_INSPECTOR_STATE, {
1691
- inspectorId,
1692
- plugin: {
1693
- descriptor: inspector.descriptor,
1694
- setupFn: () => ({})
1695
- }
1696
- });
1697
- },
1698
- inspectComponentInspector() {
1699
- return inspectComponentHighLighter();
1700
- },
1701
- cancelInspectComponentInspector() {
1702
- return cancelInspectComponentHighLighter();
1703
- },
1704
- getComponentRenderCode(id) {
1705
- const instance = getComponentInstance(activeAppRecord.value, id);
1706
- if (instance) return !(typeof instance?.type === "function") ? instance.render.toString() : instance.type.toString();
1707
- },
1708
- scrollToComponent(id) {
1709
- return scrollToComponent({ id });
1710
- },
1711
- openInEditor,
1712
- getVueInspector: getComponentInspector,
1713
- toggleApp(id, options) {
1714
- const appRecord = devtoolsAppRecords.value.find((record) => record.id === id);
1715
- if (appRecord) {
1716
- setActiveAppRecordId(id);
1717
- setActiveAppRecord(appRecord);
1718
- normalizeRouterInfo(appRecord, activeAppRecord);
1719
- callInspectorUpdatedHook();
1720
- registerDevToolsPlugin(appRecord.app, options);
1721
- }
1722
- },
1723
- inspectDOM(instanceId) {
1724
- const instance = getComponentInstance(activeAppRecord.value, instanceId);
1725
- if (instance) {
1726
- const [el] = getRootElementsFromComponentInstance(instance);
1727
- if (el) target.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__ = el;
1728
- }
1729
- },
1730
- updatePluginSettings(pluginId, key, value) {
1731
- setPluginSettings(pluginId, key, value);
1732
- },
1733
- getPluginSettings(pluginId) {
1734
- return {
1735
- options: getPluginSettingsOptions(pluginId),
1736
- values: getPluginSettings(pluginId)
1737
- };
1738
- }
1739
- };
1740
- }
1741
- target.__VUE_DEVTOOLS_ENV__ ??= { vitePluginDetected: false };
1742
- const hooks = createDevToolsCtxHooks();
1743
- target.__VUE_DEVTOOLS_KIT_CONTEXT__ ??= {
1744
- hooks,
1745
- get state() {
1746
- return {
1747
- ...devtoolsState,
1748
- activeAppRecordId: activeAppRecord.id,
1749
- activeAppRecord: activeAppRecord.value,
1750
- appRecords: devtoolsAppRecords.value
1751
- };
1752
- },
1753
- api: createDevToolsApi(hooks)
1754
- };
1755
- const devtoolsContext = target.__VUE_DEVTOOLS_KIT_CONTEXT__;
1756
- var require_speakingurl$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js": ((exports, module) => {
1757
- (function(root) {
1758
- /**
1759
- * charMap
1760
- * @type {Object}
1761
- */
1762
- var charMap = {
1763
- "À": "A",
1764
- "Á": "A",
1765
- "Â": "A",
1766
- "Ã": "A",
1767
- "Ä": "Ae",
1768
- "Å": "A",
1769
- "Æ": "AE",
1770
- "Ç": "C",
1771
- "È": "E",
1772
- "É": "E",
1773
- "Ê": "E",
1774
- "Ë": "E",
1775
- "Ì": "I",
1776
- "Í": "I",
1777
- "Î": "I",
1778
- "Ï": "I",
1779
- "Ð": "D",
1780
- "Ñ": "N",
1781
- "Ò": "O",
1782
- "Ó": "O",
1783
- "Ô": "O",
1784
- "Õ": "O",
1785
- "Ö": "Oe",
1786
- "Ő": "O",
1787
- "Ø": "O",
1788
- "Ù": "U",
1789
- "Ú": "U",
1790
- "Û": "U",
1791
- "Ü": "Ue",
1792
- "Ű": "U",
1793
- "Ý": "Y",
1794
- "Þ": "TH",
1795
- "ß": "ss",
1796
- "à": "a",
1797
- "á": "a",
1798
- "â": "a",
1799
- "ã": "a",
1800
- "ä": "ae",
1801
- "å": "a",
1802
- "æ": "ae",
1803
- "ç": "c",
1804
- "è": "e",
1805
- "é": "e",
1806
- "ê": "e",
1807
- "ë": "e",
1808
- "ì": "i",
1809
- "í": "i",
1810
- "î": "i",
1811
- "ï": "i",
1812
- "ð": "d",
1813
- "ñ": "n",
1814
- "ò": "o",
1815
- "ó": "o",
1816
- "ô": "o",
1817
- "õ": "o",
1818
- "ö": "oe",
1819
- "ő": "o",
1820
- "ø": "o",
1821
- "ù": "u",
1822
- "ú": "u",
1823
- "û": "u",
1824
- "ü": "ue",
1825
- "ű": "u",
1826
- "ý": "y",
1827
- "þ": "th",
1828
- "ÿ": "y",
1829
- "ẞ": "SS",
1830
- "ا": "a",
1831
- "أ": "a",
1832
- "إ": "i",
1833
- "آ": "aa",
1834
- "ؤ": "u",
1835
- "ئ": "e",
1836
- "ء": "a",
1837
- "ب": "b",
1838
- "ت": "t",
1839
- "ث": "th",
1840
- "ج": "j",
1841
- "ح": "h",
1842
- "خ": "kh",
1843
- "د": "d",
1844
- "ذ": "th",
1845
- "ر": "r",
1846
- "ز": "z",
1847
- "س": "s",
1848
- "ش": "sh",
1849
- "ص": "s",
1850
- "ض": "dh",
1851
- "ط": "t",
1852
- "ظ": "z",
1853
- "ع": "a",
1854
- "غ": "gh",
1855
- "ف": "f",
1856
- "ق": "q",
1857
- "ك": "k",
1858
- "ل": "l",
1859
- "م": "m",
1860
- "ن": "n",
1861
- "ه": "h",
1862
- "و": "w",
1863
- "ي": "y",
1864
- "ى": "a",
1865
- "ة": "h",
1866
- "ﻻ": "la",
1867
- "ﻷ": "laa",
1868
- "ﻹ": "lai",
1869
- "ﻵ": "laa",
1870
- "گ": "g",
1871
- "چ": "ch",
1872
- "پ": "p",
1873
- "ژ": "zh",
1874
- "ک": "k",
1875
- "ی": "y",
1876
- "َ": "a",
1877
- "ً": "an",
1878
- "ِ": "e",
1879
- "ٍ": "en",
1880
- "ُ": "u",
1881
- "ٌ": "on",
1882
- "ْ": "",
1883
- "٠": "0",
1884
- "١": "1",
1885
- "٢": "2",
1886
- "٣": "3",
1887
- "٤": "4",
1888
- "٥": "5",
1889
- "٦": "6",
1890
- "٧": "7",
1891
- "٨": "8",
1892
- "٩": "9",
1893
- "۰": "0",
1894
- "۱": "1",
1895
- "۲": "2",
1896
- "۳": "3",
1897
- "۴": "4",
1898
- "۵": "5",
1899
- "۶": "6",
1900
- "۷": "7",
1901
- "۸": "8",
1902
- "۹": "9",
1903
- "က": "k",
1904
- "ခ": "kh",
1905
- "ဂ": "g",
1906
- "ဃ": "ga",
1907
- "င": "ng",
1908
- "စ": "s",
1909
- "ဆ": "sa",
1910
- "ဇ": "z",
1911
- "စျ": "za",
1912
- "ည": "ny",
1913
- "ဋ": "t",
1914
- "ဌ": "ta",
1915
- "ဍ": "d",
1916
- "ဎ": "da",
1917
- "ဏ": "na",
1918
- "တ": "t",
1919
- "ထ": "ta",
1920
- "ဒ": "d",
1921
- "ဓ": "da",
1922
- "န": "n",
1923
- "ပ": "p",
1924
- "ဖ": "pa",
1925
- "ဗ": "b",
1926
- "ဘ": "ba",
1927
- "မ": "m",
1928
- "ယ": "y",
1929
- "ရ": "ya",
1930
- "လ": "l",
1931
- "ဝ": "w",
1932
- "သ": "th",
1933
- "ဟ": "h",
1934
- "ဠ": "la",
1935
- "အ": "a",
1936
- "ြ": "y",
1937
- "ျ": "ya",
1938
- "ွ": "w",
1939
- "ြွ": "yw",
1940
- "ျွ": "ywa",
1941
- "ှ": "h",
1942
- "ဧ": "e",
1943
- "၏": "-e",
1944
- "ဣ": "i",
1945
- "ဤ": "-i",
1946
- "ဉ": "u",
1947
- "ဦ": "-u",
1948
- "ဩ": "aw",
1949
- "သြော": "aw",
1950
- "ဪ": "aw",
1951
- "၀": "0",
1952
- "၁": "1",
1953
- "၂": "2",
1954
- "၃": "3",
1955
- "၄": "4",
1956
- "၅": "5",
1957
- "၆": "6",
1958
- "၇": "7",
1959
- "၈": "8",
1960
- "၉": "9",
1961
- "္": "",
1962
- "့": "",
1963
- "း": "",
1964
- "č": "c",
1965
- "ď": "d",
1966
- "ě": "e",
1967
- "ň": "n",
1968
- "ř": "r",
1969
- "š": "s",
1970
- "ť": "t",
1971
- "ů": "u",
1972
- "ž": "z",
1973
- "Č": "C",
1974
- "Ď": "D",
1975
- "Ě": "E",
1976
- "Ň": "N",
1977
- "Ř": "R",
1978
- "Š": "S",
1979
- "Ť": "T",
1980
- "Ů": "U",
1981
- "Ž": "Z",
1982
- "ހ": "h",
1983
- "ށ": "sh",
1984
- "ނ": "n",
1985
- "ރ": "r",
1986
- "ބ": "b",
1987
- "ޅ": "lh",
1988
- "ކ": "k",
1989
- "އ": "a",
1990
- "ވ": "v",
1991
- "މ": "m",
1992
- "ފ": "f",
1993
- "ދ": "dh",
1994
- "ތ": "th",
1995
- "ލ": "l",
1996
- "ގ": "g",
1997
- "ޏ": "gn",
1998
- "ސ": "s",
1999
- "ޑ": "d",
2000
- "ޒ": "z",
2001
- "ޓ": "t",
2002
- "ޔ": "y",
2003
- "ޕ": "p",
2004
- "ޖ": "j",
2005
- "ޗ": "ch",
2006
- "ޘ": "tt",
2007
- "ޙ": "hh",
2008
- "ޚ": "kh",
2009
- "ޛ": "th",
2010
- "ޜ": "z",
2011
- "ޝ": "sh",
2012
- "ޞ": "s",
2013
- "ޟ": "d",
2014
- "ޠ": "t",
2015
- "ޡ": "z",
2016
- "ޢ": "a",
2017
- "ޣ": "gh",
2018
- "ޤ": "q",
2019
- "ޥ": "w",
2020
- "ަ": "a",
2021
- "ާ": "aa",
2022
- "ި": "i",
2023
- "ީ": "ee",
2024
- "ު": "u",
2025
- "ޫ": "oo",
2026
- "ެ": "e",
2027
- "ޭ": "ey",
2028
- "ޮ": "o",
2029
- "ޯ": "oa",
2030
- "ް": "",
2031
- "ა": "a",
2032
- "ბ": "b",
2033
- "გ": "g",
2034
- "დ": "d",
2035
- "ე": "e",
2036
- "ვ": "v",
2037
- "ზ": "z",
2038
- "თ": "t",
2039
- "ი": "i",
2040
- "კ": "k",
2041
- "ლ": "l",
2042
- "მ": "m",
2043
- "ნ": "n",
2044
- "ო": "o",
2045
- "პ": "p",
2046
- "ჟ": "zh",
2047
- "რ": "r",
2048
- "ს": "s",
2049
- "ტ": "t",
2050
- "უ": "u",
2051
- "ფ": "p",
2052
- "ქ": "k",
2053
- "ღ": "gh",
2054
- "ყ": "q",
2055
- "შ": "sh",
2056
- "ჩ": "ch",
2057
- "ც": "ts",
2058
- "ძ": "dz",
2059
- "წ": "ts",
2060
- "ჭ": "ch",
2061
- "ხ": "kh",
2062
- "ჯ": "j",
2063
- "ჰ": "h",
2064
- "α": "a",
2065
- "β": "v",
2066
- "γ": "g",
2067
- "δ": "d",
2068
- "ε": "e",
2069
- "ζ": "z",
2070
- "η": "i",
2071
- "θ": "th",
2072
- "ι": "i",
2073
- "κ": "k",
2074
- "λ": "l",
2075
- "μ": "m",
2076
- "ν": "n",
2077
- "ξ": "ks",
2078
- "ο": "o",
2079
- "π": "p",
2080
- "ρ": "r",
2081
- "σ": "s",
2082
- "τ": "t",
2083
- "υ": "y",
2084
- "φ": "f",
2085
- "χ": "x",
2086
- "ψ": "ps",
2087
- "ω": "o",
2088
- "ά": "a",
2089
- "έ": "e",
2090
- "ί": "i",
2091
- "ό": "o",
2092
- "ύ": "y",
2093
- "ή": "i",
2094
- "ώ": "o",
2095
- "ς": "s",
2096
- "ϊ": "i",
2097
- "ΰ": "y",
2098
- "ϋ": "y",
2099
- "ΐ": "i",
2100
- "Α": "A",
2101
- "Β": "B",
2102
- "Γ": "G",
2103
- "Δ": "D",
2104
- "Ε": "E",
2105
- "Ζ": "Z",
2106
- "Η": "I",
2107
- "Θ": "TH",
2108
- "Ι": "I",
2109
- "Κ": "K",
2110
- "Λ": "L",
2111
- "Μ": "M",
2112
- "Ν": "N",
2113
- "Ξ": "KS",
2114
- "Ο": "O",
2115
- "Π": "P",
2116
- "Ρ": "R",
2117
- "Σ": "S",
2118
- "Τ": "T",
2119
- "Υ": "Y",
2120
- "Φ": "F",
2121
- "Χ": "X",
2122
- "Ψ": "PS",
2123
- "Ω": "O",
2124
- "Ά": "A",
2125
- "Έ": "E",
2126
- "Ί": "I",
2127
- "Ό": "O",
2128
- "Ύ": "Y",
2129
- "Ή": "I",
2130
- "Ώ": "O",
2131
- "Ϊ": "I",
2132
- "Ϋ": "Y",
2133
- "ā": "a",
2134
- "ē": "e",
2135
- "ģ": "g",
2136
- "ī": "i",
2137
- "ķ": "k",
2138
- "ļ": "l",
2139
- "ņ": "n",
2140
- "ū": "u",
2141
- "Ā": "A",
2142
- "Ē": "E",
2143
- "Ģ": "G",
2144
- "Ī": "I",
2145
- "Ķ": "k",
2146
- "Ļ": "L",
2147
- "Ņ": "N",
2148
- "Ū": "U",
2149
- "Ќ": "Kj",
2150
- "ќ": "kj",
2151
- "Љ": "Lj",
2152
- "љ": "lj",
2153
- "Њ": "Nj",
2154
- "њ": "nj",
2155
- "Тс": "Ts",
2156
- "тс": "ts",
2157
- "ą": "a",
2158
- "ć": "c",
2159
- "ę": "e",
2160
- "ł": "l",
2161
- "ń": "n",
2162
- "ś": "s",
2163
- "ź": "z",
2164
- "ż": "z",
2165
- "Ą": "A",
2166
- "Ć": "C",
2167
- "Ę": "E",
2168
- "Ł": "L",
2169
- "Ń": "N",
2170
- "Ś": "S",
2171
- "Ź": "Z",
2172
- "Ż": "Z",
2173
- "Є": "Ye",
2174
- "І": "I",
2175
- "Ї": "Yi",
2176
- "Ґ": "G",
2177
- "є": "ye",
2178
- "і": "i",
2179
- "ї": "yi",
2180
- "ґ": "g",
2181
- "ă": "a",
2182
- "Ă": "A",
2183
- "ș": "s",
2184
- "Ș": "S",
2185
- "ț": "t",
2186
- "Ț": "T",
2187
- "ţ": "t",
2188
- "Ţ": "T",
2189
- "а": "a",
2190
- "б": "b",
2191
- "в": "v",
2192
- "г": "g",
2193
- "д": "d",
2194
- "е": "e",
2195
- "ё": "yo",
2196
- "ж": "zh",
2197
- "з": "z",
2198
- "и": "i",
2199
- "й": "i",
2200
- "к": "k",
2201
- "л": "l",
2202
- "м": "m",
2203
- "н": "n",
2204
- "о": "o",
2205
- "п": "p",
2206
- "р": "r",
2207
- "с": "s",
2208
- "т": "t",
2209
- "у": "u",
2210
- "ф": "f",
2211
- "х": "kh",
2212
- "ц": "c",
2213
- "ч": "ch",
2214
- "ш": "sh",
2215
- "щ": "sh",
2216
- "ъ": "",
2217
- "ы": "y",
2218
- "ь": "",
2219
- "э": "e",
2220
- "ю": "yu",
2221
- "я": "ya",
2222
- "А": "A",
2223
- "Б": "B",
2224
- "В": "V",
2225
- "Г": "G",
2226
- "Д": "D",
2227
- "Е": "E",
2228
- "Ё": "Yo",
2229
- "Ж": "Zh",
2230
- "З": "Z",
2231
- "И": "I",
2232
- "Й": "I",
2233
- "К": "K",
2234
- "Л": "L",
2235
- "М": "M",
2236
- "Н": "N",
2237
- "О": "O",
2238
- "П": "P",
2239
- "Р": "R",
2240
- "С": "S",
2241
- "Т": "T",
2242
- "У": "U",
2243
- "Ф": "F",
2244
- "Х": "Kh",
2245
- "Ц": "C",
2246
- "Ч": "Ch",
2247
- "Ш": "Sh",
2248
- "Щ": "Sh",
2249
- "Ъ": "",
2250
- "Ы": "Y",
2251
- "Ь": "",
2252
- "Э": "E",
2253
- "Ю": "Yu",
2254
- "Я": "Ya",
2255
- "ђ": "dj",
2256
- "ј": "j",
2257
- "ћ": "c",
2258
- "џ": "dz",
2259
- "Ђ": "Dj",
2260
- "Ј": "j",
2261
- "Ћ": "C",
2262
- "Џ": "Dz",
2263
- "ľ": "l",
2264
- "ĺ": "l",
2265
- "ŕ": "r",
2266
- "Ľ": "L",
2267
- "Ĺ": "L",
2268
- "Ŕ": "R",
2269
- "ş": "s",
2270
- "Ş": "S",
2271
- "ı": "i",
2272
- "İ": "I",
2273
- "ğ": "g",
2274
- "Ğ": "G",
2275
- "ả": "a",
2276
- "Ả": "A",
2277
- "ẳ": "a",
2278
- "Ẳ": "A",
2279
- "ẩ": "a",
2280
- "Ẩ": "A",
2281
- "đ": "d",
2282
- "Đ": "D",
2283
- "ẹ": "e",
2284
- "Ẹ": "E",
2285
- "ẽ": "e",
2286
- "Ẽ": "E",
2287
- "ẻ": "e",
2288
- "Ẻ": "E",
2289
- "ế": "e",
2290
- "Ế": "E",
2291
- "ề": "e",
2292
- "Ề": "E",
2293
- "ệ": "e",
2294
- "Ệ": "E",
2295
- "ễ": "e",
2296
- "Ễ": "E",
2297
- "ể": "e",
2298
- "Ể": "E",
2299
- "ỏ": "o",
2300
- "ọ": "o",
2301
- "Ọ": "o",
2302
- "ố": "o",
2303
- "Ố": "O",
2304
- "ồ": "o",
2305
- "Ồ": "O",
2306
- "ổ": "o",
2307
- "Ổ": "O",
2308
- "ộ": "o",
2309
- "Ộ": "O",
2310
- "ỗ": "o",
2311
- "Ỗ": "O",
2312
- "ơ": "o",
2313
- "Ơ": "O",
2314
- "ớ": "o",
2315
- "Ớ": "O",
2316
- "ờ": "o",
2317
- "Ờ": "O",
2318
- "ợ": "o",
2319
- "Ợ": "O",
2320
- "ỡ": "o",
2321
- "Ỡ": "O",
2322
- "Ở": "o",
2323
- "ở": "o",
2324
- "ị": "i",
2325
- "Ị": "I",
2326
- "ĩ": "i",
2327
- "Ĩ": "I",
2328
- "ỉ": "i",
2329
- "Ỉ": "i",
2330
- "ủ": "u",
2331
- "Ủ": "U",
2332
- "ụ": "u",
2333
- "Ụ": "U",
2334
- "ũ": "u",
2335
- "Ũ": "U",
2336
- "ư": "u",
2337
- "Ư": "U",
2338
- "ứ": "u",
2339
- "Ứ": "U",
2340
- "ừ": "u",
2341
- "Ừ": "U",
2342
- "ự": "u",
2343
- "Ự": "U",
2344
- "ữ": "u",
2345
- "Ữ": "U",
2346
- "ử": "u",
2347
- "Ử": "ư",
2348
- "ỷ": "y",
2349
- "Ỷ": "y",
2350
- "ỳ": "y",
2351
- "Ỳ": "Y",
2352
- "ỵ": "y",
2353
- "Ỵ": "Y",
2354
- "ỹ": "y",
2355
- "Ỹ": "Y",
2356
- "ạ": "a",
2357
- "Ạ": "A",
2358
- "ấ": "a",
2359
- "Ấ": "A",
2360
- "ầ": "a",
2361
- "Ầ": "A",
2362
- "ậ": "a",
2363
- "Ậ": "A",
2364
- "ẫ": "a",
2365
- "Ẫ": "A",
2366
- "ắ": "a",
2367
- "Ắ": "A",
2368
- "ằ": "a",
2369
- "Ằ": "A",
2370
- "ặ": "a",
2371
- "Ặ": "A",
2372
- "ẵ": "a",
2373
- "Ẵ": "A",
2374
- "⓪": "0",
2375
- "①": "1",
2376
- "②": "2",
2377
- "③": "3",
2378
- "④": "4",
2379
- "⑤": "5",
2380
- "⑥": "6",
2381
- "⑦": "7",
2382
- "⑧": "8",
2383
- "⑨": "9",
2384
- "⑩": "10",
2385
- "⑪": "11",
2386
- "⑫": "12",
2387
- "⑬": "13",
2388
- "⑭": "14",
2389
- "⑮": "15",
2390
- "⑯": "16",
2391
- "⑰": "17",
2392
- "⑱": "18",
2393
- "⑲": "18",
2394
- "⑳": "18",
2395
- "⓵": "1",
2396
- "⓶": "2",
2397
- "⓷": "3",
2398
- "⓸": "4",
2399
- "⓹": "5",
2400
- "⓺": "6",
2401
- "⓻": "7",
2402
- "⓼": "8",
2403
- "⓽": "9",
2404
- "⓾": "10",
2405
- "⓿": "0",
2406
- "⓫": "11",
2407
- "⓬": "12",
2408
- "⓭": "13",
2409
- "⓮": "14",
2410
- "⓯": "15",
2411
- "⓰": "16",
2412
- "⓱": "17",
2413
- "⓲": "18",
2414
- "⓳": "19",
2415
- "⓴": "20",
2416
- "Ⓐ": "A",
2417
- "Ⓑ": "B",
2418
- "Ⓒ": "C",
2419
- "Ⓓ": "D",
2420
- "Ⓔ": "E",
2421
- "Ⓕ": "F",
2422
- "Ⓖ": "G",
2423
- "Ⓗ": "H",
2424
- "Ⓘ": "I",
2425
- "Ⓙ": "J",
2426
- "Ⓚ": "K",
2427
- "Ⓛ": "L",
2428
- "Ⓜ": "M",
2429
- "Ⓝ": "N",
2430
- "Ⓞ": "O",
2431
- "Ⓟ": "P",
2432
- "Ⓠ": "Q",
2433
- "Ⓡ": "R",
2434
- "Ⓢ": "S",
2435
- "Ⓣ": "T",
2436
- "Ⓤ": "U",
2437
- "Ⓥ": "V",
2438
- "Ⓦ": "W",
2439
- "Ⓧ": "X",
2440
- "Ⓨ": "Y",
2441
- "Ⓩ": "Z",
2442
- "ⓐ": "a",
2443
- "ⓑ": "b",
2444
- "ⓒ": "c",
2445
- "ⓓ": "d",
2446
- "ⓔ": "e",
2447
- "ⓕ": "f",
2448
- "ⓖ": "g",
2449
- "ⓗ": "h",
2450
- "ⓘ": "i",
2451
- "ⓙ": "j",
2452
- "ⓚ": "k",
2453
- "ⓛ": "l",
2454
- "ⓜ": "m",
2455
- "ⓝ": "n",
2456
- "ⓞ": "o",
2457
- "ⓟ": "p",
2458
- "ⓠ": "q",
2459
- "ⓡ": "r",
2460
- "ⓢ": "s",
2461
- "ⓣ": "t",
2462
- "ⓤ": "u",
2463
- "ⓦ": "v",
2464
- "ⓥ": "w",
2465
- "ⓧ": "x",
2466
- "ⓨ": "y",
2467
- "ⓩ": "z",
2468
- "“": "\"",
2469
- "”": "\"",
2470
- "‘": "'",
2471
- "’": "'",
2472
- "∂": "d",
2473
- "ƒ": "f",
2474
- "™": "(TM)",
2475
- "©": "(C)",
2476
- "œ": "oe",
2477
- "Œ": "OE",
2478
- "®": "(R)",
2479
- "†": "+",
2480
- "℠": "(SM)",
2481
- "…": "...",
2482
- "˚": "o",
2483
- "º": "o",
2484
- "ª": "a",
2485
- "•": "*",
2486
- "၊": ",",
2487
- "။": ".",
2488
- "$": "USD",
2489
- "€": "EUR",
2490
- "₢": "BRN",
2491
- "₣": "FRF",
2492
- "£": "GBP",
2493
- "₤": "ITL",
2494
- "₦": "NGN",
2495
- "₧": "ESP",
2496
- "₩": "KRW",
2497
- "₪": "ILS",
2498
- "₫": "VND",
2499
- "₭": "LAK",
2500
- "₮": "MNT",
2501
- "₯": "GRD",
2502
- "₱": "ARS",
2503
- "₲": "PYG",
2504
- "₳": "ARA",
2505
- "₴": "UAH",
2506
- "₵": "GHS",
2507
- "¢": "cent",
2508
- "¥": "CNY",
2509
- "元": "CNY",
2510
- "円": "YEN",
2511
- "﷼": "IRR",
2512
- "₠": "EWE",
2513
- "฿": "THB",
2514
- "₨": "INR",
2515
- "₹": "INR",
2516
- "₰": "PF",
2517
- "₺": "TRY",
2518
- "؋": "AFN",
2519
- "₼": "AZN",
2520
- "лв": "BGN",
2521
- "៛": "KHR",
2522
- "₡": "CRC",
2523
- "₸": "KZT",
2524
- "ден": "MKD",
2525
- "zł": "PLN",
2526
- "₽": "RUB",
2527
- "₾": "GEL"
2528
- };
2529
- /**
2530
- * special look ahead character array
2531
- * These characters form with consonants to become 'single'/consonant combo
2532
- * @type [Array]
2533
- */
2534
- var lookAheadCharArray = ["်", "ް"];
2535
- /**
2536
- * diatricMap for languages where transliteration changes entirely as more diatrics are added
2537
- * @type {Object}
2538
- */
2539
- var diatricMap = {
2540
- "ာ": "a",
2541
- "ါ": "a",
2542
- "ေ": "e",
2543
- "ဲ": "e",
2544
- "ိ": "i",
2545
- "ီ": "i",
2546
- "ို": "o",
2547
- "ု": "u",
2548
- "ူ": "u",
2549
- "ေါင်": "aung",
2550
- "ော": "aw",
2551
- "ော်": "aw",
2552
- "ေါ": "aw",
2553
- "ေါ်": "aw",
2554
- "်": "်",
2555
- "က်": "et",
2556
- "ိုက်": "aik",
2557
- "ောက်": "auk",
2558
- "င်": "in",
2559
- "ိုင်": "aing",
2560
- "ောင်": "aung",
2561
- "စ်": "it",
2562
- "ည်": "i",
2563
- "တ်": "at",
2564
- "ိတ်": "eik",
2565
- "ုတ်": "ok",
2566
- "ွတ်": "ut",
2567
- "ေတ်": "it",
2568
- "ဒ်": "d",
2569
- "ိုဒ်": "ok",
2570
- "ုဒ်": "ait",
2571
- "န်": "an",
2572
- "ာန်": "an",
2573
- "ိန်": "ein",
2574
- "ုန်": "on",
2575
- "ွန်": "un",
2576
- "ပ်": "at",
2577
- "ိပ်": "eik",
2578
- "ုပ်": "ok",
2579
- "ွပ်": "ut",
2580
- "န်ုပ်": "nub",
2581
- "မ်": "an",
2582
- "ိမ်": "ein",
2583
- "ုမ်": "on",
2584
- "ွမ်": "un",
2585
- "ယ်": "e",
2586
- "ိုလ်": "ol",
2587
- "ဉ်": "in",
2588
- "ံ": "an",
2589
- "ိံ": "ein",
2590
- "ုံ": "on",
2591
- "ައް": "ah",
2592
- "ަށް": "ah"
2593
- };
2594
- /**
2595
- * langCharMap language specific characters translations
2596
- * @type {Object}
2597
- */
2598
- var langCharMap = {
2599
- "en": {},
2600
- "az": {
2601
- "ç": "c",
2602
- "ə": "e",
2603
- "ğ": "g",
2604
- "ı": "i",
2605
- "ö": "o",
2606
- "ş": "s",
2607
- "ü": "u",
2608
- "Ç": "C",
2609
- "Ə": "E",
2610
- "Ğ": "G",
2611
- "İ": "I",
2612
- "Ö": "O",
2613
- "Ş": "S",
2614
- "Ü": "U"
2615
- },
2616
- "cs": {
2617
- "č": "c",
2618
- "ď": "d",
2619
- "ě": "e",
2620
- "ň": "n",
2621
- "ř": "r",
2622
- "š": "s",
2623
- "ť": "t",
2624
- "ů": "u",
2625
- "ž": "z",
2626
- "Č": "C",
2627
- "Ď": "D",
2628
- "Ě": "E",
2629
- "Ň": "N",
2630
- "Ř": "R",
2631
- "Š": "S",
2632
- "Ť": "T",
2633
- "Ů": "U",
2634
- "Ž": "Z"
2635
- },
2636
- "fi": {
2637
- "ä": "a",
2638
- "Ä": "A",
2639
- "ö": "o",
2640
- "Ö": "O"
2641
- },
2642
- "hu": {
2643
- "ä": "a",
2644
- "Ä": "A",
2645
- "ö": "o",
2646
- "Ö": "O",
2647
- "ü": "u",
2648
- "Ü": "U",
2649
- "ű": "u",
2650
- "Ű": "U"
2651
- },
2652
- "lt": {
2653
- "ą": "a",
2654
- "č": "c",
2655
- "ę": "e",
2656
- "ė": "e",
2657
- "į": "i",
2658
- "š": "s",
2659
- "ų": "u",
2660
- "ū": "u",
2661
- "ž": "z",
2662
- "Ą": "A",
2663
- "Č": "C",
2664
- "Ę": "E",
2665
- "Ė": "E",
2666
- "Į": "I",
2667
- "Š": "S",
2668
- "Ų": "U",
2669
- "Ū": "U"
2670
- },
2671
- "lv": {
2672
- "ā": "a",
2673
- "č": "c",
2674
- "ē": "e",
2675
- "ģ": "g",
2676
- "ī": "i",
2677
- "ķ": "k",
2678
- "ļ": "l",
2679
- "ņ": "n",
2680
- "š": "s",
2681
- "ū": "u",
2682
- "ž": "z",
2683
- "Ā": "A",
2684
- "Č": "C",
2685
- "Ē": "E",
2686
- "Ģ": "G",
2687
- "Ī": "i",
2688
- "Ķ": "k",
2689
- "Ļ": "L",
2690
- "Ņ": "N",
2691
- "Š": "S",
2692
- "Ū": "u",
2693
- "Ž": "Z"
2694
- },
2695
- "pl": {
2696
- "ą": "a",
2697
- "ć": "c",
2698
- "ę": "e",
2699
- "ł": "l",
2700
- "ń": "n",
2701
- "ó": "o",
2702
- "ś": "s",
2703
- "ź": "z",
2704
- "ż": "z",
2705
- "Ą": "A",
2706
- "Ć": "C",
2707
- "Ę": "e",
2708
- "Ł": "L",
2709
- "Ń": "N",
2710
- "Ó": "O",
2711
- "Ś": "S",
2712
- "Ź": "Z",
2713
- "Ż": "Z"
2714
- },
2715
- "sv": {
2716
- "ä": "a",
2717
- "Ä": "A",
2718
- "ö": "o",
2719
- "Ö": "O"
2720
- },
2721
- "sk": {
2722
- "ä": "a",
2723
- "Ä": "A"
2724
- },
2725
- "sr": {
2726
- "љ": "lj",
2727
- "њ": "nj",
2728
- "Љ": "Lj",
2729
- "Њ": "Nj",
2730
- "đ": "dj",
2731
- "Đ": "Dj"
2732
- },
2733
- "tr": {
2734
- "Ü": "U",
2735
- "Ö": "O",
2736
- "ü": "u",
2737
- "ö": "o"
2738
- }
2739
- };
2740
- /**
2741
- * symbolMap language specific symbol translations
2742
- * translations must be transliterated already
2743
- * @type {Object}
2744
- */
2745
- var symbolMap = {
2746
- "ar": {
2747
- "∆": "delta",
2748
- "∞": "la-nihaya",
2749
- "♥": "hob",
2750
- "&": "wa",
2751
- "|": "aw",
2752
- "<": "aqal-men",
2753
- ">": "akbar-men",
2754
- "∑": "majmou",
2755
- "¤": "omla"
2756
- },
2757
- "az": {},
2758
- "ca": {
2759
- "∆": "delta",
2760
- "∞": "infinit",
2761
- "♥": "amor",
2762
- "&": "i",
2763
- "|": "o",
2764
- "<": "menys que",
2765
- ">": "mes que",
2766
- "∑": "suma dels",
2767
- "¤": "moneda"
2768
- },
2769
- "cs": {
2770
- "∆": "delta",
2771
- "∞": "nekonecno",
2772
- "♥": "laska",
2773
- "&": "a",
2774
- "|": "nebo",
2775
- "<": "mensi nez",
2776
- ">": "vetsi nez",
2777
- "∑": "soucet",
2778
- "¤": "mena"
2779
- },
2780
- "de": {
2781
- "∆": "delta",
2782
- "∞": "unendlich",
2783
- "♥": "Liebe",
2784
- "&": "und",
2785
- "|": "oder",
2786
- "<": "kleiner als",
2787
- ">": "groesser als",
2788
- "∑": "Summe von",
2789
- "¤": "Waehrung"
2790
- },
2791
- "dv": {
2792
- "∆": "delta",
2793
- "∞": "kolunulaa",
2794
- "♥": "loabi",
2795
- "&": "aai",
2796
- "|": "noonee",
2797
- "<": "ah vure kuda",
2798
- ">": "ah vure bodu",
2799
- "∑": "jumula",
2800
- "¤": "faisaa"
2801
- },
2802
- "en": {
2803
- "∆": "delta",
2804
- "∞": "infinity",
2805
- "♥": "love",
2806
- "&": "and",
2807
- "|": "or",
2808
- "<": "less than",
2809
- ">": "greater than",
2810
- "∑": "sum",
2811
- "¤": "currency"
2812
- },
2813
- "es": {
2814
- "∆": "delta",
2815
- "∞": "infinito",
2816
- "♥": "amor",
2817
- "&": "y",
2818
- "|": "u",
2819
- "<": "menos que",
2820
- ">": "mas que",
2821
- "∑": "suma de los",
2822
- "¤": "moneda"
2823
- },
2824
- "fa": {
2825
- "∆": "delta",
2826
- "∞": "bi-nahayat",
2827
- "♥": "eshgh",
2828
- "&": "va",
2829
- "|": "ya",
2830
- "<": "kamtar-az",
2831
- ">": "bishtar-az",
2832
- "∑": "majmooe",
2833
- "¤": "vahed"
2834
- },
2835
- "fi": {
2836
- "∆": "delta",
2837
- "∞": "aarettomyys",
2838
- "♥": "rakkaus",
2839
- "&": "ja",
2840
- "|": "tai",
2841
- "<": "pienempi kuin",
2842
- ">": "suurempi kuin",
2843
- "∑": "summa",
2844
- "¤": "valuutta"
2845
- },
2846
- "fr": {
2847
- "∆": "delta",
2848
- "∞": "infiniment",
2849
- "♥": "Amour",
2850
- "&": "et",
2851
- "|": "ou",
2852
- "<": "moins que",
2853
- ">": "superieure a",
2854
- "∑": "somme des",
2855
- "¤": "monnaie"
2856
- },
2857
- "ge": {
2858
- "∆": "delta",
2859
- "∞": "usasruloba",
2860
- "♥": "siqvaruli",
2861
- "&": "da",
2862
- "|": "an",
2863
- "<": "naklebi",
2864
- ">": "meti",
2865
- "∑": "jami",
2866
- "¤": "valuta"
2867
- },
2868
- "gr": {},
2869
- "hu": {
2870
- "∆": "delta",
2871
- "∞": "vegtelen",
2872
- "♥": "szerelem",
2873
- "&": "es",
2874
- "|": "vagy",
2875
- "<": "kisebb mint",
2876
- ">": "nagyobb mint",
2877
- "∑": "szumma",
2878
- "¤": "penznem"
2879
- },
2880
- "it": {
2881
- "∆": "delta",
2882
- "∞": "infinito",
2883
- "♥": "amore",
2884
- "&": "e",
2885
- "|": "o",
2886
- "<": "minore di",
2887
- ">": "maggiore di",
2888
- "∑": "somma",
2889
- "¤": "moneta"
2890
- },
2891
- "lt": {
2892
- "∆": "delta",
2893
- "∞": "begalybe",
2894
- "♥": "meile",
2895
- "&": "ir",
2896
- "|": "ar",
2897
- "<": "maziau nei",
2898
- ">": "daugiau nei",
2899
- "∑": "suma",
2900
- "¤": "valiuta"
2901
- },
2902
- "lv": {
2903
- "∆": "delta",
2904
- "∞": "bezgaliba",
2905
- "♥": "milestiba",
2906
- "&": "un",
2907
- "|": "vai",
2908
- "<": "mazak neka",
2909
- ">": "lielaks neka",
2910
- "∑": "summa",
2911
- "¤": "valuta"
2912
- },
2913
- "my": {
2914
- "∆": "kwahkhyaet",
2915
- "∞": "asaonasme",
2916
- "♥": "akhyait",
2917
- "&": "nhin",
2918
- "|": "tho",
2919
- "<": "ngethaw",
2920
- ">": "kyithaw",
2921
- "∑": "paungld",
2922
- "¤": "ngwekye"
2923
- },
2924
- "mk": {},
2925
- "nl": {
2926
- "∆": "delta",
2927
- "∞": "oneindig",
2928
- "♥": "liefde",
2929
- "&": "en",
2930
- "|": "of",
2931
- "<": "kleiner dan",
2932
- ">": "groter dan",
2933
- "∑": "som",
2934
- "¤": "valuta"
2935
- },
2936
- "pl": {
2937
- "∆": "delta",
2938
- "∞": "nieskonczonosc",
2939
- "♥": "milosc",
2940
- "&": "i",
2941
- "|": "lub",
2942
- "<": "mniejsze niz",
2943
- ">": "wieksze niz",
2944
- "∑": "suma",
2945
- "¤": "waluta"
2946
- },
2947
- "pt": {
2948
- "∆": "delta",
2949
- "∞": "infinito",
2950
- "♥": "amor",
2951
- "&": "e",
2952
- "|": "ou",
2953
- "<": "menor que",
2954
- ">": "maior que",
2955
- "∑": "soma",
2956
- "¤": "moeda"
2957
- },
2958
- "ro": {
2959
- "∆": "delta",
2960
- "∞": "infinit",
2961
- "♥": "dragoste",
2962
- "&": "si",
2963
- "|": "sau",
2964
- "<": "mai mic ca",
2965
- ">": "mai mare ca",
2966
- "∑": "suma",
2967
- "¤": "valuta"
2968
- },
2969
- "ru": {
2970
- "∆": "delta",
2971
- "∞": "beskonechno",
2972
- "♥": "lubov",
2973
- "&": "i",
2974
- "|": "ili",
2975
- "<": "menshe",
2976
- ">": "bolshe",
2977
- "∑": "summa",
2978
- "¤": "valjuta"
2979
- },
2980
- "sk": {
2981
- "∆": "delta",
2982
- "∞": "nekonecno",
2983
- "♥": "laska",
2984
- "&": "a",
2985
- "|": "alebo",
2986
- "<": "menej ako",
2987
- ">": "viac ako",
2988
- "∑": "sucet",
2989
- "¤": "mena"
2990
- },
2991
- "sr": {},
2992
- "tr": {
2993
- "∆": "delta",
2994
- "∞": "sonsuzluk",
2995
- "♥": "ask",
2996
- "&": "ve",
2997
- "|": "veya",
2998
- "<": "kucuktur",
2999
- ">": "buyuktur",
3000
- "∑": "toplam",
3001
- "¤": "para birimi"
3002
- },
3003
- "uk": {
3004
- "∆": "delta",
3005
- "∞": "bezkinechnist",
3006
- "♥": "lubov",
3007
- "&": "i",
3008
- "|": "abo",
3009
- "<": "menshe",
3010
- ">": "bilshe",
3011
- "∑": "suma",
3012
- "¤": "valjuta"
3013
- },
3014
- "vn": {
3015
- "∆": "delta",
3016
- "∞": "vo cuc",
3017
- "♥": "yeu",
3018
- "&": "va",
3019
- "|": "hoac",
3020
- "<": "nho hon",
3021
- ">": "lon hon",
3022
- "∑": "tong",
3023
- "¤": "tien te"
3024
- }
3025
- };
3026
- var uricChars = [
3027
- ";",
3028
- "?",
3029
- ":",
3030
- "@",
3031
- "&",
3032
- "=",
3033
- "+",
3034
- "$",
3035
- ",",
3036
- "/"
3037
- ].join("");
3038
- var uricNoSlashChars = [
3039
- ";",
3040
- "?",
3041
- ":",
3042
- "@",
3043
- "&",
3044
- "=",
3045
- "+",
3046
- "$",
3047
- ","
3048
- ].join("");
3049
- var markChars = [
3050
- ".",
3051
- "!",
3052
- "~",
3053
- "*",
3054
- "'",
3055
- "(",
3056
- ")"
3057
- ].join("");
3058
- /**
3059
- * getSlug
3060
- * @param {string} input input string
3061
- * @param {object|string} opts config object or separator string/char
3062
- * @api public
3063
- * @return {string} sluggified string
3064
- */
3065
- var getSlug = function getSlug$1(input, opts) {
3066
- var separator = "-";
3067
- var result = "";
3068
- var diatricString = "";
3069
- var convertSymbols = true;
3070
- var customReplacements = {};
3071
- var maintainCase;
3072
- var titleCase;
3073
- var truncate;
3074
- var uricFlag;
3075
- var uricNoSlashFlag;
3076
- var markFlag;
3077
- var symbol;
3078
- var langChar;
3079
- var lucky;
3080
- var i;
3081
- var ch;
3082
- var l;
3083
- var lastCharWasSymbol;
3084
- var lastCharWasDiatric;
3085
- var allowedChars = "";
3086
- if (typeof input !== "string") return "";
3087
- if (typeof opts === "string") separator = opts;
3088
- symbol = symbolMap.en;
3089
- langChar = langCharMap.en;
3090
- if (typeof opts === "object") {
3091
- maintainCase = opts.maintainCase || false;
3092
- customReplacements = opts.custom && typeof opts.custom === "object" ? opts.custom : customReplacements;
3093
- truncate = +opts.truncate > 1 && opts.truncate || false;
3094
- uricFlag = opts.uric || false;
3095
- uricNoSlashFlag = opts.uricNoSlash || false;
3096
- markFlag = opts.mark || false;
3097
- convertSymbols = opts.symbols === false || opts.lang === false ? false : true;
3098
- separator = opts.separator || separator;
3099
- if (uricFlag) allowedChars += uricChars;
3100
- if (uricNoSlashFlag) allowedChars += uricNoSlashChars;
3101
- if (markFlag) allowedChars += markChars;
3102
- symbol = opts.lang && symbolMap[opts.lang] && convertSymbols ? symbolMap[opts.lang] : convertSymbols ? symbolMap.en : {};
3103
- langChar = opts.lang && langCharMap[opts.lang] ? langCharMap[opts.lang] : opts.lang === false || opts.lang === true ? {} : langCharMap.en;
3104
- if (opts.titleCase && typeof opts.titleCase.length === "number" && Array.prototype.toString.call(opts.titleCase)) {
3105
- opts.titleCase.forEach(function(v) {
3106
- customReplacements[v + ""] = v + "";
3107
- });
3108
- titleCase = true;
3109
- } else titleCase = !!opts.titleCase;
3110
- if (opts.custom && typeof opts.custom.length === "number" && Array.prototype.toString.call(opts.custom)) opts.custom.forEach(function(v) {
3111
- customReplacements[v + ""] = v + "";
3112
- });
3113
- Object.keys(customReplacements).forEach(function(v) {
3114
- var r;
3115
- if (v.length > 1) r = new RegExp("\\b" + escapeChars(v) + "\\b", "gi");
3116
- else r = new RegExp(escapeChars(v), "gi");
3117
- input = input.replace(r, customReplacements[v]);
3118
- });
3119
- for (ch in customReplacements) allowedChars += ch;
3120
- }
3121
- allowedChars += separator;
3122
- allowedChars = escapeChars(allowedChars);
3123
- input = input.replace(/(^\s+|\s+$)/g, "");
3124
- lastCharWasSymbol = false;
3125
- lastCharWasDiatric = false;
3126
- for (i = 0, l = input.length; i < l; i++) {
3127
- ch = input[i];
3128
- if (isReplacedCustomChar(ch, customReplacements)) lastCharWasSymbol = false;
3129
- else if (langChar[ch]) {
3130
- ch = lastCharWasSymbol && langChar[ch].match(/[A-Za-z0-9]/) ? " " + langChar[ch] : langChar[ch];
3131
- lastCharWasSymbol = false;
3132
- } else if (ch in charMap) {
3133
- if (i + 1 < l && lookAheadCharArray.indexOf(input[i + 1]) >= 0) {
3134
- diatricString += ch;
3135
- ch = "";
3136
- } else if (lastCharWasDiatric === true) {
3137
- ch = diatricMap[diatricString] + charMap[ch];
3138
- diatricString = "";
3139
- } else ch = lastCharWasSymbol && charMap[ch].match(/[A-Za-z0-9]/) ? " " + charMap[ch] : charMap[ch];
3140
- lastCharWasSymbol = false;
3141
- lastCharWasDiatric = false;
3142
- } else if (ch in diatricMap) {
3143
- diatricString += ch;
3144
- ch = "";
3145
- if (i === l - 1) ch = diatricMap[diatricString];
3146
- lastCharWasDiatric = true;
3147
- } else if (symbol[ch] && !(uricFlag && uricChars.indexOf(ch) !== -1) && !(uricNoSlashFlag && uricNoSlashChars.indexOf(ch) !== -1)) {
3148
- ch = lastCharWasSymbol || result.substr(-1).match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch];
3149
- ch += input[i + 1] !== void 0 && input[i + 1].match(/[A-Za-z0-9]/) ? separator : "";
3150
- lastCharWasSymbol = true;
3151
- } else {
3152
- if (lastCharWasDiatric === true) {
3153
- ch = diatricMap[diatricString] + ch;
3154
- diatricString = "";
3155
- lastCharWasDiatric = false;
3156
- } else if (lastCharWasSymbol && (/[A-Za-z0-9]/.test(ch) || result.substr(-1).match(/A-Za-z0-9]/))) ch = " " + ch;
3157
- lastCharWasSymbol = false;
3158
- }
3159
- result += ch.replace(new RegExp("[^\\w\\s" + allowedChars + "_-]", "g"), separator);
3160
- }
3161
- if (titleCase) result = result.replace(/(\w)(\S*)/g, function(_, i$1, r) {
3162
- var j = i$1.toUpperCase() + (r !== null ? r : "");
3163
- return Object.keys(customReplacements).indexOf(j.toLowerCase()) < 0 ? j : j.toLowerCase();
3164
- });
3165
- result = result.replace(/\s+/g, separator).replace(new RegExp("\\" + separator + "+", "g"), separator).replace(new RegExp("(^\\" + separator + "+|\\" + separator + "+$)", "g"), "");
3166
- if (truncate && result.length > truncate) {
3167
- lucky = result.charAt(truncate) === separator;
3168
- result = result.slice(0, truncate);
3169
- if (!lucky) result = result.slice(0, result.lastIndexOf(separator));
3170
- }
3171
- if (!maintainCase && !titleCase) result = result.toLowerCase();
3172
- return result;
3173
- };
3174
- /**
3175
- * createSlug curried(opts)(input)
3176
- * @param {object|string} opts config object or input string
3177
- * @return {Function} function getSlugWithConfig()
3178
- **/
3179
- var createSlug = function createSlug$1(opts) {
3180
- /**
3181
- * getSlugWithConfig
3182
- * @param {string} input string
3183
- * @return {string} slug string
3184
- */
3185
- return function getSlugWithConfig(input) {
3186
- return getSlug(input, opts);
3187
- };
3188
- };
3189
- /**
3190
- * escape Chars
3191
- * @param {string} input string
3192
- */
3193
- var escapeChars = function escapeChars$1(input) {
3194
- return input.replace(/[-\\^$*+?.()|[\]{}\/]/g, "\\$&");
3195
- };
3196
- /**
3197
- * check if the char is an already converted char from custom list
3198
- * @param {char} ch character to check
3199
- * @param {object} customReplacements custom translation map
3200
- */
3201
- var isReplacedCustomChar = function(ch, customReplacements) {
3202
- for (var c in customReplacements) if (customReplacements[c] === ch) return true;
3203
- };
3204
- if (typeof module !== "undefined" && module.exports) {
3205
- module.exports = getSlug;
3206
- module.exports.createSlug = createSlug;
3207
- } else if (typeof define !== "undefined" && define.amd) define([], function() {
3208
- return getSlug;
3209
- });
3210
- else try {
3211
- if (root.getSlug || root.createSlug) throw "speakingurl: globals exists /(getSlug|createSlug)/";
3212
- else {
3213
- root.getSlug = getSlug;
3214
- root.createSlug = createSlug;
3215
- }
3216
- } catch (e) {}
3217
- })(exports);
3218
- }) });
3219
- var import_speakingurl = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js": ((exports, module) => {
3220
- module.exports = require_speakingurl$1();
3221
- }) }))(), 1);
3222
- const appRecordInfo = target.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__ ??= {
3223
- id: 0,
3224
- appIds: /* @__PURE__ */ new Set()
3225
- };
3226
- function toggleHighPerfMode(state) {
3227
- devtoolsState.highPerfModeEnabled = state ?? !devtoolsState.highPerfModeEnabled;
3228
- if (!state && activeAppRecord.value) registerDevToolsPlugin(activeAppRecord.value.app);
3229
- }
3230
- function updateDevToolsClientDetected(params) {
3231
- devtoolsState.devtoolsClientDetected = {
3232
- ...devtoolsState.devtoolsClientDetected,
3233
- ...params
3234
- };
3235
- toggleHighPerfMode(!Object.values(devtoolsState.devtoolsClientDetected).some(Boolean));
3236
- }
3237
- target.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ ??= updateDevToolsClientDetected;
3238
- var DoubleIndexedKV = class {
3239
- constructor() {
3240
- this.keyToValue = /* @__PURE__ */ new Map();
3241
- this.valueToKey = /* @__PURE__ */ new Map();
3242
- }
3243
- set(key, value) {
3244
- this.keyToValue.set(key, value);
3245
- this.valueToKey.set(value, key);
3246
- }
3247
- getByKey(key) {
3248
- return this.keyToValue.get(key);
3249
- }
3250
- getByValue(value) {
3251
- return this.valueToKey.get(value);
3252
- }
3253
- clear() {
3254
- this.keyToValue.clear();
3255
- this.valueToKey.clear();
3256
- }
3257
- };
3258
- var Registry = class {
3259
- constructor(generateIdentifier) {
3260
- this.generateIdentifier = generateIdentifier;
3261
- this.kv = new DoubleIndexedKV();
3262
- }
3263
- register(value, identifier) {
3264
- if (this.kv.getByValue(value)) return;
3265
- if (!identifier) identifier = this.generateIdentifier(value);
3266
- this.kv.set(identifier, value);
3267
- }
3268
- clear() {
3269
- this.kv.clear();
3270
- }
3271
- getIdentifier(value) {
3272
- return this.kv.getByValue(value);
3273
- }
3274
- getValue(identifier) {
3275
- return this.kv.getByKey(identifier);
3276
- }
3277
- };
3278
- var ClassRegistry = class extends Registry {
3279
- constructor() {
3280
- super((c) => c.name);
3281
- this.classToAllowedProps = /* @__PURE__ */ new Map();
3282
- }
3283
- register(value, options) {
3284
- if (typeof options === "object") {
3285
- if (options.allowProps) this.classToAllowedProps.set(value, options.allowProps);
3286
- super.register(value, options.identifier);
3287
- } else super.register(value, options);
3288
- }
3289
- getAllowedProps(value) {
3290
- return this.classToAllowedProps.get(value);
3291
- }
3292
- };
3293
- function valuesOfObj(record) {
3294
- if ("values" in Object) return Object.values(record);
3295
- const values = [];
3296
- for (const key in record) if (record.hasOwnProperty(key)) values.push(record[key]);
3297
- return values;
3298
- }
3299
- function find(record, predicate) {
3300
- const values = valuesOfObj(record);
3301
- if ("find" in values) return values.find(predicate);
3302
- const valuesNotNever = values;
3303
- for (let i = 0; i < valuesNotNever.length; i++) {
3304
- const value = valuesNotNever[i];
3305
- if (predicate(value)) return value;
3306
- }
3307
- }
3308
- function forEach(record, run) {
3309
- Object.entries(record).forEach(([key, value]) => run(value, key));
3310
- }
3311
- function includes(arr, value) {
3312
- return arr.indexOf(value) !== -1;
3313
- }
3314
- function findArr(record, predicate) {
3315
- for (let i = 0; i < record.length; i++) {
3316
- const value = record[i];
3317
- if (predicate(value)) return value;
3318
- }
3319
- }
3320
- var CustomTransformerRegistry = class {
3321
- constructor() {
3322
- this.transfomers = {};
3323
- }
3324
- register(transformer) {
3325
- this.transfomers[transformer.name] = transformer;
3326
- }
3327
- findApplicable(v) {
3328
- return find(this.transfomers, (transformer) => transformer.isApplicable(v));
3329
- }
3330
- findByName(name) {
3331
- return this.transfomers[name];
3332
- }
3333
- };
3334
- const getType$1 = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
3335
- const isUndefined$1 = (payload) => typeof payload === "undefined";
3336
- const isNull$1 = (payload) => payload === null;
3337
- const isPlainObject$2 = (payload) => {
3338
- if (typeof payload !== "object" || payload === null) return false;
3339
- if (payload === Object.prototype) return false;
3340
- if (Object.getPrototypeOf(payload) === null) return true;
3341
- return Object.getPrototypeOf(payload) === Object.prototype;
3342
- };
3343
- const isEmptyObject = (payload) => isPlainObject$2(payload) && Object.keys(payload).length === 0;
3344
- const isArray$2 = (payload) => Array.isArray(payload);
3345
- const isString = (payload) => typeof payload === "string";
3346
- const isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
3347
- const isBoolean = (payload) => typeof payload === "boolean";
3348
- const isRegExp = (payload) => payload instanceof RegExp;
3349
- const isMap = (payload) => payload instanceof Map;
3350
- const isSet = (payload) => payload instanceof Set;
3351
- const isSymbol = (payload) => getType$1(payload) === "Symbol";
3352
- const isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
3353
- const isError = (payload) => payload instanceof Error;
3354
- const isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
3355
- const isPrimitive = (payload) => isBoolean(payload) || isNull$1(payload) || isUndefined$1(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
3356
- const isBigint = (payload) => typeof payload === "bigint";
3357
- const isInfinite = (payload) => payload === Infinity || payload === -Infinity;
3358
- const isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
3359
- const isURL = (payload) => payload instanceof URL;
3360
- const escapeKey = (key) => key.replace(/\./g, "\\.");
3361
- const stringifyPath = (path) => path.map(String).map(escapeKey).join(".");
3362
- const parsePath = (string) => {
3363
- const result = [];
3364
- let segment = "";
3365
- for (let i = 0; i < string.length; i++) {
3366
- let char = string.charAt(i);
3367
- if (char === "\\" && string.charAt(i + 1) === ".") {
3368
- segment += ".";
3369
- i++;
3370
- continue;
3371
- }
3372
- if (char === ".") {
3373
- result.push(segment);
3374
- segment = "";
3375
- continue;
3376
- }
3377
- segment += char;
3378
- }
3379
- const lastSegment = segment;
3380
- result.push(lastSegment);
3381
- return result;
3382
- };
3383
- function simpleTransformation(isApplicable, annotation, transform, untransform) {
3384
- return {
3385
- isApplicable,
3386
- annotation,
3387
- transform,
3388
- untransform
3389
- };
3390
- }
3391
- const simpleRules = [
3392
- simpleTransformation(isUndefined$1, "undefined", () => null, () => void 0),
3393
- simpleTransformation(isBigint, "bigint", (v) => v.toString(), (v) => {
3394
- if (typeof BigInt !== "undefined") return BigInt(v);
3395
- console.error("Please add a BigInt polyfill.");
3396
- return v;
3397
- }),
3398
- simpleTransformation(isDate, "Date", (v) => v.toISOString(), (v) => new Date(v)),
3399
- simpleTransformation(isError, "Error", (v, superJson) => {
3400
- const baseError = {
3401
- name: v.name,
3402
- message: v.message
3403
- };
3404
- superJson.allowedErrorProps.forEach((prop) => {
3405
- baseError[prop] = v[prop];
3406
- });
3407
- return baseError;
3408
- }, (v, superJson) => {
3409
- const e = new Error(v.message);
3410
- e.name = v.name;
3411
- e.stack = v.stack;
3412
- superJson.allowedErrorProps.forEach((prop) => {
3413
- e[prop] = v[prop];
3414
- });
3415
- return e;
3416
- }),
3417
- simpleTransformation(isRegExp, "regexp", (v) => "" + v, (regex) => {
3418
- const body = regex.slice(1, regex.lastIndexOf("/"));
3419
- const flags = regex.slice(regex.lastIndexOf("/") + 1);
3420
- return new RegExp(body, flags);
3421
- }),
3422
- simpleTransformation(isSet, "set", (v) => [...v.values()], (v) => new Set(v)),
3423
- simpleTransformation(isMap, "map", (v) => [...v.entries()], (v) => new Map(v)),
3424
- simpleTransformation((v) => isNaNValue(v) || isInfinite(v), "number", (v) => {
3425
- if (isNaNValue(v)) return "NaN";
3426
- if (v > 0) return "Infinity";
3427
- else return "-Infinity";
3428
- }, Number),
3429
- simpleTransformation((v) => v === 0 && 1 / v === -Infinity, "number", () => {
3430
- return "-0";
3431
- }, Number),
3432
- simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
3433
- ];
3434
- function compositeTransformation(isApplicable, annotation, transform, untransform) {
3435
- return {
3436
- isApplicable,
3437
- annotation,
3438
- transform,
3439
- untransform
3440
- };
3441
- }
3442
- const symbolRule = compositeTransformation((s, superJson) => {
3443
- if (isSymbol(s)) return !!superJson.symbolRegistry.getIdentifier(s);
3444
- return false;
3445
- }, (s, superJson) => {
3446
- return ["symbol", superJson.symbolRegistry.getIdentifier(s)];
3447
- }, (v) => v.description, (_, a, superJson) => {
3448
- const value = superJson.symbolRegistry.getValue(a[1]);
3449
- if (!value) throw new Error("Trying to deserialize unknown symbol");
3450
- return value;
3451
- });
3452
- const constructorToName = [
3453
- Int8Array,
3454
- Uint8Array,
3455
- Int16Array,
3456
- Uint16Array,
3457
- Int32Array,
3458
- Uint32Array,
3459
- Float32Array,
3460
- Float64Array,
3461
- Uint8ClampedArray
3462
- ].reduce((obj, ctor) => {
3463
- obj[ctor.name] = ctor;
3464
- return obj;
3465
- }, {});
3466
- const typedArrayRule = compositeTransformation(isTypedArray, (v) => ["typed-array", v.constructor.name], (v) => [...v], (v, a) => {
3467
- const ctor = constructorToName[a[1]];
3468
- if (!ctor) throw new Error("Trying to deserialize unknown typed array");
3469
- return new ctor(v);
3470
- });
3471
- function isInstanceOfRegisteredClass(potentialClass, superJson) {
3472
- if (potentialClass?.constructor) return !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
3473
- return false;
3474
- }
3475
- const classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
3476
- return ["class", superJson.classRegistry.getIdentifier(clazz.constructor)];
3477
- }, (clazz, superJson) => {
3478
- const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
3479
- if (!allowedProps) return { ...clazz };
3480
- const result = {};
3481
- allowedProps.forEach((prop) => {
3482
- result[prop] = clazz[prop];
3483
- });
3484
- return result;
3485
- }, (v, a, superJson) => {
3486
- const clazz = superJson.classRegistry.getValue(a[1]);
3487
- if (!clazz) throw new Error(`Trying to deserialize unknown class '${a[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
3488
- return Object.assign(Object.create(clazz.prototype), v);
3489
- });
3490
- const customRule = compositeTransformation((value, superJson) => {
3491
- return !!superJson.customTransformerRegistry.findApplicable(value);
3492
- }, (value, superJson) => {
3493
- return ["custom", superJson.customTransformerRegistry.findApplicable(value).name];
3494
- }, (value, superJson) => {
3495
- return superJson.customTransformerRegistry.findApplicable(value).serialize(value);
3496
- }, (v, a, superJson) => {
3497
- const transformer = superJson.customTransformerRegistry.findByName(a[1]);
3498
- if (!transformer) throw new Error("Trying to deserialize unknown custom value");
3499
- return transformer.deserialize(v);
3500
- });
3501
- const compositeRules = [
3502
- classRule,
3503
- symbolRule,
3504
- customRule,
3505
- typedArrayRule
3506
- ];
3507
- const transformValue = (value, superJson) => {
3508
- const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));
3509
- if (applicableCompositeRule) return {
3510
- value: applicableCompositeRule.transform(value, superJson),
3511
- type: applicableCompositeRule.annotation(value, superJson)
3512
- };
3513
- const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));
3514
- if (applicableSimpleRule) return {
3515
- value: applicableSimpleRule.transform(value, superJson),
3516
- type: applicableSimpleRule.annotation
3517
- };
3518
- };
3519
- const simpleRulesByAnnotation = {};
3520
- simpleRules.forEach((rule) => {
3521
- simpleRulesByAnnotation[rule.annotation] = rule;
3522
- });
3523
- const untransformValue = (json, type, superJson) => {
3524
- if (isArray$2(type)) switch (type[0]) {
3525
- case "symbol": return symbolRule.untransform(json, type, superJson);
3526
- case "class": return classRule.untransform(json, type, superJson);
3527
- case "custom": return customRule.untransform(json, type, superJson);
3528
- case "typed-array": return typedArrayRule.untransform(json, type, superJson);
3529
- default: throw new Error("Unknown transformation: " + type);
3530
- }
3531
- else {
3532
- const transformation = simpleRulesByAnnotation[type];
3533
- if (!transformation) throw new Error("Unknown transformation: " + type);
3534
- return transformation.untransform(json, superJson);
3535
- }
3536
- };
3537
- const getNthKey = (value, n) => {
3538
- if (n > value.size) throw new Error("index out of bounds");
3539
- const keys = value.keys();
3540
- while (n > 0) {
3541
- keys.next();
3542
- n--;
3543
- }
3544
- return keys.next().value;
3545
- };
3546
- function validatePath(path) {
3547
- if (includes(path, "__proto__")) throw new Error("__proto__ is not allowed as a property");
3548
- if (includes(path, "prototype")) throw new Error("prototype is not allowed as a property");
3549
- if (includes(path, "constructor")) throw new Error("constructor is not allowed as a property");
3550
- }
3551
- const getDeep = (object, path) => {
3552
- validatePath(path);
3553
- for (let i = 0; i < path.length; i++) {
3554
- const key = path[i];
3555
- if (isSet(object)) object = getNthKey(object, +key);
3556
- else if (isMap(object)) {
3557
- const row = +key;
3558
- const type = +path[++i] === 0 ? "key" : "value";
3559
- const keyOfRow = getNthKey(object, row);
3560
- switch (type) {
3561
- case "key":
3562
- object = keyOfRow;
3563
- break;
3564
- case "value":
3565
- object = object.get(keyOfRow);
3566
- break;
3567
- }
3568
- } else object = object[key];
3569
- }
3570
- return object;
3571
- };
3572
- const setDeep = (object, path, mapper) => {
3573
- validatePath(path);
3574
- if (path.length === 0) return mapper(object);
3575
- let parent = object;
3576
- for (let i = 0; i < path.length - 1; i++) {
3577
- const key = path[i];
3578
- if (isArray$2(parent)) {
3579
- const index = +key;
3580
- parent = parent[index];
3581
- } else if (isPlainObject$2(parent)) parent = parent[key];
3582
- else if (isSet(parent)) {
3583
- const row = +key;
3584
- parent = getNthKey(parent, row);
3585
- } else if (isMap(parent)) {
3586
- if (i === path.length - 2) break;
3587
- const row = +key;
3588
- const type = +path[++i] === 0 ? "key" : "value";
3589
- const keyOfRow = getNthKey(parent, row);
3590
- switch (type) {
3591
- case "key":
3592
- parent = keyOfRow;
3593
- break;
3594
- case "value":
3595
- parent = parent.get(keyOfRow);
3596
- break;
3597
- }
3598
- }
3599
- }
3600
- const lastKey = path[path.length - 1];
3601
- if (isArray$2(parent)) parent[+lastKey] = mapper(parent[+lastKey]);
3602
- else if (isPlainObject$2(parent)) parent[lastKey] = mapper(parent[lastKey]);
3603
- if (isSet(parent)) {
3604
- const oldValue = getNthKey(parent, +lastKey);
3605
- const newValue = mapper(oldValue);
3606
- if (oldValue !== newValue) {
3607
- parent.delete(oldValue);
3608
- parent.add(newValue);
3609
- }
3610
- }
3611
- if (isMap(parent)) {
3612
- const row = +path[path.length - 2];
3613
- const keyToRow = getNthKey(parent, row);
3614
- switch (+lastKey === 0 ? "key" : "value") {
3615
- case "key": {
3616
- const newKey = mapper(keyToRow);
3617
- parent.set(newKey, parent.get(keyToRow));
3618
- if (newKey !== keyToRow) parent.delete(keyToRow);
3619
- break;
3620
- }
3621
- case "value":
3622
- parent.set(keyToRow, mapper(parent.get(keyToRow)));
3623
- break;
3624
- }
3625
- }
3626
- return object;
3627
- };
3628
- function traverse(tree, walker$1, origin = []) {
3629
- if (!tree) return;
3630
- if (!isArray$2(tree)) {
3631
- forEach(tree, (subtree, key) => traverse(subtree, walker$1, [...origin, ...parsePath(key)]));
3632
- return;
3633
- }
3634
- const [nodeValue, children] = tree;
3635
- if (children) forEach(children, (child, key) => {
3636
- traverse(child, walker$1, [...origin, ...parsePath(key)]);
3637
- });
3638
- walker$1(nodeValue, origin);
3639
- }
3640
- function applyValueAnnotations(plain, annotations, superJson) {
3641
- traverse(annotations, (type, path) => {
3642
- plain = setDeep(plain, path, (v) => untransformValue(v, type, superJson));
3643
- });
3644
- return plain;
3645
- }
3646
- function applyReferentialEqualityAnnotations(plain, annotations) {
3647
- function apply(identicalPaths, path) {
3648
- const object = getDeep(plain, parsePath(path));
3649
- identicalPaths.map(parsePath).forEach((identicalObjectPath) => {
3650
- plain = setDeep(plain, identicalObjectPath, () => object);
3651
- });
3652
- }
3653
- if (isArray$2(annotations)) {
3654
- const [root, other] = annotations;
3655
- root.forEach((identicalPath) => {
3656
- plain = setDeep(plain, parsePath(identicalPath), () => plain);
3657
- });
3658
- if (other) forEach(other, apply);
3659
- } else forEach(annotations, apply);
3660
- return plain;
3661
- }
3662
- const isDeep = (object, superJson) => isPlainObject$2(object) || isArray$2(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson);
3663
- function addIdentity(object, path, identities) {
3664
- const existingSet = identities.get(object);
3665
- if (existingSet) existingSet.push(path);
3666
- else identities.set(object, [path]);
3667
- }
3668
- function generateReferentialEqualityAnnotations(identitites, dedupe) {
3669
- const result = {};
3670
- let rootEqualityPaths = void 0;
3671
- identitites.forEach((paths) => {
3672
- if (paths.length <= 1) return;
3673
- if (!dedupe) paths = paths.map((path) => path.map(String)).sort((a, b) => a.length - b.length);
3674
- const [representativePath, ...identicalPaths] = paths;
3675
- if (representativePath.length === 0) rootEqualityPaths = identicalPaths.map(stringifyPath);
3676
- else result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
3677
- });
3678
- if (rootEqualityPaths) if (isEmptyObject(result)) return [rootEqualityPaths];
3679
- else return [rootEqualityPaths, result];
3680
- else return isEmptyObject(result) ? void 0 : result;
3681
- }
3682
- const walker = (object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
3683
- const primitive = isPrimitive(object);
3684
- if (!primitive) {
3685
- addIdentity(object, path, identities);
3686
- const seen = seenObjects.get(object);
3687
- if (seen) return dedupe ? { transformedValue: null } : seen;
3688
- }
3689
- if (!isDeep(object, superJson)) {
3690
- const transformed$1 = transformValue(object, superJson);
3691
- const result$1 = transformed$1 ? {
3692
- transformedValue: transformed$1.value,
3693
- annotations: [transformed$1.type]
3694
- } : { transformedValue: object };
3695
- if (!primitive) seenObjects.set(object, result$1);
3696
- return result$1;
3697
- }
3698
- if (includes(objectsInThisPath, object)) return { transformedValue: null };
3699
- const transformationResult = transformValue(object, superJson);
3700
- const transformed = transformationResult?.value ?? object;
3701
- const transformedValue = isArray$2(transformed) ? [] : {};
3702
- const innerAnnotations = {};
3703
- forEach(transformed, (value, index) => {
3704
- if (index === "__proto__" || index === "constructor" || index === "prototype") throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);
3705
- const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index], [...objectsInThisPath, object], seenObjects);
3706
- transformedValue[index] = recursiveResult.transformedValue;
3707
- if (isArray$2(recursiveResult.annotations)) innerAnnotations[index] = recursiveResult.annotations;
3708
- else if (isPlainObject$2(recursiveResult.annotations)) forEach(recursiveResult.annotations, (tree, key) => {
3709
- innerAnnotations[escapeKey(index) + "." + key] = tree;
3710
- });
3711
- });
3712
- const result = isEmptyObject(innerAnnotations) ? {
3713
- transformedValue,
3714
- annotations: !!transformationResult ? [transformationResult.type] : void 0
3715
- } : {
3716
- transformedValue,
3717
- annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
3718
- };
3719
- if (!primitive) seenObjects.set(object, result);
3720
- return result;
3721
- };
3722
- function getType(payload) {
3723
- return Object.prototype.toString.call(payload).slice(8, -1);
3724
- }
3725
- function isArray$1(payload) {
3726
- return getType(payload) === "Array";
3727
- }
3728
- function isPlainObject$1(payload) {
3729
- if (getType(payload) !== "Object") return false;
3730
- const prototype = Object.getPrototypeOf(payload);
3731
- return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
3732
- }
3733
- function isNull(payload) {
3734
- return getType(payload) === "Null";
3735
- }
3736
- function isOneOf(a, b, c, d, e) {
3737
- return (value) => a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);
3738
- }
3739
- function isUndefined(payload) {
3740
- return getType(payload) === "Undefined";
3741
- }
3742
- isOneOf(isNull, isUndefined);
3743
- function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
3744
- const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
3745
- if (propType === "enumerable") carry[key] = newVal;
3746
- if (includeNonenumerable && propType === "nonenumerable") Object.defineProperty(carry, key, {
3747
- value: newVal,
3748
- enumerable: false,
3749
- writable: true,
3750
- configurable: true
3751
- });
3752
- }
3753
- function copy(target$1, options = {}) {
3754
- if (isArray$1(target$1)) return target$1.map((item) => copy(item, options));
3755
- if (!isPlainObject$1(target$1)) return target$1;
3756
- const props = Object.getOwnPropertyNames(target$1);
3757
- const symbols = Object.getOwnPropertySymbols(target$1);
3758
- return [...props, ...symbols].reduce((carry, key) => {
3759
- if (isArray$1(options.props) && !options.props.includes(key)) return carry;
3760
- const val = target$1[key];
3761
- assignProp(carry, key, copy(val, options), target$1, options.nonenumerable);
3762
- return carry;
3763
- }, {});
3764
- }
3765
- var SuperJSON = class {
3766
- /**
3767
- * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
3768
- */
3769
- constructor({ dedupe = false } = {}) {
3770
- this.classRegistry = new ClassRegistry();
3771
- this.symbolRegistry = new Registry((s) => s.description ?? "");
3772
- this.customTransformerRegistry = new CustomTransformerRegistry();
3773
- this.allowedErrorProps = [];
3774
- this.dedupe = dedupe;
3775
- }
3776
- serialize(object) {
3777
- const identities = /* @__PURE__ */ new Map();
3778
- const output = walker(object, identities, this, this.dedupe);
3779
- const res = { json: output.transformedValue };
3780
- if (output.annotations) res.meta = {
3781
- ...res.meta,
3782
- values: output.annotations
3783
- };
3784
- const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
3785
- if (equalityAnnotations) res.meta = {
3786
- ...res.meta,
3787
- referentialEqualities: equalityAnnotations
3788
- };
3789
- return res;
3790
- }
3791
- deserialize(payload) {
3792
- const { json, meta } = payload;
3793
- let result = copy(json);
3794
- if (meta?.values) result = applyValueAnnotations(result, meta.values, this);
3795
- if (meta?.referentialEqualities) result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
3796
- return result;
3797
- }
3798
- stringify(object) {
3799
- return JSON.stringify(this.serialize(object));
3800
- }
3801
- parse(string) {
3802
- return this.deserialize(JSON.parse(string));
3803
- }
3804
- registerClass(v, options) {
3805
- this.classRegistry.register(v, options);
3806
- }
3807
- registerSymbol(v, identifier) {
3808
- this.symbolRegistry.register(v, identifier);
3809
- }
3810
- registerCustom(transformer, name) {
3811
- this.customTransformerRegistry.register({
3812
- name,
3813
- ...transformer
3814
- });
3815
- }
3816
- allowErrorProps(...props) {
3817
- this.allowedErrorProps.push(...props);
3818
- }
3819
- };
3820
- SuperJSON.defaultInstance = new SuperJSON();
3821
- SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
3822
- SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
3823
- SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
3824
- SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
3825
- SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
3826
- SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
3827
- SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
3828
- SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
3829
- SuperJSON.serialize;
3830
- SuperJSON.deserialize;
3831
- SuperJSON.stringify;
3832
- SuperJSON.parse;
3833
- SuperJSON.registerClass;
3834
- SuperJSON.registerCustom;
3835
- SuperJSON.registerSymbol;
3836
- SuperJSON.allowErrorProps;
3837
- target.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__ ??= [];
3838
- target.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ ??= null;
3839
- target.__VUE_DEVTOOLS_KIT_RPC_SERVER__ ??= null;
3840
- target.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ ??= null;
3841
- target.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ ??= null;
3842
- target.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__ ??= null;
3843
- const MAX_SERIALIZED_SIZE = 2 * 1024 * 1024;
3844
-
3845
- //#endregion
3846
- //#region src/constants.ts
3847
- const INSPECTOR_ID = "vuebugger-inspector";
3848
- const TIMELINE_ID = "vuebugger-timeline";
3849
-
3850
- //#endregion
3851
- //#region src/devtools.ts
3852
- const handleGetInspectorTree = (payload) => {
3853
- if (payload.inspectorId === INSPECTOR_ID) {
3854
- const term = payload.filter;
3855
- payload.rootNodes = byGroupId.entries().filter(([groupId, uids]) => groupId.includes(term) || uids.values().some((uid) => uid.includes(term))).map(([groupId, uids]) => ({
3856
- id: groupId,
3857
- label: groupId,
3858
- children: uids.values().filter((uid) => uid.includes(term)).map((uid) => ({
3859
- id: uid,
3860
- label: uid
3861
- })).toArray()
3862
- })).toArray();
3863
- }
3864
- };
3865
- const handleGetInspectorState = (api) => (payload) => {
3866
- if (payload.inspectorId === INSPECTOR_ID) {
3867
- const entry = byUid.get(payload.nodeId);
3868
- const group = byGroupId.get(payload.nodeId);
3869
- if (group) {
3870
- api.unhighlightElement();
3871
- payload.state = group.values().reduce((res, uid) => {
3872
- const { debugState } = byUid.get(uid);
3873
- res[uid] = Object.entries(debugState).map(([key, value]) => ({
3874
- key,
3875
- value: toValue(value)
3876
- }));
3877
- return res;
3878
- }, {});
3879
- return;
3880
- }
3881
- if (entry) {
3882
- payload.state = { [payload.nodeId]: Object.entries(entry.debugState).map(([key, value]) => ({
3883
- key,
3884
- value,
3885
- editable: !isReadonly(value)
3886
- })) };
3887
- if (entry.componentInstance) api.highlightElement(entry.componentInstance);
3888
- }
3889
- }
3890
- };
3891
- const handleInspectComponent = (payload) => {
3892
- const entries = byUid.values().filter((entry) => entry.componentInstance === payload.componentInstance).flatMap((entry) => {
3893
- return Object.entries(entry.debugState).map(([key, value]) => ({
3894
- type: entry.uid,
3895
- key,
3896
- value,
3897
- editable: false
3898
- }));
3899
- }).toArray();
3900
- payload.instanceData.state.push(...entries);
3901
- };
3902
- const handleEditInspectorState = (payload) => {
3903
- if (payload.inspectorId === INSPECTOR_ID) {
3904
- const uid = payload.nodeId;
3905
- const entry = byUid.get(uid);
3906
- if (!entry) return;
3907
- payload.set(entry.debugState);
3908
- }
3909
- };
3910
- function setupComposableDevtools(app) {
3911
- console.log("🐞 Vuebugger ready to use");
3912
- setupDevToolsPlugin({
3913
- id: "composables-debugger",
3914
- label: "Composables",
3915
- logo: "https://raw.githubusercontent.com/vinpogo/vuebugger/main/logo.png",
3916
- app
3917
- }, (api) => {
3918
- api.addInspector({
3919
- id: INSPECTOR_ID,
3920
- label: "Vuebugger",
3921
- icon: "https://raw.githubusercontent.com/vinpogo/vuebugger/main/logo.png",
3922
- treeFilterPlaceholder: "Search by composable or component name..."
3923
- });
3924
- api.addTimelineLayer({
3925
- id: TIMELINE_ID,
3926
- label: "Vuebugger",
3927
- color: 155
3928
- });
3929
- onUpdate((entry) => {
3930
- api.sendInspectorTree(INSPECTOR_ID);
3931
- api.sendInspectorState(INSPECTOR_ID);
3932
- api.notifyComponentUpdate(entry.componentInstance);
3933
- api.addTimelineEvent({
3934
- layerId: TIMELINE_ID,
3935
- event: {
3936
- time: api.now(),
3937
- data: entry,
3938
- title: `${entry.uid} state change`,
3939
- groupId: entry.uid
3940
- }
3941
- });
3942
- });
3943
- api.on.getInspectorTree(handleGetInspectorTree);
3944
- api.on.getInspectorState(handleGetInspectorState(api));
3945
- api.on.inspectComponent(handleInspectComponent);
3946
- api.on.editInspectorState(handleEditInspectorState);
3947
- });
3948
- }
3949
-
3950
- //#endregion
3951
- //#region src/index.ts
3952
- const plugin = { install: (app, options) => {
3953
- if (!import.meta.env.DEV) return;
3954
- if (options?.uidFn) setUidGenerator(options.uidFn);
3955
- setupComposableDevtools(app);
3956
- } };
3957
-
3958
- //#endregion
3959
- export { plugin as DebugPlugin, plugin as default, debug };