btxui 1.0.5 → 1.0.6

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/index.js CHANGED
@@ -1,2744 +1,4 @@
1
- function makeMap(str, expectsLowerCase) {
2
- const map2 = /* @__PURE__ */ Object.create(null);
3
- const list = str.split(",");
4
- for (let i = 0; i < list.length; i++) {
5
- map2[list[i]] = true;
6
- }
7
- return expectsLowerCase ? (val) => !!map2[val.toLowerCase()] : (val) => !!map2[val];
8
- }
9
- const EMPTY_OBJ = !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
10
- const EMPTY_ARR = !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
11
- const NOOP = () => {
12
- };
13
- const onRE = /^on[^a-z]/;
14
- const isOn = (key) => onRE.test(key);
15
- const extend = Object.assign;
16
- const remove = (arr, el) => {
17
- const i = arr.indexOf(el);
18
- if (i > -1) {
19
- arr.splice(i, 1);
20
- }
21
- };
22
- const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
23
- const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
24
- const isArray = Array.isArray;
25
- const isMap = (val) => toTypeString(val) === "[object Map]";
26
- const isSet = (val) => toTypeString(val) === "[object Set]";
27
- const isFunction = (val) => typeof val === "function";
28
- const isString = (val) => typeof val === "string";
29
- const isSymbol = (val) => typeof val === "symbol";
30
- const isObject = (val) => val !== null && typeof val === "object";
31
- const isPromise = (val) => {
32
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
33
- };
34
- const objectToString = Object.prototype.toString;
35
- const toTypeString = (value) => objectToString.call(value);
36
- const toRawType = (value) => {
37
- return toTypeString(value).slice(8, -1);
38
- };
39
- const isPlainObject = (val) => toTypeString(val) === "[object Object]";
40
- const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
41
- const cacheStringFunction = (fn) => {
42
- const cache = /* @__PURE__ */ Object.create(null);
43
- return (str) => {
44
- const hit = cache[str];
45
- return hit || (cache[str] = fn(str));
46
- };
47
- };
48
- const capitalize = cacheStringFunction(
49
- (str) => str.charAt(0).toUpperCase() + str.slice(1)
50
- );
51
- const toHandlerKey = cacheStringFunction(
52
- (str) => str ? `on${capitalize(str)}` : ``
53
- );
54
- const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
55
- const def = (obj, key, value) => {
56
- Object.defineProperty(obj, key, {
57
- configurable: true,
58
- enumerable: false,
59
- value
60
- });
61
- };
62
- let _globalThis;
63
- const getGlobalThis = () => {
64
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
65
- };
66
- function normalizeStyle(value) {
67
- if (isArray(value)) {
68
- const res = {};
69
- for (let i = 0; i < value.length; i++) {
70
- const item = value[i];
71
- const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
72
- if (normalized) {
73
- for (const key in normalized) {
74
- res[key] = normalized[key];
75
- }
76
- }
77
- }
78
- return res;
79
- } else if (isString(value)) {
80
- return value;
81
- } else if (isObject(value)) {
82
- return value;
83
- }
84
- }
85
- const listDelimiterRE = /;(?![^(]*\))/g;
86
- const propertyDelimiterRE = /:([^]+)/;
87
- const styleCommentRE = /\/\*[^]*?\*\//g;
88
- function parseStringStyle(cssText) {
89
- const ret = {};
90
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
91
- if (item) {
92
- const tmp = item.split(propertyDelimiterRE);
93
- tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
94
- }
95
- });
96
- return ret;
97
- }
98
- function normalizeClass(value) {
99
- let res = "";
100
- if (isString(value)) {
101
- res = value;
102
- } else if (isArray(value)) {
103
- for (let i = 0; i < value.length; i++) {
104
- const normalized = normalizeClass(value[i]);
105
- if (normalized) {
106
- res += normalized + " ";
107
- }
108
- }
109
- } else if (isObject(value)) {
110
- for (const name in value) {
111
- if (value[name]) {
112
- res += name + " ";
113
- }
114
- }
115
- }
116
- return res.trim();
117
- }
118
- function warn$1(msg, ...args) {
119
- console.warn(`[Vue warn] ${msg}`, ...args);
120
- }
121
- let activeEffectScope;
122
- function recordEffectScope(effect, scope = activeEffectScope) {
123
- if (scope && scope.active) {
124
- scope.effects.push(effect);
125
- }
126
- }
127
- function getCurrentScope() {
128
- return activeEffectScope;
129
- }
130
- const createDep = (effects) => {
131
- const dep = new Set(effects);
132
- dep.w = 0;
133
- dep.n = 0;
134
- return dep;
135
- };
136
- const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
137
- const newTracked = (dep) => (dep.n & trackOpBit) > 0;
138
- const initDepMarkers = ({ deps }) => {
139
- if (deps.length) {
140
- for (let i = 0; i < deps.length; i++) {
141
- deps[i].w |= trackOpBit;
142
- }
143
- }
144
- };
145
- const finalizeDepMarkers = (effect) => {
146
- const { deps } = effect;
147
- if (deps.length) {
148
- let ptr = 0;
149
- for (let i = 0; i < deps.length; i++) {
150
- const dep = deps[i];
151
- if (wasTracked(dep) && !newTracked(dep)) {
152
- dep.delete(effect);
153
- } else {
154
- deps[ptr++] = dep;
155
- }
156
- dep.w &= ~trackOpBit;
157
- dep.n &= ~trackOpBit;
158
- }
159
- deps.length = ptr;
160
- }
161
- };
162
- const targetMap = /* @__PURE__ */ new WeakMap();
163
- let effectTrackDepth = 0;
164
- let trackOpBit = 1;
165
- const maxMarkerBits = 30;
166
- let activeEffect;
167
- const ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "iterate" : "");
168
- const MAP_KEY_ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "Map key iterate" : "");
169
- class ReactiveEffect {
170
- constructor(fn, scheduler = null, scope) {
171
- this.fn = fn;
172
- this.scheduler = scheduler;
173
- this.active = true;
174
- this.deps = [];
175
- this.parent = void 0;
176
- recordEffectScope(this, scope);
177
- }
178
- run() {
179
- if (!this.active) {
180
- return this.fn();
181
- }
182
- let parent = activeEffect;
183
- let lastShouldTrack = shouldTrack;
184
- while (parent) {
185
- if (parent === this) {
186
- return;
187
- }
188
- parent = parent.parent;
189
- }
190
- try {
191
- this.parent = activeEffect;
192
- activeEffect = this;
193
- shouldTrack = true;
194
- trackOpBit = 1 << ++effectTrackDepth;
195
- if (effectTrackDepth <= maxMarkerBits) {
196
- initDepMarkers(this);
197
- } else {
198
- cleanupEffect(this);
199
- }
200
- return this.fn();
201
- } finally {
202
- if (effectTrackDepth <= maxMarkerBits) {
203
- finalizeDepMarkers(this);
204
- }
205
- trackOpBit = 1 << --effectTrackDepth;
206
- activeEffect = this.parent;
207
- shouldTrack = lastShouldTrack;
208
- this.parent = void 0;
209
- if (this.deferStop) {
210
- this.stop();
211
- }
212
- }
213
- }
214
- stop() {
215
- if (activeEffect === this) {
216
- this.deferStop = true;
217
- } else if (this.active) {
218
- cleanupEffect(this);
219
- if (this.onStop) {
220
- this.onStop();
221
- }
222
- this.active = false;
223
- }
224
- }
225
- }
226
- function cleanupEffect(effect2) {
227
- const { deps } = effect2;
228
- if (deps.length) {
229
- for (let i = 0; i < deps.length; i++) {
230
- deps[i].delete(effect2);
231
- }
232
- deps.length = 0;
233
- }
234
- }
235
- let shouldTrack = true;
236
- const trackStack = [];
237
- function pauseTracking() {
238
- trackStack.push(shouldTrack);
239
- shouldTrack = false;
240
- }
241
- function resetTracking() {
242
- const last = trackStack.pop();
243
- shouldTrack = last === void 0 ? true : last;
244
- }
245
- function track(target, type, key) {
246
- if (shouldTrack && activeEffect) {
247
- let depsMap = targetMap.get(target);
248
- if (!depsMap) {
249
- targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
250
- }
251
- let dep = depsMap.get(key);
252
- if (!dep) {
253
- depsMap.set(key, dep = createDep());
254
- }
255
- const eventInfo = !!(process.env.NODE_ENV !== "production") ? { effect: activeEffect, target, type, key } : void 0;
256
- trackEffects(dep, eventInfo);
257
- }
258
- }
259
- function trackEffects(dep, debuggerEventExtraInfo) {
260
- let shouldTrack2 = false;
261
- if (effectTrackDepth <= maxMarkerBits) {
262
- if (!newTracked(dep)) {
263
- dep.n |= trackOpBit;
264
- shouldTrack2 = !wasTracked(dep);
265
- }
266
- } else {
267
- shouldTrack2 = !dep.has(activeEffect);
268
- }
269
- if (shouldTrack2) {
270
- dep.add(activeEffect);
271
- activeEffect.deps.push(dep);
272
- if (!!(process.env.NODE_ENV !== "production") && activeEffect.onTrack) {
273
- activeEffect.onTrack(
274
- extend(
275
- {
276
- effect: activeEffect
277
- },
278
- debuggerEventExtraInfo
279
- )
280
- );
281
- }
282
- }
283
- }
284
- function trigger(target, type, key, newValue, oldValue, oldTarget) {
285
- const depsMap = targetMap.get(target);
286
- if (!depsMap) {
287
- return;
288
- }
289
- let deps = [];
290
- if (type === "clear") {
291
- deps = [...depsMap.values()];
292
- } else if (key === "length" && isArray(target)) {
293
- const newLength = Number(newValue);
294
- depsMap.forEach((dep, key2) => {
295
- if (key2 === "length" || key2 >= newLength) {
296
- deps.push(dep);
297
- }
298
- });
299
- } else {
300
- if (key !== void 0) {
301
- deps.push(depsMap.get(key));
302
- }
303
- switch (type) {
304
- case "add":
305
- if (!isArray(target)) {
306
- deps.push(depsMap.get(ITERATE_KEY));
307
- if (isMap(target)) {
308
- deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
309
- }
310
- } else if (isIntegerKey(key)) {
311
- deps.push(depsMap.get("length"));
312
- }
313
- break;
314
- case "delete":
315
- if (!isArray(target)) {
316
- deps.push(depsMap.get(ITERATE_KEY));
317
- if (isMap(target)) {
318
- deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
319
- }
320
- }
321
- break;
322
- case "set":
323
- if (isMap(target)) {
324
- deps.push(depsMap.get(ITERATE_KEY));
325
- }
326
- break;
327
- }
328
- }
329
- const eventInfo = !!(process.env.NODE_ENV !== "production") ? { target, type, key, newValue, oldValue, oldTarget } : void 0;
330
- if (deps.length === 1) {
331
- if (deps[0]) {
332
- if (!!(process.env.NODE_ENV !== "production")) {
333
- triggerEffects(deps[0], eventInfo);
334
- } else {
335
- triggerEffects(deps[0]);
336
- }
337
- }
338
- } else {
339
- const effects = [];
340
- for (const dep of deps) {
341
- if (dep) {
342
- effects.push(...dep);
343
- }
344
- }
345
- if (!!(process.env.NODE_ENV !== "production")) {
346
- triggerEffects(createDep(effects), eventInfo);
347
- } else {
348
- triggerEffects(createDep(effects));
349
- }
350
- }
351
- }
352
- function triggerEffects(dep, debuggerEventExtraInfo) {
353
- const effects = isArray(dep) ? dep : [...dep];
354
- for (const effect2 of effects) {
355
- if (effect2.computed) {
356
- triggerEffect(effect2, debuggerEventExtraInfo);
357
- }
358
- }
359
- for (const effect2 of effects) {
360
- if (!effect2.computed) {
361
- triggerEffect(effect2, debuggerEventExtraInfo);
362
- }
363
- }
364
- }
365
- function triggerEffect(effect2, debuggerEventExtraInfo) {
366
- if (effect2 !== activeEffect || effect2.allowRecurse) {
367
- if (!!(process.env.NODE_ENV !== "production") && effect2.onTrigger) {
368
- effect2.onTrigger(extend({ effect: effect2 }, debuggerEventExtraInfo));
369
- }
370
- if (effect2.scheduler) {
371
- effect2.scheduler();
372
- } else {
373
- effect2.run();
374
- }
375
- }
376
- }
377
- const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
378
- const builtInSymbols = new Set(
379
- /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
380
- );
381
- const get$1 = /* @__PURE__ */ createGetter();
382
- const readonlyGet = /* @__PURE__ */ createGetter(true);
383
- const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
384
- const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
385
- function createArrayInstrumentations() {
386
- const instrumentations = {};
387
- ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
388
- instrumentations[key] = function(...args) {
389
- const arr = toRaw(this);
390
- for (let i = 0, l = this.length; i < l; i++) {
391
- track(arr, "get", i + "");
392
- }
393
- const res = arr[key](...args);
394
- if (res === -1 || res === false) {
395
- return arr[key](...args.map(toRaw));
396
- } else {
397
- return res;
398
- }
399
- };
400
- });
401
- ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
402
- instrumentations[key] = function(...args) {
403
- pauseTracking();
404
- const res = toRaw(this)[key].apply(this, args);
405
- resetTracking();
406
- return res;
407
- };
408
- });
409
- return instrumentations;
410
- }
411
- function hasOwnProperty(key) {
412
- const obj = toRaw(this);
413
- track(obj, "has", key);
414
- return obj.hasOwnProperty(key);
415
- }
416
- function createGetter(isReadonly2 = false, shallow = false) {
417
- return function get2(target, key, receiver) {
418
- if (key === "__v_isReactive") {
419
- return !isReadonly2;
420
- } else if (key === "__v_isReadonly") {
421
- return isReadonly2;
422
- } else if (key === "__v_isShallow") {
423
- return shallow;
424
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
425
- return target;
426
- }
427
- const targetIsArray = isArray(target);
428
- if (!isReadonly2) {
429
- if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
430
- return Reflect.get(arrayInstrumentations, key, receiver);
431
- }
432
- if (key === "hasOwnProperty") {
433
- return hasOwnProperty;
434
- }
435
- }
436
- const res = Reflect.get(target, key, receiver);
437
- if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
438
- return res;
439
- }
440
- if (!isReadonly2) {
441
- track(target, "get", key);
442
- }
443
- if (shallow) {
444
- return res;
445
- }
446
- if (isRef(res)) {
447
- return targetIsArray && isIntegerKey(key) ? res : res.value;
448
- }
449
- if (isObject(res)) {
450
- return isReadonly2 ? readonly(res) : reactive(res);
451
- }
452
- return res;
453
- };
454
- }
455
- const set$1 = /* @__PURE__ */ createSetter();
456
- function createSetter(shallow = false) {
457
- return function set2(target, key, value, receiver) {
458
- let oldValue = target[key];
459
- if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
460
- return false;
461
- }
462
- if (!shallow) {
463
- if (!isShallow$1(value) && !isReadonly(value)) {
464
- oldValue = toRaw(oldValue);
465
- value = toRaw(value);
466
- }
467
- if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
468
- oldValue.value = value;
469
- return true;
470
- }
471
- }
472
- const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
473
- const result = Reflect.set(target, key, value, receiver);
474
- if (target === toRaw(receiver)) {
475
- if (!hadKey) {
476
- trigger(target, "add", key, value);
477
- } else if (hasChanged(value, oldValue)) {
478
- trigger(target, "set", key, value, oldValue);
479
- }
480
- }
481
- return result;
482
- };
483
- }
484
- function deleteProperty(target, key) {
485
- const hadKey = hasOwn(target, key);
486
- const oldValue = target[key];
487
- const result = Reflect.deleteProperty(target, key);
488
- if (result && hadKey) {
489
- trigger(target, "delete", key, void 0, oldValue);
490
- }
491
- return result;
492
- }
493
- function has$1(target, key) {
494
- const result = Reflect.has(target, key);
495
- if (!isSymbol(key) || !builtInSymbols.has(key)) {
496
- track(target, "has", key);
497
- }
498
- return result;
499
- }
500
- function ownKeys(target) {
501
- track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
502
- return Reflect.ownKeys(target);
503
- }
504
- const mutableHandlers = {
505
- get: get$1,
506
- set: set$1,
507
- deleteProperty,
508
- has: has$1,
509
- ownKeys
510
- };
511
- const readonlyHandlers = {
512
- get: readonlyGet,
513
- set(target, key) {
514
- if (!!(process.env.NODE_ENV !== "production")) {
515
- warn$1(
516
- `Set operation on key "${String(key)}" failed: target is readonly.`,
517
- target
518
- );
519
- }
520
- return true;
521
- },
522
- deleteProperty(target, key) {
523
- if (!!(process.env.NODE_ENV !== "production")) {
524
- warn$1(
525
- `Delete operation on key "${String(key)}" failed: target is readonly.`,
526
- target
527
- );
528
- }
529
- return true;
530
- }
531
- };
532
- const shallowReadonlyHandlers = /* @__PURE__ */ extend(
533
- {},
534
- readonlyHandlers,
535
- {
536
- get: shallowReadonlyGet
537
- }
538
- );
539
- const toShallow = (value) => value;
540
- const getProto = (v) => Reflect.getPrototypeOf(v);
541
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
542
- target = target["__v_raw"];
543
- const rawTarget = toRaw(target);
544
- const rawKey = toRaw(key);
545
- if (!isReadonly2) {
546
- if (key !== rawKey) {
547
- track(rawTarget, "get", key);
548
- }
549
- track(rawTarget, "get", rawKey);
550
- }
551
- const { has: has2 } = getProto(rawTarget);
552
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
553
- if (has2.call(rawTarget, key)) {
554
- return wrap(target.get(key));
555
- } else if (has2.call(rawTarget, rawKey)) {
556
- return wrap(target.get(rawKey));
557
- } else if (target !== rawTarget) {
558
- target.get(key);
559
- }
560
- }
561
- function has(key, isReadonly2 = false) {
562
- const target = this["__v_raw"];
563
- const rawTarget = toRaw(target);
564
- const rawKey = toRaw(key);
565
- if (!isReadonly2) {
566
- if (key !== rawKey) {
567
- track(rawTarget, "has", key);
568
- }
569
- track(rawTarget, "has", rawKey);
570
- }
571
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
572
- }
573
- function size(target, isReadonly2 = false) {
574
- target = target["__v_raw"];
575
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
576
- return Reflect.get(target, "size", target);
577
- }
578
- function add(value) {
579
- value = toRaw(value);
580
- const target = toRaw(this);
581
- const proto = getProto(target);
582
- const hadKey = proto.has.call(target, value);
583
- if (!hadKey) {
584
- target.add(value);
585
- trigger(target, "add", value, value);
586
- }
587
- return this;
588
- }
589
- function set(key, value) {
590
- value = toRaw(value);
591
- const target = toRaw(this);
592
- const { has: has2, get: get2 } = getProto(target);
593
- let hadKey = has2.call(target, key);
594
- if (!hadKey) {
595
- key = toRaw(key);
596
- hadKey = has2.call(target, key);
597
- } else if (!!(process.env.NODE_ENV !== "production")) {
598
- checkIdentityKeys(target, has2, key);
599
- }
600
- const oldValue = get2.call(target, key);
601
- target.set(key, value);
602
- if (!hadKey) {
603
- trigger(target, "add", key, value);
604
- } else if (hasChanged(value, oldValue)) {
605
- trigger(target, "set", key, value, oldValue);
606
- }
607
- return this;
608
- }
609
- function deleteEntry(key) {
610
- const target = toRaw(this);
611
- const { has: has2, get: get2 } = getProto(target);
612
- let hadKey = has2.call(target, key);
613
- if (!hadKey) {
614
- key = toRaw(key);
615
- hadKey = has2.call(target, key);
616
- } else if (!!(process.env.NODE_ENV !== "production")) {
617
- checkIdentityKeys(target, has2, key);
618
- }
619
- const oldValue = get2 ? get2.call(target, key) : void 0;
620
- const result = target.delete(key);
621
- if (hadKey) {
622
- trigger(target, "delete", key, void 0, oldValue);
623
- }
624
- return result;
625
- }
626
- function clear() {
627
- const target = toRaw(this);
628
- const hadItems = target.size !== 0;
629
- const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
630
- const result = target.clear();
631
- if (hadItems) {
632
- trigger(target, "clear", void 0, void 0, oldTarget);
633
- }
634
- return result;
635
- }
636
- function createForEach(isReadonly2, isShallow2) {
637
- return function forEach(callback, thisArg) {
638
- const observed = this;
639
- const target = observed["__v_raw"];
640
- const rawTarget = toRaw(target);
641
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
642
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
643
- return target.forEach((value, key) => {
644
- return callback.call(thisArg, wrap(value), wrap(key), observed);
645
- });
646
- };
647
- }
648
- function createIterableMethod(method, isReadonly2, isShallow2) {
649
- return function(...args) {
650
- const target = this["__v_raw"];
651
- const rawTarget = toRaw(target);
652
- const targetIsMap = isMap(rawTarget);
653
- const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
654
- const isKeyOnly = method === "keys" && targetIsMap;
655
- const innerIterator = target[method](...args);
656
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
657
- !isReadonly2 && track(
658
- rawTarget,
659
- "iterate",
660
- isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
661
- );
662
- return {
663
- // iterator protocol
664
- next() {
665
- const { value, done } = innerIterator.next();
666
- return done ? { value, done } : {
667
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
668
- done
669
- };
670
- },
671
- // iterable protocol
672
- [Symbol.iterator]() {
673
- return this;
674
- }
675
- };
676
- };
677
- }
678
- function createReadonlyMethod(type) {
679
- return function(...args) {
680
- if (!!(process.env.NODE_ENV !== "production")) {
681
- const key = args[0] ? `on key "${args[0]}" ` : ``;
682
- console.warn(
683
- `${capitalize(type)} operation ${key}failed: target is readonly.`,
684
- toRaw(this)
685
- );
686
- }
687
- return type === "delete" ? false : this;
688
- };
689
- }
690
- function createInstrumentations() {
691
- const mutableInstrumentations2 = {
692
- get(key) {
693
- return get(this, key);
694
- },
695
- get size() {
696
- return size(this);
697
- },
698
- has,
699
- add,
700
- set,
701
- delete: deleteEntry,
702
- clear,
703
- forEach: createForEach(false, false)
704
- };
705
- const shallowInstrumentations2 = {
706
- get(key) {
707
- return get(this, key, false, true);
708
- },
709
- get size() {
710
- return size(this);
711
- },
712
- has,
713
- add,
714
- set,
715
- delete: deleteEntry,
716
- clear,
717
- forEach: createForEach(false, true)
718
- };
719
- const readonlyInstrumentations2 = {
720
- get(key) {
721
- return get(this, key, true);
722
- },
723
- get size() {
724
- return size(this, true);
725
- },
726
- has(key) {
727
- return has.call(this, key, true);
728
- },
729
- add: createReadonlyMethod("add"),
730
- set: createReadonlyMethod("set"),
731
- delete: createReadonlyMethod("delete"),
732
- clear: createReadonlyMethod("clear"),
733
- forEach: createForEach(true, false)
734
- };
735
- const shallowReadonlyInstrumentations2 = {
736
- get(key) {
737
- return get(this, key, true, true);
738
- },
739
- get size() {
740
- return size(this, true);
741
- },
742
- has(key) {
743
- return has.call(this, key, true);
744
- },
745
- add: createReadonlyMethod("add"),
746
- set: createReadonlyMethod("set"),
747
- delete: createReadonlyMethod("delete"),
748
- clear: createReadonlyMethod("clear"),
749
- forEach: createForEach(true, true)
750
- };
751
- const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
752
- iteratorMethods.forEach((method) => {
753
- mutableInstrumentations2[method] = createIterableMethod(
754
- method,
755
- false,
756
- false
757
- );
758
- readonlyInstrumentations2[method] = createIterableMethod(
759
- method,
760
- true,
761
- false
762
- );
763
- shallowInstrumentations2[method] = createIterableMethod(
764
- method,
765
- false,
766
- true
767
- );
768
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
769
- method,
770
- true,
771
- true
772
- );
773
- });
774
- return [
775
- mutableInstrumentations2,
776
- readonlyInstrumentations2,
777
- shallowInstrumentations2,
778
- shallowReadonlyInstrumentations2
779
- ];
780
- }
781
- const [
782
- mutableInstrumentations,
783
- readonlyInstrumentations,
784
- shallowInstrumentations,
785
- shallowReadonlyInstrumentations
786
- ] = /* @__PURE__ */ createInstrumentations();
787
- function createInstrumentationGetter(isReadonly2, shallow) {
788
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
789
- return (target, key, receiver) => {
790
- if (key === "__v_isReactive") {
791
- return !isReadonly2;
792
- } else if (key === "__v_isReadonly") {
793
- return isReadonly2;
794
- } else if (key === "__v_raw") {
795
- return target;
796
- }
797
- return Reflect.get(
798
- hasOwn(instrumentations, key) && key in target ? instrumentations : target,
799
- key,
800
- receiver
801
- );
802
- };
803
- }
804
- const mutableCollectionHandlers = {
805
- get: /* @__PURE__ */ createInstrumentationGetter(false, false)
806
- };
807
- const readonlyCollectionHandlers = {
808
- get: /* @__PURE__ */ createInstrumentationGetter(true, false)
809
- };
810
- const shallowReadonlyCollectionHandlers = {
811
- get: /* @__PURE__ */ createInstrumentationGetter(true, true)
812
- };
813
- function checkIdentityKeys(target, has2, key) {
814
- const rawKey = toRaw(key);
815
- if (rawKey !== key && has2.call(target, rawKey)) {
816
- const type = toRawType(target);
817
- console.warn(
818
- `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
819
- );
820
- }
821
- }
822
- const reactiveMap = /* @__PURE__ */ new WeakMap();
823
- const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
824
- const readonlyMap = /* @__PURE__ */ new WeakMap();
825
- const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
826
- function targetTypeMap(rawType) {
827
- switch (rawType) {
828
- case "Object":
829
- case "Array":
830
- return 1;
831
- case "Map":
832
- case "Set":
833
- case "WeakMap":
834
- case "WeakSet":
835
- return 2;
836
- default:
837
- return 0;
838
- }
839
- }
840
- function getTargetType(value) {
841
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
842
- }
843
- function reactive(target) {
844
- if (isReadonly(target)) {
845
- return target;
846
- }
847
- return createReactiveObject(
848
- target,
849
- false,
850
- mutableHandlers,
851
- mutableCollectionHandlers,
852
- reactiveMap
853
- );
854
- }
855
- function readonly(target) {
856
- return createReactiveObject(
857
- target,
858
- true,
859
- readonlyHandlers,
860
- readonlyCollectionHandlers,
861
- readonlyMap
862
- );
863
- }
864
- function shallowReadonly(target) {
865
- return createReactiveObject(
866
- target,
867
- true,
868
- shallowReadonlyHandlers,
869
- shallowReadonlyCollectionHandlers,
870
- shallowReadonlyMap
871
- );
872
- }
873
- function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
874
- if (!isObject(target)) {
875
- if (!!(process.env.NODE_ENV !== "production")) {
876
- console.warn(`value cannot be made reactive: ${String(target)}`);
877
- }
878
- return target;
879
- }
880
- if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
881
- return target;
882
- }
883
- const existingProxy = proxyMap.get(target);
884
- if (existingProxy) {
885
- return existingProxy;
886
- }
887
- const targetType = getTargetType(target);
888
- if (targetType === 0) {
889
- return target;
890
- }
891
- const proxy = new Proxy(
892
- target,
893
- targetType === 2 ? collectionHandlers : baseHandlers
894
- );
895
- proxyMap.set(target, proxy);
896
- return proxy;
897
- }
898
- function isReactive(value) {
899
- if (isReadonly(value)) {
900
- return isReactive(value["__v_raw"]);
901
- }
902
- return !!(value && value["__v_isReactive"]);
903
- }
904
- function isReadonly(value) {
905
- return !!(value && value["__v_isReadonly"]);
906
- }
907
- function isShallow$1(value) {
908
- return !!(value && value["__v_isShallow"]);
909
- }
910
- function isProxy(value) {
911
- return isReactive(value) || isReadonly(value);
912
- }
913
- function toRaw(observed) {
914
- const raw = observed && observed["__v_raw"];
915
- return raw ? toRaw(raw) : observed;
916
- }
917
- function markRaw(value) {
918
- def(value, "__v_skip", true);
919
- return value;
920
- }
921
- const toReactive = (value) => isObject(value) ? reactive(value) : value;
922
- const toReadonly = (value) => isObject(value) ? readonly(value) : value;
923
- function trackRefValue(ref2) {
924
- if (shouldTrack && activeEffect) {
925
- ref2 = toRaw(ref2);
926
- if (!!(process.env.NODE_ENV !== "production")) {
927
- trackEffects(ref2.dep || (ref2.dep = createDep()), {
928
- target: ref2,
929
- type: "get",
930
- key: "value"
931
- });
932
- } else {
933
- trackEffects(ref2.dep || (ref2.dep = createDep()));
934
- }
935
- }
936
- }
937
- function triggerRefValue(ref2, newVal) {
938
- ref2 = toRaw(ref2);
939
- const dep = ref2.dep;
940
- if (dep) {
941
- if (!!(process.env.NODE_ENV !== "production")) {
942
- triggerEffects(dep, {
943
- target: ref2,
944
- type: "set",
945
- key: "value",
946
- newValue: newVal
947
- });
948
- } else {
949
- triggerEffects(dep);
950
- }
951
- }
952
- }
953
- function isRef(r) {
954
- return !!(r && r.__v_isRef === true);
955
- }
956
- function ref(value) {
957
- return createRef(value, false);
958
- }
959
- function createRef(rawValue, shallow) {
960
- if (isRef(rawValue)) {
961
- return rawValue;
962
- }
963
- return new RefImpl(rawValue, shallow);
964
- }
965
- class RefImpl {
966
- constructor(value, __v_isShallow) {
967
- this.__v_isShallow = __v_isShallow;
968
- this.dep = void 0;
969
- this.__v_isRef = true;
970
- this._rawValue = __v_isShallow ? value : toRaw(value);
971
- this._value = __v_isShallow ? value : toReactive(value);
972
- }
973
- get value() {
974
- trackRefValue(this);
975
- return this._value;
976
- }
977
- set value(newVal) {
978
- const useDirectValue = this.__v_isShallow || isShallow$1(newVal) || isReadonly(newVal);
979
- newVal = useDirectValue ? newVal : toRaw(newVal);
980
- if (hasChanged(newVal, this._rawValue)) {
981
- this._rawValue = newVal;
982
- this._value = useDirectValue ? newVal : toReactive(newVal);
983
- triggerRefValue(this, newVal);
984
- }
985
- }
986
- }
987
- function unref(ref2) {
988
- return isRef(ref2) ? ref2.value : ref2;
989
- }
990
- const shallowUnwrapHandlers = {
991
- get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
992
- set: (target, key, value, receiver) => {
993
- const oldValue = target[key];
994
- if (isRef(oldValue) && !isRef(value)) {
995
- oldValue.value = value;
996
- return true;
997
- } else {
998
- return Reflect.set(target, key, value, receiver);
999
- }
1000
- }
1001
- };
1002
- function proxyRefs(objectWithRefs) {
1003
- return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
1004
- }
1005
- class ComputedRefImpl {
1006
- constructor(getter, _setter, isReadonly2, isSSR) {
1007
- this._setter = _setter;
1008
- this.dep = void 0;
1009
- this.__v_isRef = true;
1010
- this["__v_isReadonly"] = false;
1011
- this._dirty = true;
1012
- this.effect = new ReactiveEffect(getter, () => {
1013
- if (!this._dirty) {
1014
- this._dirty = true;
1015
- triggerRefValue(this);
1016
- }
1017
- });
1018
- this.effect.computed = this;
1019
- this.effect.active = this._cacheable = !isSSR;
1020
- this["__v_isReadonly"] = isReadonly2;
1021
- }
1022
- get value() {
1023
- const self2 = toRaw(this);
1024
- trackRefValue(self2);
1025
- if (self2._dirty || !self2._cacheable) {
1026
- self2._dirty = false;
1027
- self2._value = self2.effect.run();
1028
- }
1029
- return self2._value;
1030
- }
1031
- set value(newValue) {
1032
- this._setter(newValue);
1033
- }
1034
- }
1035
- function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1036
- let getter;
1037
- let setter;
1038
- const onlyGetter = isFunction(getterOrOptions);
1039
- if (onlyGetter) {
1040
- getter = getterOrOptions;
1041
- setter = !!(process.env.NODE_ENV !== "production") ? () => {
1042
- console.warn("Write operation failed: computed value is readonly");
1043
- } : NOOP;
1044
- } else {
1045
- getter = getterOrOptions.get;
1046
- setter = getterOrOptions.set;
1047
- }
1048
- const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
1049
- if (!!(process.env.NODE_ENV !== "production") && debugOptions && !isSSR) {
1050
- cRef.effect.onTrack = debugOptions.onTrack;
1051
- cRef.effect.onTrigger = debugOptions.onTrigger;
1052
- }
1053
- return cRef;
1054
- }
1055
- const stack = [];
1056
- function pushWarningContext(vnode) {
1057
- stack.push(vnode);
1058
- }
1059
- function popWarningContext() {
1060
- stack.pop();
1061
- }
1062
- function warn(msg, ...args) {
1063
- if (!!!(process.env.NODE_ENV !== "production"))
1064
- return;
1065
- pauseTracking();
1066
- const instance = stack.length ? stack[stack.length - 1].component : null;
1067
- const appWarnHandler = instance && instance.appContext.config.warnHandler;
1068
- const trace = getComponentTrace();
1069
- if (appWarnHandler) {
1070
- callWithErrorHandling(
1071
- appWarnHandler,
1072
- instance,
1073
- 11,
1074
- [
1075
- msg + args.join(""),
1076
- instance && instance.proxy,
1077
- trace.map(
1078
- ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
1079
- ).join("\n"),
1080
- trace
1081
- ]
1082
- );
1083
- } else {
1084
- const warnArgs = [`[Vue warn]: ${msg}`, ...args];
1085
- if (trace.length && // avoid spamming console during tests
1086
- true) {
1087
- warnArgs.push(`
1088
- `, ...formatTrace(trace));
1089
- }
1090
- console.warn(...warnArgs);
1091
- }
1092
- resetTracking();
1093
- }
1094
- function getComponentTrace() {
1095
- let currentVNode = stack[stack.length - 1];
1096
- if (!currentVNode) {
1097
- return [];
1098
- }
1099
- const normalizedStack = [];
1100
- while (currentVNode) {
1101
- const last = normalizedStack[0];
1102
- if (last && last.vnode === currentVNode) {
1103
- last.recurseCount++;
1104
- } else {
1105
- normalizedStack.push({
1106
- vnode: currentVNode,
1107
- recurseCount: 0
1108
- });
1109
- }
1110
- const parentInstance = currentVNode.component && currentVNode.component.parent;
1111
- currentVNode = parentInstance && parentInstance.vnode;
1112
- }
1113
- return normalizedStack;
1114
- }
1115
- function formatTrace(trace) {
1116
- const logs = [];
1117
- trace.forEach((entry, i) => {
1118
- logs.push(...i === 0 ? [] : [`
1119
- `], ...formatTraceEntry(entry));
1120
- });
1121
- return logs;
1122
- }
1123
- function formatTraceEntry({ vnode, recurseCount }) {
1124
- const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
1125
- const isRoot = vnode.component ? vnode.component.parent == null : false;
1126
- const open = ` at <${formatComponentName(
1127
- vnode.component,
1128
- vnode.type,
1129
- isRoot
1130
- )}`;
1131
- const close = `>` + postfix;
1132
- return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
1133
- }
1134
- function formatProps(props) {
1135
- const res = [];
1136
- const keys = Object.keys(props);
1137
- keys.slice(0, 3).forEach((key) => {
1138
- res.push(...formatProp(key, props[key]));
1139
- });
1140
- if (keys.length > 3) {
1141
- res.push(` ...`);
1142
- }
1143
- return res;
1144
- }
1145
- function formatProp(key, value, raw) {
1146
- if (isString(value)) {
1147
- value = JSON.stringify(value);
1148
- return raw ? value : [`${key}=${value}`];
1149
- } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
1150
- return raw ? value : [`${key}=${value}`];
1151
- } else if (isRef(value)) {
1152
- value = formatProp(key, toRaw(value.value), true);
1153
- return raw ? value : [`${key}=Ref<`, value, `>`];
1154
- } else if (isFunction(value)) {
1155
- return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
1156
- } else {
1157
- value = toRaw(value);
1158
- return raw ? value : [`${key}=`, value];
1159
- }
1160
- }
1161
- const ErrorTypeStrings = {
1162
- ["sp"]: "serverPrefetch hook",
1163
- ["bc"]: "beforeCreate hook",
1164
- ["c"]: "created hook",
1165
- ["bm"]: "beforeMount hook",
1166
- ["m"]: "mounted hook",
1167
- ["bu"]: "beforeUpdate hook",
1168
- ["u"]: "updated",
1169
- ["bum"]: "beforeUnmount hook",
1170
- ["um"]: "unmounted hook",
1171
- ["a"]: "activated hook",
1172
- ["da"]: "deactivated hook",
1173
- ["ec"]: "errorCaptured hook",
1174
- ["rtc"]: "renderTracked hook",
1175
- ["rtg"]: "renderTriggered hook",
1176
- [0]: "setup function",
1177
- [1]: "render function",
1178
- [2]: "watcher getter",
1179
- [3]: "watcher callback",
1180
- [4]: "watcher cleanup function",
1181
- [5]: "native event handler",
1182
- [6]: "component event handler",
1183
- [7]: "vnode hook",
1184
- [8]: "directive hook",
1185
- [9]: "transition hook",
1186
- [10]: "app errorHandler",
1187
- [11]: "app warnHandler",
1188
- [12]: "ref function",
1189
- [13]: "async component loader",
1190
- [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
1191
- };
1192
- function callWithErrorHandling(fn, instance, type, args) {
1193
- let res;
1194
- try {
1195
- res = args ? fn(...args) : fn();
1196
- } catch (err) {
1197
- handleError(err, instance, type);
1198
- }
1199
- return res;
1200
- }
1201
- function callWithAsyncErrorHandling(fn, instance, type, args) {
1202
- if (isFunction(fn)) {
1203
- const res = callWithErrorHandling(fn, instance, type, args);
1204
- if (res && isPromise(res)) {
1205
- res.catch((err) => {
1206
- handleError(err, instance, type);
1207
- });
1208
- }
1209
- return res;
1210
- }
1211
- const values = [];
1212
- for (let i = 0; i < fn.length; i++) {
1213
- values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1214
- }
1215
- return values;
1216
- }
1217
- function handleError(err, instance, type, throwInDev = true) {
1218
- const contextVNode = instance ? instance.vnode : null;
1219
- if (instance) {
1220
- let cur = instance.parent;
1221
- const exposedInstance = instance.proxy;
1222
- const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings[type] : type;
1223
- while (cur) {
1224
- const errorCapturedHooks = cur.ec;
1225
- if (errorCapturedHooks) {
1226
- for (let i = 0; i < errorCapturedHooks.length; i++) {
1227
- if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
1228
- return;
1229
- }
1230
- }
1231
- }
1232
- cur = cur.parent;
1233
- }
1234
- const appErrorHandler = instance.appContext.config.errorHandler;
1235
- if (appErrorHandler) {
1236
- callWithErrorHandling(
1237
- appErrorHandler,
1238
- null,
1239
- 10,
1240
- [err, exposedInstance, errorInfo]
1241
- );
1242
- return;
1243
- }
1244
- }
1245
- logError(err, type, contextVNode, throwInDev);
1246
- }
1247
- function logError(err, type, contextVNode, throwInDev = true) {
1248
- if (!!(process.env.NODE_ENV !== "production")) {
1249
- const info = ErrorTypeStrings[type];
1250
- if (contextVNode) {
1251
- pushWarningContext(contextVNode);
1252
- }
1253
- warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
1254
- if (contextVNode) {
1255
- popWarningContext();
1256
- }
1257
- if (throwInDev) {
1258
- throw err;
1259
- } else {
1260
- console.error(err);
1261
- }
1262
- } else {
1263
- console.error(err);
1264
- }
1265
- }
1266
- let isFlushing = false;
1267
- let isFlushPending = false;
1268
- const queue = [];
1269
- let flushIndex = 0;
1270
- const pendingPostFlushCbs = [];
1271
- let activePostFlushCbs = null;
1272
- let postFlushIndex = 0;
1273
- const resolvedPromise = /* @__PURE__ */ Promise.resolve();
1274
- let currentFlushPromise = null;
1275
- const RECURSION_LIMIT = 100;
1276
- function nextTick(fn) {
1277
- const p = currentFlushPromise || resolvedPromise;
1278
- return fn ? p.then(this ? fn.bind(this) : fn) : p;
1279
- }
1280
- function findInsertionIndex(id) {
1281
- let start = flushIndex + 1;
1282
- let end = queue.length;
1283
- while (start < end) {
1284
- const middle = start + end >>> 1;
1285
- const middleJobId = getId(queue[middle]);
1286
- middleJobId < id ? start = middle + 1 : end = middle;
1287
- }
1288
- return start;
1289
- }
1290
- function queueJob(job) {
1291
- if (!queue.length || !queue.includes(
1292
- job,
1293
- isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
1294
- )) {
1295
- if (job.id == null) {
1296
- queue.push(job);
1297
- } else {
1298
- queue.splice(findInsertionIndex(job.id), 0, job);
1299
- }
1300
- queueFlush();
1301
- }
1302
- }
1303
- function queueFlush() {
1304
- if (!isFlushing && !isFlushPending) {
1305
- isFlushPending = true;
1306
- currentFlushPromise = resolvedPromise.then(flushJobs);
1307
- }
1308
- }
1309
- function queuePostFlushCb(cb) {
1310
- if (!isArray(cb)) {
1311
- if (!activePostFlushCbs || !activePostFlushCbs.includes(
1312
- cb,
1313
- cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
1314
- )) {
1315
- pendingPostFlushCbs.push(cb);
1316
- }
1317
- } else {
1318
- pendingPostFlushCbs.push(...cb);
1319
- }
1320
- queueFlush();
1321
- }
1322
- function flushPostFlushCbs(seen) {
1323
- if (pendingPostFlushCbs.length) {
1324
- const deduped = [...new Set(pendingPostFlushCbs)];
1325
- pendingPostFlushCbs.length = 0;
1326
- if (activePostFlushCbs) {
1327
- activePostFlushCbs.push(...deduped);
1328
- return;
1329
- }
1330
- activePostFlushCbs = deduped;
1331
- if (!!(process.env.NODE_ENV !== "production")) {
1332
- seen = seen || /* @__PURE__ */ new Map();
1333
- }
1334
- activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
1335
- for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
1336
- if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
1337
- continue;
1338
- }
1339
- activePostFlushCbs[postFlushIndex]();
1340
- }
1341
- activePostFlushCbs = null;
1342
- postFlushIndex = 0;
1343
- }
1344
- }
1345
- const getId = (job) => job.id == null ? Infinity : job.id;
1346
- const comparator = (a, b) => {
1347
- const diff = getId(a) - getId(b);
1348
- if (diff === 0) {
1349
- if (a.pre && !b.pre)
1350
- return -1;
1351
- if (b.pre && !a.pre)
1352
- return 1;
1353
- }
1354
- return diff;
1355
- };
1356
- function flushJobs(seen) {
1357
- isFlushPending = false;
1358
- isFlushing = true;
1359
- if (!!(process.env.NODE_ENV !== "production")) {
1360
- seen = seen || /* @__PURE__ */ new Map();
1361
- }
1362
- queue.sort(comparator);
1363
- const check = !!(process.env.NODE_ENV !== "production") ? (job) => checkRecursiveUpdates(seen, job) : NOOP;
1364
- try {
1365
- for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
1366
- const job = queue[flushIndex];
1367
- if (job && job.active !== false) {
1368
- if (!!(process.env.NODE_ENV !== "production") && check(job)) {
1369
- continue;
1370
- }
1371
- callWithErrorHandling(job, null, 14);
1372
- }
1373
- }
1374
- } finally {
1375
- flushIndex = 0;
1376
- queue.length = 0;
1377
- flushPostFlushCbs(seen);
1378
- isFlushing = false;
1379
- currentFlushPromise = null;
1380
- if (queue.length || pendingPostFlushCbs.length) {
1381
- flushJobs(seen);
1382
- }
1383
- }
1384
- }
1385
- function checkRecursiveUpdates(seen, fn) {
1386
- if (!seen.has(fn)) {
1387
- seen.set(fn, 1);
1388
- } else {
1389
- const count = seen.get(fn);
1390
- if (count > RECURSION_LIMIT) {
1391
- const instance = fn.ownerInstance;
1392
- const componentName = instance && getComponentName(instance.type);
1393
- warn(
1394
- `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`
1395
- );
1396
- return true;
1397
- } else {
1398
- seen.set(fn, count + 1);
1399
- }
1400
- }
1401
- }
1402
- const hmrDirtyComponents = /* @__PURE__ */ new Set();
1403
- if (!!(process.env.NODE_ENV !== "production")) {
1404
- getGlobalThis().__VUE_HMR_RUNTIME__ = {
1405
- createRecord: tryWrap(createRecord),
1406
- rerender: tryWrap(rerender),
1407
- reload: tryWrap(reload)
1408
- };
1409
- }
1410
- const map = /* @__PURE__ */ new Map();
1411
- function createRecord(id, initialDef) {
1412
- if (map.has(id)) {
1413
- return false;
1414
- }
1415
- map.set(id, {
1416
- initialDef: normalizeClassComponent(initialDef),
1417
- instances: /* @__PURE__ */ new Set()
1418
- });
1419
- return true;
1420
- }
1421
- function normalizeClassComponent(component) {
1422
- return isClassComponent(component) ? component.__vccOpts : component;
1423
- }
1424
- function rerender(id, newRender) {
1425
- const record = map.get(id);
1426
- if (!record) {
1427
- return;
1428
- }
1429
- record.initialDef.render = newRender;
1430
- [...record.instances].forEach((instance) => {
1431
- if (newRender) {
1432
- instance.render = newRender;
1433
- normalizeClassComponent(instance.type).render = newRender;
1434
- }
1435
- instance.renderCache = [];
1436
- instance.update();
1437
- });
1438
- }
1439
- function reload(id, newComp) {
1440
- const record = map.get(id);
1441
- if (!record)
1442
- return;
1443
- newComp = normalizeClassComponent(newComp);
1444
- updateComponentDef(record.initialDef, newComp);
1445
- const instances = [...record.instances];
1446
- for (const instance of instances) {
1447
- const oldComp = normalizeClassComponent(instance.type);
1448
- if (!hmrDirtyComponents.has(oldComp)) {
1449
- if (oldComp !== record.initialDef) {
1450
- updateComponentDef(oldComp, newComp);
1451
- }
1452
- hmrDirtyComponents.add(oldComp);
1453
- }
1454
- instance.appContext.propsCache.delete(instance.type);
1455
- instance.appContext.emitsCache.delete(instance.type);
1456
- instance.appContext.optionsCache.delete(instance.type);
1457
- if (instance.ceReload) {
1458
- hmrDirtyComponents.add(oldComp);
1459
- instance.ceReload(newComp.styles);
1460
- hmrDirtyComponents.delete(oldComp);
1461
- } else if (instance.parent) {
1462
- queueJob(instance.parent.update);
1463
- } else if (instance.appContext.reload) {
1464
- instance.appContext.reload();
1465
- } else if (typeof window !== "undefined") {
1466
- window.location.reload();
1467
- } else {
1468
- console.warn(
1469
- "[HMR] Root or manually mounted instance modified. Full reload required."
1470
- );
1471
- }
1472
- }
1473
- queuePostFlushCb(() => {
1474
- for (const instance of instances) {
1475
- hmrDirtyComponents.delete(
1476
- normalizeClassComponent(instance.type)
1477
- );
1478
- }
1479
- });
1480
- }
1481
- function updateComponentDef(oldComp, newComp) {
1482
- extend(oldComp, newComp);
1483
- for (const key in oldComp) {
1484
- if (key !== "__file" && !(key in newComp)) {
1485
- delete oldComp[key];
1486
- }
1487
- }
1488
- }
1489
- function tryWrap(fn) {
1490
- return (id, arg) => {
1491
- try {
1492
- return fn(id, arg);
1493
- } catch (e) {
1494
- console.error(e);
1495
- console.warn(
1496
- `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
1497
- );
1498
- }
1499
- };
1500
- }
1501
- function emit$1(event, ...args) {
1502
- }
1503
- const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(
1504
- "component:updated"
1505
- /* COMPONENT_UPDATED */
1506
- );
1507
- function createDevtoolsComponentHook(hook) {
1508
- return (component) => {
1509
- emit$1(
1510
- hook,
1511
- component.appContext.app,
1512
- component.uid,
1513
- component.parent ? component.parent.uid : void 0,
1514
- component
1515
- );
1516
- };
1517
- }
1518
- let currentRenderingInstance = null;
1519
- let currentScopeId = null;
1520
- function setCurrentRenderingInstance(instance) {
1521
- const prev = currentRenderingInstance;
1522
- currentRenderingInstance = instance;
1523
- currentScopeId = instance && instance.type.__scopeId || null;
1524
- return prev;
1525
- }
1526
- function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
1527
- if (!ctx)
1528
- return fn;
1529
- if (fn._n) {
1530
- return fn;
1531
- }
1532
- const renderFnWithContext = (...args) => {
1533
- if (renderFnWithContext._d) {
1534
- setBlockTracking(-1);
1535
- }
1536
- const prevInstance = setCurrentRenderingInstance(ctx);
1537
- let res;
1538
- try {
1539
- res = fn(...args);
1540
- } finally {
1541
- setCurrentRenderingInstance(prevInstance);
1542
- if (renderFnWithContext._d) {
1543
- setBlockTracking(1);
1544
- }
1545
- }
1546
- if (!!(process.env.NODE_ENV !== "production") || false) {
1547
- devtoolsComponentUpdated(ctx);
1548
- }
1549
- return res;
1550
- };
1551
- renderFnWithContext._n = true;
1552
- renderFnWithContext._c = true;
1553
- renderFnWithContext._d = true;
1554
- return renderFnWithContext;
1555
- }
1556
- function markAttrsAccessed() {
1557
- }
1558
- const isSuspense = (type) => type.__isSuspense;
1559
- function queueEffectWithSuspense(fn, suspense) {
1560
- if (suspense && suspense.pendingBranch) {
1561
- if (isArray(fn)) {
1562
- suspense.effects.push(...fn);
1563
- } else {
1564
- suspense.effects.push(fn);
1565
- }
1566
- } else {
1567
- queuePostFlushCb(fn);
1568
- }
1569
- }
1570
- const INITIAL_WATCHER_VALUE = {};
1571
- function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
1572
- var _a;
1573
- if (!!(process.env.NODE_ENV !== "production") && !cb) {
1574
- if (immediate !== void 0) {
1575
- warn(
1576
- `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
1577
- );
1578
- }
1579
- if (deep !== void 0) {
1580
- warn(
1581
- `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
1582
- );
1583
- }
1584
- }
1585
- const warnInvalidSource = (s) => {
1586
- warn(
1587
- `Invalid watch source: `,
1588
- s,
1589
- `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
1590
- );
1591
- };
1592
- const instance = getCurrentScope() === ((_a = currentInstance) == null ? void 0 : _a.scope) ? currentInstance : null;
1593
- let getter;
1594
- let forceTrigger = false;
1595
- let isMultiSource = false;
1596
- if (isRef(source)) {
1597
- getter = () => source.value;
1598
- forceTrigger = isShallow$1(source);
1599
- } else if (isReactive(source)) {
1600
- getter = () => source;
1601
- deep = true;
1602
- } else if (isArray(source)) {
1603
- isMultiSource = true;
1604
- forceTrigger = source.some((s) => isReactive(s) || isShallow$1(s));
1605
- getter = () => source.map((s) => {
1606
- if (isRef(s)) {
1607
- return s.value;
1608
- } else if (isReactive(s)) {
1609
- return traverse(s);
1610
- } else if (isFunction(s)) {
1611
- return callWithErrorHandling(s, instance, 2);
1612
- } else {
1613
- !!(process.env.NODE_ENV !== "production") && warnInvalidSource(s);
1614
- }
1615
- });
1616
- } else if (isFunction(source)) {
1617
- if (cb) {
1618
- getter = () => callWithErrorHandling(source, instance, 2);
1619
- } else {
1620
- getter = () => {
1621
- if (instance && instance.isUnmounted) {
1622
- return;
1623
- }
1624
- if (cleanup) {
1625
- cleanup();
1626
- }
1627
- return callWithAsyncErrorHandling(
1628
- source,
1629
- instance,
1630
- 3,
1631
- [onCleanup]
1632
- );
1633
- };
1634
- }
1635
- } else {
1636
- getter = NOOP;
1637
- !!(process.env.NODE_ENV !== "production") && warnInvalidSource(source);
1638
- }
1639
- if (cb && deep) {
1640
- const baseGetter = getter;
1641
- getter = () => traverse(baseGetter());
1642
- }
1643
- let cleanup;
1644
- let onCleanup = (fn) => {
1645
- cleanup = effect.onStop = () => {
1646
- callWithErrorHandling(fn, instance, 4);
1647
- };
1648
- };
1649
- let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
1650
- const job = () => {
1651
- if (!effect.active) {
1652
- return;
1653
- }
1654
- if (cb) {
1655
- const newValue = effect.run();
1656
- if (deep || forceTrigger || (isMultiSource ? newValue.some(
1657
- (v, i) => hasChanged(v, oldValue[i])
1658
- ) : hasChanged(newValue, oldValue)) || false) {
1659
- if (cleanup) {
1660
- cleanup();
1661
- }
1662
- callWithAsyncErrorHandling(cb, instance, 3, [
1663
- newValue,
1664
- // pass undefined as the old value when it's changed for the first time
1665
- oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
1666
- onCleanup
1667
- ]);
1668
- oldValue = newValue;
1669
- }
1670
- } else {
1671
- effect.run();
1672
- }
1673
- };
1674
- job.allowRecurse = !!cb;
1675
- let scheduler;
1676
- if (flush === "sync") {
1677
- scheduler = job;
1678
- } else if (flush === "post") {
1679
- scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
1680
- } else {
1681
- job.pre = true;
1682
- if (instance)
1683
- job.id = instance.uid;
1684
- scheduler = () => queueJob(job);
1685
- }
1686
- const effect = new ReactiveEffect(getter, scheduler);
1687
- if (!!(process.env.NODE_ENV !== "production")) {
1688
- effect.onTrack = onTrack;
1689
- effect.onTrigger = onTrigger;
1690
- }
1691
- if (cb) {
1692
- if (immediate) {
1693
- job();
1694
- } else {
1695
- oldValue = effect.run();
1696
- }
1697
- } else if (flush === "post") {
1698
- queuePostRenderEffect(
1699
- effect.run.bind(effect),
1700
- instance && instance.suspense
1701
- );
1702
- } else {
1703
- effect.run();
1704
- }
1705
- const unwatch = () => {
1706
- effect.stop();
1707
- if (instance && instance.scope) {
1708
- remove(instance.scope.effects, effect);
1709
- }
1710
- };
1711
- return unwatch;
1712
- }
1713
- function instanceWatch(source, value, options) {
1714
- const publicThis = this.proxy;
1715
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
1716
- let cb;
1717
- if (isFunction(value)) {
1718
- cb = value;
1719
- } else {
1720
- cb = value.handler;
1721
- options = value;
1722
- }
1723
- const cur = currentInstance;
1724
- setCurrentInstance(this);
1725
- const res = doWatch(getter, cb.bind(publicThis), options);
1726
- if (cur) {
1727
- setCurrentInstance(cur);
1728
- } else {
1729
- unsetCurrentInstance();
1730
- }
1731
- return res;
1732
- }
1733
- function createPathGetter(ctx, path) {
1734
- const segments = path.split(".");
1735
- return () => {
1736
- let cur = ctx;
1737
- for (let i = 0; i < segments.length && cur; i++) {
1738
- cur = cur[segments[i]];
1739
- }
1740
- return cur;
1741
- };
1742
- }
1743
- function traverse(value, seen) {
1744
- if (!isObject(value) || value["__v_skip"]) {
1745
- return value;
1746
- }
1747
- seen = seen || /* @__PURE__ */ new Set();
1748
- if (seen.has(value)) {
1749
- return value;
1750
- }
1751
- seen.add(value);
1752
- if (isRef(value)) {
1753
- traverse(value.value, seen);
1754
- } else if (isArray(value)) {
1755
- for (let i = 0; i < value.length; i++) {
1756
- traverse(value[i], seen);
1757
- }
1758
- } else if (isSet(value) || isMap(value)) {
1759
- value.forEach((v) => {
1760
- traverse(v, seen);
1761
- });
1762
- } else if (isPlainObject(value)) {
1763
- for (const key in value) {
1764
- traverse(value[key], seen);
1765
- }
1766
- }
1767
- return value;
1768
- }
1769
- function defineComponent(options, extraOptions) {
1770
- return isFunction(options) ? (
1771
- // #8326: extend call and options.name access are considered side-effects
1772
- // by Rollup, so we have to wrap it in a pure-annotated IIFE.
1773
- /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
1774
- ) : options;
1775
- }
1776
- const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
1777
- function injectHook(type, hook, target = currentInstance, prepend = false) {
1778
- if (target) {
1779
- const hooks = target[type] || (target[type] = []);
1780
- const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
1781
- if (target.isUnmounted) {
1782
- return;
1783
- }
1784
- pauseTracking();
1785
- setCurrentInstance(target);
1786
- const res = callWithAsyncErrorHandling(hook, target, type, args);
1787
- unsetCurrentInstance();
1788
- resetTracking();
1789
- return res;
1790
- });
1791
- if (prepend) {
1792
- hooks.unshift(wrappedHook);
1793
- } else {
1794
- hooks.push(wrappedHook);
1795
- }
1796
- return wrappedHook;
1797
- } else if (!!(process.env.NODE_ENV !== "production")) {
1798
- const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ""));
1799
- warn(
1800
- `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`
1801
- );
1802
- }
1803
- }
1804
- const createHook = (lifecycle) => (hook, target = currentInstance) => (
1805
- // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
1806
- injectHook(lifecycle, (...args) => hook(...args), target)
1807
- );
1808
- const onMounted = createHook("m");
1809
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
1810
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
1811
- if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
1812
- if (name !== "default")
1813
- props.name = name;
1814
- return createVNode("slot", props, fallback && fallback());
1815
- }
1816
- let slot = slots[name];
1817
- if (!!(process.env.NODE_ENV !== "production") && slot && slot.length > 1) {
1818
- warn(
1819
- `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`
1820
- );
1821
- slot = () => [];
1822
- }
1823
- if (slot && slot._c) {
1824
- slot._d = false;
1825
- }
1826
- openBlock();
1827
- const validSlotContent = slot && ensureValidVNode(slot(props));
1828
- const rendered = createBlock(
1829
- Fragment,
1830
- {
1831
- key: props.key || // slot content array of a dynamic conditional slot may have a branch
1832
- // key attached in the `createSlots` helper, respect that
1833
- validSlotContent && validSlotContent.key || `_${name}`
1834
- },
1835
- validSlotContent || (fallback ? fallback() : []),
1836
- validSlotContent && slots._ === 1 ? 64 : -2
1837
- );
1838
- if (!noSlotted && rendered.scopeId) {
1839
- rendered.slotScopeIds = [rendered.scopeId + "-s"];
1840
- }
1841
- if (slot && slot._c) {
1842
- slot._d = true;
1843
- }
1844
- return rendered;
1845
- }
1846
- function ensureValidVNode(vnodes) {
1847
- return vnodes.some((child) => {
1848
- if (!isVNode(child))
1849
- return true;
1850
- if (child.type === Comment)
1851
- return false;
1852
- if (child.type === Fragment && !ensureValidVNode(child.children))
1853
- return false;
1854
- return true;
1855
- }) ? vnodes : null;
1856
- }
1857
- const getPublicInstance = (i) => {
1858
- if (!i)
1859
- return null;
1860
- if (isStatefulComponent(i))
1861
- return getExposeProxy(i) || i.proxy;
1862
- return getPublicInstance(i.parent);
1863
- };
1864
- const publicPropertiesMap = (
1865
- // Move PURE marker to new line to workaround compiler discarding it
1866
- // due to type annotation
1867
- /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
1868
- $: (i) => i,
1869
- $el: (i) => i.vnode.el,
1870
- $data: (i) => i.data,
1871
- $props: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.props) : i.props,
1872
- $attrs: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.attrs) : i.attrs,
1873
- $slots: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.slots) : i.slots,
1874
- $refs: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.refs) : i.refs,
1875
- $parent: (i) => getPublicInstance(i.parent),
1876
- $root: (i) => getPublicInstance(i.root),
1877
- $emit: (i) => i.emit,
1878
- $options: (i) => resolveMergedOptions(i),
1879
- $forceUpdate: (i) => i.f || (i.f = () => queueJob(i.update)),
1880
- $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
1881
- $watch: (i) => instanceWatch.bind(i)
1882
- })
1883
- );
1884
- const isReservedPrefix = (key) => key === "_" || key === "$";
1885
- const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
1886
- const PublicInstanceProxyHandlers = {
1887
- get({ _: instance }, key) {
1888
- const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
1889
- if (!!(process.env.NODE_ENV !== "production") && key === "__isVue") {
1890
- return true;
1891
- }
1892
- let normalizedProps;
1893
- if (key[0] !== "$") {
1894
- const n = accessCache[key];
1895
- if (n !== void 0) {
1896
- switch (n) {
1897
- case 1:
1898
- return setupState[key];
1899
- case 2:
1900
- return data[key];
1901
- case 4:
1902
- return ctx[key];
1903
- case 3:
1904
- return props[key];
1905
- }
1906
- } else if (hasSetupBinding(setupState, key)) {
1907
- accessCache[key] = 1;
1908
- return setupState[key];
1909
- } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
1910
- accessCache[key] = 2;
1911
- return data[key];
1912
- } else if (
1913
- // only cache other properties when instance has declared (thus stable)
1914
- // props
1915
- (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
1916
- ) {
1917
- accessCache[key] = 3;
1918
- return props[key];
1919
- } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
1920
- accessCache[key] = 4;
1921
- return ctx[key];
1922
- } else {
1923
- accessCache[key] = 0;
1924
- }
1925
- }
1926
- const publicGetter = publicPropertiesMap[key];
1927
- let cssModule, globalProperties;
1928
- if (publicGetter) {
1929
- if (key === "$attrs") {
1930
- track(instance, "get", key);
1931
- !!(process.env.NODE_ENV !== "production") && markAttrsAccessed();
1932
- } else if (!!(process.env.NODE_ENV !== "production") && key === "$slots") {
1933
- track(instance, "get", key);
1934
- }
1935
- return publicGetter(instance);
1936
- } else if (
1937
- // css module (injected by vue-loader)
1938
- (cssModule = type.__cssModules) && (cssModule = cssModule[key])
1939
- ) {
1940
- return cssModule;
1941
- } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
1942
- accessCache[key] = 4;
1943
- return ctx[key];
1944
- } else if (
1945
- // global properties
1946
- globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
1947
- ) {
1948
- {
1949
- return globalProperties[key];
1950
- }
1951
- } else if (!!(process.env.NODE_ENV !== "production") && currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
1952
- // to infinite warning loop
1953
- key.indexOf("__v") !== 0)) {
1954
- if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
1955
- warn(
1956
- `Property ${JSON.stringify(
1957
- key
1958
- )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
1959
- );
1960
- } else if (instance === currentRenderingInstance) {
1961
- warn(
1962
- `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
1963
- );
1964
- }
1965
- }
1966
- },
1967
- set({ _: instance }, key, value) {
1968
- const { data, setupState, ctx } = instance;
1969
- if (hasSetupBinding(setupState, key)) {
1970
- setupState[key] = value;
1971
- return true;
1972
- } else if (!!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup && hasOwn(setupState, key)) {
1973
- warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
1974
- return false;
1975
- } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
1976
- data[key] = value;
1977
- return true;
1978
- } else if (hasOwn(instance.props, key)) {
1979
- !!(process.env.NODE_ENV !== "production") && warn(`Attempting to mutate prop "${key}". Props are readonly.`);
1980
- return false;
1981
- }
1982
- if (key[0] === "$" && key.slice(1) in instance) {
1983
- !!(process.env.NODE_ENV !== "production") && warn(
1984
- `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
1985
- );
1986
- return false;
1987
- } else {
1988
- if (!!(process.env.NODE_ENV !== "production") && key in instance.appContext.config.globalProperties) {
1989
- Object.defineProperty(ctx, key, {
1990
- enumerable: true,
1991
- configurable: true,
1992
- value
1993
- });
1994
- } else {
1995
- ctx[key] = value;
1996
- }
1997
- }
1998
- return true;
1999
- },
2000
- has({
2001
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
2002
- }, key) {
2003
- let normalizedProps;
2004
- return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
2005
- },
2006
- defineProperty(target, key, descriptor) {
2007
- if (descriptor.get != null) {
2008
- target._.accessCache[key] = 0;
2009
- } else if (hasOwn(descriptor, "value")) {
2010
- this.set(target, key, descriptor.value, null);
2011
- }
2012
- return Reflect.defineProperty(target, key, descriptor);
2013
- }
2014
- };
2015
- if (!!(process.env.NODE_ENV !== "production") && true) {
2016
- PublicInstanceProxyHandlers.ownKeys = (target) => {
2017
- warn(
2018
- `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
2019
- );
2020
- return Reflect.ownKeys(target);
2021
- };
2022
- }
2023
- function normalizePropsOrEmits(props) {
2024
- return isArray(props) ? props.reduce(
2025
- (normalized, p) => (normalized[p] = null, normalized),
2026
- {}
2027
- ) : props;
2028
- }
2029
- function resolveMergedOptions(instance) {
2030
- const base = instance.type;
2031
- const { mixins, extends: extendsOptions } = base;
2032
- const {
2033
- mixins: globalMixins,
2034
- optionsCache: cache,
2035
- config: { optionMergeStrategies }
2036
- } = instance.appContext;
2037
- const cached = cache.get(base);
2038
- let resolved;
2039
- if (cached) {
2040
- resolved = cached;
2041
- } else if (!globalMixins.length && !mixins && !extendsOptions) {
2042
- {
2043
- resolved = base;
2044
- }
2045
- } else {
2046
- resolved = {};
2047
- if (globalMixins.length) {
2048
- globalMixins.forEach(
2049
- (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
2050
- );
2051
- }
2052
- mergeOptions(resolved, base, optionMergeStrategies);
2053
- }
2054
- if (isObject(base)) {
2055
- cache.set(base, resolved);
2056
- }
2057
- return resolved;
2058
- }
2059
- function mergeOptions(to, from, strats, asMixin = false) {
2060
- const { mixins, extends: extendsOptions } = from;
2061
- if (extendsOptions) {
2062
- mergeOptions(to, extendsOptions, strats, true);
2063
- }
2064
- if (mixins) {
2065
- mixins.forEach(
2066
- (m) => mergeOptions(to, m, strats, true)
2067
- );
2068
- }
2069
- for (const key in from) {
2070
- if (asMixin && key === "expose") {
2071
- !!(process.env.NODE_ENV !== "production") && warn(
2072
- `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
2073
- );
2074
- } else {
2075
- const strat = internalOptionMergeStrats[key] || strats && strats[key];
2076
- to[key] = strat ? strat(to[key], from[key]) : from[key];
2077
- }
2078
- }
2079
- return to;
2080
- }
2081
- const internalOptionMergeStrats = {
2082
- data: mergeDataFn,
2083
- props: mergeEmitsOrPropsOptions,
2084
- emits: mergeEmitsOrPropsOptions,
2085
- // objects
2086
- methods: mergeObjectOptions,
2087
- computed: mergeObjectOptions,
2088
- // lifecycle
2089
- beforeCreate: mergeAsArray,
2090
- created: mergeAsArray,
2091
- beforeMount: mergeAsArray,
2092
- mounted: mergeAsArray,
2093
- beforeUpdate: mergeAsArray,
2094
- updated: mergeAsArray,
2095
- beforeDestroy: mergeAsArray,
2096
- beforeUnmount: mergeAsArray,
2097
- destroyed: mergeAsArray,
2098
- unmounted: mergeAsArray,
2099
- activated: mergeAsArray,
2100
- deactivated: mergeAsArray,
2101
- errorCaptured: mergeAsArray,
2102
- serverPrefetch: mergeAsArray,
2103
- // assets
2104
- components: mergeObjectOptions,
2105
- directives: mergeObjectOptions,
2106
- // watch
2107
- watch: mergeWatchOptions,
2108
- // provide / inject
2109
- provide: mergeDataFn,
2110
- inject: mergeInject
2111
- };
2112
- function mergeDataFn(to, from) {
2113
- if (!from) {
2114
- return to;
2115
- }
2116
- if (!to) {
2117
- return from;
2118
- }
2119
- return function mergedDataFn() {
2120
- return extend(
2121
- isFunction(to) ? to.call(this, this) : to,
2122
- isFunction(from) ? from.call(this, this) : from
2123
- );
2124
- };
2125
- }
2126
- function mergeInject(to, from) {
2127
- return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
2128
- }
2129
- function normalizeInject(raw) {
2130
- if (isArray(raw)) {
2131
- const res = {};
2132
- for (let i = 0; i < raw.length; i++) {
2133
- res[raw[i]] = raw[i];
2134
- }
2135
- return res;
2136
- }
2137
- return raw;
2138
- }
2139
- function mergeAsArray(to, from) {
2140
- return to ? [...new Set([].concat(to, from))] : from;
2141
- }
2142
- function mergeObjectOptions(to, from) {
2143
- return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
2144
- }
2145
- function mergeEmitsOrPropsOptions(to, from) {
2146
- if (to) {
2147
- if (isArray(to) && isArray(from)) {
2148
- return [.../* @__PURE__ */ new Set([...to, ...from])];
2149
- }
2150
- return extend(
2151
- /* @__PURE__ */ Object.create(null),
2152
- normalizePropsOrEmits(to),
2153
- normalizePropsOrEmits(from != null ? from : {})
2154
- );
2155
- } else {
2156
- return from;
2157
- }
2158
- }
2159
- function mergeWatchOptions(to, from) {
2160
- if (!to)
2161
- return from;
2162
- if (!from)
2163
- return to;
2164
- const merged = extend(/* @__PURE__ */ Object.create(null), to);
2165
- for (const key in from) {
2166
- merged[key] = mergeAsArray(to[key], from[key]);
2167
- }
2168
- return merged;
2169
- }
2170
- const queuePostRenderEffect = queueEffectWithSuspense;
2171
- const isTeleport = (type) => type.__isTeleport;
2172
- const Fragment = Symbol.for("v-fgt");
2173
- const Text = Symbol.for("v-txt");
2174
- const Comment = Symbol.for("v-cmt");
2175
- const blockStack = [];
2176
- let currentBlock = null;
2177
- function openBlock(disableTracking = false) {
2178
- blockStack.push(currentBlock = disableTracking ? null : []);
2179
- }
2180
- function closeBlock() {
2181
- blockStack.pop();
2182
- currentBlock = blockStack[blockStack.length - 1] || null;
2183
- }
2184
- let isBlockTreeEnabled = 1;
2185
- function setBlockTracking(value) {
2186
- isBlockTreeEnabled += value;
2187
- }
2188
- function setupBlock(vnode) {
2189
- vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
2190
- closeBlock();
2191
- if (isBlockTreeEnabled > 0 && currentBlock) {
2192
- currentBlock.push(vnode);
2193
- }
2194
- return vnode;
2195
- }
2196
- function createBlock(type, props, children, patchFlag, dynamicProps) {
2197
- return setupBlock(
2198
- createVNode(
2199
- type,
2200
- props,
2201
- children,
2202
- patchFlag,
2203
- dynamicProps,
2204
- true
2205
- /* isBlock: prevent a block from tracking itself */
2206
- )
2207
- );
2208
- }
2209
- function isVNode(value) {
2210
- return value ? value.__v_isVNode === true : false;
2211
- }
2212
- const createVNodeWithArgsTransform = (...args) => {
2213
- return _createVNode(
2214
- ...args
2215
- );
2216
- };
2217
- const InternalObjectKey = `__vInternal`;
2218
- const normalizeKey = ({ key }) => key != null ? key : null;
2219
- const normalizeRef = ({
2220
- ref: ref2,
2221
- ref_key,
2222
- ref_for
2223
- }) => {
2224
- if (typeof ref2 === "number") {
2225
- ref2 = "" + ref2;
2226
- }
2227
- return ref2 != null ? isString(ref2) || isRef(ref2) || isFunction(ref2) ? { i: currentRenderingInstance, r: ref2, k: ref_key, f: !!ref_for } : ref2 : null;
2228
- };
2229
- function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
2230
- const vnode = {
2231
- __v_isVNode: true,
2232
- __v_skip: true,
2233
- type,
2234
- props,
2235
- key: props && normalizeKey(props),
2236
- ref: props && normalizeRef(props),
2237
- scopeId: currentScopeId,
2238
- slotScopeIds: null,
2239
- children,
2240
- component: null,
2241
- suspense: null,
2242
- ssContent: null,
2243
- ssFallback: null,
2244
- dirs: null,
2245
- transition: null,
2246
- el: null,
2247
- anchor: null,
2248
- target: null,
2249
- targetAnchor: null,
2250
- staticCount: 0,
2251
- shapeFlag,
2252
- patchFlag,
2253
- dynamicProps,
2254
- dynamicChildren: null,
2255
- appContext: null,
2256
- ctx: currentRenderingInstance
2257
- };
2258
- if (needFullChildrenNormalization) {
2259
- normalizeChildren(vnode, children);
2260
- if (shapeFlag & 128) {
2261
- type.normalize(vnode);
2262
- }
2263
- } else if (children) {
2264
- vnode.shapeFlag |= isString(children) ? 8 : 16;
2265
- }
2266
- if (!!(process.env.NODE_ENV !== "production") && vnode.key !== vnode.key) {
2267
- warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
2268
- }
2269
- if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
2270
- !isBlockNode && // has current parent block
2271
- currentBlock && // presence of a patch flag indicates this node needs patching on updates.
2272
- // component nodes also should always be patched, because even if the
2273
- // component doesn't need to update, it needs to persist the instance on to
2274
- // the next vnode so that it can be properly unmounted later.
2275
- (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
2276
- // vnode should not be considered dynamic due to handler caching.
2277
- vnode.patchFlag !== 32) {
2278
- currentBlock.push(vnode);
2279
- }
2280
- return vnode;
2281
- }
2282
- const createVNode = !!(process.env.NODE_ENV !== "production") ? createVNodeWithArgsTransform : _createVNode;
2283
- function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
2284
- if (!type || type === NULL_DYNAMIC_COMPONENT) {
2285
- if (!!(process.env.NODE_ENV !== "production") && !type) {
2286
- warn(`Invalid vnode type when creating vnode: ${type}.`);
2287
- }
2288
- type = Comment;
2289
- }
2290
- if (isVNode(type)) {
2291
- const cloned = cloneVNode(
2292
- type,
2293
- props,
2294
- true
2295
- /* mergeRef: true */
2296
- );
2297
- if (children) {
2298
- normalizeChildren(cloned, children);
2299
- }
2300
- if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
2301
- if (cloned.shapeFlag & 6) {
2302
- currentBlock[currentBlock.indexOf(type)] = cloned;
2303
- } else {
2304
- currentBlock.push(cloned);
2305
- }
2306
- }
2307
- cloned.patchFlag |= -2;
2308
- return cloned;
2309
- }
2310
- if (isClassComponent(type)) {
2311
- type = type.__vccOpts;
2312
- }
2313
- if (props) {
2314
- props = guardReactiveProps(props);
2315
- let { class: klass, style } = props;
2316
- if (klass && !isString(klass)) {
2317
- props.class = normalizeClass(klass);
2318
- }
2319
- if (isObject(style)) {
2320
- if (isProxy(style) && !isArray(style)) {
2321
- style = extend({}, style);
2322
- }
2323
- props.style = normalizeStyle(style);
2324
- }
2325
- }
2326
- const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
2327
- if (!!(process.env.NODE_ENV !== "production") && shapeFlag & 4 && isProxy(type)) {
2328
- type = toRaw(type);
2329
- warn(
2330
- `Vue received a Component which was made a reactive object. This can lead to unnecessary performance overhead, and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
2331
- `
2332
- Component that was made reactive: `,
2333
- type
2334
- );
2335
- }
2336
- return createBaseVNode(
2337
- type,
2338
- props,
2339
- children,
2340
- patchFlag,
2341
- dynamicProps,
2342
- shapeFlag,
2343
- isBlockNode,
2344
- true
2345
- );
2346
- }
2347
- function guardReactiveProps(props) {
2348
- if (!props)
2349
- return null;
2350
- return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
2351
- }
2352
- function cloneVNode(vnode, extraProps, mergeRef = false) {
2353
- const { props, ref: ref2, patchFlag, children } = vnode;
2354
- const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
2355
- const cloned = {
2356
- __v_isVNode: true,
2357
- __v_skip: true,
2358
- type: vnode.type,
2359
- props: mergedProps,
2360
- key: mergedProps && normalizeKey(mergedProps),
2361
- ref: extraProps && extraProps.ref ? (
2362
- // #2078 in the case of <component :is="vnode" ref="extra"/>
2363
- // if the vnode itself already has a ref, cloneVNode will need to merge
2364
- // the refs so the single vnode can be set on multiple refs
2365
- mergeRef && ref2 ? isArray(ref2) ? ref2.concat(normalizeRef(extraProps)) : [ref2, normalizeRef(extraProps)] : normalizeRef(extraProps)
2366
- ) : ref2,
2367
- scopeId: vnode.scopeId,
2368
- slotScopeIds: vnode.slotScopeIds,
2369
- children: !!(process.env.NODE_ENV !== "production") && patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
2370
- target: vnode.target,
2371
- targetAnchor: vnode.targetAnchor,
2372
- staticCount: vnode.staticCount,
2373
- shapeFlag: vnode.shapeFlag,
2374
- // if the vnode is cloned with extra props, we can no longer assume its
2375
- // existing patch flag to be reliable and need to add the FULL_PROPS flag.
2376
- // note: preserve flag for fragments since they use the flag for children
2377
- // fast paths only.
2378
- patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
2379
- dynamicProps: vnode.dynamicProps,
2380
- dynamicChildren: vnode.dynamicChildren,
2381
- appContext: vnode.appContext,
2382
- dirs: vnode.dirs,
2383
- transition: vnode.transition,
2384
- // These should technically only be non-null on mounted VNodes. However,
2385
- // they *should* be copied for kept-alive vnodes. So we just always copy
2386
- // them since them being non-null during a mount doesn't affect the logic as
2387
- // they will simply be overwritten.
2388
- component: vnode.component,
2389
- suspense: vnode.suspense,
2390
- ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
2391
- ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
2392
- el: vnode.el,
2393
- anchor: vnode.anchor,
2394
- ctx: vnode.ctx,
2395
- ce: vnode.ce
2396
- };
2397
- return cloned;
2398
- }
2399
- function deepCloneVNode(vnode) {
2400
- const cloned = cloneVNode(vnode);
2401
- if (isArray(vnode.children)) {
2402
- cloned.children = vnode.children.map(deepCloneVNode);
2403
- }
2404
- return cloned;
2405
- }
2406
- function createTextVNode(text = " ", flag = 0) {
2407
- return createVNode(Text, null, text, flag);
2408
- }
2409
- function normalizeChildren(vnode, children) {
2410
- let type = 0;
2411
- const { shapeFlag } = vnode;
2412
- if (children == null) {
2413
- children = null;
2414
- } else if (isArray(children)) {
2415
- type = 16;
2416
- } else if (typeof children === "object") {
2417
- if (shapeFlag & (1 | 64)) {
2418
- const slot = children.default;
2419
- if (slot) {
2420
- slot._c && (slot._d = false);
2421
- normalizeChildren(vnode, slot());
2422
- slot._c && (slot._d = true);
2423
- }
2424
- return;
2425
- } else {
2426
- type = 32;
2427
- const slotFlag = children._;
2428
- if (!slotFlag && !(InternalObjectKey in children)) {
2429
- children._ctx = currentRenderingInstance;
2430
- } else if (slotFlag === 3 && currentRenderingInstance) {
2431
- if (currentRenderingInstance.slots._ === 1) {
2432
- children._ = 1;
2433
- } else {
2434
- children._ = 2;
2435
- vnode.patchFlag |= 1024;
2436
- }
2437
- }
2438
- }
2439
- } else if (isFunction(children)) {
2440
- children = { default: children, _ctx: currentRenderingInstance };
2441
- type = 32;
2442
- } else {
2443
- children = String(children);
2444
- if (shapeFlag & 64) {
2445
- type = 16;
2446
- children = [createTextVNode(children)];
2447
- } else {
2448
- type = 8;
2449
- }
2450
- }
2451
- vnode.children = children;
2452
- vnode.shapeFlag |= type;
2453
- }
2454
- function mergeProps(...args) {
2455
- const ret = {};
2456
- for (let i = 0; i < args.length; i++) {
2457
- const toMerge = args[i];
2458
- for (const key in toMerge) {
2459
- if (key === "class") {
2460
- if (ret.class !== toMerge.class) {
2461
- ret.class = normalizeClass([ret.class, toMerge.class]);
2462
- }
2463
- } else if (key === "style") {
2464
- ret.style = normalizeStyle([ret.style, toMerge.style]);
2465
- } else if (isOn(key)) {
2466
- const existing = ret[key];
2467
- const incoming = toMerge[key];
2468
- if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
2469
- ret[key] = existing ? [].concat(existing, incoming) : incoming;
2470
- }
2471
- } else if (key !== "") {
2472
- ret[key] = toMerge[key];
2473
- }
2474
- }
2475
- }
2476
- return ret;
2477
- }
2478
- let currentInstance = null;
2479
- let internalSetCurrentInstance;
2480
- let globalCurrentInstanceSetters;
2481
- let settersKey = "__VUE_INSTANCE_SETTERS__";
2482
- {
2483
- if (!(globalCurrentInstanceSetters = getGlobalThis()[settersKey])) {
2484
- globalCurrentInstanceSetters = getGlobalThis()[settersKey] = [];
2485
- }
2486
- globalCurrentInstanceSetters.push((i) => currentInstance = i);
2487
- internalSetCurrentInstance = (instance) => {
2488
- if (globalCurrentInstanceSetters.length > 1) {
2489
- globalCurrentInstanceSetters.forEach((s) => s(instance));
2490
- } else {
2491
- globalCurrentInstanceSetters[0](instance);
2492
- }
2493
- };
2494
- }
2495
- const setCurrentInstance = (instance) => {
2496
- internalSetCurrentInstance(instance);
2497
- instance.scope.on();
2498
- };
2499
- const unsetCurrentInstance = () => {
2500
- currentInstance && currentInstance.scope.off();
2501
- internalSetCurrentInstance(null);
2502
- };
2503
- function isStatefulComponent(instance) {
2504
- return instance.vnode.shapeFlag & 4;
2505
- }
2506
- let isInSSRComponentSetup = false;
2507
- function getExposeProxy(instance) {
2508
- if (instance.exposed) {
2509
- return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
2510
- get(target, key) {
2511
- if (key in target) {
2512
- return target[key];
2513
- } else if (key in publicPropertiesMap) {
2514
- return publicPropertiesMap[key](instance);
2515
- }
2516
- },
2517
- has(target, key) {
2518
- return key in target || key in publicPropertiesMap;
2519
- }
2520
- }));
2521
- }
2522
- }
2523
- const classifyRE = /(?:^|[-_])(\w)/g;
2524
- const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
2525
- function getComponentName(Component, includeInferred = true) {
2526
- return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
2527
- }
2528
- function formatComponentName(instance, Component, isRoot = false) {
2529
- let name = getComponentName(Component);
2530
- if (!name && Component.__file) {
2531
- const match = Component.__file.match(/([^/\\]+)\.\w+$/);
2532
- if (match) {
2533
- name = match[1];
2534
- }
2535
- }
2536
- if (!name && instance && instance.parent) {
2537
- const inferFromRegistry = (registry) => {
2538
- for (const key in registry) {
2539
- if (registry[key] === Component) {
2540
- return key;
2541
- }
2542
- }
2543
- };
2544
- name = inferFromRegistry(
2545
- instance.components || instance.parent.type.components
2546
- ) || inferFromRegistry(instance.appContext.components);
2547
- }
2548
- return name ? classify(name) : isRoot ? `App` : `Anonymous`;
2549
- }
2550
- function isClassComponent(value) {
2551
- return isFunction(value) && "__vccOpts" in value;
2552
- }
2553
- const computed = (getterOrOptions, debugOptions) => {
2554
- return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
2555
- };
2556
- function isShallow(value) {
2557
- return !!(value && value["__v_isShallow"]);
2558
- }
2559
- function initCustomFormatter() {
2560
- if (!!!(process.env.NODE_ENV !== "production") || typeof window === "undefined") {
2561
- return;
2562
- }
2563
- const vueStyle = { style: "color:#3ba776" };
2564
- const numberStyle = { style: "color:#0b1bc9" };
2565
- const stringStyle = { style: "color:#b62e24" };
2566
- const keywordStyle = { style: "color:#9d288c" };
2567
- const formatter = {
2568
- header(obj) {
2569
- if (!isObject(obj)) {
2570
- return null;
2571
- }
2572
- if (obj.__isVue) {
2573
- return ["div", vueStyle, `VueInstance`];
2574
- } else if (isRef(obj)) {
2575
- return [
2576
- "div",
2577
- {},
2578
- ["span", vueStyle, genRefFlag(obj)],
2579
- "<",
2580
- formatValue(obj.value),
2581
- `>`
2582
- ];
2583
- } else if (isReactive(obj)) {
2584
- return [
2585
- "div",
2586
- {},
2587
- ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
2588
- "<",
2589
- formatValue(obj),
2590
- `>${isReadonly(obj) ? ` (readonly)` : ``}`
2591
- ];
2592
- } else if (isReadonly(obj)) {
2593
- return [
2594
- "div",
2595
- {},
2596
- ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
2597
- "<",
2598
- formatValue(obj),
2599
- ">"
2600
- ];
2601
- }
2602
- return null;
2603
- },
2604
- hasBody(obj) {
2605
- return obj && obj.__isVue;
2606
- },
2607
- body(obj) {
2608
- if (obj && obj.__isVue) {
2609
- return [
2610
- "div",
2611
- {},
2612
- ...formatInstance(obj.$)
2613
- ];
2614
- }
2615
- }
2616
- };
2617
- function formatInstance(instance) {
2618
- const blocks = [];
2619
- if (instance.type.props && instance.props) {
2620
- blocks.push(createInstanceBlock("props", toRaw(instance.props)));
2621
- }
2622
- if (instance.setupState !== EMPTY_OBJ) {
2623
- blocks.push(createInstanceBlock("setup", instance.setupState));
2624
- }
2625
- if (instance.data !== EMPTY_OBJ) {
2626
- blocks.push(createInstanceBlock("data", toRaw(instance.data)));
2627
- }
2628
- const computed2 = extractKeys(instance, "computed");
2629
- if (computed2) {
2630
- blocks.push(createInstanceBlock("computed", computed2));
2631
- }
2632
- const injected = extractKeys(instance, "inject");
2633
- if (injected) {
2634
- blocks.push(createInstanceBlock("injected", injected));
2635
- }
2636
- blocks.push([
2637
- "div",
2638
- {},
2639
- [
2640
- "span",
2641
- {
2642
- style: keywordStyle.style + ";opacity:0.66"
2643
- },
2644
- "$ (internal): "
2645
- ],
2646
- ["object", { object: instance }]
2647
- ]);
2648
- return blocks;
2649
- }
2650
- function createInstanceBlock(type, target) {
2651
- target = extend({}, target);
2652
- if (!Object.keys(target).length) {
2653
- return ["span", {}];
2654
- }
2655
- return [
2656
- "div",
2657
- { style: "line-height:1.25em;margin-bottom:0.6em" },
2658
- [
2659
- "div",
2660
- {
2661
- style: "color:#476582"
2662
- },
2663
- type
2664
- ],
2665
- [
2666
- "div",
2667
- {
2668
- style: "padding-left:1.25em"
2669
- },
2670
- ...Object.keys(target).map((key) => {
2671
- return [
2672
- "div",
2673
- {},
2674
- ["span", keywordStyle, key + ": "],
2675
- formatValue(target[key], false)
2676
- ];
2677
- })
2678
- ]
2679
- ];
2680
- }
2681
- function formatValue(v, asRaw = true) {
2682
- if (typeof v === "number") {
2683
- return ["span", numberStyle, v];
2684
- } else if (typeof v === "string") {
2685
- return ["span", stringStyle, JSON.stringify(v)];
2686
- } else if (typeof v === "boolean") {
2687
- return ["span", keywordStyle, v];
2688
- } else if (isObject(v)) {
2689
- return ["object", { object: asRaw ? toRaw(v) : v }];
2690
- } else {
2691
- return ["span", stringStyle, String(v)];
2692
- }
2693
- }
2694
- function extractKeys(instance, type) {
2695
- const Comp = instance.type;
2696
- if (isFunction(Comp)) {
2697
- return;
2698
- }
2699
- const extracted = {};
2700
- for (const key in instance.ctx) {
2701
- if (isKeyOfType(Comp, key, type)) {
2702
- extracted[key] = instance.ctx[key];
2703
- }
2704
- }
2705
- return extracted;
2706
- }
2707
- function isKeyOfType(Comp, key, type) {
2708
- const opts = Comp[type];
2709
- if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
2710
- return true;
2711
- }
2712
- if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
2713
- return true;
2714
- }
2715
- if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
2716
- return true;
2717
- }
2718
- }
2719
- function genRefFlag(v) {
2720
- if (isShallow(v)) {
2721
- return `ShallowRef`;
2722
- }
2723
- if (v.effect) {
2724
- return `ComputedRef`;
2725
- }
2726
- return `Ref`;
2727
- }
2728
- if (window.devtoolsFormatters) {
2729
- window.devtoolsFormatters.push(formatter);
2730
- } else {
2731
- window.devtoolsFormatters = [formatter];
2732
- }
2733
- }
2734
- function initDev() {
2735
- {
2736
- initCustomFormatter();
2737
- }
2738
- }
2739
- if (!!(process.env.NODE_ENV !== "production")) {
2740
- initDev();
2741
- }
1
+ import { defineComponent, ref, computed, reactive, onMounted, renderSlot, openBlock, createBlock, normalizeClass, withCtx, createElementVNode, normalizeStyle } from "vue";
2742
2
  const prestyles = {
2743
3
  //预置样式-----------------------------------------------------------------------------------
2744
4
  //重置初始字号及行高
@@ -3254,7 +514,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3254
514
  class: normalizeClass(_ctx.class)
3255
515
  }, {
3256
516
  default: withCtx(() => [
3257
- createBaseVNode("div", {
517
+ createElementVNode("div", {
3258
518
  class: normalizeClass(_ctx.class),
3259
519
  style: normalizeStyle({ backgroundImage: `url(${_ctx.bgImg})` })
3260
520
  }, [