Subversion Repositories wpShopGermany4

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
8392 daniel 1
function makeMap(str, expectsLowerCase) {
2
  const map = /* @__PURE__ */ Object.create(null);
3
  const list = str.split(",");
4
  for (let i = 0; i < list.length; i++) {
5
    map[list[i]] = true;
6
  }
7
  return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
8
}
9
 
10
const EMPTY_OBJ = Object.freeze({}) ;
11
const EMPTY_ARR = Object.freeze([]) ;
12
const NOOP = () => {
13
};
14
const NO = () => false;
15
const onRE = /^on[^a-z]/;
16
const isOn = (key) => onRE.test(key);
17
const isModelListener = (key) => key.startsWith("onUpdate:");
18
const extend = Object.assign;
19
const remove = (arr, el) => {
20
  const i = arr.indexOf(el);
21
  if (i > -1) {
22
    arr.splice(i, 1);
23
  }
24
};
25
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
26
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
27
const isArray = Array.isArray;
28
const isMap = (val) => toTypeString(val) === "[object Map]";
29
const isSet = (val) => toTypeString(val) === "[object Set]";
30
const isDate = (val) => toTypeString(val) === "[object Date]";
31
const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
32
const isFunction = (val) => typeof val === "function";
33
const isString = (val) => typeof val === "string";
34
const isSymbol = (val) => typeof val === "symbol";
35
const isObject = (val) => val !== null && typeof val === "object";
36
const isPromise = (val) => {
37
  return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
38
};
39
const objectToString = Object.prototype.toString;
40
const toTypeString = (value) => objectToString.call(value);
41
const toRawType = (value) => {
42
  return toTypeString(value).slice(8, -1);
43
};
44
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
45
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
46
const isReservedProp = /* @__PURE__ */ makeMap(
47
  // the leading comma is intentional so empty string "" is also included
48
  ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
49
);
50
const isBuiltInDirective = /* @__PURE__ */ makeMap(
51
  "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
52
);
53
const cacheStringFunction = (fn) => {
54
  const cache = /* @__PURE__ */ Object.create(null);
55
  return (str) => {
56
    const hit = cache[str];
57
    return hit || (cache[str] = fn(str));
58
  };
59
};
60
const camelizeRE = /-(\w)/g;
61
const camelize = cacheStringFunction((str) => {
62
  return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
63
});
64
const hyphenateRE = /\B([A-Z])/g;
65
const hyphenate = cacheStringFunction(
66
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
67
);
68
const capitalize = cacheStringFunction((str) => {
69
  return str.charAt(0).toUpperCase() + str.slice(1);
70
});
71
const toHandlerKey = cacheStringFunction((str) => {
72
  const s = str ? `on${capitalize(str)}` : ``;
73
  return s;
74
});
75
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
76
const invokeArrayFns = (fns, arg) => {
77
  for (let i = 0; i < fns.length; i++) {
78
    fns[i](arg);
79
  }
80
};
81
const def = (obj, key, value) => {
82
  Object.defineProperty(obj, key, {
83
    configurable: true,
84
    enumerable: false,
85
    value
86
  });
87
};
88
const looseToNumber = (val) => {
89
  const n = parseFloat(val);
90
  return isNaN(n) ? val : n;
91
};
92
const toNumber = (val) => {
93
  const n = isString(val) ? Number(val) : NaN;
94
  return isNaN(n) ? val : n;
95
};
96
let _globalThis;
97
const getGlobalThis = () => {
98
  return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
99
};
100
 
101
const PatchFlagNames = {
102
  [1]: `TEXT`,
103
  [2]: `CLASS`,
104
  [4]: `STYLE`,
105
  [8]: `PROPS`,
106
  [16]: `FULL_PROPS`,
107
  [32]: `HYDRATE_EVENTS`,
108
  [64]: `STABLE_FRAGMENT`,
109
  [128]: `KEYED_FRAGMENT`,
110
  [256]: `UNKEYED_FRAGMENT`,
111
  [512]: `NEED_PATCH`,
112
  [1024]: `DYNAMIC_SLOTS`,
113
  [2048]: `DEV_ROOT_FRAGMENT`,
114
  [-1]: `HOISTED`,
115
  [-2]: `BAIL`
116
};
117
 
118
const slotFlagsText = {
119
  [1]: "STABLE",
120
  [2]: "DYNAMIC",
121
  [3]: "FORWARDED"
122
};
123
 
124
const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
125
const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
126
 
127
const range = 2;
128
function generateCodeFrame(source, start = 0, end = source.length) {
129
  let lines = source.split(/(\r?\n)/);
130
  const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
131
  lines = lines.filter((_, idx) => idx % 2 === 0);
132
  let count = 0;
133
  const res = [];
134
  for (let i = 0; i < lines.length; i++) {
135
    count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);
136
    if (count >= start) {
137
      for (let j = i - range; j <= i + range || end > count; j++) {
138
        if (j < 0 || j >= lines.length)
139
          continue;
140
        const line = j + 1;
141
        res.push(
142
          `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}|  ${lines[j]}`
143
        );
144
        const lineLength = lines[j].length;
145
        const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;
146
        if (j === i) {
147
          const pad = start - (count - (lineLength + newLineSeqLength));
148
          const length = Math.max(
149
            1,
150
            end > count ? lineLength - pad : end - start
151
          );
152
          res.push(`   |  ` + " ".repeat(pad) + "^".repeat(length));
153
        } else if (j > i) {
154
          if (end > count) {
155
            const length = Math.max(Math.min(end - count, lineLength), 1);
156
            res.push(`   |  ` + "^".repeat(length));
157
          }
158
          count += lineLength + newLineSeqLength;
159
        }
160
      }
161
      break;
162
    }
163
  }
164
  return res.join("\n");
165
}
166
 
167
function normalizeStyle(value) {
168
  if (isArray(value)) {
169
    const res = {};
170
    for (let i = 0; i < value.length; i++) {
171
      const item = value[i];
172
      const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
173
      if (normalized) {
174
        for (const key in normalized) {
175
          res[key] = normalized[key];
176
        }
177
      }
178
    }
179
    return res;
180
  } else if (isString(value) || isObject(value)) {
181
    return value;
182
  }
183
}
184
const listDelimiterRE = /;(?![^(]*\))/g;
185
const propertyDelimiterRE = /:([^]+)/;
186
const styleCommentRE = /\/\*[^]*?\*\//g;
187
function parseStringStyle(cssText) {
188
  const ret = {};
189
  cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
190
    if (item) {
191
      const tmp = item.split(propertyDelimiterRE);
192
      tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
193
    }
194
  });
195
  return ret;
196
}
197
function normalizeClass(value) {
198
  let res = "";
199
  if (isString(value)) {
200
    res = value;
201
  } else if (isArray(value)) {
202
    for (let i = 0; i < value.length; i++) {
203
      const normalized = normalizeClass(value[i]);
204
      if (normalized) {
205
        res += normalized + " ";
206
      }
207
    }
208
  } else if (isObject(value)) {
209
    for (const name in value) {
210
      if (value[name]) {
211
        res += name + " ";
212
      }
213
    }
214
  }
215
  return res.trim();
216
}
217
function normalizeProps(props) {
218
  if (!props)
219
    return null;
220
  let { class: klass, style } = props;
221
  if (klass && !isString(klass)) {
222
    props.class = normalizeClass(klass);
223
  }
224
  if (style) {
225
    props.style = normalizeStyle(style);
226
  }
227
  return props;
228
}
229
 
230
const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
231
const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
232
const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
233
const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
234
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
235
const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
236
 
237
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
238
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
239
function includeBooleanAttr(value) {
240
  return !!value || value === "";
241
}
242
 
243
function looseCompareArrays(a, b) {
244
  if (a.length !== b.length)
245
    return false;
246
  let equal = true;
247
  for (let i = 0; equal && i < a.length; i++) {
248
    equal = looseEqual(a[i], b[i]);
249
  }
250
  return equal;
251
}
252
function looseEqual(a, b) {
253
  if (a === b)
254
    return true;
255
  let aValidType = isDate(a);
256
  let bValidType = isDate(b);
257
  if (aValidType || bValidType) {
258
    return aValidType && bValidType ? a.getTime() === b.getTime() : false;
259
  }
260
  aValidType = isSymbol(a);
261
  bValidType = isSymbol(b);
262
  if (aValidType || bValidType) {
263
    return a === b;
264
  }
265
  aValidType = isArray(a);
266
  bValidType = isArray(b);
267
  if (aValidType || bValidType) {
268
    return aValidType && bValidType ? looseCompareArrays(a, b) : false;
269
  }
270
  aValidType = isObject(a);
271
  bValidType = isObject(b);
272
  if (aValidType || bValidType) {
273
    if (!aValidType || !bValidType) {
274
      return false;
275
    }
276
    const aKeysCount = Object.keys(a).length;
277
    const bKeysCount = Object.keys(b).length;
278
    if (aKeysCount !== bKeysCount) {
279
      return false;
280
    }
281
    for (const key in a) {
282
      const aHasKey = a.hasOwnProperty(key);
283
      const bHasKey = b.hasOwnProperty(key);
284
      if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
285
        return false;
286
      }
287
    }
288
  }
289
  return String(a) === String(b);
290
}
291
function looseIndexOf(arr, val) {
292
  return arr.findIndex((item) => looseEqual(item, val));
293
}
294
 
295
const toDisplayString = (val) => {
296
  return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
297
};
298
const replacer = (_key, val) => {
299
  if (val && val.__v_isRef) {
300
    return replacer(_key, val.value);
301
  } else if (isMap(val)) {
302
    return {
303
      [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
304
        entries[`${key} =>`] = val2;
305
        return entries;
306
      }, {})
307
    };
308
  } else if (isSet(val)) {
309
    return {
310
      [`Set(${val.size})`]: [...val.values()]
311
    };
312
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
313
    return String(val);
314
  }
315
  return val;
316
};
317
 
318
function warn$1(msg, ...args) {
319
  console.warn(`[Vue warn] ${msg}`, ...args);
320
}
321
 
322
let activeEffectScope;
323
class EffectScope {
324
  constructor(detached = false) {
325
    this.detached = detached;
326
    /**
327
     * @internal
328
     */
329
    this._active = true;
330
    /**
331
     * @internal
332
     */
333
    this.effects = [];
334
    /**
335
     * @internal
336
     */
337
    this.cleanups = [];
338
    this.parent = activeEffectScope;
339
    if (!detached && activeEffectScope) {
340
      this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
341
        this
342
      ) - 1;
343
    }
344
  }
345
  get active() {
346
    return this._active;
347
  }
348
  run(fn) {
349
    if (this._active) {
350
      const currentEffectScope = activeEffectScope;
351
      try {
352
        activeEffectScope = this;
353
        return fn();
354
      } finally {
355
        activeEffectScope = currentEffectScope;
356
      }
357
    } else {
358
      warn$1(`cannot run an inactive effect scope.`);
359
    }
360
  }
361
  /**
362
   * This should only be called on non-detached scopes
363
   * @internal
364
   */
365
  on() {
366
    activeEffectScope = this;
367
  }
368
  /**
369
   * This should only be called on non-detached scopes
370
   * @internal
371
   */
372
  off() {
373
    activeEffectScope = this.parent;
374
  }
375
  stop(fromParent) {
376
    if (this._active) {
377
      let i, l;
378
      for (i = 0, l = this.effects.length; i < l; i++) {
379
        this.effects[i].stop();
380
      }
381
      for (i = 0, l = this.cleanups.length; i < l; i++) {
382
        this.cleanups[i]();
383
      }
384
      if (this.scopes) {
385
        for (i = 0, l = this.scopes.length; i < l; i++) {
386
          this.scopes[i].stop(true);
387
        }
388
      }
389
      if (!this.detached && this.parent && !fromParent) {
390
        const last = this.parent.scopes.pop();
391
        if (last && last !== this) {
392
          this.parent.scopes[this.index] = last;
393
          last.index = this.index;
394
        }
395
      }
396
      this.parent = void 0;
397
      this._active = false;
398
    }
399
  }
400
}
401
function effectScope(detached) {
402
  return new EffectScope(detached);
403
}
404
function recordEffectScope(effect, scope = activeEffectScope) {
405
  if (scope && scope.active) {
406
    scope.effects.push(effect);
407
  }
408
}
409
function getCurrentScope() {
410
  return activeEffectScope;
411
}
412
function onScopeDispose(fn) {
413
  if (activeEffectScope) {
414
    activeEffectScope.cleanups.push(fn);
415
  } else {
416
    warn$1(
417
      `onScopeDispose() is called when there is no active effect scope to be associated with.`
418
    );
419
  }
420
}
421
 
422
const createDep = (effects) => {
423
  const dep = new Set(effects);
424
  dep.w = 0;
425
  dep.n = 0;
426
  return dep;
427
};
428
const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
429
const newTracked = (dep) => (dep.n & trackOpBit) > 0;
430
const initDepMarkers = ({ deps }) => {
431
  if (deps.length) {
432
    for (let i = 0; i < deps.length; i++) {
433
      deps[i].w |= trackOpBit;
434
    }
435
  }
436
};
437
const finalizeDepMarkers = (effect) => {
438
  const { deps } = effect;
439
  if (deps.length) {
440
    let ptr = 0;
441
    for (let i = 0; i < deps.length; i++) {
442
      const dep = deps[i];
443
      if (wasTracked(dep) && !newTracked(dep)) {
444
        dep.delete(effect);
445
      } else {
446
        deps[ptr++] = dep;
447
      }
448
      dep.w &= ~trackOpBit;
449
      dep.n &= ~trackOpBit;
450
    }
451
    deps.length = ptr;
452
  }
453
};
454
 
455
const targetMap = /* @__PURE__ */ new WeakMap();
456
let effectTrackDepth = 0;
457
let trackOpBit = 1;
458
const maxMarkerBits = 30;
459
let activeEffect;
460
const ITERATE_KEY = Symbol("iterate" );
461
const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" );
462
class ReactiveEffect {
463
  constructor(fn, scheduler = null, scope) {
464
    this.fn = fn;
465
    this.scheduler = scheduler;
466
    this.active = true;
467
    this.deps = [];
468
    this.parent = void 0;
469
    recordEffectScope(this, scope);
470
  }
471
  run() {
472
    if (!this.active) {
473
      return this.fn();
474
    }
475
    let parent = activeEffect;
476
    let lastShouldTrack = shouldTrack;
477
    while (parent) {
478
      if (parent === this) {
479
        return;
480
      }
481
      parent = parent.parent;
482
    }
483
    try {
484
      this.parent = activeEffect;
485
      activeEffect = this;
486
      shouldTrack = true;
487
      trackOpBit = 1 << ++effectTrackDepth;
488
      if (effectTrackDepth <= maxMarkerBits) {
489
        initDepMarkers(this);
490
      } else {
491
        cleanupEffect(this);
492
      }
493
      return this.fn();
494
    } finally {
495
      if (effectTrackDepth <= maxMarkerBits) {
496
        finalizeDepMarkers(this);
497
      }
498
      trackOpBit = 1 << --effectTrackDepth;
499
      activeEffect = this.parent;
500
      shouldTrack = lastShouldTrack;
501
      this.parent = void 0;
502
      if (this.deferStop) {
503
        this.stop();
504
      }
505
    }
506
  }
507
  stop() {
508
    if (activeEffect === this) {
509
      this.deferStop = true;
510
    } else if (this.active) {
511
      cleanupEffect(this);
512
      if (this.onStop) {
513
        this.onStop();
514
      }
515
      this.active = false;
516
    }
517
  }
518
}
519
function cleanupEffect(effect2) {
520
  const { deps } = effect2;
521
  if (deps.length) {
522
    for (let i = 0; i < deps.length; i++) {
523
      deps[i].delete(effect2);
524
    }
525
    deps.length = 0;
526
  }
527
}
528
function effect(fn, options) {
529
  if (fn.effect instanceof ReactiveEffect) {
530
    fn = fn.effect.fn;
531
  }
532
  const _effect = new ReactiveEffect(fn);
533
  if (options) {
534
    extend(_effect, options);
535
    if (options.scope)
536
      recordEffectScope(_effect, options.scope);
537
  }
538
  if (!options || !options.lazy) {
539
    _effect.run();
540
  }
541
  const runner = _effect.run.bind(_effect);
542
  runner.effect = _effect;
543
  return runner;
544
}
545
function stop(runner) {
546
  runner.effect.stop();
547
}
548
let shouldTrack = true;
549
const trackStack = [];
550
function pauseTracking() {
551
  trackStack.push(shouldTrack);
552
  shouldTrack = false;
553
}
554
function resetTracking() {
555
  const last = trackStack.pop();
556
  shouldTrack = last === void 0 ? true : last;
557
}
558
function track(target, type, key) {
559
  if (shouldTrack && activeEffect) {
560
    let depsMap = targetMap.get(target);
561
    if (!depsMap) {
562
      targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
563
    }
564
    let dep = depsMap.get(key);
565
    if (!dep) {
566
      depsMap.set(key, dep = createDep());
567
    }
568
    const eventInfo = { effect: activeEffect, target, type, key } ;
569
    trackEffects(dep, eventInfo);
570
  }
571
}
572
function trackEffects(dep, debuggerEventExtraInfo) {
573
  let shouldTrack2 = false;
574
  if (effectTrackDepth <= maxMarkerBits) {
575
    if (!newTracked(dep)) {
576
      dep.n |= trackOpBit;
577
      shouldTrack2 = !wasTracked(dep);
578
    }
579
  } else {
580
    shouldTrack2 = !dep.has(activeEffect);
581
  }
582
  if (shouldTrack2) {
583
    dep.add(activeEffect);
584
    activeEffect.deps.push(dep);
585
    if (activeEffect.onTrack) {
586
      activeEffect.onTrack(
587
        extend(
588
          {
589
            effect: activeEffect
590
          },
591
          debuggerEventExtraInfo
592
        )
593
      );
594
    }
595
  }
596
}
597
function trigger(target, type, key, newValue, oldValue, oldTarget) {
598
  const depsMap = targetMap.get(target);
599
  if (!depsMap) {
600
    return;
601
  }
602
  let deps = [];
603
  if (type === "clear") {
604
    deps = [...depsMap.values()];
605
  } else if (key === "length" && isArray(target)) {
606
    const newLength = Number(newValue);
607
    depsMap.forEach((dep, key2) => {
608
      if (key2 === "length" || key2 >= newLength) {
609
        deps.push(dep);
610
      }
611
    });
612
  } else {
613
    if (key !== void 0) {
614
      deps.push(depsMap.get(key));
615
    }
616
    switch (type) {
617
      case "add":
618
        if (!isArray(target)) {
619
          deps.push(depsMap.get(ITERATE_KEY));
620
          if (isMap(target)) {
621
            deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
622
          }
623
        } else if (isIntegerKey(key)) {
624
          deps.push(depsMap.get("length"));
625
        }
626
        break;
627
      case "delete":
628
        if (!isArray(target)) {
629
          deps.push(depsMap.get(ITERATE_KEY));
630
          if (isMap(target)) {
631
            deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
632
          }
633
        }
634
        break;
635
      case "set":
636
        if (isMap(target)) {
637
          deps.push(depsMap.get(ITERATE_KEY));
638
        }
639
        break;
640
    }
641
  }
642
  const eventInfo = { target, type, key, newValue, oldValue, oldTarget } ;
643
  if (deps.length === 1) {
644
    if (deps[0]) {
645
      {
646
        triggerEffects(deps[0], eventInfo);
647
      }
648
    }
649
  } else {
650
    const effects = [];
651
    for (const dep of deps) {
652
      if (dep) {
653
        effects.push(...dep);
654
      }
655
    }
656
    {
657
      triggerEffects(createDep(effects), eventInfo);
658
    }
659
  }
660
}
661
function triggerEffects(dep, debuggerEventExtraInfo) {
662
  const effects = isArray(dep) ? dep : [...dep];
663
  for (const effect2 of effects) {
664
    if (effect2.computed) {
665
      triggerEffect(effect2, debuggerEventExtraInfo);
666
    }
667
  }
668
  for (const effect2 of effects) {
669
    if (!effect2.computed) {
670
      triggerEffect(effect2, debuggerEventExtraInfo);
671
    }
672
  }
673
}
674
function triggerEffect(effect2, debuggerEventExtraInfo) {
675
  if (effect2 !== activeEffect || effect2.allowRecurse) {
676
    if (effect2.onTrigger) {
677
      effect2.onTrigger(extend({ effect: effect2 }, debuggerEventExtraInfo));
678
    }
679
    if (effect2.scheduler) {
680
      effect2.scheduler();
681
    } else {
682
      effect2.run();
683
    }
684
  }
685
}
686
function getDepFromReactive(object, key) {
687
  var _a;
688
  return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
689
}
690
 
691
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
692
const builtInSymbols = new Set(
693
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
694
);
695
const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
696
function createArrayInstrumentations() {
697
  const instrumentations = {};
698
  ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
699
    instrumentations[key] = function(...args) {
700
      const arr = toRaw(this);
701
      for (let i = 0, l = this.length; i < l; i++) {
702
        track(arr, "get", i + "");
703
      }
704
      const res = arr[key](...args);
705
      if (res === -1 || res === false) {
706
        return arr[key](...args.map(toRaw));
707
      } else {
708
        return res;
709
      }
710
    };
711
  });
712
  ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
713
    instrumentations[key] = function(...args) {
714
      pauseTracking();
715
      const res = toRaw(this)[key].apply(this, args);
716
      resetTracking();
717
      return res;
718
    };
719
  });
720
  return instrumentations;
721
}
722
function hasOwnProperty(key) {
723
  const obj = toRaw(this);
724
  track(obj, "has", key);
725
  return obj.hasOwnProperty(key);
726
}
727
class BaseReactiveHandler {
728
  constructor(_isReadonly = false, _shallow = false) {
729
    this._isReadonly = _isReadonly;
730
    this._shallow = _shallow;
731
  }
732
  get(target, key, receiver) {
733
    const isReadonly2 = this._isReadonly, shallow = this._shallow;
734
    if (key === "__v_isReactive") {
735
      return !isReadonly2;
736
    } else if (key === "__v_isReadonly") {
737
      return isReadonly2;
738
    } else if (key === "__v_isShallow") {
739
      return shallow;
740
    } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
741
      return target;
742
    }
743
    const targetIsArray = isArray(target);
744
    if (!isReadonly2) {
745
      if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
746
        return Reflect.get(arrayInstrumentations, key, receiver);
747
      }
748
      if (key === "hasOwnProperty") {
749
        return hasOwnProperty;
750
      }
751
    }
752
    const res = Reflect.get(target, key, receiver);
753
    if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
754
      return res;
755
    }
756
    if (!isReadonly2) {
757
      track(target, "get", key);
758
    }
759
    if (shallow) {
760
      return res;
761
    }
762
    if (isRef(res)) {
763
      return targetIsArray && isIntegerKey(key) ? res : res.value;
764
    }
765
    if (isObject(res)) {
766
      return isReadonly2 ? readonly(res) : reactive(res);
767
    }
768
    return res;
769
  }
770
}
771
class MutableReactiveHandler extends BaseReactiveHandler {
772
  constructor(shallow = false) {
773
    super(false, shallow);
774
  }
775
  set(target, key, value, receiver) {
776
    let oldValue = target[key];
777
    if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
778
      return false;
779
    }
780
    if (!this._shallow) {
781
      if (!isShallow(value) && !isReadonly(value)) {
782
        oldValue = toRaw(oldValue);
783
        value = toRaw(value);
784
      }
785
      if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
786
        oldValue.value = value;
787
        return true;
788
      }
789
    }
790
    const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
791
    const result = Reflect.set(target, key, value, receiver);
792
    if (target === toRaw(receiver)) {
793
      if (!hadKey) {
794
        trigger(target, "add", key, value);
795
      } else if (hasChanged(value, oldValue)) {
796
        trigger(target, "set", key, value, oldValue);
797
      }
798
    }
799
    return result;
800
  }
801
  deleteProperty(target, key) {
802
    const hadKey = hasOwn(target, key);
803
    const oldValue = target[key];
804
    const result = Reflect.deleteProperty(target, key);
805
    if (result && hadKey) {
806
      trigger(target, "delete", key, void 0, oldValue);
807
    }
808
    return result;
809
  }
810
  has(target, key) {
811
    const result = Reflect.has(target, key);
812
    if (!isSymbol(key) || !builtInSymbols.has(key)) {
813
      track(target, "has", key);
814
    }
815
    return result;
816
  }
817
  ownKeys(target) {
818
    track(
819
      target,
820
      "iterate",
821
      isArray(target) ? "length" : ITERATE_KEY
822
    );
823
    return Reflect.ownKeys(target);
824
  }
825
}
826
class ReadonlyReactiveHandler extends BaseReactiveHandler {
827
  constructor(shallow = false) {
828
    super(true, shallow);
829
  }
830
  set(target, key) {
831
    {
832
      warn$1(
833
        `Set operation on key "${String(key)}" failed: target is readonly.`,
834
        target
835
      );
836
    }
837
    return true;
838
  }
839
  deleteProperty(target, key) {
840
    {
841
      warn$1(
842
        `Delete operation on key "${String(key)}" failed: target is readonly.`,
843
        target
844
      );
845
    }
846
    return true;
847
  }
848
}
849
const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
850
const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
851
const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
852
  true
853
);
854
const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
855
 
856
const toShallow = (value) => value;
857
const getProto = (v) => Reflect.getPrototypeOf(v);
858
function get(target, key, isReadonly = false, isShallow = false) {
859
  target = target["__v_raw"];
860
  const rawTarget = toRaw(target);
861
  const rawKey = toRaw(key);
862
  if (!isReadonly) {
863
    if (hasChanged(key, rawKey)) {
864
      track(rawTarget, "get", key);
865
    }
866
    track(rawTarget, "get", rawKey);
867
  }
868
  const { has: has2 } = getProto(rawTarget);
869
  const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
870
  if (has2.call(rawTarget, key)) {
871
    return wrap(target.get(key));
872
  } else if (has2.call(rawTarget, rawKey)) {
873
    return wrap(target.get(rawKey));
874
  } else if (target !== rawTarget) {
875
    target.get(key);
876
  }
877
}
878
function has(key, isReadonly = false) {
879
  const target = this["__v_raw"];
880
  const rawTarget = toRaw(target);
881
  const rawKey = toRaw(key);
882
  if (!isReadonly) {
883
    if (hasChanged(key, rawKey)) {
884
      track(rawTarget, "has", key);
885
    }
886
    track(rawTarget, "has", rawKey);
887
  }
888
  return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
889
}
890
function size(target, isReadonly = false) {
891
  target = target["__v_raw"];
892
  !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY);
893
  return Reflect.get(target, "size", target);
894
}
895
function add(value) {
896
  value = toRaw(value);
897
  const target = toRaw(this);
898
  const proto = getProto(target);
899
  const hadKey = proto.has.call(target, value);
900
  if (!hadKey) {
901
    target.add(value);
902
    trigger(target, "add", value, value);
903
  }
904
  return this;
905
}
906
function set(key, value) {
907
  value = toRaw(value);
908
  const target = toRaw(this);
909
  const { has: has2, get: get2 } = getProto(target);
910
  let hadKey = has2.call(target, key);
911
  if (!hadKey) {
912
    key = toRaw(key);
913
    hadKey = has2.call(target, key);
914
  } else {
915
    checkIdentityKeys(target, has2, key);
916
  }
917
  const oldValue = get2.call(target, key);
918
  target.set(key, value);
919
  if (!hadKey) {
920
    trigger(target, "add", key, value);
921
  } else if (hasChanged(value, oldValue)) {
922
    trigger(target, "set", key, value, oldValue);
923
  }
924
  return this;
925
}
926
function deleteEntry(key) {
927
  const target = toRaw(this);
928
  const { has: has2, get: get2 } = getProto(target);
929
  let hadKey = has2.call(target, key);
930
  if (!hadKey) {
931
    key = toRaw(key);
932
    hadKey = has2.call(target, key);
933
  } else {
934
    checkIdentityKeys(target, has2, key);
935
  }
936
  const oldValue = get2 ? get2.call(target, key) : void 0;
937
  const result = target.delete(key);
938
  if (hadKey) {
939
    trigger(target, "delete", key, void 0, oldValue);
940
  }
941
  return result;
942
}
943
function clear() {
944
  const target = toRaw(this);
945
  const hadItems = target.size !== 0;
946
  const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
947
  const result = target.clear();
948
  if (hadItems) {
949
    trigger(target, "clear", void 0, void 0, oldTarget);
950
  }
951
  return result;
952
}
953
function createForEach(isReadonly, isShallow) {
954
  return function forEach(callback, thisArg) {
955
    const observed = this;
956
    const target = observed["__v_raw"];
957
    const rawTarget = toRaw(target);
958
    const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
959
    !isReadonly && track(rawTarget, "iterate", ITERATE_KEY);
960
    return target.forEach((value, key) => {
961
      return callback.call(thisArg, wrap(value), wrap(key), observed);
962
    });
963
  };
964
}
965
function createIterableMethod(method, isReadonly, isShallow) {
966
  return function(...args) {
967
    const target = this["__v_raw"];
968
    const rawTarget = toRaw(target);
969
    const targetIsMap = isMap(rawTarget);
970
    const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
971
    const isKeyOnly = method === "keys" && targetIsMap;
972
    const innerIterator = target[method](...args);
973
    const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
974
    !isReadonly && track(
975
      rawTarget,
976
      "iterate",
977
      isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
978
    );
979
    return {
980
      // iterator protocol
981
      next() {
982
        const { value, done } = innerIterator.next();
983
        return done ? { value, done } : {
984
          value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
985
          done
986
        };
987
      },
988
      // iterable protocol
989
      [Symbol.iterator]() {
990
        return this;
991
      }
992
    };
993
  };
994
}
995
function createReadonlyMethod(type) {
996
  return function(...args) {
997
    {
998
      const key = args[0] ? `on key "${args[0]}" ` : ``;
999
      console.warn(
1000
        `${capitalize(type)} operation ${key}failed: target is readonly.`,
1001
        toRaw(this)
1002
      );
1003
    }
1004
    return type === "delete" ? false : this;
1005
  };
1006
}
1007
function createInstrumentations() {
1008
  const mutableInstrumentations2 = {
1009
    get(key) {
1010
      return get(this, key);
1011
    },
1012
    get size() {
1013
      return size(this);
1014
    },
1015
    has,
1016
    add,
1017
    set,
1018
    delete: deleteEntry,
1019
    clear,
1020
    forEach: createForEach(false, false)
1021
  };
1022
  const shallowInstrumentations2 = {
1023
    get(key) {
1024
      return get(this, key, false, true);
1025
    },
1026
    get size() {
1027
      return size(this);
1028
    },
1029
    has,
1030
    add,
1031
    set,
1032
    delete: deleteEntry,
1033
    clear,
1034
    forEach: createForEach(false, true)
1035
  };
1036
  const readonlyInstrumentations2 = {
1037
    get(key) {
1038
      return get(this, key, true);
1039
    },
1040
    get size() {
1041
      return size(this, true);
1042
    },
1043
    has(key) {
1044
      return has.call(this, key, true);
1045
    },
1046
    add: createReadonlyMethod("add"),
1047
    set: createReadonlyMethod("set"),
1048
    delete: createReadonlyMethod("delete"),
1049
    clear: createReadonlyMethod("clear"),
1050
    forEach: createForEach(true, false)
1051
  };
1052
  const shallowReadonlyInstrumentations2 = {
1053
    get(key) {
1054
      return get(this, key, true, true);
1055
    },
1056
    get size() {
1057
      return size(this, true);
1058
    },
1059
    has(key) {
1060
      return has.call(this, key, true);
1061
    },
1062
    add: createReadonlyMethod("add"),
1063
    set: createReadonlyMethod("set"),
1064
    delete: createReadonlyMethod("delete"),
1065
    clear: createReadonlyMethod("clear"),
1066
    forEach: createForEach(true, true)
1067
  };
1068
  const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
1069
  iteratorMethods.forEach((method) => {
1070
    mutableInstrumentations2[method] = createIterableMethod(
1071
      method,
1072
      false,
1073
      false
1074
    );
1075
    readonlyInstrumentations2[method] = createIterableMethod(
1076
      method,
1077
      true,
1078
      false
1079
    );
1080
    shallowInstrumentations2[method] = createIterableMethod(
1081
      method,
1082
      false,
1083
      true
1084
    );
1085
    shallowReadonlyInstrumentations2[method] = createIterableMethod(
1086
      method,
1087
      true,
1088
      true
1089
    );
1090
  });
1091
  return [
1092
    mutableInstrumentations2,
1093
    readonlyInstrumentations2,
1094
    shallowInstrumentations2,
1095
    shallowReadonlyInstrumentations2
1096
  ];
1097
}
1098
const [
1099
  mutableInstrumentations,
1100
  readonlyInstrumentations,
1101
  shallowInstrumentations,
1102
  shallowReadonlyInstrumentations
1103
] = /* @__PURE__ */ createInstrumentations();
1104
function createInstrumentationGetter(isReadonly, shallow) {
1105
  const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations;
1106
  return (target, key, receiver) => {
1107
    if (key === "__v_isReactive") {
1108
      return !isReadonly;
1109
    } else if (key === "__v_isReadonly") {
1110
      return isReadonly;
1111
    } else if (key === "__v_raw") {
1112
      return target;
1113
    }
1114
    return Reflect.get(
1115
      hasOwn(instrumentations, key) && key in target ? instrumentations : target,
1116
      key,
1117
      receiver
1118
    );
1119
  };
1120
}
1121
const mutableCollectionHandlers = {
1122
  get: /* @__PURE__ */ createInstrumentationGetter(false, false)
1123
};
1124
const shallowCollectionHandlers = {
1125
  get: /* @__PURE__ */ createInstrumentationGetter(false, true)
1126
};
1127
const readonlyCollectionHandlers = {
1128
  get: /* @__PURE__ */ createInstrumentationGetter(true, false)
1129
};
1130
const shallowReadonlyCollectionHandlers = {
1131
  get: /* @__PURE__ */ createInstrumentationGetter(true, true)
1132
};
1133
function checkIdentityKeys(target, has2, key) {
1134
  const rawKey = toRaw(key);
1135
  if (rawKey !== key && has2.call(target, rawKey)) {
1136
    const type = toRawType(target);
1137
    console.warn(
1138
      `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.`
1139
    );
1140
  }
1141
}
1142
 
1143
const reactiveMap = /* @__PURE__ */ new WeakMap();
1144
const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
1145
const readonlyMap = /* @__PURE__ */ new WeakMap();
1146
const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
1147
function targetTypeMap(rawType) {
1148
  switch (rawType) {
1149
    case "Object":
1150
    case "Array":
1151
      return 1 /* COMMON */;
1152
    case "Map":
1153
    case "Set":
1154
    case "WeakMap":
1155
    case "WeakSet":
1156
      return 2 /* COLLECTION */;
1157
    default:
1158
      return 0 /* INVALID */;
1159
  }
1160
}
1161
function getTargetType(value) {
1162
  return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1163
}
1164
function reactive(target) {
1165
  if (isReadonly(target)) {
1166
    return target;
1167
  }
1168
  return createReactiveObject(
1169
    target,
1170
    false,
1171
    mutableHandlers,
1172
    mutableCollectionHandlers,
1173
    reactiveMap
1174
  );
1175
}
1176
function shallowReactive(target) {
1177
  return createReactiveObject(
1178
    target,
1179
    false,
1180
    shallowReactiveHandlers,
1181
    shallowCollectionHandlers,
1182
    shallowReactiveMap
1183
  );
1184
}
1185
function readonly(target) {
1186
  return createReactiveObject(
1187
    target,
1188
    true,
1189
    readonlyHandlers,
1190
    readonlyCollectionHandlers,
1191
    readonlyMap
1192
  );
1193
}
1194
function shallowReadonly(target) {
1195
  return createReactiveObject(
1196
    target,
1197
    true,
1198
    shallowReadonlyHandlers,
1199
    shallowReadonlyCollectionHandlers,
1200
    shallowReadonlyMap
1201
  );
1202
}
1203
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
1204
  if (!isObject(target)) {
1205
    {
1206
      console.warn(`value cannot be made reactive: ${String(target)}`);
1207
    }
1208
    return target;
1209
  }
1210
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1211
    return target;
1212
  }
1213
  const existingProxy = proxyMap.get(target);
1214
  if (existingProxy) {
1215
    return existingProxy;
1216
  }
1217
  const targetType = getTargetType(target);
1218
  if (targetType === 0 /* INVALID */) {
1219
    return target;
1220
  }
1221
  const proxy = new Proxy(
1222
    target,
1223
    targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
1224
  );
1225
  proxyMap.set(target, proxy);
1226
  return proxy;
1227
}
1228
function isReactive(value) {
1229
  if (isReadonly(value)) {
1230
    return isReactive(value["__v_raw"]);
1231
  }
1232
  return !!(value && value["__v_isReactive"]);
1233
}
1234
function isReadonly(value) {
1235
  return !!(value && value["__v_isReadonly"]);
1236
}
1237
function isShallow(value) {
1238
  return !!(value && value["__v_isShallow"]);
1239
}
1240
function isProxy(value) {
1241
  return isReactive(value) || isReadonly(value);
1242
}
1243
function toRaw(observed) {
1244
  const raw = observed && observed["__v_raw"];
1245
  return raw ? toRaw(raw) : observed;
1246
}
1247
function markRaw(value) {
1248
  def(value, "__v_skip", true);
1249
  return value;
1250
}
1251
const toReactive = (value) => isObject(value) ? reactive(value) : value;
1252
const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1253
 
1254
function trackRefValue(ref2) {
1255
  if (shouldTrack && activeEffect) {
1256
    ref2 = toRaw(ref2);
1257
    {
1258
      trackEffects(ref2.dep || (ref2.dep = createDep()), {
1259
        target: ref2,
1260
        type: "get",
1261
        key: "value"
1262
      });
1263
    }
1264
  }
1265
}
1266
function triggerRefValue(ref2, newVal) {
1267
  ref2 = toRaw(ref2);
1268
  const dep = ref2.dep;
1269
  if (dep) {
1270
    {
1271
      triggerEffects(dep, {
1272
        target: ref2,
1273
        type: "set",
1274
        key: "value",
1275
        newValue: newVal
1276
      });
1277
    }
1278
  }
1279
}
1280
function isRef(r) {
1281
  return !!(r && r.__v_isRef === true);
1282
}
1283
function ref(value) {
1284
  return createRef(value, false);
1285
}
1286
function shallowRef(value) {
1287
  return createRef(value, true);
1288
}
1289
function createRef(rawValue, shallow) {
1290
  if (isRef(rawValue)) {
1291
    return rawValue;
1292
  }
1293
  return new RefImpl(rawValue, shallow);
1294
}
1295
class RefImpl {
1296
  constructor(value, __v_isShallow) {
1297
    this.__v_isShallow = __v_isShallow;
1298
    this.dep = void 0;
1299
    this.__v_isRef = true;
1300
    this._rawValue = __v_isShallow ? value : toRaw(value);
1301
    this._value = __v_isShallow ? value : toReactive(value);
1302
  }
1303
  get value() {
1304
    trackRefValue(this);
1305
    return this._value;
1306
  }
1307
  set value(newVal) {
1308
    const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
1309
    newVal = useDirectValue ? newVal : toRaw(newVal);
1310
    if (hasChanged(newVal, this._rawValue)) {
1311
      this._rawValue = newVal;
1312
      this._value = useDirectValue ? newVal : toReactive(newVal);
1313
      triggerRefValue(this, newVal);
1314
    }
1315
  }
1316
}
1317
function triggerRef(ref2) {
1318
  triggerRefValue(ref2, ref2.value );
1319
}
1320
function unref(ref2) {
1321
  return isRef(ref2) ? ref2.value : ref2;
1322
}
1323
function toValue(source) {
1324
  return isFunction(source) ? source() : unref(source);
1325
}
1326
const shallowUnwrapHandlers = {
1327
  get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
1328
  set: (target, key, value, receiver) => {
1329
    const oldValue = target[key];
1330
    if (isRef(oldValue) && !isRef(value)) {
1331
      oldValue.value = value;
1332
      return true;
1333
    } else {
1334
      return Reflect.set(target, key, value, receiver);
1335
    }
1336
  }
1337
};
1338
function proxyRefs(objectWithRefs) {
1339
  return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
1340
}
1341
class CustomRefImpl {
1342
  constructor(factory) {
1343
    this.dep = void 0;
1344
    this.__v_isRef = true;
1345
    const { get, set } = factory(
1346
      () => trackRefValue(this),
1347
      () => triggerRefValue(this)
1348
    );
1349
    this._get = get;
1350
    this._set = set;
1351
  }
1352
  get value() {
1353
    return this._get();
1354
  }
1355
  set value(newVal) {
1356
    this._set(newVal);
1357
  }
1358
}
1359
function customRef(factory) {
1360
  return new CustomRefImpl(factory);
1361
}
1362
function toRefs(object) {
1363
  if (!isProxy(object)) {
1364
    console.warn(`toRefs() expects a reactive object but received a plain one.`);
1365
  }
1366
  const ret = isArray(object) ? new Array(object.length) : {};
1367
  for (const key in object) {
1368
    ret[key] = propertyToRef(object, key);
1369
  }
1370
  return ret;
1371
}
1372
class ObjectRefImpl {
1373
  constructor(_object, _key, _defaultValue) {
1374
    this._object = _object;
1375
    this._key = _key;
1376
    this._defaultValue = _defaultValue;
1377
    this.__v_isRef = true;
1378
  }
1379
  get value() {
1380
    const val = this._object[this._key];
1381
    return val === void 0 ? this._defaultValue : val;
1382
  }
1383
  set value(newVal) {
1384
    this._object[this._key] = newVal;
1385
  }
1386
  get dep() {
1387
    return getDepFromReactive(toRaw(this._object), this._key);
1388
  }
1389
}
1390
class GetterRefImpl {
1391
  constructor(_getter) {
1392
    this._getter = _getter;
1393
    this.__v_isRef = true;
1394
    this.__v_isReadonly = true;
1395
  }
1396
  get value() {
1397
    return this._getter();
1398
  }
1399
}
1400
function toRef(source, key, defaultValue) {
1401
  if (isRef(source)) {
1402
    return source;
1403
  } else if (isFunction(source)) {
1404
    return new GetterRefImpl(source);
1405
  } else if (isObject(source) && arguments.length > 1) {
1406
    return propertyToRef(source, key, defaultValue);
1407
  } else {
1408
    return ref(source);
1409
  }
1410
}
1411
function propertyToRef(source, key, defaultValue) {
1412
  const val = source[key];
1413
  return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1414
}
1415
 
1416
class ComputedRefImpl {
1417
  constructor(getter, _setter, isReadonly, isSSR) {
1418
    this._setter = _setter;
1419
    this.dep = void 0;
1420
    this.__v_isRef = true;
1421
    this["__v_isReadonly"] = false;
1422
    this._dirty = true;
1423
    this.effect = new ReactiveEffect(getter, () => {
1424
      if (!this._dirty) {
1425
        this._dirty = true;
1426
        triggerRefValue(this);
1427
      }
1428
    });
1429
    this.effect.computed = this;
1430
    this.effect.active = this._cacheable = !isSSR;
1431
    this["__v_isReadonly"] = isReadonly;
1432
  }
1433
  get value() {
1434
    const self = toRaw(this);
1435
    trackRefValue(self);
1436
    if (self._dirty || !self._cacheable) {
1437
      self._dirty = false;
1438
      self._value = self.effect.run();
1439
    }
1440
    return self._value;
1441
  }
1442
  set value(newValue) {
1443
    this._setter(newValue);
1444
  }
1445
}
1446
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1447
  let getter;
1448
  let setter;
1449
  const onlyGetter = isFunction(getterOrOptions);
1450
  if (onlyGetter) {
1451
    getter = getterOrOptions;
1452
    setter = () => {
1453
      console.warn("Write operation failed: computed value is readonly");
1454
    } ;
1455
  } else {
1456
    getter = getterOrOptions.get;
1457
    setter = getterOrOptions.set;
1458
  }
1459
  const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
1460
  if (debugOptions && !isSSR) {
1461
    cRef.effect.onTrack = debugOptions.onTrack;
1462
    cRef.effect.onTrigger = debugOptions.onTrigger;
1463
  }
1464
  return cRef;
1465
}
1466
 
1467
const stack = [];
1468
function pushWarningContext(vnode) {
1469
  stack.push(vnode);
1470
}
1471
function popWarningContext() {
1472
  stack.pop();
1473
}
1474
function warn(msg, ...args) {
1475
  pauseTracking();
1476
  const instance = stack.length ? stack[stack.length - 1].component : null;
1477
  const appWarnHandler = instance && instance.appContext.config.warnHandler;
1478
  const trace = getComponentTrace();
1479
  if (appWarnHandler) {
1480
    callWithErrorHandling(
1481
      appWarnHandler,
1482
      instance,
1483
      11,
1484
      [
1485
        msg + args.join(""),
1486
        instance && instance.proxy,
1487
        trace.map(
1488
          ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
1489
        ).join("\n"),
1490
        trace
1491
      ]
1492
    );
1493
  } else {
1494
    const warnArgs = [`[Vue warn]: ${msg}`, ...args];
1495
    if (trace.length && // avoid spamming console during tests
1496
    true) {
1497
      warnArgs.push(`
1498
`, ...formatTrace(trace));
1499
    }
1500
    console.warn(...warnArgs);
1501
  }
1502
  resetTracking();
1503
}
1504
function getComponentTrace() {
1505
  let currentVNode = stack[stack.length - 1];
1506
  if (!currentVNode) {
1507
    return [];
1508
  }
1509
  const normalizedStack = [];
1510
  while (currentVNode) {
1511
    const last = normalizedStack[0];
1512
    if (last && last.vnode === currentVNode) {
1513
      last.recurseCount++;
1514
    } else {
1515
      normalizedStack.push({
1516
        vnode: currentVNode,
1517
        recurseCount: 0
1518
      });
1519
    }
1520
    const parentInstance = currentVNode.component && currentVNode.component.parent;
1521
    currentVNode = parentInstance && parentInstance.vnode;
1522
  }
1523
  return normalizedStack;
1524
}
1525
function formatTrace(trace) {
1526
  const logs = [];
1527
  trace.forEach((entry, i) => {
1528
    logs.push(...i === 0 ? [] : [`
1529
`], ...formatTraceEntry(entry));
1530
  });
1531
  return logs;
1532
}
1533
function formatTraceEntry({ vnode, recurseCount }) {
1534
  const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
1535
  const isRoot = vnode.component ? vnode.component.parent == null : false;
1536
  const open = ` at <${formatComponentName(
1537
    vnode.component,
1538
    vnode.type,
1539
    isRoot
1540
  )}`;
1541
  const close = `>` + postfix;
1542
  return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
1543
}
1544
function formatProps(props) {
1545
  const res = [];
1546
  const keys = Object.keys(props);
1547
  keys.slice(0, 3).forEach((key) => {
1548
    res.push(...formatProp(key, props[key]));
1549
  });
1550
  if (keys.length > 3) {
1551
    res.push(` ...`);
1552
  }
1553
  return res;
1554
}
1555
function formatProp(key, value, raw) {
1556
  if (isString(value)) {
1557
    value = JSON.stringify(value);
1558
    return raw ? value : [`${key}=${value}`];
1559
  } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
1560
    return raw ? value : [`${key}=${value}`];
1561
  } else if (isRef(value)) {
1562
    value = formatProp(key, toRaw(value.value), true);
1563
    return raw ? value : [`${key}=Ref<`, value, `>`];
1564
  } else if (isFunction(value)) {
1565
    return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
1566
  } else {
1567
    value = toRaw(value);
1568
    return raw ? value : [`${key}=`, value];
1569
  }
1570
}
1571
function assertNumber(val, type) {
1572
  if (val === void 0) {
1573
    return;
1574
  } else if (typeof val !== "number") {
1575
    warn(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
1576
  } else if (isNaN(val)) {
1577
    warn(`${type} is NaN - the duration expression might be incorrect.`);
1578
  }
1579
}
1580
 
1581
const ErrorTypeStrings = {
1582
  ["sp"]: "serverPrefetch hook",
1583
  ["bc"]: "beforeCreate hook",
1584
  ["c"]: "created hook",
1585
  ["bm"]: "beforeMount hook",
1586
  ["m"]: "mounted hook",
1587
  ["bu"]: "beforeUpdate hook",
1588
  ["u"]: "updated",
1589
  ["bum"]: "beforeUnmount hook",
1590
  ["um"]: "unmounted hook",
1591
  ["a"]: "activated hook",
1592
  ["da"]: "deactivated hook",
1593
  ["ec"]: "errorCaptured hook",
1594
  ["rtc"]: "renderTracked hook",
1595
  ["rtg"]: "renderTriggered hook",
1596
  [0]: "setup function",
1597
  [1]: "render function",
1598
  [2]: "watcher getter",
1599
  [3]: "watcher callback",
1600
  [4]: "watcher cleanup function",
1601
  [5]: "native event handler",
1602
  [6]: "component event handler",
1603
  [7]: "vnode hook",
1604
  [8]: "directive hook",
1605
  [9]: "transition hook",
1606
  [10]: "app errorHandler",
1607
  [11]: "app warnHandler",
1608
  [12]: "ref function",
1609
  [13]: "async component loader",
1610
  [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
1611
};
1612
function callWithErrorHandling(fn, instance, type, args) {
1613
  let res;
1614
  try {
1615
    res = args ? fn(...args) : fn();
1616
  } catch (err) {
1617
    handleError(err, instance, type);
1618
  }
1619
  return res;
1620
}
1621
function callWithAsyncErrorHandling(fn, instance, type, args) {
1622
  if (isFunction(fn)) {
1623
    const res = callWithErrorHandling(fn, instance, type, args);
1624
    if (res && isPromise(res)) {
1625
      res.catch((err) => {
1626
        handleError(err, instance, type);
1627
      });
1628
    }
1629
    return res;
1630
  }
1631
  const values = [];
1632
  for (let i = 0; i < fn.length; i++) {
1633
    values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1634
  }
1635
  return values;
1636
}
1637
function handleError(err, instance, type, throwInDev = true) {
1638
  const contextVNode = instance ? instance.vnode : null;
1639
  if (instance) {
1640
    let cur = instance.parent;
1641
    const exposedInstance = instance.proxy;
1642
    const errorInfo = ErrorTypeStrings[type] ;
1643
    while (cur) {
1644
      const errorCapturedHooks = cur.ec;
1645
      if (errorCapturedHooks) {
1646
        for (let i = 0; i < errorCapturedHooks.length; i++) {
1647
          if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
1648
            return;
1649
          }
1650
        }
1651
      }
1652
      cur = cur.parent;
1653
    }
1654
    const appErrorHandler = instance.appContext.config.errorHandler;
1655
    if (appErrorHandler) {
1656
      callWithErrorHandling(
1657
        appErrorHandler,
1658
        null,
1659
        10,
1660
        [err, exposedInstance, errorInfo]
1661
      );
1662
      return;
1663
    }
1664
  }
1665
  logError(err, type, contextVNode, throwInDev);
1666
}
1667
function logError(err, type, contextVNode, throwInDev = true) {
1668
  {
1669
    const info = ErrorTypeStrings[type];
1670
    if (contextVNode) {
1671
      pushWarningContext(contextVNode);
1672
    }
1673
    warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
1674
    if (contextVNode) {
1675
      popWarningContext();
1676
    }
1677
    if (throwInDev) {
1678
      throw err;
1679
    } else {
1680
      console.error(err);
1681
    }
1682
  }
1683
}
1684
 
1685
let isFlushing = false;
1686
let isFlushPending = false;
1687
const queue = [];
1688
let flushIndex = 0;
1689
const pendingPostFlushCbs = [];
1690
let activePostFlushCbs = null;
1691
let postFlushIndex = 0;
1692
const resolvedPromise = /* @__PURE__ */ Promise.resolve();
1693
let currentFlushPromise = null;
1694
const RECURSION_LIMIT = 100;
1695
function nextTick(fn) {
1696
  const p = currentFlushPromise || resolvedPromise;
1697
  return fn ? p.then(this ? fn.bind(this) : fn) : p;
1698
}
1699
function findInsertionIndex(id) {
1700
  let start = flushIndex + 1;
1701
  let end = queue.length;
1702
  while (start < end) {
1703
    const middle = start + end >>> 1;
1704
    const middleJobId = getId(queue[middle]);
1705
    middleJobId < id ? start = middle + 1 : end = middle;
1706
  }
1707
  return start;
1708
}
1709
function queueJob(job) {
1710
  if (!queue.length || !queue.includes(
1711
    job,
1712
    isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
1713
  )) {
1714
    if (job.id == null) {
1715
      queue.push(job);
1716
    } else {
1717
      queue.splice(findInsertionIndex(job.id), 0, job);
1718
    }
1719
    queueFlush();
1720
  }
1721
}
1722
function queueFlush() {
1723
  if (!isFlushing && !isFlushPending) {
1724
    isFlushPending = true;
1725
    currentFlushPromise = resolvedPromise.then(flushJobs);
1726
  }
1727
}
1728
function invalidateJob(job) {
1729
  const i = queue.indexOf(job);
1730
  if (i > flushIndex) {
1731
    queue.splice(i, 1);
1732
  }
1733
}
1734
function queuePostFlushCb(cb) {
1735
  if (!isArray(cb)) {
1736
    if (!activePostFlushCbs || !activePostFlushCbs.includes(
1737
      cb,
1738
      cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
1739
    )) {
1740
      pendingPostFlushCbs.push(cb);
1741
    }
1742
  } else {
1743
    pendingPostFlushCbs.push(...cb);
1744
  }
1745
  queueFlush();
1746
}
1747
function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
1748
  {
1749
    seen = seen || /* @__PURE__ */ new Map();
1750
  }
1751
  for (; i < queue.length; i++) {
1752
    const cb = queue[i];
1753
    if (cb && cb.pre) {
1754
      if (checkRecursiveUpdates(seen, cb)) {
1755
        continue;
1756
      }
1757
      queue.splice(i, 1);
1758
      i--;
1759
      cb();
1760
    }
1761
  }
1762
}
1763
function flushPostFlushCbs(seen) {
1764
  if (pendingPostFlushCbs.length) {
1765
    const deduped = [...new Set(pendingPostFlushCbs)];
1766
    pendingPostFlushCbs.length = 0;
1767
    if (activePostFlushCbs) {
1768
      activePostFlushCbs.push(...deduped);
1769
      return;
1770
    }
1771
    activePostFlushCbs = deduped;
1772
    {
1773
      seen = seen || /* @__PURE__ */ new Map();
1774
    }
1775
    activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
1776
    for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
1777
      if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
1778
        continue;
1779
      }
1780
      activePostFlushCbs[postFlushIndex]();
1781
    }
1782
    activePostFlushCbs = null;
1783
    postFlushIndex = 0;
1784
  }
1785
}
1786
const getId = (job) => job.id == null ? Infinity : job.id;
1787
const comparator = (a, b) => {
1788
  const diff = getId(a) - getId(b);
1789
  if (diff === 0) {
1790
    if (a.pre && !b.pre)
1791
      return -1;
1792
    if (b.pre && !a.pre)
1793
      return 1;
1794
  }
1795
  return diff;
1796
};
1797
function flushJobs(seen) {
1798
  isFlushPending = false;
1799
  isFlushing = true;
1800
  {
1801
    seen = seen || /* @__PURE__ */ new Map();
1802
  }
1803
  queue.sort(comparator);
1804
  const check = (job) => checkRecursiveUpdates(seen, job) ;
1805
  try {
1806
    for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
1807
      const job = queue[flushIndex];
1808
      if (job && job.active !== false) {
1809
        if (check(job)) {
1810
          continue;
1811
        }
1812
        callWithErrorHandling(job, null, 14);
1813
      }
1814
    }
1815
  } finally {
1816
    flushIndex = 0;
1817
    queue.length = 0;
1818
    flushPostFlushCbs(seen);
1819
    isFlushing = false;
1820
    currentFlushPromise = null;
1821
    if (queue.length || pendingPostFlushCbs.length) {
1822
      flushJobs(seen);
1823
    }
1824
  }
1825
}
1826
function checkRecursiveUpdates(seen, fn) {
1827
  if (!seen.has(fn)) {
1828
    seen.set(fn, 1);
1829
  } else {
1830
    const count = seen.get(fn);
1831
    if (count > RECURSION_LIMIT) {
1832
      const instance = fn.ownerInstance;
1833
      const componentName = instance && getComponentName(instance.type);
1834
      warn(
1835
        `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.`
1836
      );
1837
      return true;
1838
    } else {
1839
      seen.set(fn, count + 1);
1840
    }
1841
  }
1842
}
1843
 
1844
let isHmrUpdating = false;
1845
const hmrDirtyComponents = /* @__PURE__ */ new Set();
1846
{
1847
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
1848
    createRecord: tryWrap(createRecord),
1849
    rerender: tryWrap(rerender),
1850
    reload: tryWrap(reload)
1851
  };
1852
}
1853
const map = /* @__PURE__ */ new Map();
1854
function registerHMR(instance) {
1855
  const id = instance.type.__hmrId;
1856
  let record = map.get(id);
1857
  if (!record) {
1858
    createRecord(id, instance.type);
1859
    record = map.get(id);
1860
  }
1861
  record.instances.add(instance);
1862
}
1863
function unregisterHMR(instance) {
1864
  map.get(instance.type.__hmrId).instances.delete(instance);
1865
}
1866
function createRecord(id, initialDef) {
1867
  if (map.has(id)) {
1868
    return false;
1869
  }
1870
  map.set(id, {
1871
    initialDef: normalizeClassComponent(initialDef),
1872
    instances: /* @__PURE__ */ new Set()
1873
  });
1874
  return true;
1875
}
1876
function normalizeClassComponent(component) {
1877
  return isClassComponent(component) ? component.__vccOpts : component;
1878
}
1879
function rerender(id, newRender) {
1880
  const record = map.get(id);
1881
  if (!record) {
1882
    return;
1883
  }
1884
  record.initialDef.render = newRender;
1885
  [...record.instances].forEach((instance) => {
1886
    if (newRender) {
1887
      instance.render = newRender;
1888
      normalizeClassComponent(instance.type).render = newRender;
1889
    }
1890
    instance.renderCache = [];
1891
    isHmrUpdating = true;
1892
    instance.update();
1893
    isHmrUpdating = false;
1894
  });
1895
}
1896
function reload(id, newComp) {
1897
  const record = map.get(id);
1898
  if (!record)
1899
    return;
1900
  newComp = normalizeClassComponent(newComp);
1901
  updateComponentDef(record.initialDef, newComp);
1902
  const instances = [...record.instances];
1903
  for (const instance of instances) {
1904
    const oldComp = normalizeClassComponent(instance.type);
1905
    if (!hmrDirtyComponents.has(oldComp)) {
1906
      if (oldComp !== record.initialDef) {
1907
        updateComponentDef(oldComp, newComp);
1908
      }
1909
      hmrDirtyComponents.add(oldComp);
1910
    }
1911
    instance.appContext.propsCache.delete(instance.type);
1912
    instance.appContext.emitsCache.delete(instance.type);
1913
    instance.appContext.optionsCache.delete(instance.type);
1914
    if (instance.ceReload) {
1915
      hmrDirtyComponents.add(oldComp);
1916
      instance.ceReload(newComp.styles);
1917
      hmrDirtyComponents.delete(oldComp);
1918
    } else if (instance.parent) {
1919
      queueJob(instance.parent.update);
1920
    } else if (instance.appContext.reload) {
1921
      instance.appContext.reload();
1922
    } else if (typeof window !== "undefined") {
1923
      window.location.reload();
1924
    } else {
1925
      console.warn(
1926
        "[HMR] Root or manually mounted instance modified. Full reload required."
1927
      );
1928
    }
1929
  }
1930
  queuePostFlushCb(() => {
1931
    for (const instance of instances) {
1932
      hmrDirtyComponents.delete(
1933
        normalizeClassComponent(instance.type)
1934
      );
1935
    }
1936
  });
1937
}
1938
function updateComponentDef(oldComp, newComp) {
1939
  extend(oldComp, newComp);
1940
  for (const key in oldComp) {
1941
    if (key !== "__file" && !(key in newComp)) {
1942
      delete oldComp[key];
1943
    }
1944
  }
1945
}
1946
function tryWrap(fn) {
1947
  return (id, arg) => {
1948
    try {
1949
      return fn(id, arg);
1950
    } catch (e) {
1951
      console.error(e);
1952
      console.warn(
1953
        `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
1954
      );
1955
    }
1956
  };
1957
}
1958
 
1959
let devtools;
1960
let buffer = [];
1961
let devtoolsNotInstalled = false;
1962
function emit$1(event, ...args) {
1963
  if (devtools) {
1964
    devtools.emit(event, ...args);
1965
  } else if (!devtoolsNotInstalled) {
1966
    buffer.push({ event, args });
1967
  }
1968
}
1969
function setDevtoolsHook(hook, target) {
1970
  var _a, _b;
1971
  devtools = hook;
1972
  if (devtools) {
1973
    devtools.enabled = true;
1974
    buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
1975
    buffer = [];
1976
  } else if (
1977
    // handle late devtools injection - only do this if we are in an actual
1978
    // browser environment to avoid the timer handle stalling test runner exit
1979
    // (#4815)
1980
    typeof window !== "undefined" && // some envs mock window but not fully
1981
    window.HTMLElement && // also exclude jsdom
1982
    !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
1983
  ) {
1984
    const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
1985
    replay.push((newHook) => {
1986
      setDevtoolsHook(newHook, target);
1987
    });
1988
    setTimeout(() => {
1989
      if (!devtools) {
1990
        target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
1991
        devtoolsNotInstalled = true;
1992
        buffer = [];
1993
      }
1994
    }, 3e3);
1995
  } else {
1996
    devtoolsNotInstalled = true;
1997
    buffer = [];
1998
  }
1999
}
2000
function devtoolsInitApp(app, version) {
2001
  emit$1("app:init" /* APP_INIT */, app, version, {
2002
    Fragment,
2003
    Text,
2004
    Comment,
2005
    Static
2006
  });
2007
}
2008
function devtoolsUnmountApp(app) {
2009
  emit$1("app:unmount" /* APP_UNMOUNT */, app);
2010
}
2011
const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
2012
  "component:added" /* COMPONENT_ADDED */
2013
);
2014
const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
2015
const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
2016
  "component:removed" /* COMPONENT_REMOVED */
2017
);
2018
const devtoolsComponentRemoved = (component) => {
2019
  if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered
2020
  !devtools.cleanupBuffer(component)) {
2021
    _devtoolsComponentRemoved(component);
2022
  }
2023
};
2024
function createDevtoolsComponentHook(hook) {
2025
  return (component) => {
2026
    emit$1(
2027
      hook,
2028
      component.appContext.app,
2029
      component.uid,
2030
      component.parent ? component.parent.uid : void 0,
2031
      component
2032
    );
2033
  };
2034
}
2035
const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
2036
  "perf:start" /* PERFORMANCE_START */
2037
);
2038
const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
2039
  "perf:end" /* PERFORMANCE_END */
2040
);
2041
function createDevtoolsPerformanceHook(hook) {
2042
  return (component, type, time) => {
2043
    emit$1(hook, component.appContext.app, component.uid, component, type, time);
2044
  };
2045
}
2046
function devtoolsComponentEmit(component, event, params) {
2047
  emit$1(
2048
    "component:emit" /* COMPONENT_EMIT */,
2049
    component.appContext.app,
2050
    component,
2051
    event,
2052
    params
2053
  );
2054
}
2055
 
2056
function emit(instance, event, ...rawArgs) {
2057
  if (instance.isUnmounted)
2058
    return;
2059
  const props = instance.vnode.props || EMPTY_OBJ;
2060
  {
2061
    const {
2062
      emitsOptions,
2063
      propsOptions: [propsOptions]
2064
    } = instance;
2065
    if (emitsOptions) {
2066
      if (!(event in emitsOptions) && true) {
2067
        if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
2068
          warn(
2069
            `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
2070
          );
2071
        }
2072
      } else {
2073
        const validator = emitsOptions[event];
2074
        if (isFunction(validator)) {
2075
          const isValid = validator(...rawArgs);
2076
          if (!isValid) {
2077
            warn(
2078
              `Invalid event arguments: event validation failed for event "${event}".`
2079
            );
2080
          }
2081
        }
2082
      }
2083
    }
2084
  }
2085
  let args = rawArgs;
2086
  const isModelListener = event.startsWith("update:");
2087
  const modelArg = isModelListener && event.slice(7);
2088
  if (modelArg && modelArg in props) {
2089
    const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
2090
    const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
2091
    if (trim) {
2092
      args = rawArgs.map((a) => isString(a) ? a.trim() : a);
2093
    }
2094
    if (number) {
2095
      args = rawArgs.map(looseToNumber);
2096
    }
2097
  }
2098
  {
2099
    devtoolsComponentEmit(instance, event, args);
2100
  }
2101
  {
2102
    const lowerCaseEvent = event.toLowerCase();
2103
    if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
2104
      warn(
2105
        `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
2106
          instance,
2107
          instance.type
2108
        )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(event)}" instead of "${event}".`
2109
      );
2110
    }
2111
  }
2112
  let handlerName;
2113
  let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
2114
  props[handlerName = toHandlerKey(camelize(event))];
2115
  if (!handler && isModelListener) {
2116
    handler = props[handlerName = toHandlerKey(hyphenate(event))];
2117
  }
2118
  if (handler) {
2119
    callWithAsyncErrorHandling(
2120
      handler,
2121
      instance,
2122
      6,
2123
      args
2124
    );
2125
  }
2126
  const onceHandler = props[handlerName + `Once`];
2127
  if (onceHandler) {
2128
    if (!instance.emitted) {
2129
      instance.emitted = {};
2130
    } else if (instance.emitted[handlerName]) {
2131
      return;
2132
    }
2133
    instance.emitted[handlerName] = true;
2134
    callWithAsyncErrorHandling(
2135
      onceHandler,
2136
      instance,
2137
      6,
2138
      args
2139
    );
2140
  }
2141
}
2142
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
2143
  const cache = appContext.emitsCache;
2144
  const cached = cache.get(comp);
2145
  if (cached !== void 0) {
2146
    return cached;
2147
  }
2148
  const raw = comp.emits;
2149
  let normalized = {};
2150
  let hasExtends = false;
2151
  if (!isFunction(comp)) {
2152
    const extendEmits = (raw2) => {
2153
      const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
2154
      if (normalizedFromExtend) {
2155
        hasExtends = true;
2156
        extend(normalized, normalizedFromExtend);
2157
      }
2158
    };
2159
    if (!asMixin && appContext.mixins.length) {
2160
      appContext.mixins.forEach(extendEmits);
2161
    }
2162
    if (comp.extends) {
2163
      extendEmits(comp.extends);
2164
    }
2165
    if (comp.mixins) {
2166
      comp.mixins.forEach(extendEmits);
2167
    }
2168
  }
2169
  if (!raw && !hasExtends) {
2170
    if (isObject(comp)) {
2171
      cache.set(comp, null);
2172
    }
2173
    return null;
2174
  }
2175
  if (isArray(raw)) {
2176
    raw.forEach((key) => normalized[key] = null);
2177
  } else {
2178
    extend(normalized, raw);
2179
  }
2180
  if (isObject(comp)) {
2181
    cache.set(comp, normalized);
2182
  }
2183
  return normalized;
2184
}
2185
function isEmitListener(options, key) {
2186
  if (!options || !isOn(key)) {
2187
    return false;
2188
  }
2189
  key = key.slice(2).replace(/Once$/, "");
2190
  return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
2191
}
2192
 
2193
let currentRenderingInstance = null;
2194
let currentScopeId = null;
2195
function setCurrentRenderingInstance(instance) {
2196
  const prev = currentRenderingInstance;
2197
  currentRenderingInstance = instance;
2198
  currentScopeId = instance && instance.type.__scopeId || null;
2199
  return prev;
2200
}
2201
function pushScopeId(id) {
2202
  currentScopeId = id;
2203
}
2204
function popScopeId() {
2205
  currentScopeId = null;
2206
}
2207
const withScopeId = (_id) => withCtx;
2208
function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
2209
  if (!ctx)
2210
    return fn;
2211
  if (fn._n) {
2212
    return fn;
2213
  }
2214
  const renderFnWithContext = (...args) => {
2215
    if (renderFnWithContext._d) {
2216
      setBlockTracking(-1);
2217
    }
2218
    const prevInstance = setCurrentRenderingInstance(ctx);
2219
    let res;
2220
    try {
2221
      res = fn(...args);
2222
    } finally {
2223
      setCurrentRenderingInstance(prevInstance);
2224
      if (renderFnWithContext._d) {
2225
        setBlockTracking(1);
2226
      }
2227
    }
2228
    {
2229
      devtoolsComponentUpdated(ctx);
2230
    }
2231
    return res;
2232
  };
2233
  renderFnWithContext._n = true;
2234
  renderFnWithContext._c = true;
2235
  renderFnWithContext._d = true;
2236
  return renderFnWithContext;
2237
}
2238
 
2239
let accessedAttrs = false;
2240
function markAttrsAccessed() {
2241
  accessedAttrs = true;
2242
}
2243
function renderComponentRoot(instance) {
2244
  const {
2245
    type: Component,
2246
    vnode,
2247
    proxy,
2248
    withProxy,
2249
    props,
2250
    propsOptions: [propsOptions],
2251
    slots,
2252
    attrs,
2253
    emit,
2254
    render,
2255
    renderCache,
2256
    data,
2257
    setupState,
2258
    ctx,
2259
    inheritAttrs
2260
  } = instance;
2261
  let result;
2262
  let fallthroughAttrs;
2263
  const prev = setCurrentRenderingInstance(instance);
2264
  {
2265
    accessedAttrs = false;
2266
  }
2267
  try {
2268
    if (vnode.shapeFlag & 4) {
2269
      const proxyToUse = withProxy || proxy;
2270
      result = normalizeVNode(
2271
        render.call(
2272
          proxyToUse,
2273
          proxyToUse,
2274
          renderCache,
2275
          props,
2276
          setupState,
2277
          data,
2278
          ctx
2279
        )
2280
      );
2281
      fallthroughAttrs = attrs;
2282
    } else {
2283
      const render2 = Component;
2284
      if (attrs === props) {
2285
        markAttrsAccessed();
2286
      }
2287
      result = normalizeVNode(
2288
        render2.length > 1 ? render2(
2289
          props,
2290
          true ? {
2291
            get attrs() {
2292
              markAttrsAccessed();
2293
              return attrs;
2294
            },
2295
            slots,
2296
            emit
2297
          } : { attrs, slots, emit }
2298
        ) : render2(
2299
          props,
2300
          null
2301
          /* we know it doesn't need it */
2302
        )
2303
      );
2304
      fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
2305
    }
2306
  } catch (err) {
2307
    blockStack.length = 0;
2308
    handleError(err, instance, 1);
2309
    result = createVNode(Comment);
2310
  }
2311
  let root = result;
2312
  let setRoot = void 0;
2313
  if (result.patchFlag > 0 && result.patchFlag & 2048) {
2314
    [root, setRoot] = getChildRoot(result);
2315
  }
2316
  if (fallthroughAttrs && inheritAttrs !== false) {
2317
    const keys = Object.keys(fallthroughAttrs);
2318
    const { shapeFlag } = root;
2319
    if (keys.length) {
2320
      if (shapeFlag & (1 | 6)) {
2321
        if (propsOptions && keys.some(isModelListener)) {
2322
          fallthroughAttrs = filterModelListeners(
2323
            fallthroughAttrs,
2324
            propsOptions
2325
          );
2326
        }
2327
        root = cloneVNode(root, fallthroughAttrs);
2328
      } else if (!accessedAttrs && root.type !== Comment) {
2329
        const allAttrs = Object.keys(attrs);
2330
        const eventAttrs = [];
2331
        const extraAttrs = [];
2332
        for (let i = 0, l = allAttrs.length; i < l; i++) {
2333
          const key = allAttrs[i];
2334
          if (isOn(key)) {
2335
            if (!isModelListener(key)) {
2336
              eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2337
            }
2338
          } else {
2339
            extraAttrs.push(key);
2340
          }
2341
        }
2342
        if (extraAttrs.length) {
2343
          warn(
2344
            `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
2345
          );
2346
        }
2347
        if (eventAttrs.length) {
2348
          warn(
2349
            `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
2350
          );
2351
        }
2352
      }
2353
    }
2354
  }
2355
  if (vnode.dirs) {
2356
    if (!isElementRoot(root)) {
2357
      warn(
2358
        `Runtime directive used on component with non-element root node. The directives will not function as intended.`
2359
      );
2360
    }
2361
    root = cloneVNode(root);
2362
    root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2363
  }
2364
  if (vnode.transition) {
2365
    if (!isElementRoot(root)) {
2366
      warn(
2367
        `Component inside <Transition> renders non-element root node that cannot be animated.`
2368
      );
2369
    }
2370
    root.transition = vnode.transition;
2371
  }
2372
  if (setRoot) {
2373
    setRoot(root);
2374
  } else {
2375
    result = root;
2376
  }
2377
  setCurrentRenderingInstance(prev);
2378
  return result;
2379
}
2380
const getChildRoot = (vnode) => {
2381
  const rawChildren = vnode.children;
2382
  const dynamicChildren = vnode.dynamicChildren;
2383
  const childRoot = filterSingleRoot(rawChildren);
2384
  if (!childRoot) {
2385
    return [vnode, void 0];
2386
  }
2387
  const index = rawChildren.indexOf(childRoot);
2388
  const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
2389
  const setRoot = (updatedRoot) => {
2390
    rawChildren[index] = updatedRoot;
2391
    if (dynamicChildren) {
2392
      if (dynamicIndex > -1) {
2393
        dynamicChildren[dynamicIndex] = updatedRoot;
2394
      } else if (updatedRoot.patchFlag > 0) {
2395
        vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
2396
      }
2397
    }
2398
  };
2399
  return [normalizeVNode(childRoot), setRoot];
2400
};
2401
function filterSingleRoot(children) {
2402
  let singleRoot;
2403
  for (let i = 0; i < children.length; i++) {
2404
    const child = children[i];
2405
    if (isVNode(child)) {
2406
      if (child.type !== Comment || child.children === "v-if") {
2407
        if (singleRoot) {
2408
          return;
2409
        } else {
2410
          singleRoot = child;
2411
        }
2412
      }
2413
    } else {
2414
      return;
2415
    }
2416
  }
2417
  return singleRoot;
2418
}
2419
const getFunctionalFallthrough = (attrs) => {
2420
  let res;
2421
  for (const key in attrs) {
2422
    if (key === "class" || key === "style" || isOn(key)) {
2423
      (res || (res = {}))[key] = attrs[key];
2424
    }
2425
  }
2426
  return res;
2427
};
2428
const filterModelListeners = (attrs, props) => {
2429
  const res = {};
2430
  for (const key in attrs) {
2431
    if (!isModelListener(key) || !(key.slice(9) in props)) {
2432
      res[key] = attrs[key];
2433
    }
2434
  }
2435
  return res;
2436
};
2437
const isElementRoot = (vnode) => {
2438
  return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
2439
};
2440
function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
2441
  const { props: prevProps, children: prevChildren, component } = prevVNode;
2442
  const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
2443
  const emits = component.emitsOptions;
2444
  if ((prevChildren || nextChildren) && isHmrUpdating) {
2445
    return true;
2446
  }
2447
  if (nextVNode.dirs || nextVNode.transition) {
2448
    return true;
2449
  }
2450
  if (optimized && patchFlag >= 0) {
2451
    if (patchFlag & 1024) {
2452
      return true;
2453
    }
2454
    if (patchFlag & 16) {
2455
      if (!prevProps) {
2456
        return !!nextProps;
2457
      }
2458
      return hasPropsChanged(prevProps, nextProps, emits);
2459
    } else if (patchFlag & 8) {
2460
      const dynamicProps = nextVNode.dynamicProps;
2461
      for (let i = 0; i < dynamicProps.length; i++) {
2462
        const key = dynamicProps[i];
2463
        if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
2464
          return true;
2465
        }
2466
      }
2467
    }
2468
  } else {
2469
    if (prevChildren || nextChildren) {
2470
      if (!nextChildren || !nextChildren.$stable) {
2471
        return true;
2472
      }
2473
    }
2474
    if (prevProps === nextProps) {
2475
      return false;
2476
    }
2477
    if (!prevProps) {
2478
      return !!nextProps;
2479
    }
2480
    if (!nextProps) {
2481
      return true;
2482
    }
2483
    return hasPropsChanged(prevProps, nextProps, emits);
2484
  }
2485
  return false;
2486
}
2487
function hasPropsChanged(prevProps, nextProps, emitsOptions) {
2488
  const nextKeys = Object.keys(nextProps);
2489
  if (nextKeys.length !== Object.keys(prevProps).length) {
2490
    return true;
2491
  }
2492
  for (let i = 0; i < nextKeys.length; i++) {
2493
    const key = nextKeys[i];
2494
    if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
2495
      return true;
2496
    }
2497
  }
2498
  return false;
2499
}
2500
function updateHOCHostEl({ vnode, parent }, el) {
2501
  while (parent && parent.subTree === vnode) {
2502
    (vnode = parent.vnode).el = el;
2503
    parent = parent.parent;
2504
  }
2505
}
2506
 
2507
const isSuspense = (type) => type.__isSuspense;
2508
const SuspenseImpl = {
2509
  name: "Suspense",
2510
  // In order to make Suspense tree-shakable, we need to avoid importing it
2511
  // directly in the renderer. The renderer checks for the __isSuspense flag
2512
  // on a vnode's type and calls the `process` method, passing in renderer
2513
  // internals.
2514
  __isSuspense: true,
2515
  process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
2516
    if (n1 == null) {
2517
      mountSuspense(
2518
        n2,
2519
        container,
2520
        anchor,
2521
        parentComponent,
2522
        parentSuspense,
2523
        isSVG,
2524
        slotScopeIds,
2525
        optimized,
2526
        rendererInternals
2527
      );
2528
    } else {
2529
      patchSuspense(
2530
        n1,
2531
        n2,
2532
        container,
2533
        anchor,
2534
        parentComponent,
2535
        isSVG,
2536
        slotScopeIds,
2537
        optimized,
2538
        rendererInternals
2539
      );
2540
    }
2541
  },
2542
  hydrate: hydrateSuspense,
2543
  create: createSuspenseBoundary,
2544
  normalize: normalizeSuspenseChildren
2545
};
2546
const Suspense = SuspenseImpl ;
2547
function triggerEvent(vnode, name) {
2548
  const eventListener = vnode.props && vnode.props[name];
2549
  if (isFunction(eventListener)) {
2550
    eventListener();
2551
  }
2552
}
2553
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
2554
  const {
2555
    p: patch,
2556
    o: { createElement }
2557
  } = rendererInternals;
2558
  const hiddenContainer = createElement("div");
2559
  const suspense = vnode.suspense = createSuspenseBoundary(
2560
    vnode,
2561
    parentSuspense,
2562
    parentComponent,
2563
    container,
2564
    hiddenContainer,
2565
    anchor,
2566
    isSVG,
2567
    slotScopeIds,
2568
    optimized,
2569
    rendererInternals
2570
  );
2571
  patch(
2572
    null,
2573
    suspense.pendingBranch = vnode.ssContent,
2574
    hiddenContainer,
2575
    null,
2576
    parentComponent,
2577
    suspense,
2578
    isSVG,
2579
    slotScopeIds
2580
  );
2581
  if (suspense.deps > 0) {
2582
    triggerEvent(vnode, "onPending");
2583
    triggerEvent(vnode, "onFallback");
2584
    patch(
2585
      null,
2586
      vnode.ssFallback,
2587
      container,
2588
      anchor,
2589
      parentComponent,
2590
      null,
2591
      // fallback tree will not have suspense context
2592
      isSVG,
2593
      slotScopeIds
2594
    );
2595
    setActiveBranch(suspense, vnode.ssFallback);
2596
  } else {
2597
    suspense.resolve(false, true);
2598
  }
2599
}
2600
function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
2601
  const suspense = n2.suspense = n1.suspense;
2602
  suspense.vnode = n2;
2603
  n2.el = n1.el;
2604
  const newBranch = n2.ssContent;
2605
  const newFallback = n2.ssFallback;
2606
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
2607
  if (pendingBranch) {
2608
    suspense.pendingBranch = newBranch;
2609
    if (isSameVNodeType(newBranch, pendingBranch)) {
2610
      patch(
2611
        pendingBranch,
2612
        newBranch,
2613
        suspense.hiddenContainer,
2614
        null,
2615
        parentComponent,
2616
        suspense,
2617
        isSVG,
2618
        slotScopeIds,
2619
        optimized
2620
      );
2621
      if (suspense.deps <= 0) {
2622
        suspense.resolve();
2623
      } else if (isInFallback) {
2624
        patch(
2625
          activeBranch,
2626
          newFallback,
2627
          container,
2628
          anchor,
2629
          parentComponent,
2630
          null,
2631
          // fallback tree will not have suspense context
2632
          isSVG,
2633
          slotScopeIds,
2634
          optimized
2635
        );
2636
        setActiveBranch(suspense, newFallback);
2637
      }
2638
    } else {
2639
      suspense.pendingId++;
2640
      if (isHydrating) {
2641
        suspense.isHydrating = false;
2642
        suspense.activeBranch = pendingBranch;
2643
      } else {
2644
        unmount(pendingBranch, parentComponent, suspense);
2645
      }
2646
      suspense.deps = 0;
2647
      suspense.effects.length = 0;
2648
      suspense.hiddenContainer = createElement("div");
2649
      if (isInFallback) {
2650
        patch(
2651
          null,
2652
          newBranch,
2653
          suspense.hiddenContainer,
2654
          null,
2655
          parentComponent,
2656
          suspense,
2657
          isSVG,
2658
          slotScopeIds,
2659
          optimized
2660
        );
2661
        if (suspense.deps <= 0) {
2662
          suspense.resolve();
2663
        } else {
2664
          patch(
2665
            activeBranch,
2666
            newFallback,
2667
            container,
2668
            anchor,
2669
            parentComponent,
2670
            null,
2671
            // fallback tree will not have suspense context
2672
            isSVG,
2673
            slotScopeIds,
2674
            optimized
2675
          );
2676
          setActiveBranch(suspense, newFallback);
2677
        }
2678
      } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
2679
        patch(
2680
          activeBranch,
2681
          newBranch,
2682
          container,
2683
          anchor,
2684
          parentComponent,
2685
          suspense,
2686
          isSVG,
2687
          slotScopeIds,
2688
          optimized
2689
        );
2690
        suspense.resolve(true);
2691
      } else {
2692
        patch(
2693
          null,
2694
          newBranch,
2695
          suspense.hiddenContainer,
2696
          null,
2697
          parentComponent,
2698
          suspense,
2699
          isSVG,
2700
          slotScopeIds,
2701
          optimized
2702
        );
2703
        if (suspense.deps <= 0) {
2704
          suspense.resolve();
2705
        }
2706
      }
2707
    }
2708
  } else {
2709
    if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
2710
      patch(
2711
        activeBranch,
2712
        newBranch,
2713
        container,
2714
        anchor,
2715
        parentComponent,
2716
        suspense,
2717
        isSVG,
2718
        slotScopeIds,
2719
        optimized
2720
      );
2721
      setActiveBranch(suspense, newBranch);
2722
    } else {
2723
      triggerEvent(n2, "onPending");
2724
      suspense.pendingBranch = newBranch;
2725
      suspense.pendingId++;
2726
      patch(
2727
        null,
2728
        newBranch,
2729
        suspense.hiddenContainer,
2730
        null,
2731
        parentComponent,
2732
        suspense,
2733
        isSVG,
2734
        slotScopeIds,
2735
        optimized
2736
      );
2737
      if (suspense.deps <= 0) {
2738
        suspense.resolve();
2739
      } else {
2740
        const { timeout, pendingId } = suspense;
2741
        if (timeout > 0) {
2742
          setTimeout(() => {
2743
            if (suspense.pendingId === pendingId) {
2744
              suspense.fallback(newFallback);
2745
            }
2746
          }, timeout);
2747
        } else if (timeout === 0) {
2748
          suspense.fallback(newFallback);
2749
        }
2750
      }
2751
    }
2752
  }
2753
}
2754
let hasWarned = false;
2755
function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
2756
  if (!hasWarned) {
2757
    hasWarned = true;
2758
    console[console.info ? "info" : "log"](
2759
      `<Suspense> is an experimental feature and its API will likely change.`
2760
    );
2761
  }
2762
  const {
2763
    p: patch,
2764
    m: move,
2765
    um: unmount,
2766
    n: next,
2767
    o: { parentNode, remove }
2768
  } = rendererInternals;
2769
  let parentSuspenseId;
2770
  const isSuspensible = isVNodeSuspensible(vnode);
2771
  if (isSuspensible) {
2772
    if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
2773
      parentSuspenseId = parentSuspense.pendingId;
2774
      parentSuspense.deps++;
2775
    }
2776
  }
2777
  const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
2778
  {
2779
    assertNumber(timeout, `Suspense timeout`);
2780
  }
2781
  const suspense = {
2782
    vnode,
2783
    parent: parentSuspense,
2784
    parentComponent,
2785
    isSVG,
2786
    container,
2787
    hiddenContainer,
2788
    anchor,
2789
    deps: 0,
2790
    pendingId: 0,
2791
    timeout: typeof timeout === "number" ? timeout : -1,
2792
    activeBranch: null,
2793
    pendingBranch: null,
2794
    isInFallback: true,
2795
    isHydrating,
2796
    isUnmounted: false,
2797
    effects: [],
2798
    resolve(resume = false, sync = false) {
2799
      {
2800
        if (!resume && !suspense.pendingBranch) {
2801
          throw new Error(
2802
            `suspense.resolve() is called without a pending branch.`
2803
          );
2804
        }
2805
        if (suspense.isUnmounted) {
2806
          throw new Error(
2807
            `suspense.resolve() is called on an already unmounted suspense boundary.`
2808
          );
2809
        }
2810
      }
2811
      const {
2812
        vnode: vnode2,
2813
        activeBranch,
2814
        pendingBranch,
2815
        pendingId,
2816
        effects,
2817
        parentComponent: parentComponent2,
2818
        container: container2
2819
      } = suspense;
2820
      if (suspense.isHydrating) {
2821
        suspense.isHydrating = false;
2822
      } else if (!resume) {
2823
        const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
2824
        if (delayEnter) {
2825
          activeBranch.transition.afterLeave = () => {
2826
            if (pendingId === suspense.pendingId) {
2827
              move(pendingBranch, container2, anchor2, 0);
2828
            }
2829
          };
2830
        }
2831
        let { anchor: anchor2 } = suspense;
2832
        if (activeBranch) {
2833
          anchor2 = next(activeBranch);
2834
          unmount(activeBranch, parentComponent2, suspense, true);
2835
        }
2836
        if (!delayEnter) {
2837
          move(pendingBranch, container2, anchor2, 0);
2838
        }
2839
      }
2840
      setActiveBranch(suspense, pendingBranch);
2841
      suspense.pendingBranch = null;
2842
      suspense.isInFallback = false;
2843
      let parent = suspense.parent;
2844
      let hasUnresolvedAncestor = false;
2845
      while (parent) {
2846
        if (parent.pendingBranch) {
2847
          parent.effects.push(...effects);
2848
          hasUnresolvedAncestor = true;
2849
          break;
2850
        }
2851
        parent = parent.parent;
2852
      }
2853
      if (!hasUnresolvedAncestor) {
2854
        queuePostFlushCb(effects);
2855
      }
2856
      suspense.effects = [];
2857
      if (isSuspensible) {
2858
        if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
2859
          parentSuspense.deps--;
2860
          if (parentSuspense.deps === 0 && !sync) {
2861
            parentSuspense.resolve();
2862
          }
2863
        }
2864
      }
2865
      triggerEvent(vnode2, "onResolve");
2866
    },
2867
    fallback(fallbackVNode) {
2868
      if (!suspense.pendingBranch) {
2869
        return;
2870
      }
2871
      const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
2872
      triggerEvent(vnode2, "onFallback");
2873
      const anchor2 = next(activeBranch);
2874
      const mountFallback = () => {
2875
        if (!suspense.isInFallback) {
2876
          return;
2877
        }
2878
        patch(
2879
          null,
2880
          fallbackVNode,
2881
          container2,
2882
          anchor2,
2883
          parentComponent2,
2884
          null,
2885
          // fallback tree will not have suspense context
2886
          isSVG2,
2887
          slotScopeIds,
2888
          optimized
2889
        );
2890
        setActiveBranch(suspense, fallbackVNode);
2891
      };
2892
      const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
2893
      if (delayEnter) {
2894
        activeBranch.transition.afterLeave = mountFallback;
2895
      }
2896
      suspense.isInFallback = true;
2897
      unmount(
2898
        activeBranch,
2899
        parentComponent2,
2900
        null,
2901
        // no suspense so unmount hooks fire now
2902
        true
2903
        // shouldRemove
2904
      );
2905
      if (!delayEnter) {
2906
        mountFallback();
2907
      }
2908
    },
2909
    move(container2, anchor2, type) {
2910
      suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
2911
      suspense.container = container2;
2912
    },
2913
    next() {
2914
      return suspense.activeBranch && next(suspense.activeBranch);
2915
    },
2916
    registerDep(instance, setupRenderEffect) {
2917
      const isInPendingSuspense = !!suspense.pendingBranch;
2918
      if (isInPendingSuspense) {
2919
        suspense.deps++;
2920
      }
2921
      const hydratedEl = instance.vnode.el;
2922
      instance.asyncDep.catch((err) => {
2923
        handleError(err, instance, 0);
2924
      }).then((asyncSetupResult) => {
2925
        if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
2926
          return;
2927
        }
2928
        instance.asyncResolved = true;
2929
        const { vnode: vnode2 } = instance;
2930
        {
2931
          pushWarningContext(vnode2);
2932
        }
2933
        handleSetupResult(instance, asyncSetupResult, false);
2934
        if (hydratedEl) {
2935
          vnode2.el = hydratedEl;
2936
        }
2937
        const placeholder = !hydratedEl && instance.subTree.el;
2938
        setupRenderEffect(
2939
          instance,
2940
          vnode2,
2941
          // component may have been moved before resolve.
2942
          // if this is not a hydration, instance.subTree will be the comment
2943
          // placeholder.
2944
          parentNode(hydratedEl || instance.subTree.el),
2945
          // anchor will not be used if this is hydration, so only need to
2946
          // consider the comment placeholder case.
2947
          hydratedEl ? null : next(instance.subTree),
2948
          suspense,
2949
          isSVG,
2950
          optimized
2951
        );
2952
        if (placeholder) {
2953
          remove(placeholder);
2954
        }
2955
        updateHOCHostEl(instance, vnode2.el);
2956
        {
2957
          popWarningContext();
2958
        }
2959
        if (isInPendingSuspense && --suspense.deps === 0) {
2960
          suspense.resolve();
2961
        }
2962
      });
2963
    },
2964
    unmount(parentSuspense2, doRemove) {
2965
      suspense.isUnmounted = true;
2966
      if (suspense.activeBranch) {
2967
        unmount(
2968
          suspense.activeBranch,
2969
          parentComponent,
2970
          parentSuspense2,
2971
          doRemove
2972
        );
2973
      }
2974
      if (suspense.pendingBranch) {
2975
        unmount(
2976
          suspense.pendingBranch,
2977
          parentComponent,
2978
          parentSuspense2,
2979
          doRemove
2980
        );
2981
      }
2982
    }
2983
  };
2984
  return suspense;
2985
}
2986
function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {
2987
  const suspense = vnode.suspense = createSuspenseBoundary(
2988
    vnode,
2989
    parentSuspense,
2990
    parentComponent,
2991
    node.parentNode,
2992
    document.createElement("div"),
2993
    null,
2994
    isSVG,
2995
    slotScopeIds,
2996
    optimized,
2997
    rendererInternals,
2998
    true
2999
    /* hydrating */
3000
  );
3001
  const result = hydrateNode(
3002
    node,
3003
    suspense.pendingBranch = vnode.ssContent,
3004
    parentComponent,
3005
    suspense,
3006
    slotScopeIds,
3007
    optimized
3008
  );
3009
  if (suspense.deps === 0) {
3010
    suspense.resolve(false, true);
3011
  }
3012
  return result;
3013
}
3014
function normalizeSuspenseChildren(vnode) {
3015
  const { shapeFlag, children } = vnode;
3016
  const isSlotChildren = shapeFlag & 32;
3017
  vnode.ssContent = normalizeSuspenseSlot(
3018
    isSlotChildren ? children.default : children
3019
  );
3020
  vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
3021
}
3022
function normalizeSuspenseSlot(s) {
3023
  let block;
3024
  if (isFunction(s)) {
3025
    const trackBlock = isBlockTreeEnabled && s._c;
3026
    if (trackBlock) {
3027
      s._d = false;
3028
      openBlock();
3029
    }
3030
    s = s();
3031
    if (trackBlock) {
3032
      s._d = true;
3033
      block = currentBlock;
3034
      closeBlock();
3035
    }
3036
  }
3037
  if (isArray(s)) {
3038
    const singleChild = filterSingleRoot(s);
3039
    if (!singleChild) {
3040
      warn(`<Suspense> slots expect a single root node.`);
3041
    }
3042
    s = singleChild;
3043
  }
3044
  s = normalizeVNode(s);
3045
  if (block && !s.dynamicChildren) {
3046
    s.dynamicChildren = block.filter((c) => c !== s);
3047
  }
3048
  return s;
3049
}
3050
function queueEffectWithSuspense(fn, suspense) {
3051
  if (suspense && suspense.pendingBranch) {
3052
    if (isArray(fn)) {
3053
      suspense.effects.push(...fn);
3054
    } else {
3055
      suspense.effects.push(fn);
3056
    }
3057
  } else {
3058
    queuePostFlushCb(fn);
3059
  }
3060
}
3061
function setActiveBranch(suspense, branch) {
3062
  suspense.activeBranch = branch;
3063
  const { vnode, parentComponent } = suspense;
3064
  const el = vnode.el = branch.el;
3065
  if (parentComponent && parentComponent.subTree === vnode) {
3066
    parentComponent.vnode.el = el;
3067
    updateHOCHostEl(parentComponent, el);
3068
  }
3069
}
3070
function isVNodeSuspensible(vnode) {
3071
  var _a;
3072
  return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
3073
}
3074
 
3075
function watchEffect(effect, options) {
3076
  return doWatch(effect, null, options);
3077
}
3078
function watchPostEffect(effect, options) {
3079
  return doWatch(
3080
    effect,
3081
    null,
3082
    extend({}, options, { flush: "post" })
3083
  );
3084
}
3085
function watchSyncEffect(effect, options) {
3086
  return doWatch(
3087
    effect,
3088
    null,
3089
    extend({}, options, { flush: "sync" })
3090
  );
3091
}
3092
const INITIAL_WATCHER_VALUE = {};
3093
function watch(source, cb, options) {
3094
  if (!isFunction(cb)) {
3095
    warn(
3096
      `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
3097
    );
3098
  }
3099
  return doWatch(source, cb, options);
3100
}
3101
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
3102
  var _a;
3103
  if (!cb) {
3104
    if (immediate !== void 0) {
3105
      warn(
3106
        `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
3107
      );
3108
    }
3109
    if (deep !== void 0) {
3110
      warn(
3111
        `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
3112
      );
3113
    }
3114
  }
3115
  const warnInvalidSource = (s) => {
3116
    warn(
3117
      `Invalid watch source: `,
3118
      s,
3119
      `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
3120
    );
3121
  };
3122
  const instance = getCurrentScope() === ((_a = currentInstance) == null ? void 0 : _a.scope) ? currentInstance : null;
3123
  let getter;
3124
  let forceTrigger = false;
3125
  let isMultiSource = false;
3126
  if (isRef(source)) {
3127
    getter = () => source.value;
3128
    forceTrigger = isShallow(source);
3129
  } else if (isReactive(source)) {
3130
    getter = () => source;
3131
    deep = true;
3132
  } else if (isArray(source)) {
3133
    isMultiSource = true;
3134
    forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
3135
    getter = () => source.map((s) => {
3136
      if (isRef(s)) {
3137
        return s.value;
3138
      } else if (isReactive(s)) {
3139
        return traverse(s);
3140
      } else if (isFunction(s)) {
3141
        return callWithErrorHandling(s, instance, 2);
3142
      } else {
3143
        warnInvalidSource(s);
3144
      }
3145
    });
3146
  } else if (isFunction(source)) {
3147
    if (cb) {
3148
      getter = () => callWithErrorHandling(source, instance, 2);
3149
    } else {
3150
      getter = () => {
3151
        if (instance && instance.isUnmounted) {
3152
          return;
3153
        }
3154
        if (cleanup) {
3155
          cleanup();
3156
        }
3157
        return callWithAsyncErrorHandling(
3158
          source,
3159
          instance,
3160
          3,
3161
          [onCleanup]
3162
        );
3163
      };
3164
    }
3165
  } else {
3166
    getter = NOOP;
3167
    warnInvalidSource(source);
3168
  }
3169
  if (cb && deep) {
3170
    const baseGetter = getter;
3171
    getter = () => traverse(baseGetter());
3172
  }
3173
  let cleanup;
3174
  let onCleanup = (fn) => {
3175
    cleanup = effect.onStop = () => {
3176
      callWithErrorHandling(fn, instance, 4);
3177
    };
3178
  };
3179
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
3180
  const job = () => {
3181
    if (!effect.active) {
3182
      return;
3183
    }
3184
    if (cb) {
3185
      const newValue = effect.run();
3186
      if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
3187
        if (cleanup) {
3188
          cleanup();
3189
        }
3190
        callWithAsyncErrorHandling(cb, instance, 3, [
3191
          newValue,
3192
          // pass undefined as the old value when it's changed for the first time
3193
          oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
3194
          onCleanup
3195
        ]);
3196
        oldValue = newValue;
3197
      }
3198
    } else {
3199
      effect.run();
3200
    }
3201
  };
3202
  job.allowRecurse = !!cb;
3203
  let scheduler;
3204
  if (flush === "sync") {
3205
    scheduler = job;
3206
  } else if (flush === "post") {
3207
    scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
3208
  } else {
3209
    job.pre = true;
3210
    if (instance)
3211
      job.id = instance.uid;
3212
    scheduler = () => queueJob(job);
3213
  }
3214
  const effect = new ReactiveEffect(getter, scheduler);
3215
  {
3216
    effect.onTrack = onTrack;
3217
    effect.onTrigger = onTrigger;
3218
  }
3219
  if (cb) {
3220
    if (immediate) {
3221
      job();
3222
    } else {
3223
      oldValue = effect.run();
3224
    }
3225
  } else if (flush === "post") {
3226
    queuePostRenderEffect(
3227
      effect.run.bind(effect),
3228
      instance && instance.suspense
3229
    );
3230
  } else {
3231
    effect.run();
3232
  }
3233
  const unwatch = () => {
3234
    effect.stop();
3235
    if (instance && instance.scope) {
3236
      remove(instance.scope.effects, effect);
3237
    }
3238
  };
3239
  return unwatch;
3240
}
3241
function instanceWatch(source, value, options) {
3242
  const publicThis = this.proxy;
3243
  const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
3244
  let cb;
3245
  if (isFunction(value)) {
3246
    cb = value;
3247
  } else {
3248
    cb = value.handler;
3249
    options = value;
3250
  }
3251
  const cur = currentInstance;
3252
  setCurrentInstance(this);
3253
  const res = doWatch(getter, cb.bind(publicThis), options);
3254
  if (cur) {
3255
    setCurrentInstance(cur);
3256
  } else {
3257
    unsetCurrentInstance();
3258
  }
3259
  return res;
3260
}
3261
function createPathGetter(ctx, path) {
3262
  const segments = path.split(".");
3263
  return () => {
3264
    let cur = ctx;
3265
    for (let i = 0; i < segments.length && cur; i++) {
3266
      cur = cur[segments[i]];
3267
    }
3268
    return cur;
3269
  };
3270
}
3271
function traverse(value, seen) {
3272
  if (!isObject(value) || value["__v_skip"]) {
3273
    return value;
3274
  }
3275
  seen = seen || /* @__PURE__ */ new Set();
3276
  if (seen.has(value)) {
3277
    return value;
3278
  }
3279
  seen.add(value);
3280
  if (isRef(value)) {
3281
    traverse(value.value, seen);
3282
  } else if (isArray(value)) {
3283
    for (let i = 0; i < value.length; i++) {
3284
      traverse(value[i], seen);
3285
    }
3286
  } else if (isSet(value) || isMap(value)) {
3287
    value.forEach((v) => {
3288
      traverse(v, seen);
3289
    });
3290
  } else if (isPlainObject(value)) {
3291
    for (const key in value) {
3292
      traverse(value[key], seen);
3293
    }
3294
  }
3295
  return value;
3296
}
3297
 
3298
function validateDirectiveName(name) {
3299
  if (isBuiltInDirective(name)) {
3300
    warn("Do not use built-in directive ids as custom directive id: " + name);
3301
  }
3302
}
3303
function withDirectives(vnode, directives) {
3304
  const internalInstance = currentRenderingInstance;
3305
  if (internalInstance === null) {
3306
    warn(`withDirectives can only be used inside render functions.`);
3307
    return vnode;
3308
  }
3309
  const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
3310
  const bindings = vnode.dirs || (vnode.dirs = []);
3311
  for (let i = 0; i < directives.length; i++) {
3312
    let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
3313
    if (dir) {
3314
      if (isFunction(dir)) {
3315
        dir = {
3316
          mounted: dir,
3317
          updated: dir
3318
        };
3319
      }
3320
      if (dir.deep) {
3321
        traverse(value);
3322
      }
3323
      bindings.push({
3324
        dir,
3325
        instance,
3326
        value,
3327
        oldValue: void 0,
3328
        arg,
3329
        modifiers
3330
      });
3331
    }
3332
  }
3333
  return vnode;
3334
}
3335
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3336
  const bindings = vnode.dirs;
3337
  const oldBindings = prevVNode && prevVNode.dirs;
3338
  for (let i = 0; i < bindings.length; i++) {
3339
    const binding = bindings[i];
3340
    if (oldBindings) {
3341
      binding.oldValue = oldBindings[i].value;
3342
    }
3343
    let hook = binding.dir[name];
3344
    if (hook) {
3345
      pauseTracking();
3346
      callWithAsyncErrorHandling(hook, instance, 8, [
3347
        vnode.el,
3348
        binding,
3349
        vnode,
3350
        prevVNode
3351
      ]);
3352
      resetTracking();
3353
    }
3354
  }
3355
}
3356
 
3357
const leaveCbKey = Symbol("_leaveCb");
3358
const enterCbKey$1 = Symbol("_enterCb");
3359
function useTransitionState() {
3360
  const state = {
3361
    isMounted: false,
3362
    isLeaving: false,
3363
    isUnmounting: false,
3364
    leavingVNodes: /* @__PURE__ */ new Map()
3365
  };
3366
  onMounted(() => {
3367
    state.isMounted = true;
3368
  });
3369
  onBeforeUnmount(() => {
3370
    state.isUnmounting = true;
3371
  });
3372
  return state;
3373
}
3374
const TransitionHookValidator = [Function, Array];
3375
const BaseTransitionPropsValidators = {
3376
  mode: String,
3377
  appear: Boolean,
3378
  persisted: Boolean,
3379
  // enter
3380
  onBeforeEnter: TransitionHookValidator,
3381
  onEnter: TransitionHookValidator,
3382
  onAfterEnter: TransitionHookValidator,
3383
  onEnterCancelled: TransitionHookValidator,
3384
  // leave
3385
  onBeforeLeave: TransitionHookValidator,
3386
  onLeave: TransitionHookValidator,
3387
  onAfterLeave: TransitionHookValidator,
3388
  onLeaveCancelled: TransitionHookValidator,
3389
  // appear
3390
  onBeforeAppear: TransitionHookValidator,
3391
  onAppear: TransitionHookValidator,
3392
  onAfterAppear: TransitionHookValidator,
3393
  onAppearCancelled: TransitionHookValidator
3394
};
3395
const BaseTransitionImpl = {
3396
  name: `BaseTransition`,
3397
  props: BaseTransitionPropsValidators,
3398
  setup(props, { slots }) {
3399
    const instance = getCurrentInstance();
3400
    const state = useTransitionState();
3401
    let prevTransitionKey;
3402
    return () => {
3403
      const children = slots.default && getTransitionRawChildren(slots.default(), true);
3404
      if (!children || !children.length) {
3405
        return;
3406
      }
3407
      let child = children[0];
3408
      if (children.length > 1) {
3409
        let hasFound = false;
3410
        for (const c of children) {
3411
          if (c.type !== Comment) {
3412
            if (hasFound) {
3413
              warn(
3414
                "<transition> can only be used on a single element or component. Use <transition-group> for lists."
3415
              );
3416
              break;
3417
            }
3418
            child = c;
3419
            hasFound = true;
3420
          }
3421
        }
3422
      }
3423
      const rawProps = toRaw(props);
3424
      const { mode } = rawProps;
3425
      if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
3426
        warn(`invalid <transition> mode: ${mode}`);
3427
      }
3428
      if (state.isLeaving) {
3429
        return emptyPlaceholder(child);
3430
      }
3431
      const innerChild = getKeepAliveChild(child);
3432
      if (!innerChild) {
3433
        return emptyPlaceholder(child);
3434
      }
3435
      const enterHooks = resolveTransitionHooks(
3436
        innerChild,
3437
        rawProps,
3438
        state,
3439
        instance
3440
      );
3441
      setTransitionHooks(innerChild, enterHooks);
3442
      const oldChild = instance.subTree;
3443
      const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
3444
      let transitionKeyChanged = false;
3445
      const { getTransitionKey } = innerChild.type;
3446
      if (getTransitionKey) {
3447
        const key = getTransitionKey();
3448
        if (prevTransitionKey === void 0) {
3449
          prevTransitionKey = key;
3450
        } else if (key !== prevTransitionKey) {
3451
          prevTransitionKey = key;
3452
          transitionKeyChanged = true;
3453
        }
3454
      }
3455
      if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {
3456
        const leavingHooks = resolveTransitionHooks(
3457
          oldInnerChild,
3458
          rawProps,
3459
          state,
3460
          instance
3461
        );
3462
        setTransitionHooks(oldInnerChild, leavingHooks);
3463
        if (mode === "out-in") {
3464
          state.isLeaving = true;
3465
          leavingHooks.afterLeave = () => {
3466
            state.isLeaving = false;
3467
            if (instance.update.active !== false) {
3468
              instance.update();
3469
            }
3470
          };
3471
          return emptyPlaceholder(child);
3472
        } else if (mode === "in-out" && innerChild.type !== Comment) {
3473
          leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3474
            const leavingVNodesCache = getLeavingNodesForType(
3475
              state,
3476
              oldInnerChild
3477
            );
3478
            leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3479
            el[leaveCbKey] = () => {
3480
              earlyRemove();
3481
              el[leaveCbKey] = void 0;
3482
              delete enterHooks.delayedLeave;
3483
            };
3484
            enterHooks.delayedLeave = delayedLeave;
3485
          };
3486
        }
3487
      }
3488
      return child;
3489
    };
3490
  }
3491
};
3492
const BaseTransition = BaseTransitionImpl;
3493
function getLeavingNodesForType(state, vnode) {
3494
  const { leavingVNodes } = state;
3495
  let leavingVNodesCache = leavingVNodes.get(vnode.type);
3496
  if (!leavingVNodesCache) {
3497
    leavingVNodesCache = /* @__PURE__ */ Object.create(null);
3498
    leavingVNodes.set(vnode.type, leavingVNodesCache);
3499
  }
3500
  return leavingVNodesCache;
3501
}
3502
function resolveTransitionHooks(vnode, props, state, instance) {
3503
  const {
3504
    appear,
3505
    mode,
3506
    persisted = false,
3507
    onBeforeEnter,
3508
    onEnter,
3509
    onAfterEnter,
3510
    onEnterCancelled,
3511
    onBeforeLeave,
3512
    onLeave,
3513
    onAfterLeave,
3514
    onLeaveCancelled,
3515
    onBeforeAppear,
3516
    onAppear,
3517
    onAfterAppear,
3518
    onAppearCancelled
3519
  } = props;
3520
  const key = String(vnode.key);
3521
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3522
  const callHook = (hook, args) => {
3523
    hook && callWithAsyncErrorHandling(
3524
      hook,
3525
      instance,
3526
      9,
3527
      args
3528
    );
3529
  };
3530
  const callAsyncHook = (hook, args) => {
3531
    const done = args[1];
3532
    callHook(hook, args);
3533
    if (isArray(hook)) {
3534
      if (hook.every((hook2) => hook2.length <= 1))
3535
        done();
3536
    } else if (hook.length <= 1) {
3537
      done();
3538
    }
3539
  };
3540
  const hooks = {
3541
    mode,
3542
    persisted,
3543
    beforeEnter(el) {
3544
      let hook = onBeforeEnter;
3545
      if (!state.isMounted) {
3546
        if (appear) {
3547
          hook = onBeforeAppear || onBeforeEnter;
3548
        } else {
3549
          return;
3550
        }
3551
      }
3552
      if (el[leaveCbKey]) {
3553
        el[leaveCbKey](
3554
          true
3555
          /* cancelled */
3556
        );
3557
      }
3558
      const leavingVNode = leavingVNodesCache[key];
3559
      if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3560
        leavingVNode.el[leaveCbKey]();
3561
      }
3562
      callHook(hook, [el]);
3563
    },
3564
    enter(el) {
3565
      let hook = onEnter;
3566
      let afterHook = onAfterEnter;
3567
      let cancelHook = onEnterCancelled;
3568
      if (!state.isMounted) {
3569
        if (appear) {
3570
          hook = onAppear || onEnter;
3571
          afterHook = onAfterAppear || onAfterEnter;
3572
          cancelHook = onAppearCancelled || onEnterCancelled;
3573
        } else {
3574
          return;
3575
        }
3576
      }
3577
      let called = false;
3578
      const done = el[enterCbKey$1] = (cancelled) => {
3579
        if (called)
3580
          return;
3581
        called = true;
3582
        if (cancelled) {
3583
          callHook(cancelHook, [el]);
3584
        } else {
3585
          callHook(afterHook, [el]);
3586
        }
3587
        if (hooks.delayedLeave) {
3588
          hooks.delayedLeave();
3589
        }
3590
        el[enterCbKey$1] = void 0;
3591
      };
3592
      if (hook) {
3593
        callAsyncHook(hook, [el, done]);
3594
      } else {
3595
        done();
3596
      }
3597
    },
3598
    leave(el, remove) {
3599
      const key2 = String(vnode.key);
3600
      if (el[enterCbKey$1]) {
3601
        el[enterCbKey$1](
3602
          true
3603
          /* cancelled */
3604
        );
3605
      }
3606
      if (state.isUnmounting) {
3607
        return remove();
3608
      }
3609
      callHook(onBeforeLeave, [el]);
3610
      let called = false;
3611
      const done = el[leaveCbKey] = (cancelled) => {
3612
        if (called)
3613
          return;
3614
        called = true;
3615
        remove();
3616
        if (cancelled) {
3617
          callHook(onLeaveCancelled, [el]);
3618
        } else {
3619
          callHook(onAfterLeave, [el]);
3620
        }
3621
        el[leaveCbKey] = void 0;
3622
        if (leavingVNodesCache[key2] === vnode) {
3623
          delete leavingVNodesCache[key2];
3624
        }
3625
      };
3626
      leavingVNodesCache[key2] = vnode;
3627
      if (onLeave) {
3628
        callAsyncHook(onLeave, [el, done]);
3629
      } else {
3630
        done();
3631
      }
3632
    },
3633
    clone(vnode2) {
3634
      return resolveTransitionHooks(vnode2, props, state, instance);
3635
    }
3636
  };
3637
  return hooks;
3638
}
3639
function emptyPlaceholder(vnode) {
3640
  if (isKeepAlive(vnode)) {
3641
    vnode = cloneVNode(vnode);
3642
    vnode.children = null;
3643
    return vnode;
3644
  }
3645
}
3646
function getKeepAliveChild(vnode) {
3647
  return isKeepAlive(vnode) ? vnode.children ? vnode.children[0] : void 0 : vnode;
3648
}
3649
function setTransitionHooks(vnode, hooks) {
3650
  if (vnode.shapeFlag & 6 && vnode.component) {
3651
    setTransitionHooks(vnode.component.subTree, hooks);
3652
  } else if (vnode.shapeFlag & 128) {
3653
    vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3654
    vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3655
  } else {
3656
    vnode.transition = hooks;
3657
  }
3658
}
3659
function getTransitionRawChildren(children, keepComment = false, parentKey) {
3660
  let ret = [];
3661
  let keyedFragmentCount = 0;
3662
  for (let i = 0; i < children.length; i++) {
3663
    let child = children[i];
3664
    const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
3665
    if (child.type === Fragment) {
3666
      if (child.patchFlag & 128)
3667
        keyedFragmentCount++;
3668
      ret = ret.concat(
3669
        getTransitionRawChildren(child.children, keepComment, key)
3670
      );
3671
    } else if (keepComment || child.type !== Comment) {
3672
      ret.push(key != null ? cloneVNode(child, { key }) : child);
3673
    }
3674
  }
3675
  if (keyedFragmentCount > 1) {
3676
    for (let i = 0; i < ret.length; i++) {
3677
      ret[i].patchFlag = -2;
3678
    }
3679
  }
3680
  return ret;
3681
}
3682
 
3683
/*! #__NO_SIDE_EFFECTS__ */
3684
// @__NO_SIDE_EFFECTS__
3685
function defineComponent(options, extraOptions) {
3686
  return isFunction(options) ? (
3687
    // #8326: extend call and options.name access are considered side-effects
3688
    // by Rollup, so we have to wrap it in a pure-annotated IIFE.
3689
    /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
3690
  ) : options;
3691
}
3692
 
3693
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
3694
/*! #__NO_SIDE_EFFECTS__ */
3695
// @__NO_SIDE_EFFECTS__
3696
function defineAsyncComponent(source) {
3697
  if (isFunction(source)) {
3698
    source = { loader: source };
3699
  }
3700
  const {
3701
    loader,
3702
    loadingComponent,
3703
    errorComponent,
3704
    delay = 200,
3705
    timeout,
3706
    // undefined = never times out
3707
    suspensible = true,
3708
    onError: userOnError
3709
  } = source;
3710
  let pendingRequest = null;
3711
  let resolvedComp;
3712
  let retries = 0;
3713
  const retry = () => {
3714
    retries++;
3715
    pendingRequest = null;
3716
    return load();
3717
  };
3718
  const load = () => {
3719
    let thisRequest;
3720
    return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
3721
      err = err instanceof Error ? err : new Error(String(err));
3722
      if (userOnError) {
3723
        return new Promise((resolve, reject) => {
3724
          const userRetry = () => resolve(retry());
3725
          const userFail = () => reject(err);
3726
          userOnError(err, userRetry, userFail, retries + 1);
3727
        });
3728
      } else {
3729
        throw err;
3730
      }
3731
    }).then((comp) => {
3732
      if (thisRequest !== pendingRequest && pendingRequest) {
3733
        return pendingRequest;
3734
      }
3735
      if (!comp) {
3736
        warn(
3737
          `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
3738
        );
3739
      }
3740
      if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
3741
        comp = comp.default;
3742
      }
3743
      if (comp && !isObject(comp) && !isFunction(comp)) {
3744
        throw new Error(`Invalid async component load result: ${comp}`);
3745
      }
3746
      resolvedComp = comp;
3747
      return comp;
3748
    }));
3749
  };
3750
  return defineComponent({
3751
    name: "AsyncComponentWrapper",
3752
    __asyncLoader: load,
3753
    get __asyncResolved() {
3754
      return resolvedComp;
3755
    },
3756
    setup() {
3757
      const instance = currentInstance;
3758
      if (resolvedComp) {
3759
        return () => createInnerComp(resolvedComp, instance);
3760
      }
3761
      const onError = (err) => {
3762
        pendingRequest = null;
3763
        handleError(
3764
          err,
3765
          instance,
3766
          13,
3767
          !errorComponent
3768
          /* do not throw in dev if user provided error component */
3769
        );
3770
      };
3771
      if (suspensible && instance.suspense || false) {
3772
        return load().then((comp) => {
3773
          return () => createInnerComp(comp, instance);
3774
        }).catch((err) => {
3775
          onError(err);
3776
          return () => errorComponent ? createVNode(errorComponent, {
3777
            error: err
3778
          }) : null;
3779
        });
3780
      }
3781
      const loaded = ref(false);
3782
      const error = ref();
3783
      const delayed = ref(!!delay);
3784
      if (delay) {
3785
        setTimeout(() => {
3786
          delayed.value = false;
3787
        }, delay);
3788
      }
3789
      if (timeout != null) {
3790
        setTimeout(() => {
3791
          if (!loaded.value && !error.value) {
3792
            const err = new Error(
3793
              `Async component timed out after ${timeout}ms.`
3794
            );
3795
            onError(err);
3796
            error.value = err;
3797
          }
3798
        }, timeout);
3799
      }
3800
      load().then(() => {
3801
        loaded.value = true;
3802
        if (instance.parent && isKeepAlive(instance.parent.vnode)) {
3803
          queueJob(instance.parent.update);
3804
        }
3805
      }).catch((err) => {
3806
        onError(err);
3807
        error.value = err;
3808
      });
3809
      return () => {
3810
        if (loaded.value && resolvedComp) {
3811
          return createInnerComp(resolvedComp, instance);
3812
        } else if (error.value && errorComponent) {
3813
          return createVNode(errorComponent, {
3814
            error: error.value
3815
          });
3816
        } else if (loadingComponent && !delayed.value) {
3817
          return createVNode(loadingComponent);
3818
        }
3819
      };
3820
    }
3821
  });
3822
}
3823
function createInnerComp(comp, parent) {
3824
  const { ref: ref2, props, children, ce } = parent.vnode;
3825
  const vnode = createVNode(comp, props, children);
3826
  vnode.ref = ref2;
3827
  vnode.ce = ce;
3828
  delete parent.vnode.ce;
3829
  return vnode;
3830
}
3831
 
3832
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
3833
const KeepAliveImpl = {
3834
  name: `KeepAlive`,
3835
  // Marker for special handling inside the renderer. We are not using a ===
3836
  // check directly on KeepAlive in the renderer, because importing it directly
3837
  // would prevent it from being tree-shaken.
3838
  __isKeepAlive: true,
3839
  props: {
3840
    include: [String, RegExp, Array],
3841
    exclude: [String, RegExp, Array],
3842
    max: [String, Number]
3843
  },
3844
  setup(props, { slots }) {
3845
    const instance = getCurrentInstance();
3846
    const sharedContext = instance.ctx;
3847
    const cache = /* @__PURE__ */ new Map();
3848
    const keys = /* @__PURE__ */ new Set();
3849
    let current = null;
3850
    {
3851
      instance.__v_cache = cache;
3852
    }
3853
    const parentSuspense = instance.suspense;
3854
    const {
3855
      renderer: {
3856
        p: patch,
3857
        m: move,
3858
        um: _unmount,
3859
        o: { createElement }
3860
      }
3861
    } = sharedContext;
3862
    const storageContainer = createElement("div");
3863
    sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
3864
      const instance2 = vnode.component;
3865
      move(vnode, container, anchor, 0, parentSuspense);
3866
      patch(
3867
        instance2.vnode,
3868
        vnode,
3869
        container,
3870
        anchor,
3871
        instance2,
3872
        parentSuspense,
3873
        isSVG,
3874
        vnode.slotScopeIds,
3875
        optimized
3876
      );
3877
      queuePostRenderEffect(() => {
3878
        instance2.isDeactivated = false;
3879
        if (instance2.a) {
3880
          invokeArrayFns(instance2.a);
3881
        }
3882
        const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
3883
        if (vnodeHook) {
3884
          invokeVNodeHook(vnodeHook, instance2.parent, vnode);
3885
        }
3886
      }, parentSuspense);
3887
      {
3888
        devtoolsComponentAdded(instance2);
3889
      }
3890
    };
3891
    sharedContext.deactivate = (vnode) => {
3892
      const instance2 = vnode.component;
3893
      move(vnode, storageContainer, null, 1, parentSuspense);
3894
      queuePostRenderEffect(() => {
3895
        if (instance2.da) {
3896
          invokeArrayFns(instance2.da);
3897
        }
3898
        const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
3899
        if (vnodeHook) {
3900
          invokeVNodeHook(vnodeHook, instance2.parent, vnode);
3901
        }
3902
        instance2.isDeactivated = true;
3903
      }, parentSuspense);
3904
      {
3905
        devtoolsComponentAdded(instance2);
3906
      }
3907
    };
3908
    function unmount(vnode) {
3909
      resetShapeFlag(vnode);
3910
      _unmount(vnode, instance, parentSuspense, true);
3911
    }
3912
    function pruneCache(filter) {
3913
      cache.forEach((vnode, key) => {
3914
        const name = getComponentName(vnode.type);
3915
        if (name && (!filter || !filter(name))) {
3916
          pruneCacheEntry(key);
3917
        }
3918
      });
3919
    }
3920
    function pruneCacheEntry(key) {
3921
      const cached = cache.get(key);
3922
      if (!current || !isSameVNodeType(cached, current)) {
3923
        unmount(cached);
3924
      } else if (current) {
3925
        resetShapeFlag(current);
3926
      }
3927
      cache.delete(key);
3928
      keys.delete(key);
3929
    }
3930
    watch(
3931
      () => [props.include, props.exclude],
3932
      ([include, exclude]) => {
3933
        include && pruneCache((name) => matches(include, name));
3934
        exclude && pruneCache((name) => !matches(exclude, name));
3935
      },
3936
      // prune post-render after `current` has been updated
3937
      { flush: "post", deep: true }
3938
    );
3939
    let pendingCacheKey = null;
3940
    const cacheSubtree = () => {
3941
      if (pendingCacheKey != null) {
3942
        cache.set(pendingCacheKey, getInnerChild(instance.subTree));
3943
      }
3944
    };
3945
    onMounted(cacheSubtree);
3946
    onUpdated(cacheSubtree);
3947
    onBeforeUnmount(() => {
3948
      cache.forEach((cached) => {
3949
        const { subTree, suspense } = instance;
3950
        const vnode = getInnerChild(subTree);
3951
        if (cached.type === vnode.type && cached.key === vnode.key) {
3952
          resetShapeFlag(vnode);
3953
          const da = vnode.component.da;
3954
          da && queuePostRenderEffect(da, suspense);
3955
          return;
3956
        }
3957
        unmount(cached);
3958
      });
3959
    });
3960
    return () => {
3961
      pendingCacheKey = null;
3962
      if (!slots.default) {
3963
        return null;
3964
      }
3965
      const children = slots.default();
3966
      const rawVNode = children[0];
3967
      if (children.length > 1) {
3968
        {
3969
          warn(`KeepAlive should contain exactly one component child.`);
3970
        }
3971
        current = null;
3972
        return children;
3973
      } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
3974
        current = null;
3975
        return rawVNode;
3976
      }
3977
      let vnode = getInnerChild(rawVNode);
3978
      const comp = vnode.type;
3979
      const name = getComponentName(
3980
        isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
3981
      );
3982
      const { include, exclude, max } = props;
3983
      if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
3984
        current = vnode;
3985
        return rawVNode;
3986
      }
3987
      const key = vnode.key == null ? comp : vnode.key;
3988
      const cachedVNode = cache.get(key);
3989
      if (vnode.el) {
3990
        vnode = cloneVNode(vnode);
3991
        if (rawVNode.shapeFlag & 128) {
3992
          rawVNode.ssContent = vnode;
3993
        }
3994
      }
3995
      pendingCacheKey = key;
3996
      if (cachedVNode) {
3997
        vnode.el = cachedVNode.el;
3998
        vnode.component = cachedVNode.component;
3999
        if (vnode.transition) {
4000
          setTransitionHooks(vnode, vnode.transition);
4001
        }
4002
        vnode.shapeFlag |= 512;
4003
        keys.delete(key);
4004
        keys.add(key);
4005
      } else {
4006
        keys.add(key);
4007
        if (max && keys.size > parseInt(max, 10)) {
4008
          pruneCacheEntry(keys.values().next().value);
4009
        }
4010
      }
4011
      vnode.shapeFlag |= 256;
4012
      current = vnode;
4013
      return isSuspense(rawVNode.type) ? rawVNode : vnode;
4014
    };
4015
  }
4016
};
4017
const KeepAlive = KeepAliveImpl;
4018
function matches(pattern, name) {
4019
  if (isArray(pattern)) {
4020
    return pattern.some((p) => matches(p, name));
4021
  } else if (isString(pattern)) {
4022
    return pattern.split(",").includes(name);
4023
  } else if (isRegExp(pattern)) {
4024
    return pattern.test(name);
4025
  }
4026
  return false;
4027
}
4028
function onActivated(hook, target) {
4029
  registerKeepAliveHook(hook, "a", target);
4030
}
4031
function onDeactivated(hook, target) {
4032
  registerKeepAliveHook(hook, "da", target);
4033
}
4034
function registerKeepAliveHook(hook, type, target = currentInstance) {
4035
  const wrappedHook = hook.__wdc || (hook.__wdc = () => {
4036
    let current = target;
4037
    while (current) {
4038
      if (current.isDeactivated) {
4039
        return;
4040
      }
4041
      current = current.parent;
4042
    }
4043
    return hook();
4044
  });
4045
  injectHook(type, wrappedHook, target);
4046
  if (target) {
4047
    let current = target.parent;
4048
    while (current && current.parent) {
4049
      if (isKeepAlive(current.parent.vnode)) {
4050
        injectToKeepAliveRoot(wrappedHook, type, target, current);
4051
      }
4052
      current = current.parent;
4053
    }
4054
  }
4055
}
4056
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4057
  const injected = injectHook(
4058
    type,
4059
    hook,
4060
    keepAliveRoot,
4061
    true
4062
    /* prepend */
4063
  );
4064
  onUnmounted(() => {
4065
    remove(keepAliveRoot[type], injected);
4066
  }, target);
4067
}
4068
function resetShapeFlag(vnode) {
4069
  vnode.shapeFlag &= ~256;
4070
  vnode.shapeFlag &= ~512;
4071
}
4072
function getInnerChild(vnode) {
4073
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
4074
}
4075
 
4076
function injectHook(type, hook, target = currentInstance, prepend = false) {
4077
  if (target) {
4078
    const hooks = target[type] || (target[type] = []);
4079
    const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
4080
      if (target.isUnmounted) {
4081
        return;
4082
      }
4083
      pauseTracking();
4084
      setCurrentInstance(target);
4085
      const res = callWithAsyncErrorHandling(hook, target, type, args);
4086
      unsetCurrentInstance();
4087
      resetTracking();
4088
      return res;
4089
    });
4090
    if (prepend) {
4091
      hooks.unshift(wrappedHook);
4092
    } else {
4093
      hooks.push(wrappedHook);
4094
    }
4095
    return wrappedHook;
4096
  } else {
4097
    const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ""));
4098
    warn(
4099
      `${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.` )
4100
    );
4101
  }
4102
}
4103
const createHook = (lifecycle) => (hook, target = currentInstance) => (
4104
  // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
4105
  (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
4106
);
4107
const onBeforeMount = createHook("bm");
4108
const onMounted = createHook("m");
4109
const onBeforeUpdate = createHook("bu");
4110
const onUpdated = createHook("u");
4111
const onBeforeUnmount = createHook("bum");
4112
const onUnmounted = createHook("um");
4113
const onServerPrefetch = createHook("sp");
4114
const onRenderTriggered = createHook(
4115
  "rtg"
4116
);
4117
const onRenderTracked = createHook(
4118
  "rtc"
4119
);
4120
function onErrorCaptured(hook, target = currentInstance) {
4121
  injectHook("ec", hook, target);
4122
}
4123
 
4124
const COMPONENTS = "components";
4125
const DIRECTIVES = "directives";
4126
function resolveComponent(name, maybeSelfReference) {
4127
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
4128
}
4129
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
4130
function resolveDynamicComponent(component) {
4131
  if (isString(component)) {
4132
    return resolveAsset(COMPONENTS, component, false) || component;
4133
  } else {
4134
    return component || NULL_DYNAMIC_COMPONENT;
4135
  }
4136
}
4137
function resolveDirective(name) {
4138
  return resolveAsset(DIRECTIVES, name);
4139
}
4140
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
4141
  const instance = currentRenderingInstance || currentInstance;
4142
  if (instance) {
4143
    const Component = instance.type;
4144
    if (type === COMPONENTS) {
4145
      const selfName = getComponentName(
4146
        Component,
4147
        false
4148
        /* do not include inferred name to avoid breaking existing code */
4149
      );
4150
      if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
4151
        return Component;
4152
      }
4153
    }
4154
    const res = (
4155
      // local registration
4156
      // check instance[type] first which is resolved for options API
4157
      resolve(instance[type] || Component[type], name) || // global registration
4158
      resolve(instance.appContext[type], name)
4159
    );
4160
    if (!res && maybeSelfReference) {
4161
      return Component;
4162
    }
4163
    if (warnMissing && !res) {
4164
      const extra = type === COMPONENTS ? `
4165
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
4166
      warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
4167
    }
4168
    return res;
4169
  } else {
4170
    warn(
4171
      `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
4172
    );
4173
  }
4174
}
4175
function resolve(registry, name) {
4176
  return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
4177
}
4178
 
4179
function renderList(source, renderItem, cache, index) {
4180
  let ret;
4181
  const cached = cache && cache[index];
4182
  if (isArray(source) || isString(source)) {
4183
    ret = new Array(source.length);
4184
    for (let i = 0, l = source.length; i < l; i++) {
4185
      ret[i] = renderItem(source[i], i, void 0, cached && cached[i]);
4186
    }
4187
  } else if (typeof source === "number") {
4188
    if (!Number.isInteger(source)) {
4189
      warn(`The v-for range expect an integer value but got ${source}.`);
4190
    }
4191
    ret = new Array(source);
4192
    for (let i = 0; i < source; i++) {
4193
      ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
4194
    }
4195
  } else if (isObject(source)) {
4196
    if (source[Symbol.iterator]) {
4197
      ret = Array.from(
4198
        source,
4199
        (item, i) => renderItem(item, i, void 0, cached && cached[i])
4200
      );
4201
    } else {
4202
      const keys = Object.keys(source);
4203
      ret = new Array(keys.length);
4204
      for (let i = 0, l = keys.length; i < l; i++) {
4205
        const key = keys[i];
4206
        ret[i] = renderItem(source[key], key, i, cached && cached[i]);
4207
      }
4208
    }
4209
  } else {
4210
    ret = [];
4211
  }
4212
  if (cache) {
4213
    cache[index] = ret;
4214
  }
4215
  return ret;
4216
}
4217
 
4218
function createSlots(slots, dynamicSlots) {
4219
  for (let i = 0; i < dynamicSlots.length; i++) {
4220
    const slot = dynamicSlots[i];
4221
    if (isArray(slot)) {
4222
      for (let j = 0; j < slot.length; j++) {
4223
        slots[slot[j].name] = slot[j].fn;
4224
      }
4225
    } else if (slot) {
4226
      slots[slot.name] = slot.key ? (...args) => {
4227
        const res = slot.fn(...args);
4228
        if (res)
4229
          res.key = slot.key;
4230
        return res;
4231
      } : slot.fn;
4232
    }
4233
  }
4234
  return slots;
4235
}
4236
 
4237
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4238
  if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
4239
    if (name !== "default")
4240
      props.name = name;
4241
    return createVNode("slot", props, fallback && fallback());
4242
  }
4243
  let slot = slots[name];
4244
  if (slot && slot.length > 1) {
4245
    warn(
4246
      `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.`
4247
    );
4248
    slot = () => [];
4249
  }
4250
  if (slot && slot._c) {
4251
    slot._d = false;
4252
  }
4253
  openBlock();
4254
  const validSlotContent = slot && ensureValidVNode(slot(props));
4255
  const rendered = createBlock(
4256
    Fragment,
4257
    {
4258
      key: props.key || // slot content array of a dynamic conditional slot may have a branch
4259
      // key attached in the `createSlots` helper, respect that
4260
      validSlotContent && validSlotContent.key || `_${name}`
4261
    },
4262
    validSlotContent || (fallback ? fallback() : []),
4263
    validSlotContent && slots._ === 1 ? 64 : -2
4264
  );
4265
  if (!noSlotted && rendered.scopeId) {
4266
    rendered.slotScopeIds = [rendered.scopeId + "-s"];
4267
  }
4268
  if (slot && slot._c) {
4269
    slot._d = true;
4270
  }
4271
  return rendered;
4272
}
4273
function ensureValidVNode(vnodes) {
4274
  return vnodes.some((child) => {
4275
    if (!isVNode(child))
4276
      return true;
4277
    if (child.type === Comment)
4278
      return false;
4279
    if (child.type === Fragment && !ensureValidVNode(child.children))
4280
      return false;
4281
    return true;
4282
  }) ? vnodes : null;
4283
}
4284
 
4285
function toHandlers(obj, preserveCaseIfNecessary) {
4286
  const ret = {};
4287
  if (!isObject(obj)) {
4288
    warn(`v-on with no argument expects an object value.`);
4289
    return ret;
4290
  }
4291
  for (const key in obj) {
4292
    ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
4293
  }
4294
  return ret;
4295
}
4296
 
4297
const getPublicInstance = (i) => {
4298
  if (!i)
4299
    return null;
4300
  if (isStatefulComponent(i))
4301
    return getExposeProxy(i) || i.proxy;
4302
  return getPublicInstance(i.parent);
4303
};
4304
const publicPropertiesMap = (
4305
  // Move PURE marker to new line to workaround compiler discarding it
4306
  // due to type annotation
4307
  /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
4308
    $: (i) => i,
4309
    $el: (i) => i.vnode.el,
4310
    $data: (i) => i.data,
4311
    $props: (i) => shallowReadonly(i.props) ,
4312
    $attrs: (i) => shallowReadonly(i.attrs) ,
4313
    $slots: (i) => shallowReadonly(i.slots) ,
4314
    $refs: (i) => shallowReadonly(i.refs) ,
4315
    $parent: (i) => getPublicInstance(i.parent),
4316
    $root: (i) => getPublicInstance(i.root),
4317
    $emit: (i) => i.emit,
4318
    $options: (i) => resolveMergedOptions(i) ,
4319
    $forceUpdate: (i) => i.f || (i.f = () => queueJob(i.update)),
4320
    $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
4321
    $watch: (i) => instanceWatch.bind(i)
4322
  })
4323
);
4324
const isReservedPrefix = (key) => key === "_" || key === "$";
4325
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
4326
const PublicInstanceProxyHandlers = {
4327
  get({ _: instance }, key) {
4328
    const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
4329
    if (key === "__isVue") {
4330
      return true;
4331
    }
4332
    let normalizedProps;
4333
    if (key[0] !== "$") {
4334
      const n = accessCache[key];
4335
      if (n !== void 0) {
4336
        switch (n) {
4337
          case 1 /* SETUP */:
4338
            return setupState[key];
4339
          case 2 /* DATA */:
4340
            return data[key];
4341
          case 4 /* CONTEXT */:
4342
            return ctx[key];
4343
          case 3 /* PROPS */:
4344
            return props[key];
4345
        }
4346
      } else if (hasSetupBinding(setupState, key)) {
4347
        accessCache[key] = 1 /* SETUP */;
4348
        return setupState[key];
4349
      } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
4350
        accessCache[key] = 2 /* DATA */;
4351
        return data[key];
4352
      } else if (
4353
        // only cache other properties when instance has declared (thus stable)
4354
        // props
4355
        (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
4356
      ) {
4357
        accessCache[key] = 3 /* PROPS */;
4358
        return props[key];
4359
      } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
4360
        accessCache[key] = 4 /* CONTEXT */;
4361
        return ctx[key];
4362
      } else if (shouldCacheAccess) {
4363
        accessCache[key] = 0 /* OTHER */;
4364
      }
4365
    }
4366
    const publicGetter = publicPropertiesMap[key];
4367
    let cssModule, globalProperties;
4368
    if (publicGetter) {
4369
      if (key === "$attrs") {
4370
        track(instance, "get", key);
4371
        markAttrsAccessed();
4372
      } else if (key === "$slots") {
4373
        track(instance, "get", key);
4374
      }
4375
      return publicGetter(instance);
4376
    } else if (
4377
      // css module (injected by vue-loader)
4378
      (cssModule = type.__cssModules) && (cssModule = cssModule[key])
4379
    ) {
4380
      return cssModule;
4381
    } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
4382
      accessCache[key] = 4 /* CONTEXT */;
4383
      return ctx[key];
4384
    } else if (
4385
      // global properties
4386
      globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
4387
    ) {
4388
      {
4389
        return globalProperties[key];
4390
      }
4391
    } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
4392
    // to infinite warning loop
4393
    key.indexOf("__v") !== 0)) {
4394
      if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
4395
        warn(
4396
          `Property ${JSON.stringify(
4397
            key
4398
          )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
4399
        );
4400
      } else if (instance === currentRenderingInstance) {
4401
        warn(
4402
          `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
4403
        );
4404
      }
4405
    }
4406
  },
4407
  set({ _: instance }, key, value) {
4408
    const { data, setupState, ctx } = instance;
4409
    if (hasSetupBinding(setupState, key)) {
4410
      setupState[key] = value;
4411
      return true;
4412
    } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
4413
      warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
4414
      return false;
4415
    } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
4416
      data[key] = value;
4417
      return true;
4418
    } else if (hasOwn(instance.props, key)) {
4419
      warn(`Attempting to mutate prop "${key}". Props are readonly.`);
4420
      return false;
4421
    }
4422
    if (key[0] === "$" && key.slice(1) in instance) {
4423
      warn(
4424
        `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
4425
      );
4426
      return false;
4427
    } else {
4428
      if (key in instance.appContext.config.globalProperties) {
4429
        Object.defineProperty(ctx, key, {
4430
          enumerable: true,
4431
          configurable: true,
4432
          value
4433
        });
4434
      } else {
4435
        ctx[key] = value;
4436
      }
4437
    }
4438
    return true;
4439
  },
4440
  has({
4441
    _: { data, setupState, accessCache, ctx, appContext, propsOptions }
4442
  }, key) {
4443
    let normalizedProps;
4444
    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);
4445
  },
4446
  defineProperty(target, key, descriptor) {
4447
    if (descriptor.get != null) {
4448
      target._.accessCache[key] = 0;
4449
    } else if (hasOwn(descriptor, "value")) {
4450
      this.set(target, key, descriptor.value, null);
4451
    }
4452
    return Reflect.defineProperty(target, key, descriptor);
4453
  }
4454
};
4455
{
4456
  PublicInstanceProxyHandlers.ownKeys = (target) => {
4457
    warn(
4458
      `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
4459
    );
4460
    return Reflect.ownKeys(target);
4461
  };
4462
}
4463
const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
4464
  {},
4465
  PublicInstanceProxyHandlers,
4466
  {
4467
    get(target, key) {
4468
      if (key === Symbol.unscopables) {
4469
        return;
4470
      }
4471
      return PublicInstanceProxyHandlers.get(target, key, target);
4472
    },
4473
    has(_, key) {
4474
      const has = key[0] !== "_" && !isGloballyAllowed(key);
4475
      if (!has && PublicInstanceProxyHandlers.has(_, key)) {
4476
        warn(
4477
          `Property ${JSON.stringify(
4478
            key
4479
          )} should not start with _ which is a reserved prefix for Vue internals.`
4480
        );
4481
      }
4482
      return has;
4483
    }
4484
  }
4485
);
4486
function createDevRenderContext(instance) {
4487
  const target = {};
4488
  Object.defineProperty(target, `_`, {
4489
    configurable: true,
4490
    enumerable: false,
4491
    get: () => instance
4492
  });
4493
  Object.keys(publicPropertiesMap).forEach((key) => {
4494
    Object.defineProperty(target, key, {
4495
      configurable: true,
4496
      enumerable: false,
4497
      get: () => publicPropertiesMap[key](instance),
4498
      // intercepted by the proxy so no need for implementation,
4499
      // but needed to prevent set errors
4500
      set: NOOP
4501
    });
4502
  });
4503
  return target;
4504
}
4505
function exposePropsOnRenderContext(instance) {
4506
  const {
4507
    ctx,
4508
    propsOptions: [propsOptions]
4509
  } = instance;
4510
  if (propsOptions) {
4511
    Object.keys(propsOptions).forEach((key) => {
4512
      Object.defineProperty(ctx, key, {
4513
        enumerable: true,
4514
        configurable: true,
4515
        get: () => instance.props[key],
4516
        set: NOOP
4517
      });
4518
    });
4519
  }
4520
}
4521
function exposeSetupStateOnRenderContext(instance) {
4522
  const { ctx, setupState } = instance;
4523
  Object.keys(toRaw(setupState)).forEach((key) => {
4524
    if (!setupState.__isScriptSetup) {
4525
      if (isReservedPrefix(key[0])) {
4526
        warn(
4527
          `setup() return property ${JSON.stringify(
4528
            key
4529
          )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
4530
        );
4531
        return;
4532
      }
4533
      Object.defineProperty(ctx, key, {
4534
        enumerable: true,
4535
        configurable: true,
4536
        get: () => setupState[key],
4537
        set: NOOP
4538
      });
4539
    }
4540
  });
4541
}
4542
 
4543
const warnRuntimeUsage = (method) => warn(
4544
  `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
4545
);
4546
function defineProps() {
4547
  {
4548
    warnRuntimeUsage(`defineProps`);
4549
  }
4550
  return null;
4551
}
4552
function defineEmits() {
4553
  {
4554
    warnRuntimeUsage(`defineEmits`);
4555
  }
4556
  return null;
4557
}
4558
function defineExpose(exposed) {
4559
  {
4560
    warnRuntimeUsage(`defineExpose`);
4561
  }
4562
}
4563
function defineOptions(options) {
4564
  {
4565
    warnRuntimeUsage(`defineOptions`);
4566
  }
4567
}
4568
function defineSlots() {
4569
  {
4570
    warnRuntimeUsage(`defineSlots`);
4571
  }
4572
  return null;
4573
}
4574
function defineModel() {
4575
  {
4576
    warnRuntimeUsage("defineModel");
4577
  }
4578
}
4579
function withDefaults(props, defaults) {
4580
  {
4581
    warnRuntimeUsage(`withDefaults`);
4582
  }
4583
  return null;
4584
}
4585
function useSlots() {
4586
  return getContext().slots;
4587
}
4588
function useAttrs() {
4589
  return getContext().attrs;
4590
}
4591
function useModel(props, name, options) {
4592
  const i = getCurrentInstance();
4593
  if (!i) {
4594
    warn(`useModel() called without active instance.`);
4595
    return ref();
4596
  }
4597
  if (!i.propsOptions[0][name]) {
4598
    warn(`useModel() called with prop "${name}" which is not declared.`);
4599
    return ref();
4600
  }
4601
  if (options && options.local) {
4602
    const proxy = ref(props[name]);
4603
    watch(
4604
      () => props[name],
4605
      (v) => proxy.value = v
4606
    );
4607
    watch(proxy, (value) => {
4608
      if (value !== props[name]) {
4609
        i.emit(`update:${name}`, value);
4610
      }
4611
    });
4612
    return proxy;
4613
  } else {
4614
    return {
4615
      __v_isRef: true,
4616
      get value() {
4617
        return props[name];
4618
      },
4619
      set value(value) {
4620
        i.emit(`update:${name}`, value);
4621
      }
4622
    };
4623
  }
4624
}
4625
function getContext() {
4626
  const i = getCurrentInstance();
4627
  if (!i) {
4628
    warn(`useContext() called without active instance.`);
4629
  }
4630
  return i.setupContext || (i.setupContext = createSetupContext(i));
4631
}
4632
function normalizePropsOrEmits(props) {
4633
  return isArray(props) ? props.reduce(
4634
    (normalized, p) => (normalized[p] = null, normalized),
4635
    {}
4636
  ) : props;
4637
}
4638
function mergeDefaults(raw, defaults) {
4639
  const props = normalizePropsOrEmits(raw);
4640
  for (const key in defaults) {
4641
    if (key.startsWith("__skip"))
4642
      continue;
4643
    let opt = props[key];
4644
    if (opt) {
4645
      if (isArray(opt) || isFunction(opt)) {
4646
        opt = props[key] = { type: opt, default: defaults[key] };
4647
      } else {
4648
        opt.default = defaults[key];
4649
      }
4650
    } else if (opt === null) {
4651
      opt = props[key] = { default: defaults[key] };
4652
    } else {
4653
      warn(`props default key "${key}" has no corresponding declaration.`);
4654
    }
4655
    if (opt && defaults[`__skip_${key}`]) {
4656
      opt.skipFactory = true;
4657
    }
4658
  }
4659
  return props;
4660
}
4661
function mergeModels(a, b) {
4662
  if (!a || !b)
4663
    return a || b;
4664
  if (isArray(a) && isArray(b))
4665
    return a.concat(b);
4666
  return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
4667
}
4668
function createPropsRestProxy(props, excludedKeys) {
4669
  const ret = {};
4670
  for (const key in props) {
4671
    if (!excludedKeys.includes(key)) {
4672
      Object.defineProperty(ret, key, {
4673
        enumerable: true,
4674
        get: () => props[key]
4675
      });
4676
    }
4677
  }
4678
  return ret;
4679
}
4680
function withAsyncContext(getAwaitable) {
4681
  const ctx = getCurrentInstance();
4682
  if (!ctx) {
4683
    warn(
4684
      `withAsyncContext called without active current instance. This is likely a bug.`
4685
    );
4686
  }
4687
  let awaitable = getAwaitable();
4688
  unsetCurrentInstance();
4689
  if (isPromise(awaitable)) {
4690
    awaitable = awaitable.catch((e) => {
4691
      setCurrentInstance(ctx);
4692
      throw e;
4693
    });
4694
  }
4695
  return [awaitable, () => setCurrentInstance(ctx)];
4696
}
4697
 
4698
function createDuplicateChecker() {
4699
  const cache = /* @__PURE__ */ Object.create(null);
4700
  return (type, key) => {
4701
    if (cache[key]) {
4702
      warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
4703
    } else {
4704
      cache[key] = type;
4705
    }
4706
  };
4707
}
4708
let shouldCacheAccess = true;
4709
function applyOptions(instance) {
4710
  const options = resolveMergedOptions(instance);
4711
  const publicThis = instance.proxy;
4712
  const ctx = instance.ctx;
4713
  shouldCacheAccess = false;
4714
  if (options.beforeCreate) {
4715
    callHook$1(options.beforeCreate, instance, "bc");
4716
  }
4717
  const {
4718
    // state
4719
    data: dataOptions,
4720
    computed: computedOptions,
4721
    methods,
4722
    watch: watchOptions,
4723
    provide: provideOptions,
4724
    inject: injectOptions,
4725
    // lifecycle
4726
    created,
4727
    beforeMount,
4728
    mounted,
4729
    beforeUpdate,
4730
    updated,
4731
    activated,
4732
    deactivated,
4733
    beforeDestroy,
4734
    beforeUnmount,
4735
    destroyed,
4736
    unmounted,
4737
    render,
4738
    renderTracked,
4739
    renderTriggered,
4740
    errorCaptured,
4741
    serverPrefetch,
4742
    // public API
4743
    expose,
4744
    inheritAttrs,
4745
    // assets
4746
    components,
4747
    directives,
4748
    filters
4749
  } = options;
4750
  const checkDuplicateProperties = createDuplicateChecker() ;
4751
  {
4752
    const [propsOptions] = instance.propsOptions;
4753
    if (propsOptions) {
4754
      for (const key in propsOptions) {
4755
        checkDuplicateProperties("Props" /* PROPS */, key);
4756
      }
4757
    }
4758
  }
4759
  if (injectOptions) {
4760
    resolveInjections(injectOptions, ctx, checkDuplicateProperties);
4761
  }
4762
  if (methods) {
4763
    for (const key in methods) {
4764
      const methodHandler = methods[key];
4765
      if (isFunction(methodHandler)) {
4766
        {
4767
          Object.defineProperty(ctx, key, {
4768
            value: methodHandler.bind(publicThis),
4769
            configurable: true,
4770
            enumerable: true,
4771
            writable: true
4772
          });
4773
        }
4774
        {
4775
          checkDuplicateProperties("Methods" /* METHODS */, key);
4776
        }
4777
      } else {
4778
        warn(
4779
          `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
4780
        );
4781
      }
4782
    }
4783
  }
4784
  if (dataOptions) {
4785
    if (!isFunction(dataOptions)) {
4786
      warn(
4787
        `The data option must be a function. Plain object usage is no longer supported.`
4788
      );
4789
    }
4790
    const data = dataOptions.call(publicThis, publicThis);
4791
    if (isPromise(data)) {
4792
      warn(
4793
        `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
4794
      );
4795
    }
4796
    if (!isObject(data)) {
4797
      warn(`data() should return an object.`);
4798
    } else {
4799
      instance.data = reactive(data);
4800
      {
4801
        for (const key in data) {
4802
          checkDuplicateProperties("Data" /* DATA */, key);
4803
          if (!isReservedPrefix(key[0])) {
4804
            Object.defineProperty(ctx, key, {
4805
              configurable: true,
4806
              enumerable: true,
4807
              get: () => data[key],
4808
              set: NOOP
4809
            });
4810
          }
4811
        }
4812
      }
4813
    }
4814
  }
4815
  shouldCacheAccess = true;
4816
  if (computedOptions) {
4817
    for (const key in computedOptions) {
4818
      const opt = computedOptions[key];
4819
      const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
4820
      if (get === NOOP) {
4821
        warn(`Computed property "${key}" has no getter.`);
4822
      }
4823
      const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
4824
        warn(
4825
          `Write operation failed: computed property "${key}" is readonly.`
4826
        );
4827
      } ;
4828
      const c = computed({
4829
        get,
4830
        set
4831
      });
4832
      Object.defineProperty(ctx, key, {
4833
        enumerable: true,
4834
        configurable: true,
4835
        get: () => c.value,
4836
        set: (v) => c.value = v
4837
      });
4838
      {
4839
        checkDuplicateProperties("Computed" /* COMPUTED */, key);
4840
      }
4841
    }
4842
  }
4843
  if (watchOptions) {
4844
    for (const key in watchOptions) {
4845
      createWatcher(watchOptions[key], ctx, publicThis, key);
4846
    }
4847
  }
4848
  if (provideOptions) {
4849
    const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
4850
    Reflect.ownKeys(provides).forEach((key) => {
4851
      provide(key, provides[key]);
4852
    });
4853
  }
4854
  if (created) {
4855
    callHook$1(created, instance, "c");
4856
  }
4857
  function registerLifecycleHook(register, hook) {
4858
    if (isArray(hook)) {
4859
      hook.forEach((_hook) => register(_hook.bind(publicThis)));
4860
    } else if (hook) {
4861
      register(hook.bind(publicThis));
4862
    }
4863
  }
4864
  registerLifecycleHook(onBeforeMount, beforeMount);
4865
  registerLifecycleHook(onMounted, mounted);
4866
  registerLifecycleHook(onBeforeUpdate, beforeUpdate);
4867
  registerLifecycleHook(onUpdated, updated);
4868
  registerLifecycleHook(onActivated, activated);
4869
  registerLifecycleHook(onDeactivated, deactivated);
4870
  registerLifecycleHook(onErrorCaptured, errorCaptured);
4871
  registerLifecycleHook(onRenderTracked, renderTracked);
4872
  registerLifecycleHook(onRenderTriggered, renderTriggered);
4873
  registerLifecycleHook(onBeforeUnmount, beforeUnmount);
4874
  registerLifecycleHook(onUnmounted, unmounted);
4875
  registerLifecycleHook(onServerPrefetch, serverPrefetch);
4876
  if (isArray(expose)) {
4877
    if (expose.length) {
4878
      const exposed = instance.exposed || (instance.exposed = {});
4879
      expose.forEach((key) => {
4880
        Object.defineProperty(exposed, key, {
4881
          get: () => publicThis[key],
4882
          set: (val) => publicThis[key] = val
4883
        });
4884
      });
4885
    } else if (!instance.exposed) {
4886
      instance.exposed = {};
4887
    }
4888
  }
4889
  if (render && instance.render === NOOP) {
4890
    instance.render = render;
4891
  }
4892
  if (inheritAttrs != null) {
4893
    instance.inheritAttrs = inheritAttrs;
4894
  }
4895
  if (components)
4896
    instance.components = components;
4897
  if (directives)
4898
    instance.directives = directives;
4899
}
4900
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
4901
  if (isArray(injectOptions)) {
4902
    injectOptions = normalizeInject(injectOptions);
4903
  }
4904
  for (const key in injectOptions) {
4905
    const opt = injectOptions[key];
4906
    let injected;
4907
    if (isObject(opt)) {
4908
      if ("default" in opt) {
4909
        injected = inject(
4910
          opt.from || key,
4911
          opt.default,
4912
          true
4913
          /* treat default function as factory */
4914
        );
4915
      } else {
4916
        injected = inject(opt.from || key);
4917
      }
4918
    } else {
4919
      injected = inject(opt);
4920
    }
4921
    if (isRef(injected)) {
4922
      Object.defineProperty(ctx, key, {
4923
        enumerable: true,
4924
        configurable: true,
4925
        get: () => injected.value,
4926
        set: (v) => injected.value = v
4927
      });
4928
    } else {
4929
      ctx[key] = injected;
4930
    }
4931
    {
4932
      checkDuplicateProperties("Inject" /* INJECT */, key);
4933
    }
4934
  }
4935
}
4936
function callHook$1(hook, instance, type) {
4937
  callWithAsyncErrorHandling(
4938
    isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
4939
    instance,
4940
    type
4941
  );
4942
}
4943
function createWatcher(raw, ctx, publicThis, key) {
4944
  const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
4945
  if (isString(raw)) {
4946
    const handler = ctx[raw];
4947
    if (isFunction(handler)) {
4948
      watch(getter, handler);
4949
    } else {
4950
      warn(`Invalid watch handler specified by key "${raw}"`, handler);
4951
    }
4952
  } else if (isFunction(raw)) {
4953
    watch(getter, raw.bind(publicThis));
4954
  } else if (isObject(raw)) {
4955
    if (isArray(raw)) {
4956
      raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
4957
    } else {
4958
      const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
4959
      if (isFunction(handler)) {
4960
        watch(getter, handler, raw);
4961
      } else {
4962
        warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);
4963
      }
4964
    }
4965
  } else {
4966
    warn(`Invalid watch option: "${key}"`, raw);
4967
  }
4968
}
4969
function resolveMergedOptions(instance) {
4970
  const base = instance.type;
4971
  const { mixins, extends: extendsOptions } = base;
4972
  const {
4973
    mixins: globalMixins,
4974
    optionsCache: cache,
4975
    config: { optionMergeStrategies }
4976
  } = instance.appContext;
4977
  const cached = cache.get(base);
4978
  let resolved;
4979
  if (cached) {
4980
    resolved = cached;
4981
  } else if (!globalMixins.length && !mixins && !extendsOptions) {
4982
    {
4983
      resolved = base;
4984
    }
4985
  } else {
4986
    resolved = {};
4987
    if (globalMixins.length) {
4988
      globalMixins.forEach(
4989
        (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
4990
      );
4991
    }
4992
    mergeOptions(resolved, base, optionMergeStrategies);
4993
  }
4994
  if (isObject(base)) {
4995
    cache.set(base, resolved);
4996
  }
4997
  return resolved;
4998
}
4999
function mergeOptions(to, from, strats, asMixin = false) {
5000
  const { mixins, extends: extendsOptions } = from;
5001
  if (extendsOptions) {
5002
    mergeOptions(to, extendsOptions, strats, true);
5003
  }
5004
  if (mixins) {
5005
    mixins.forEach(
5006
      (m) => mergeOptions(to, m, strats, true)
5007
    );
5008
  }
5009
  for (const key in from) {
5010
    if (asMixin && key === "expose") {
5011
      warn(
5012
        `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
5013
      );
5014
    } else {
5015
      const strat = internalOptionMergeStrats[key] || strats && strats[key];
5016
      to[key] = strat ? strat(to[key], from[key]) : from[key];
5017
    }
5018
  }
5019
  return to;
5020
}
5021
const internalOptionMergeStrats = {
5022
  data: mergeDataFn,
5023
  props: mergeEmitsOrPropsOptions,
5024
  emits: mergeEmitsOrPropsOptions,
5025
  // objects
5026
  methods: mergeObjectOptions,
5027
  computed: mergeObjectOptions,
5028
  // lifecycle
5029
  beforeCreate: mergeAsArray$1,
5030
  created: mergeAsArray$1,
5031
  beforeMount: mergeAsArray$1,
5032
  mounted: mergeAsArray$1,
5033
  beforeUpdate: mergeAsArray$1,
5034
  updated: mergeAsArray$1,
5035
  beforeDestroy: mergeAsArray$1,
5036
  beforeUnmount: mergeAsArray$1,
5037
  destroyed: mergeAsArray$1,
5038
  unmounted: mergeAsArray$1,
5039
  activated: mergeAsArray$1,
5040
  deactivated: mergeAsArray$1,
5041
  errorCaptured: mergeAsArray$1,
5042
  serverPrefetch: mergeAsArray$1,
5043
  // assets
5044
  components: mergeObjectOptions,
5045
  directives: mergeObjectOptions,
5046
  // watch
5047
  watch: mergeWatchOptions,
5048
  // provide / inject
5049
  provide: mergeDataFn,
5050
  inject: mergeInject
5051
};
5052
function mergeDataFn(to, from) {
5053
  if (!from) {
5054
    return to;
5055
  }
5056
  if (!to) {
5057
    return from;
5058
  }
5059
  return function mergedDataFn() {
5060
    return (extend)(
5061
      isFunction(to) ? to.call(this, this) : to,
5062
      isFunction(from) ? from.call(this, this) : from
5063
    );
5064
  };
5065
}
5066
function mergeInject(to, from) {
5067
  return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
5068
}
5069
function normalizeInject(raw) {
5070
  if (isArray(raw)) {
5071
    const res = {};
5072
    for (let i = 0; i < raw.length; i++) {
5073
      res[raw[i]] = raw[i];
5074
    }
5075
    return res;
5076
  }
5077
  return raw;
5078
}
5079
function mergeAsArray$1(to, from) {
5080
  return to ? [...new Set([].concat(to, from))] : from;
5081
}
5082
function mergeObjectOptions(to, from) {
5083
  return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
5084
}
5085
function mergeEmitsOrPropsOptions(to, from) {
5086
  if (to) {
5087
    if (isArray(to) && isArray(from)) {
5088
      return [.../* @__PURE__ */ new Set([...to, ...from])];
5089
    }
5090
    return extend(
5091
      /* @__PURE__ */ Object.create(null),
5092
      normalizePropsOrEmits(to),
5093
      normalizePropsOrEmits(from != null ? from : {})
5094
    );
5095
  } else {
5096
    return from;
5097
  }
5098
}
5099
function mergeWatchOptions(to, from) {
5100
  if (!to)
5101
    return from;
5102
  if (!from)
5103
    return to;
5104
  const merged = extend(/* @__PURE__ */ Object.create(null), to);
5105
  for (const key in from) {
5106
    merged[key] = mergeAsArray$1(to[key], from[key]);
5107
  }
5108
  return merged;
5109
}
5110
 
5111
function createAppContext() {
5112
  return {
5113
    app: null,
5114
    config: {
5115
      isNativeTag: NO,
5116
      performance: false,
5117
      globalProperties: {},
5118
      optionMergeStrategies: {},
5119
      errorHandler: void 0,
5120
      warnHandler: void 0,
5121
      compilerOptions: {}
5122
    },
5123
    mixins: [],
5124
    components: {},
5125
    directives: {},
5126
    provides: /* @__PURE__ */ Object.create(null),
5127
    optionsCache: /* @__PURE__ */ new WeakMap(),
5128
    propsCache: /* @__PURE__ */ new WeakMap(),
5129
    emitsCache: /* @__PURE__ */ new WeakMap()
5130
  };
5131
}
5132
let uid$1 = 0;
5133
function createAppAPI(render, hydrate) {
5134
  return function createApp(rootComponent, rootProps = null) {
5135
    if (!isFunction(rootComponent)) {
5136
      rootComponent = extend({}, rootComponent);
5137
    }
5138
    if (rootProps != null && !isObject(rootProps)) {
5139
      warn(`root props passed to app.mount() must be an object.`);
5140
      rootProps = null;
5141
    }
5142
    const context = createAppContext();
5143
    {
5144
      Object.defineProperty(context.config, "unwrapInjectedRef", {
5145
        get() {
5146
          return true;
5147
        },
5148
        set() {
5149
          warn(
5150
            `app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
5151
          );
5152
        }
5153
      });
5154
    }
5155
    const installedPlugins = /* @__PURE__ */ new WeakSet();
5156
    let isMounted = false;
5157
    const app = context.app = {
5158
      _uid: uid$1++,
5159
      _component: rootComponent,
5160
      _props: rootProps,
5161
      _container: null,
5162
      _context: context,
5163
      _instance: null,
5164
      version,
5165
      get config() {
5166
        return context.config;
5167
      },
5168
      set config(v) {
5169
        {
5170
          warn(
5171
            `app.config cannot be replaced. Modify individual options instead.`
5172
          );
5173
        }
5174
      },
5175
      use(plugin, ...options) {
5176
        if (installedPlugins.has(plugin)) {
5177
          warn(`Plugin has already been applied to target app.`);
5178
        } else if (plugin && isFunction(plugin.install)) {
5179
          installedPlugins.add(plugin);
5180
          plugin.install(app, ...options);
5181
        } else if (isFunction(plugin)) {
5182
          installedPlugins.add(plugin);
5183
          plugin(app, ...options);
5184
        } else {
5185
          warn(
5186
            `A plugin must either be a function or an object with an "install" function.`
5187
          );
5188
        }
5189
        return app;
5190
      },
5191
      mixin(mixin) {
5192
        {
5193
          if (!context.mixins.includes(mixin)) {
5194
            context.mixins.push(mixin);
5195
          } else {
5196
            warn(
5197
              "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
5198
            );
5199
          }
5200
        }
5201
        return app;
5202
      },
5203
      component(name, component) {
5204
        {
5205
          validateComponentName(name, context.config);
5206
        }
5207
        if (!component) {
5208
          return context.components[name];
5209
        }
5210
        if (context.components[name]) {
5211
          warn(`Component "${name}" has already been registered in target app.`);
5212
        }
5213
        context.components[name] = component;
5214
        return app;
5215
      },
5216
      directive(name, directive) {
5217
        {
5218
          validateDirectiveName(name);
5219
        }
5220
        if (!directive) {
5221
          return context.directives[name];
5222
        }
5223
        if (context.directives[name]) {
5224
          warn(`Directive "${name}" has already been registered in target app.`);
5225
        }
5226
        context.directives[name] = directive;
5227
        return app;
5228
      },
5229
      mount(rootContainer, isHydrate, isSVG) {
5230
        if (!isMounted) {
5231
          if (rootContainer.__vue_app__) {
5232
            warn(
5233
              `There is already an app instance mounted on the host container.
5234
 If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
5235
            );
5236
          }
5237
          const vnode = createVNode(rootComponent, rootProps);
5238
          vnode.appContext = context;
5239
          {
5240
            context.reload = () => {
5241
              render(cloneVNode(vnode), rootContainer, isSVG);
5242
            };
5243
          }
5244
          if (isHydrate && hydrate) {
5245
            hydrate(vnode, rootContainer);
5246
          } else {
5247
            render(vnode, rootContainer, isSVG);
5248
          }
5249
          isMounted = true;
5250
          app._container = rootContainer;
5251
          rootContainer.__vue_app__ = app;
5252
          {
5253
            app._instance = vnode.component;
5254
            devtoolsInitApp(app, version);
5255
          }
5256
          return getExposeProxy(vnode.component) || vnode.component.proxy;
5257
        } else {
5258
          warn(
5259
            `App has already been mounted.
5260
If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
5261
          );
5262
        }
5263
      },
5264
      unmount() {
5265
        if (isMounted) {
5266
          render(null, app._container);
5267
          {
5268
            app._instance = null;
5269
            devtoolsUnmountApp(app);
5270
          }
5271
          delete app._container.__vue_app__;
5272
        } else {
5273
          warn(`Cannot unmount an app that is not mounted.`);
5274
        }
5275
      },
5276
      provide(key, value) {
5277
        if (key in context.provides) {
5278
          warn(
5279
            `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
5280
          );
5281
        }
5282
        context.provides[key] = value;
5283
        return app;
5284
      },
5285
      runWithContext(fn) {
5286
        currentApp = app;
5287
        try {
5288
          return fn();
5289
        } finally {
5290
          currentApp = null;
5291
        }
5292
      }
5293
    };
5294
    return app;
5295
  };
5296
}
5297
let currentApp = null;
5298
 
5299
function provide(key, value) {
5300
  if (!currentInstance) {
5301
    {
5302
      warn(`provide() can only be used inside setup().`);
5303
    }
5304
  } else {
5305
    let provides = currentInstance.provides;
5306
    const parentProvides = currentInstance.parent && currentInstance.parent.provides;
5307
    if (parentProvides === provides) {
5308
      provides = currentInstance.provides = Object.create(parentProvides);
5309
    }
5310
    provides[key] = value;
5311
  }
5312
}
5313
function inject(key, defaultValue, treatDefaultAsFactory = false) {
5314
  const instance = currentInstance || currentRenderingInstance;
5315
  if (instance || currentApp) {
5316
    const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
5317
    if (provides && key in provides) {
5318
      return provides[key];
5319
    } else if (arguments.length > 1) {
5320
      return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
5321
    } else {
5322
      warn(`injection "${String(key)}" not found.`);
5323
    }
5324
  } else {
5325
    warn(`inject() can only be used inside setup() or functional components.`);
5326
  }
5327
}
5328
function hasInjectionContext() {
5329
  return !!(currentInstance || currentRenderingInstance || currentApp);
5330
}
5331
 
5332
function initProps(instance, rawProps, isStateful, isSSR = false) {
5333
  const props = {};
5334
  const attrs = {};
5335
  def(attrs, InternalObjectKey, 1);
5336
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
5337
  setFullProps(instance, rawProps, props, attrs);
5338
  for (const key in instance.propsOptions[0]) {
5339
    if (!(key in props)) {
5340
      props[key] = void 0;
5341
    }
5342
  }
5343
  {
5344
    validateProps(rawProps || {}, props, instance);
5345
  }
5346
  if (isStateful) {
5347
    instance.props = isSSR ? props : shallowReactive(props);
5348
  } else {
5349
    if (!instance.type.props) {
5350
      instance.props = attrs;
5351
    } else {
5352
      instance.props = props;
5353
    }
5354
  }
5355
  instance.attrs = attrs;
5356
}
5357
function isInHmrContext(instance) {
5358
  while (instance) {
5359
    if (instance.type.__hmrId)
5360
      return true;
5361
    instance = instance.parent;
5362
  }
5363
}
5364
function updateProps(instance, rawProps, rawPrevProps, optimized) {
5365
  const {
5366
    props,
5367
    attrs,
5368
    vnode: { patchFlag }
5369
  } = instance;
5370
  const rawCurrentProps = toRaw(props);
5371
  const [options] = instance.propsOptions;
5372
  let hasAttrsChanged = false;
5373
  if (
5374
    // always force full diff in dev
5375
    // - #1942 if hmr is enabled with sfc component
5376
    // - vite#872 non-sfc component used by sfc component
5377
    !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
5378
  ) {
5379
    if (patchFlag & 8) {
5380
      const propsToUpdate = instance.vnode.dynamicProps;
5381
      for (let i = 0; i < propsToUpdate.length; i++) {
5382
        let key = propsToUpdate[i];
5383
        if (isEmitListener(instance.emitsOptions, key)) {
5384
          continue;
5385
        }
5386
        const value = rawProps[key];
5387
        if (options) {
5388
          if (hasOwn(attrs, key)) {
5389
            if (value !== attrs[key]) {
5390
              attrs[key] = value;
5391
              hasAttrsChanged = true;
5392
            }
5393
          } else {
5394
            const camelizedKey = camelize(key);
5395
            props[camelizedKey] = resolvePropValue(
5396
              options,
5397
              rawCurrentProps,
5398
              camelizedKey,
5399
              value,
5400
              instance,
5401
              false
5402
              /* isAbsent */
5403
            );
5404
          }
5405
        } else {
5406
          if (value !== attrs[key]) {
5407
            attrs[key] = value;
5408
            hasAttrsChanged = true;
5409
          }
5410
        }
5411
      }
5412
    }
5413
  } else {
5414
    if (setFullProps(instance, rawProps, props, attrs)) {
5415
      hasAttrsChanged = true;
5416
    }
5417
    let kebabKey;
5418
    for (const key in rawCurrentProps) {
5419
      if (!rawProps || // for camelCase
5420
      !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
5421
      // and converted to camelCase (#955)
5422
      ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
5423
        if (options) {
5424
          if (rawPrevProps && // for camelCase
5425
          (rawPrevProps[key] !== void 0 || // for kebab-case
5426
          rawPrevProps[kebabKey] !== void 0)) {
5427
            props[key] = resolvePropValue(
5428
              options,
5429
              rawCurrentProps,
5430
              key,
5431
              void 0,
5432
              instance,
5433
              true
5434
              /* isAbsent */
5435
            );
5436
          }
5437
        } else {
5438
          delete props[key];
5439
        }
5440
      }
5441
    }
5442
    if (attrs !== rawCurrentProps) {
5443
      for (const key in attrs) {
5444
        if (!rawProps || !hasOwn(rawProps, key) && true) {
5445
          delete attrs[key];
5446
          hasAttrsChanged = true;
5447
        }
5448
      }
5449
    }
5450
  }
5451
  if (hasAttrsChanged) {
5452
    trigger(instance, "set", "$attrs");
5453
  }
5454
  {
5455
    validateProps(rawProps || {}, props, instance);
5456
  }
5457
}
5458
function setFullProps(instance, rawProps, props, attrs) {
5459
  const [options, needCastKeys] = instance.propsOptions;
5460
  let hasAttrsChanged = false;
5461
  let rawCastValues;
5462
  if (rawProps) {
5463
    for (let key in rawProps) {
5464
      if (isReservedProp(key)) {
5465
        continue;
5466
      }
5467
      const value = rawProps[key];
5468
      let camelKey;
5469
      if (options && hasOwn(options, camelKey = camelize(key))) {
5470
        if (!needCastKeys || !needCastKeys.includes(camelKey)) {
5471
          props[camelKey] = value;
5472
        } else {
5473
          (rawCastValues || (rawCastValues = {}))[camelKey] = value;
5474
        }
5475
      } else if (!isEmitListener(instance.emitsOptions, key)) {
5476
        if (!(key in attrs) || value !== attrs[key]) {
5477
          attrs[key] = value;
5478
          hasAttrsChanged = true;
5479
        }
5480
      }
5481
    }
5482
  }
5483
  if (needCastKeys) {
5484
    const rawCurrentProps = toRaw(props);
5485
    const castValues = rawCastValues || EMPTY_OBJ;
5486
    for (let i = 0; i < needCastKeys.length; i++) {
5487
      const key = needCastKeys[i];
5488
      props[key] = resolvePropValue(
5489
        options,
5490
        rawCurrentProps,
5491
        key,
5492
        castValues[key],
5493
        instance,
5494
        !hasOwn(castValues, key)
5495
      );
5496
    }
5497
  }
5498
  return hasAttrsChanged;
5499
}
5500
function resolvePropValue(options, props, key, value, instance, isAbsent) {
5501
  const opt = options[key];
5502
  if (opt != null) {
5503
    const hasDefault = hasOwn(opt, "default");
5504
    if (hasDefault && value === void 0) {
5505
      const defaultValue = opt.default;
5506
      if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
5507
        const { propsDefaults } = instance;
5508
        if (key in propsDefaults) {
5509
          value = propsDefaults[key];
5510
        } else {
5511
          setCurrentInstance(instance);
5512
          value = propsDefaults[key] = defaultValue.call(
5513
            null,
5514
            props
5515
          );
5516
          unsetCurrentInstance();
5517
        }
5518
      } else {
5519
        value = defaultValue;
5520
      }
5521
    }
5522
    if (opt[0 /* shouldCast */]) {
5523
      if (isAbsent && !hasDefault) {
5524
        value = false;
5525
      } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
5526
        value = true;
5527
      }
5528
    }
5529
  }
5530
  return value;
5531
}
5532
function normalizePropsOptions(comp, appContext, asMixin = false) {
5533
  const cache = appContext.propsCache;
5534
  const cached = cache.get(comp);
5535
  if (cached) {
5536
    return cached;
5537
  }
5538
  const raw = comp.props;
5539
  const normalized = {};
5540
  const needCastKeys = [];
5541
  let hasExtends = false;
5542
  if (!isFunction(comp)) {
5543
    const extendProps = (raw2) => {
5544
      hasExtends = true;
5545
      const [props, keys] = normalizePropsOptions(raw2, appContext, true);
5546
      extend(normalized, props);
5547
      if (keys)
5548
        needCastKeys.push(...keys);
5549
    };
5550
    if (!asMixin && appContext.mixins.length) {
5551
      appContext.mixins.forEach(extendProps);
5552
    }
5553
    if (comp.extends) {
5554
      extendProps(comp.extends);
5555
    }
5556
    if (comp.mixins) {
5557
      comp.mixins.forEach(extendProps);
5558
    }
5559
  }
5560
  if (!raw && !hasExtends) {
5561
    if (isObject(comp)) {
5562
      cache.set(comp, EMPTY_ARR);
5563
    }
5564
    return EMPTY_ARR;
5565
  }
5566
  if (isArray(raw)) {
5567
    for (let i = 0; i < raw.length; i++) {
5568
      if (!isString(raw[i])) {
5569
        warn(`props must be strings when using array syntax.`, raw[i]);
5570
      }
5571
      const normalizedKey = camelize(raw[i]);
5572
      if (validatePropName(normalizedKey)) {
5573
        normalized[normalizedKey] = EMPTY_OBJ;
5574
      }
5575
    }
5576
  } else if (raw) {
5577
    if (!isObject(raw)) {
5578
      warn(`invalid props options`, raw);
5579
    }
5580
    for (const key in raw) {
5581
      const normalizedKey = camelize(key);
5582
      if (validatePropName(normalizedKey)) {
5583
        const opt = raw[key];
5584
        const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
5585
        if (prop) {
5586
          const booleanIndex = getTypeIndex(Boolean, prop.type);
5587
          const stringIndex = getTypeIndex(String, prop.type);
5588
          prop[0 /* shouldCast */] = booleanIndex > -1;
5589
          prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
5590
          if (booleanIndex > -1 || hasOwn(prop, "default")) {
5591
            needCastKeys.push(normalizedKey);
5592
          }
5593
        }
5594
      }
5595
    }
5596
  }
5597
  const res = [normalized, needCastKeys];
5598
  if (isObject(comp)) {
5599
    cache.set(comp, res);
5600
  }
5601
  return res;
5602
}
5603
function validatePropName(key) {
5604
  if (key[0] !== "$") {
5605
    return true;
5606
  } else {
5607
    warn(`Invalid prop name: "${key}" is a reserved property.`);
5608
  }
5609
  return false;
5610
}
5611
function getType(ctor) {
5612
  const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
5613
  return match ? match[2] : ctor === null ? "null" : "";
5614
}
5615
function isSameType(a, b) {
5616
  return getType(a) === getType(b);
5617
}
5618
function getTypeIndex(type, expectedTypes) {
5619
  if (isArray(expectedTypes)) {
5620
    return expectedTypes.findIndex((t) => isSameType(t, type));
5621
  } else if (isFunction(expectedTypes)) {
5622
    return isSameType(expectedTypes, type) ? 0 : -1;
5623
  }
5624
  return -1;
5625
}
5626
function validateProps(rawProps, props, instance) {
5627
  const resolvedValues = toRaw(props);
5628
  const options = instance.propsOptions[0];
5629
  for (const key in options) {
5630
    let opt = options[key];
5631
    if (opt == null)
5632
      continue;
5633
    validateProp(
5634
      key,
5635
      resolvedValues[key],
5636
      opt,
5637
      !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
5638
    );
5639
  }
5640
}
5641
function validateProp(name, value, prop, isAbsent) {
5642
  const { type, required, validator, skipCheck } = prop;
5643
  if (required && isAbsent) {
5644
    warn('Missing required prop: "' + name + '"');
5645
    return;
5646
  }
5647
  if (value == null && !required) {
5648
    return;
5649
  }
5650
  if (type != null && type !== true && !skipCheck) {
5651
    let isValid = false;
5652
    const types = isArray(type) ? type : [type];
5653
    const expectedTypes = [];
5654
    for (let i = 0; i < types.length && !isValid; i++) {
5655
      const { valid, expectedType } = assertType(value, types[i]);
5656
      expectedTypes.push(expectedType || "");
5657
      isValid = valid;
5658
    }
5659
    if (!isValid) {
5660
      warn(getInvalidTypeMessage(name, value, expectedTypes));
5661
      return;
5662
    }
5663
  }
5664
  if (validator && !validator(value)) {
5665
    warn('Invalid prop: custom validator check failed for prop "' + name + '".');
5666
  }
5667
}
5668
const isSimpleType = /* @__PURE__ */ makeMap(
5669
  "String,Number,Boolean,Function,Symbol,BigInt"
5670
);
5671
function assertType(value, type) {
5672
  let valid;
5673
  const expectedType = getType(type);
5674
  if (isSimpleType(expectedType)) {
5675
    const t = typeof value;
5676
    valid = t === expectedType.toLowerCase();
5677
    if (!valid && t === "object") {
5678
      valid = value instanceof type;
5679
    }
5680
  } else if (expectedType === "Object") {
5681
    valid = isObject(value);
5682
  } else if (expectedType === "Array") {
5683
    valid = isArray(value);
5684
  } else if (expectedType === "null") {
5685
    valid = value === null;
5686
  } else {
5687
    valid = value instanceof type;
5688
  }
5689
  return {
5690
    valid,
5691
    expectedType
5692
  };
5693
}
5694
function getInvalidTypeMessage(name, value, expectedTypes) {
5695
  let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
5696
  const expectedType = expectedTypes[0];
5697
  const receivedType = toRawType(value);
5698
  const expectedValue = styleValue(value, expectedType);
5699
  const receivedValue = styleValue(value, receivedType);
5700
  if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
5701
    message += ` with value ${expectedValue}`;
5702
  }
5703
  message += `, got ${receivedType} `;
5704
  if (isExplicable(receivedType)) {
5705
    message += `with value ${receivedValue}.`;
5706
  }
5707
  return message;
5708
}
5709
function styleValue(value, type) {
5710
  if (type === "String") {
5711
    return `"${value}"`;
5712
  } else if (type === "Number") {
5713
    return `${Number(value)}`;
5714
  } else {
5715
    return `${value}`;
5716
  }
5717
}
5718
function isExplicable(type) {
5719
  const explicitTypes = ["string", "number", "boolean"];
5720
  return explicitTypes.some((elem) => type.toLowerCase() === elem);
5721
}
5722
function isBoolean(...args) {
5723
  return args.some((elem) => elem.toLowerCase() === "boolean");
5724
}
5725
 
5726
const isInternalKey = (key) => key[0] === "_" || key === "$stable";
5727
const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
5728
const normalizeSlot = (key, rawSlot, ctx) => {
5729
  if (rawSlot._n) {
5730
    return rawSlot;
5731
  }
5732
  const normalized = withCtx((...args) => {
5733
    if (currentInstance) {
5734
      warn(
5735
        `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
5736
      );
5737
    }
5738
    return normalizeSlotValue(rawSlot(...args));
5739
  }, ctx);
5740
  normalized._c = false;
5741
  return normalized;
5742
};
5743
const normalizeObjectSlots = (rawSlots, slots, instance) => {
5744
  const ctx = rawSlots._ctx;
5745
  for (const key in rawSlots) {
5746
    if (isInternalKey(key))
5747
      continue;
5748
    const value = rawSlots[key];
5749
    if (isFunction(value)) {
5750
      slots[key] = normalizeSlot(key, value, ctx);
5751
    } else if (value != null) {
5752
      {
5753
        warn(
5754
          `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
5755
        );
5756
      }
5757
      const normalized = normalizeSlotValue(value);
5758
      slots[key] = () => normalized;
5759
    }
5760
  }
5761
};
5762
const normalizeVNodeSlots = (instance, children) => {
5763
  if (!isKeepAlive(instance.vnode) && true) {
5764
    warn(
5765
      `Non-function value encountered for default slot. Prefer function slots for better performance.`
5766
    );
5767
  }
5768
  const normalized = normalizeSlotValue(children);
5769
  instance.slots.default = () => normalized;
5770
};
5771
const initSlots = (instance, children) => {
5772
  if (instance.vnode.shapeFlag & 32) {
5773
    const type = children._;
5774
    if (type) {
5775
      instance.slots = toRaw(children);
5776
      def(children, "_", type);
5777
    } else {
5778
      normalizeObjectSlots(
5779
        children,
5780
        instance.slots = {});
5781
    }
5782
  } else {
5783
    instance.slots = {};
5784
    if (children) {
5785
      normalizeVNodeSlots(instance, children);
5786
    }
5787
  }
5788
  def(instance.slots, InternalObjectKey, 1);
5789
};
5790
const updateSlots = (instance, children, optimized) => {
5791
  const { vnode, slots } = instance;
5792
  let needDeletionCheck = true;
5793
  let deletionComparisonTarget = EMPTY_OBJ;
5794
  if (vnode.shapeFlag & 32) {
5795
    const type = children._;
5796
    if (type) {
5797
      if (isHmrUpdating) {
5798
        extend(slots, children);
5799
        trigger(instance, "set", "$slots");
5800
      } else if (optimized && type === 1) {
5801
        needDeletionCheck = false;
5802
      } else {
5803
        extend(slots, children);
5804
        if (!optimized && type === 1) {
5805
          delete slots._;
5806
        }
5807
      }
5808
    } else {
5809
      needDeletionCheck = !children.$stable;
5810
      normalizeObjectSlots(children, slots);
5811
    }
5812
    deletionComparisonTarget = children;
5813
  } else if (children) {
5814
    normalizeVNodeSlots(instance, children);
5815
    deletionComparisonTarget = { default: 1 };
5816
  }
5817
  if (needDeletionCheck) {
5818
    for (const key in slots) {
5819
      if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
5820
        delete slots[key];
5821
      }
5822
    }
5823
  }
5824
};
5825
 
5826
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
5827
  if (isArray(rawRef)) {
5828
    rawRef.forEach(
5829
      (r, i) => setRef(
5830
        r,
5831
        oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
5832
        parentSuspense,
5833
        vnode,
5834
        isUnmount
5835
      )
5836
    );
5837
    return;
5838
  }
5839
  if (isAsyncWrapper(vnode) && !isUnmount) {
5840
    return;
5841
  }
5842
  const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el;
5843
  const value = isUnmount ? null : refValue;
5844
  const { i: owner, r: ref } = rawRef;
5845
  if (!owner) {
5846
    warn(
5847
      `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
5848
    );
5849
    return;
5850
  }
5851
  const oldRef = oldRawRef && oldRawRef.r;
5852
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
5853
  const setupState = owner.setupState;
5854
  if (oldRef != null && oldRef !== ref) {
5855
    if (isString(oldRef)) {
5856
      refs[oldRef] = null;
5857
      if (hasOwn(setupState, oldRef)) {
5858
        setupState[oldRef] = null;
5859
      }
5860
    } else if (isRef(oldRef)) {
5861
      oldRef.value = null;
5862
    }
5863
  }
5864
  if (isFunction(ref)) {
5865
    callWithErrorHandling(ref, owner, 12, [value, refs]);
5866
  } else {
5867
    const _isString = isString(ref);
5868
    const _isRef = isRef(ref);
5869
    if (_isString || _isRef) {
5870
      const doSet = () => {
5871
        if (rawRef.f) {
5872
          const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
5873
          if (isUnmount) {
5874
            isArray(existing) && remove(existing, refValue);
5875
          } else {
5876
            if (!isArray(existing)) {
5877
              if (_isString) {
5878
                refs[ref] = [refValue];
5879
                if (hasOwn(setupState, ref)) {
5880
                  setupState[ref] = refs[ref];
5881
                }
5882
              } else {
5883
                ref.value = [refValue];
5884
                if (rawRef.k)
5885
                  refs[rawRef.k] = ref.value;
5886
              }
5887
            } else if (!existing.includes(refValue)) {
5888
              existing.push(refValue);
5889
            }
5890
          }
5891
        } else if (_isString) {
5892
          refs[ref] = value;
5893
          if (hasOwn(setupState, ref)) {
5894
            setupState[ref] = value;
5895
          }
5896
        } else if (_isRef) {
5897
          ref.value = value;
5898
          if (rawRef.k)
5899
            refs[rawRef.k] = value;
5900
        } else {
5901
          warn("Invalid template ref type:", ref, `(${typeof ref})`);
5902
        }
5903
      };
5904
      if (value) {
5905
        doSet.id = -1;
5906
        queuePostRenderEffect(doSet, parentSuspense);
5907
      } else {
5908
        doSet();
5909
      }
5910
    } else {
5911
      warn("Invalid template ref type:", ref, `(${typeof ref})`);
5912
    }
5913
  }
5914
}
5915
 
5916
let hasMismatch = false;
5917
const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject";
5918
const isComment = (node) => node.nodeType === 8 /* COMMENT */;
5919
function createHydrationFunctions(rendererInternals) {
5920
  const {
5921
    mt: mountComponent,
5922
    p: patch,
5923
    o: {
5924
      patchProp,
5925
      createText,
5926
      nextSibling,
5927
      parentNode,
5928
      remove,
5929
      insert,
5930
      createComment
5931
    }
5932
  } = rendererInternals;
5933
  const hydrate = (vnode, container) => {
5934
    if (!container.hasChildNodes()) {
5935
      warn(
5936
        `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
5937
      );
5938
      patch(null, vnode, container);
5939
      flushPostFlushCbs();
5940
      container._vnode = vnode;
5941
      return;
5942
    }
5943
    hasMismatch = false;
5944
    hydrateNode(container.firstChild, vnode, null, null, null);
5945
    flushPostFlushCbs();
5946
    container._vnode = vnode;
5947
    if (hasMismatch && true) {
5948
      console.error(`Hydration completed but contains mismatches.`);
5949
    }
5950
  };
5951
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
5952
    const isFragmentStart = isComment(node) && node.data === "[";
5953
    const onMismatch = () => handleMismatch(
5954
      node,
5955
      vnode,
5956
      parentComponent,
5957
      parentSuspense,
5958
      slotScopeIds,
5959
      isFragmentStart
5960
    );
5961
    const { type, ref, shapeFlag, patchFlag } = vnode;
5962
    let domType = node.nodeType;
5963
    vnode.el = node;
5964
    if (patchFlag === -2) {
5965
      optimized = false;
5966
      vnode.dynamicChildren = null;
5967
    }
5968
    let nextNode = null;
5969
    switch (type) {
5970
      case Text:
5971
        if (domType !== 3 /* TEXT */) {
5972
          if (vnode.children === "") {
5973
            insert(vnode.el = createText(""), parentNode(node), node);
5974
            nextNode = node;
5975
          } else {
5976
            nextNode = onMismatch();
5977
          }
5978
        } else {
5979
          if (node.data !== vnode.children) {
5980
            hasMismatch = true;
5981
            warn(
5982
              `Hydration text mismatch:
5983
- Server rendered: ${JSON.stringify(
5984
                node.data
5985
              )}
5986
- Client rendered: ${JSON.stringify(vnode.children)}`
5987
            );
5988
            node.data = vnode.children;
5989
          }
5990
          nextNode = nextSibling(node);
5991
        }
5992
        break;
5993
      case Comment:
5994
        if (domType !== 8 /* COMMENT */ || isFragmentStart) {
5995
          nextNode = onMismatch();
5996
        } else {
5997
          nextNode = nextSibling(node);
5998
        }
5999
        break;
6000
      case Static:
6001
        if (isFragmentStart) {
6002
          node = nextSibling(node);
6003
          domType = node.nodeType;
6004
        }
6005
        if (domType === 1 /* ELEMENT */ || domType === 3 /* TEXT */) {
6006
          nextNode = node;
6007
          const needToAdoptContent = !vnode.children.length;
6008
          for (let i = 0; i < vnode.staticCount; i++) {
6009
            if (needToAdoptContent)
6010
              vnode.children += nextNode.nodeType === 1 /* ELEMENT */ ? nextNode.outerHTML : nextNode.data;
6011
            if (i === vnode.staticCount - 1) {
6012
              vnode.anchor = nextNode;
6013
            }
6014
            nextNode = nextSibling(nextNode);
6015
          }
6016
          return isFragmentStart ? nextSibling(nextNode) : nextNode;
6017
        } else {
6018
          onMismatch();
6019
        }
6020
        break;
6021
      case Fragment:
6022
        if (!isFragmentStart) {
6023
          nextNode = onMismatch();
6024
        } else {
6025
          nextNode = hydrateFragment(
6026
            node,
6027
            vnode,
6028
            parentComponent,
6029
            parentSuspense,
6030
            slotScopeIds,
6031
            optimized
6032
          );
6033
        }
6034
        break;
6035
      default:
6036
        if (shapeFlag & 1) {
6037
          if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
6038
            nextNode = onMismatch();
6039
          } else {
6040
            nextNode = hydrateElement(
6041
              node,
6042
              vnode,
6043
              parentComponent,
6044
              parentSuspense,
6045
              slotScopeIds,
6046
              optimized
6047
            );
6048
          }
6049
        } else if (shapeFlag & 6) {
6050
          vnode.slotScopeIds = slotScopeIds;
6051
          const container = parentNode(node);
6052
          mountComponent(
6053
            vnode,
6054
            container,
6055
            null,
6056
            parentComponent,
6057
            parentSuspense,
6058
            isSVGContainer(container),
6059
            optimized
6060
          );
6061
          nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
6062
          if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
6063
            nextNode = nextSibling(nextNode);
6064
          }
6065
          if (isAsyncWrapper(vnode)) {
6066
            let subTree;
6067
            if (isFragmentStart) {
6068
              subTree = createVNode(Fragment);
6069
              subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
6070
            } else {
6071
              subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
6072
            }
6073
            subTree.el = node;
6074
            vnode.component.subTree = subTree;
6075
          }
6076
        } else if (shapeFlag & 64) {
6077
          if (domType !== 8 /* COMMENT */) {
6078
            nextNode = onMismatch();
6079
          } else {
6080
            nextNode = vnode.type.hydrate(
6081
              node,
6082
              vnode,
6083
              parentComponent,
6084
              parentSuspense,
6085
              slotScopeIds,
6086
              optimized,
6087
              rendererInternals,
6088
              hydrateChildren
6089
            );
6090
          }
6091
        } else if (shapeFlag & 128) {
6092
          nextNode = vnode.type.hydrate(
6093
            node,
6094
            vnode,
6095
            parentComponent,
6096
            parentSuspense,
6097
            isSVGContainer(parentNode(node)),
6098
            slotScopeIds,
6099
            optimized,
6100
            rendererInternals,
6101
            hydrateNode
6102
          );
6103
        } else {
6104
          warn("Invalid HostVNode type:", type, `(${typeof type})`);
6105
        }
6106
    }
6107
    if (ref != null) {
6108
      setRef(ref, null, parentSuspense, vnode);
6109
    }
6110
    return nextNode;
6111
  };
6112
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
6113
    optimized = optimized || !!vnode.dynamicChildren;
6114
    const { type, props, patchFlag, shapeFlag, dirs } = vnode;
6115
    const forcePatchValue = type === "input" && dirs || type === "option";
6116
    {
6117
      if (dirs) {
6118
        invokeDirectiveHook(vnode, null, parentComponent, "created");
6119
      }
6120
      if (props) {
6121
        if (forcePatchValue || !optimized || patchFlag & (16 | 32)) {
6122
          for (const key in props) {
6123
            if (forcePatchValue && key.endsWith("value") || isOn(key) && !isReservedProp(key)) {
6124
              patchProp(
6125
                el,
6126
                key,
6127
                null,
6128
                props[key],
6129
                false,
6130
                void 0,
6131
                parentComponent
6132
              );
6133
            }
6134
          }
6135
        } else if (props.onClick) {
6136
          patchProp(
6137
            el,
6138
            "onClick",
6139
            null,
6140
            props.onClick,
6141
            false,
6142
            void 0,
6143
            parentComponent
6144
          );
6145
        }
6146
      }
6147
      let vnodeHooks;
6148
      if (vnodeHooks = props && props.onVnodeBeforeMount) {
6149
        invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6150
      }
6151
      if (dirs) {
6152
        invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6153
      }
6154
      if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
6155
        queueEffectWithSuspense(() => {
6156
          vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6157
          dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6158
        }, parentSuspense);
6159
      }
6160
      if (shapeFlag & 16 && // skip if element has innerHTML / textContent
6161
      !(props && (props.innerHTML || props.textContent))) {
6162
        let next = hydrateChildren(
6163
          el.firstChild,
6164
          vnode,
6165
          el,
6166
          parentComponent,
6167
          parentSuspense,
6168
          slotScopeIds,
6169
          optimized
6170
        );
6171
        let hasWarned = false;
6172
        while (next) {
6173
          hasMismatch = true;
6174
          if (!hasWarned) {
6175
            warn(
6176
              `Hydration children mismatch in <${vnode.type}>: server rendered element contains more child nodes than client vdom.`
6177
            );
6178
            hasWarned = true;
6179
          }
6180
          const cur = next;
6181
          next = next.nextSibling;
6182
          remove(cur);
6183
        }
6184
      } else if (shapeFlag & 8) {
6185
        if (el.textContent !== vnode.children) {
6186
          hasMismatch = true;
6187
          warn(
6188
            `Hydration text content mismatch in <${vnode.type}>:
6189
- Server rendered: ${el.textContent}
6190
- Client rendered: ${vnode.children}`
6191
          );
6192
          el.textContent = vnode.children;
6193
        }
6194
      }
6195
    }
6196
    return el.nextSibling;
6197
  };
6198
  const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
6199
    optimized = optimized || !!parentVNode.dynamicChildren;
6200
    const children = parentVNode.children;
6201
    const l = children.length;
6202
    let hasWarned = false;
6203
    for (let i = 0; i < l; i++) {
6204
      const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
6205
      if (node) {
6206
        node = hydrateNode(
6207
          node,
6208
          vnode,
6209
          parentComponent,
6210
          parentSuspense,
6211
          slotScopeIds,
6212
          optimized
6213
        );
6214
      } else if (vnode.type === Text && !vnode.children) {
6215
        continue;
6216
      } else {
6217
        hasMismatch = true;
6218
        if (!hasWarned) {
6219
          warn(
6220
            `Hydration children mismatch in <${container.tagName.toLowerCase()}>: server rendered element contains fewer child nodes than client vdom.`
6221
          );
6222
          hasWarned = true;
6223
        }
6224
        patch(
6225
          null,
6226
          vnode,
6227
          container,
6228
          null,
6229
          parentComponent,
6230
          parentSuspense,
6231
          isSVGContainer(container),
6232
          slotScopeIds
6233
        );
6234
      }
6235
    }
6236
    return node;
6237
  };
6238
  const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
6239
    const { slotScopeIds: fragmentSlotScopeIds } = vnode;
6240
    if (fragmentSlotScopeIds) {
6241
      slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
6242
    }
6243
    const container = parentNode(node);
6244
    const next = hydrateChildren(
6245
      nextSibling(node),
6246
      vnode,
6247
      container,
6248
      parentComponent,
6249
      parentSuspense,
6250
      slotScopeIds,
6251
      optimized
6252
    );
6253
    if (next && isComment(next) && next.data === "]") {
6254
      return nextSibling(vnode.anchor = next);
6255
    } else {
6256
      hasMismatch = true;
6257
      insert(vnode.anchor = createComment(`]`), container, next);
6258
      return next;
6259
    }
6260
  };
6261
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
6262
    hasMismatch = true;
6263
    warn(
6264
      `Hydration node mismatch:
6265
- Client vnode:`,
6266
      vnode.type,
6267
      `
6268
- Server rendered DOM:`,
6269
      node,
6270
      node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``
6271
    );
6272
    vnode.el = null;
6273
    if (isFragment) {
6274
      const end = locateClosingAsyncAnchor(node);
6275
      while (true) {
6276
        const next2 = nextSibling(node);
6277
        if (next2 && next2 !== end) {
6278
          remove(next2);
6279
        } else {
6280
          break;
6281
        }
6282
      }
6283
    }
6284
    const next = nextSibling(node);
6285
    const container = parentNode(node);
6286
    remove(node);
6287
    patch(
6288
      null,
6289
      vnode,
6290
      container,
6291
      next,
6292
      parentComponent,
6293
      parentSuspense,
6294
      isSVGContainer(container),
6295
      slotScopeIds
6296
    );
6297
    return next;
6298
  };
6299
  const locateClosingAsyncAnchor = (node) => {
6300
    let match = 0;
6301
    while (node) {
6302
      node = nextSibling(node);
6303
      if (node && isComment(node)) {
6304
        if (node.data === "[")
6305
          match++;
6306
        if (node.data === "]") {
6307
          if (match === 0) {
6308
            return nextSibling(node);
6309
          } else {
6310
            match--;
6311
          }
6312
        }
6313
      }
6314
    }
6315
    return node;
6316
  };
6317
  return [hydrate, hydrateNode];
6318
}
6319
 
6320
let supported;
6321
let perf;
6322
function startMeasure(instance, type) {
6323
  if (instance.appContext.config.performance && isSupported()) {
6324
    perf.mark(`vue-${type}-${instance.uid}`);
6325
  }
6326
  {
6327
    devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
6328
  }
6329
}
6330
function endMeasure(instance, type) {
6331
  if (instance.appContext.config.performance && isSupported()) {
6332
    const startTag = `vue-${type}-${instance.uid}`;
6333
    const endTag = startTag + `:end`;
6334
    perf.mark(endTag);
6335
    perf.measure(
6336
      `<${formatComponentName(instance, instance.type)}> ${type}`,
6337
      startTag,
6338
      endTag
6339
    );
6340
    perf.clearMarks(startTag);
6341
    perf.clearMarks(endTag);
6342
  }
6343
  {
6344
    devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
6345
  }
6346
}
6347
function isSupported() {
6348
  if (supported !== void 0) {
6349
    return supported;
6350
  }
6351
  if (typeof window !== "undefined" && window.performance) {
6352
    supported = true;
6353
    perf = window.performance;
6354
  } else {
6355
    supported = false;
6356
  }
6357
  return supported;
6358
}
6359
 
6360
const queuePostRenderEffect = queueEffectWithSuspense ;
6361
function createRenderer(options) {
6362
  return baseCreateRenderer(options);
6363
}
6364
function createHydrationRenderer(options) {
6365
  return baseCreateRenderer(options, createHydrationFunctions);
6366
}
6367
function baseCreateRenderer(options, createHydrationFns) {
6368
  const target = getGlobalThis();
6369
  target.__VUE__ = true;
6370
  {
6371
    setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
6372
  }
6373
  const {
6374
    insert: hostInsert,
6375
    remove: hostRemove,
6376
    patchProp: hostPatchProp,
6377
    createElement: hostCreateElement,
6378
    createText: hostCreateText,
6379
    createComment: hostCreateComment,
6380
    setText: hostSetText,
6381
    setElementText: hostSetElementText,
6382
    parentNode: hostParentNode,
6383
    nextSibling: hostNextSibling,
6384
    setScopeId: hostSetScopeId = NOOP,
6385
    insertStaticContent: hostInsertStaticContent
6386
  } = options;
6387
  const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
6388
    if (n1 === n2) {
6389
      return;
6390
    }
6391
    if (n1 && !isSameVNodeType(n1, n2)) {
6392
      anchor = getNextHostNode(n1);
6393
      unmount(n1, parentComponent, parentSuspense, true);
6394
      n1 = null;
6395
    }
6396
    if (n2.patchFlag === -2) {
6397
      optimized = false;
6398
      n2.dynamicChildren = null;
6399
    }
6400
    const { type, ref, shapeFlag } = n2;
6401
    switch (type) {
6402
      case Text:
6403
        processText(n1, n2, container, anchor);
6404
        break;
6405
      case Comment:
6406
        processCommentNode(n1, n2, container, anchor);
6407
        break;
6408
      case Static:
6409
        if (n1 == null) {
6410
          mountStaticNode(n2, container, anchor, isSVG);
6411
        } else {
6412
          patchStaticNode(n1, n2, container, isSVG);
6413
        }
6414
        break;
6415
      case Fragment:
6416
        processFragment(
6417
          n1,
6418
          n2,
6419
          container,
6420
          anchor,
6421
          parentComponent,
6422
          parentSuspense,
6423
          isSVG,
6424
          slotScopeIds,
6425
          optimized
6426
        );
6427
        break;
6428
      default:
6429
        if (shapeFlag & 1) {
6430
          processElement(
6431
            n1,
6432
            n2,
6433
            container,
6434
            anchor,
6435
            parentComponent,
6436
            parentSuspense,
6437
            isSVG,
6438
            slotScopeIds,
6439
            optimized
6440
          );
6441
        } else if (shapeFlag & 6) {
6442
          processComponent(
6443
            n1,
6444
            n2,
6445
            container,
6446
            anchor,
6447
            parentComponent,
6448
            parentSuspense,
6449
            isSVG,
6450
            slotScopeIds,
6451
            optimized
6452
          );
6453
        } else if (shapeFlag & 64) {
6454
          type.process(
6455
            n1,
6456
            n2,
6457
            container,
6458
            anchor,
6459
            parentComponent,
6460
            parentSuspense,
6461
            isSVG,
6462
            slotScopeIds,
6463
            optimized,
6464
            internals
6465
          );
6466
        } else if (shapeFlag & 128) {
6467
          type.process(
6468
            n1,
6469
            n2,
6470
            container,
6471
            anchor,
6472
            parentComponent,
6473
            parentSuspense,
6474
            isSVG,
6475
            slotScopeIds,
6476
            optimized,
6477
            internals
6478
          );
6479
        } else {
6480
          warn("Invalid VNode type:", type, `(${typeof type})`);
6481
        }
6482
    }
6483
    if (ref != null && parentComponent) {
6484
      setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
6485
    }
6486
  };
6487
  const processText = (n1, n2, container, anchor) => {
6488
    if (n1 == null) {
6489
      hostInsert(
6490
        n2.el = hostCreateText(n2.children),
6491
        container,
6492
        anchor
6493
      );
6494
    } else {
6495
      const el = n2.el = n1.el;
6496
      if (n2.children !== n1.children) {
6497
        hostSetText(el, n2.children);
6498
      }
6499
    }
6500
  };
6501
  const processCommentNode = (n1, n2, container, anchor) => {
6502
    if (n1 == null) {
6503
      hostInsert(
6504
        n2.el = hostCreateComment(n2.children || ""),
6505
        container,
6506
        anchor
6507
      );
6508
    } else {
6509
      n2.el = n1.el;
6510
    }
6511
  };
6512
  const mountStaticNode = (n2, container, anchor, isSVG) => {
6513
    [n2.el, n2.anchor] = hostInsertStaticContent(
6514
      n2.children,
6515
      container,
6516
      anchor,
6517
      isSVG,
6518
      n2.el,
6519
      n2.anchor
6520
    );
6521
  };
6522
  const patchStaticNode = (n1, n2, container, isSVG) => {
6523
    if (n2.children !== n1.children) {
6524
      const anchor = hostNextSibling(n1.anchor);
6525
      removeStaticNode(n1);
6526
      [n2.el, n2.anchor] = hostInsertStaticContent(
6527
        n2.children,
6528
        container,
6529
        anchor,
6530
        isSVG
6531
      );
6532
    } else {
6533
      n2.el = n1.el;
6534
      n2.anchor = n1.anchor;
6535
    }
6536
  };
6537
  const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
6538
    let next;
6539
    while (el && el !== anchor) {
6540
      next = hostNextSibling(el);
6541
      hostInsert(el, container, nextSibling);
6542
      el = next;
6543
    }
6544
    hostInsert(anchor, container, nextSibling);
6545
  };
6546
  const removeStaticNode = ({ el, anchor }) => {
6547
    let next;
6548
    while (el && el !== anchor) {
6549
      next = hostNextSibling(el);
6550
      hostRemove(el);
6551
      el = next;
6552
    }
6553
    hostRemove(anchor);
6554
  };
6555
  const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
6556
    isSVG = isSVG || n2.type === "svg";
6557
    if (n1 == null) {
6558
      mountElement(
6559
        n2,
6560
        container,
6561
        anchor,
6562
        parentComponent,
6563
        parentSuspense,
6564
        isSVG,
6565
        slotScopeIds,
6566
        optimized
6567
      );
6568
    } else {
6569
      patchElement(
6570
        n1,
6571
        n2,
6572
        parentComponent,
6573
        parentSuspense,
6574
        isSVG,
6575
        slotScopeIds,
6576
        optimized
6577
      );
6578
    }
6579
  };
6580
  const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
6581
    let el;
6582
    let vnodeHook;
6583
    const { type, props, shapeFlag, transition, dirs } = vnode;
6584
    el = vnode.el = hostCreateElement(
6585
      vnode.type,
6586
      isSVG,
6587
      props && props.is,
6588
      props
6589
    );
6590
    if (shapeFlag & 8) {
6591
      hostSetElementText(el, vnode.children);
6592
    } else if (shapeFlag & 16) {
6593
      mountChildren(
6594
        vnode.children,
6595
        el,
6596
        null,
6597
        parentComponent,
6598
        parentSuspense,
6599
        isSVG && type !== "foreignObject",
6600
        slotScopeIds,
6601
        optimized
6602
      );
6603
    }
6604
    if (dirs) {
6605
      invokeDirectiveHook(vnode, null, parentComponent, "created");
6606
    }
6607
    setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
6608
    if (props) {
6609
      for (const key in props) {
6610
        if (key !== "value" && !isReservedProp(key)) {
6611
          hostPatchProp(
6612
            el,
6613
            key,
6614
            null,
6615
            props[key],
6616
            isSVG,
6617
            vnode.children,
6618
            parentComponent,
6619
            parentSuspense,
6620
            unmountChildren
6621
          );
6622
        }
6623
      }
6624
      if ("value" in props) {
6625
        hostPatchProp(el, "value", null, props.value);
6626
      }
6627
      if (vnodeHook = props.onVnodeBeforeMount) {
6628
        invokeVNodeHook(vnodeHook, parentComponent, vnode);
6629
      }
6630
    }
6631
    {
6632
      Object.defineProperty(el, "__vnode", {
6633
        value: vnode,
6634
        enumerable: false
6635
      });
6636
      Object.defineProperty(el, "__vueParentComponent", {
6637
        value: parentComponent,
6638
        enumerable: false
6639
      });
6640
    }
6641
    if (dirs) {
6642
      invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6643
    }
6644
    const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
6645
    if (needCallTransitionHooks) {
6646
      transition.beforeEnter(el);
6647
    }
6648
    hostInsert(el, container, anchor);
6649
    if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
6650
      queuePostRenderEffect(() => {
6651
        vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
6652
        needCallTransitionHooks && transition.enter(el);
6653
        dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6654
      }, parentSuspense);
6655
    }
6656
  };
6657
  const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
6658
    if (scopeId) {
6659
      hostSetScopeId(el, scopeId);
6660
    }
6661
    if (slotScopeIds) {
6662
      for (let i = 0; i < slotScopeIds.length; i++) {
6663
        hostSetScopeId(el, slotScopeIds[i]);
6664
      }
6665
    }
6666
    if (parentComponent) {
6667
      let subTree = parentComponent.subTree;
6668
      if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
6669
        subTree = filterSingleRoot(subTree.children) || subTree;
6670
      }
6671
      if (vnode === subTree) {
6672
        const parentVNode = parentComponent.vnode;
6673
        setScopeId(
6674
          el,
6675
          parentVNode,
6676
          parentVNode.scopeId,
6677
          parentVNode.slotScopeIds,
6678
          parentComponent.parent
6679
        );
6680
      }
6681
    }
6682
  };
6683
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {
6684
    for (let i = start; i < children.length; i++) {
6685
      const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
6686
      patch(
6687
        null,
6688
        child,
6689
        container,
6690
        anchor,
6691
        parentComponent,
6692
        parentSuspense,
6693
        isSVG,
6694
        slotScopeIds,
6695
        optimized
6696
      );
6697
    }
6698
  };
6699
  const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
6700
    const el = n2.el = n1.el;
6701
    let { patchFlag, dynamicChildren, dirs } = n2;
6702
    patchFlag |= n1.patchFlag & 16;
6703
    const oldProps = n1.props || EMPTY_OBJ;
6704
    const newProps = n2.props || EMPTY_OBJ;
6705
    let vnodeHook;
6706
    parentComponent && toggleRecurse(parentComponent, false);
6707
    if (vnodeHook = newProps.onVnodeBeforeUpdate) {
6708
      invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
6709
    }
6710
    if (dirs) {
6711
      invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
6712
    }
6713
    parentComponent && toggleRecurse(parentComponent, true);
6714
    if (isHmrUpdating) {
6715
      patchFlag = 0;
6716
      optimized = false;
6717
      dynamicChildren = null;
6718
    }
6719
    const areChildrenSVG = isSVG && n2.type !== "foreignObject";
6720
    if (dynamicChildren) {
6721
      patchBlockChildren(
6722
        n1.dynamicChildren,
6723
        dynamicChildren,
6724
        el,
6725
        parentComponent,
6726
        parentSuspense,
6727
        areChildrenSVG,
6728
        slotScopeIds
6729
      );
6730
      {
6731
        traverseStaticChildren(n1, n2);
6732
      }
6733
    } else if (!optimized) {
6734
      patchChildren(
6735
        n1,
6736
        n2,
6737
        el,
6738
        null,
6739
        parentComponent,
6740
        parentSuspense,
6741
        areChildrenSVG,
6742
        slotScopeIds,
6743
        false
6744
      );
6745
    }
6746
    if (patchFlag > 0) {
6747
      if (patchFlag & 16) {
6748
        patchProps(
6749
          el,
6750
          n2,
6751
          oldProps,
6752
          newProps,
6753
          parentComponent,
6754
          parentSuspense,
6755
          isSVG
6756
        );
6757
      } else {
6758
        if (patchFlag & 2) {
6759
          if (oldProps.class !== newProps.class) {
6760
            hostPatchProp(el, "class", null, newProps.class, isSVG);
6761
          }
6762
        }
6763
        if (patchFlag & 4) {
6764
          hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);
6765
        }
6766
        if (patchFlag & 8) {
6767
          const propsToUpdate = n2.dynamicProps;
6768
          for (let i = 0; i < propsToUpdate.length; i++) {
6769
            const key = propsToUpdate[i];
6770
            const prev = oldProps[key];
6771
            const next = newProps[key];
6772
            if (next !== prev || key === "value") {
6773
              hostPatchProp(
6774
                el,
6775
                key,
6776
                prev,
6777
                next,
6778
                isSVG,
6779
                n1.children,
6780
                parentComponent,
6781
                parentSuspense,
6782
                unmountChildren
6783
              );
6784
            }
6785
          }
6786
        }
6787
      }
6788
      if (patchFlag & 1) {
6789
        if (n1.children !== n2.children) {
6790
          hostSetElementText(el, n2.children);
6791
        }
6792
      }
6793
    } else if (!optimized && dynamicChildren == null) {
6794
      patchProps(
6795
        el,
6796
        n2,
6797
        oldProps,
6798
        newProps,
6799
        parentComponent,
6800
        parentSuspense,
6801
        isSVG
6802
      );
6803
    }
6804
    if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
6805
      queuePostRenderEffect(() => {
6806
        vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
6807
        dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
6808
      }, parentSuspense);
6809
    }
6810
  };
6811
  const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {
6812
    for (let i = 0; i < newChildren.length; i++) {
6813
      const oldVNode = oldChildren[i];
6814
      const newVNode = newChildren[i];
6815
      const container = (
6816
        // oldVNode may be an errored async setup() component inside Suspense
6817
        // which will not have a mounted element
6818
        oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
6819
        // of the Fragment itself so it can move its children.
6820
        (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
6821
        // which also requires the correct parent container
6822
        !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
6823
        oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
6824
          // In other cases, the parent container is not actually used so we
6825
          // just pass the block element here to avoid a DOM parentNode call.
6826
          fallbackContainer
6827
        )
6828
      );
6829
      patch(
6830
        oldVNode,
6831
        newVNode,
6832
        container,
6833
        null,
6834
        parentComponent,
6835
        parentSuspense,
6836
        isSVG,
6837
        slotScopeIds,
6838
        true
6839
      );
6840
    }
6841
  };
6842
  const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
6843
    if (oldProps !== newProps) {
6844
      if (oldProps !== EMPTY_OBJ) {
6845
        for (const key in oldProps) {
6846
          if (!isReservedProp(key) && !(key in newProps)) {
6847
            hostPatchProp(
6848
              el,
6849
              key,
6850
              oldProps[key],
6851
              null,
6852
              isSVG,
6853
              vnode.children,
6854
              parentComponent,
6855
              parentSuspense,
6856
              unmountChildren
6857
            );
6858
          }
6859
        }
6860
      }
6861
      for (const key in newProps) {
6862
        if (isReservedProp(key))
6863
          continue;
6864
        const next = newProps[key];
6865
        const prev = oldProps[key];
6866
        if (next !== prev && key !== "value") {
6867
          hostPatchProp(
6868
            el,
6869
            key,
6870
            prev,
6871
            next,
6872
            isSVG,
6873
            vnode.children,
6874
            parentComponent,
6875
            parentSuspense,
6876
            unmountChildren
6877
          );
6878
        }
6879
      }
6880
      if ("value" in newProps) {
6881
        hostPatchProp(el, "value", oldProps.value, newProps.value);
6882
      }
6883
    }
6884
  };
6885
  const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
6886
    const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
6887
    const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
6888
    let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
6889
    if (
6890
      // #5523 dev root fragment may inherit directives
6891
      isHmrUpdating || patchFlag & 2048
6892
    ) {
6893
      patchFlag = 0;
6894
      optimized = false;
6895
      dynamicChildren = null;
6896
    }
6897
    if (fragmentSlotScopeIds) {
6898
      slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
6899
    }
6900
    if (n1 == null) {
6901
      hostInsert(fragmentStartAnchor, container, anchor);
6902
      hostInsert(fragmentEndAnchor, container, anchor);
6903
      mountChildren(
6904
        n2.children,
6905
        container,
6906
        fragmentEndAnchor,
6907
        parentComponent,
6908
        parentSuspense,
6909
        isSVG,
6910
        slotScopeIds,
6911
        optimized
6912
      );
6913
    } else {
6914
      if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
6915
      // of renderSlot() with no valid children
6916
      n1.dynamicChildren) {
6917
        patchBlockChildren(
6918
          n1.dynamicChildren,
6919
          dynamicChildren,
6920
          container,
6921
          parentComponent,
6922
          parentSuspense,
6923
          isSVG,
6924
          slotScopeIds
6925
        );
6926
        {
6927
          traverseStaticChildren(n1, n2);
6928
        }
6929
      } else {
6930
        patchChildren(
6931
          n1,
6932
          n2,
6933
          container,
6934
          fragmentEndAnchor,
6935
          parentComponent,
6936
          parentSuspense,
6937
          isSVG,
6938
          slotScopeIds,
6939
          optimized
6940
        );
6941
      }
6942
    }
6943
  };
6944
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
6945
    n2.slotScopeIds = slotScopeIds;
6946
    if (n1 == null) {
6947
      if (n2.shapeFlag & 512) {
6948
        parentComponent.ctx.activate(
6949
          n2,
6950
          container,
6951
          anchor,
6952
          isSVG,
6953
          optimized
6954
        );
6955
      } else {
6956
        mountComponent(
6957
          n2,
6958
          container,
6959
          anchor,
6960
          parentComponent,
6961
          parentSuspense,
6962
          isSVG,
6963
          optimized
6964
        );
6965
      }
6966
    } else {
6967
      updateComponent(n1, n2, optimized);
6968
    }
6969
  };
6970
  const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
6971
    const instance = (initialVNode.component = createComponentInstance(
6972
      initialVNode,
6973
      parentComponent,
6974
      parentSuspense
6975
    ));
6976
    if (instance.type.__hmrId) {
6977
      registerHMR(instance);
6978
    }
6979
    {
6980
      pushWarningContext(initialVNode);
6981
      startMeasure(instance, `mount`);
6982
    }
6983
    if (isKeepAlive(initialVNode)) {
6984
      instance.ctx.renderer = internals;
6985
    }
6986
    {
6987
      {
6988
        startMeasure(instance, `init`);
6989
      }
6990
      setupComponent(instance);
6991
      {
6992
        endMeasure(instance, `init`);
6993
      }
6994
    }
6995
    if (instance.asyncDep) {
6996
      parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);
6997
      if (!initialVNode.el) {
6998
        const placeholder = instance.subTree = createVNode(Comment);
6999
        processCommentNode(null, placeholder, container, anchor);
7000
      }
7001
      return;
7002
    }
7003
    setupRenderEffect(
7004
      instance,
7005
      initialVNode,
7006
      container,
7007
      anchor,
7008
      parentSuspense,
7009
      isSVG,
7010
      optimized
7011
    );
7012
    {
7013
      popWarningContext();
7014
      endMeasure(instance, `mount`);
7015
    }
7016
  };
7017
  const updateComponent = (n1, n2, optimized) => {
7018
    const instance = n2.component = n1.component;
7019
    if (shouldUpdateComponent(n1, n2, optimized)) {
7020
      if (instance.asyncDep && !instance.asyncResolved) {
7021
        {
7022
          pushWarningContext(n2);
7023
        }
7024
        updateComponentPreRender(instance, n2, optimized);
7025
        {
7026
          popWarningContext();
7027
        }
7028
        return;
7029
      } else {
7030
        instance.next = n2;
7031
        invalidateJob(instance.update);
7032
        instance.update();
7033
      }
7034
    } else {
7035
      n2.el = n1.el;
7036
      instance.vnode = n2;
7037
    }
7038
  };
7039
  const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {
7040
    const componentUpdateFn = () => {
7041
      if (!instance.isMounted) {
7042
        let vnodeHook;
7043
        const { el, props } = initialVNode;
7044
        const { bm, m, parent } = instance;
7045
        const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
7046
        toggleRecurse(instance, false);
7047
        if (bm) {
7048
          invokeArrayFns(bm);
7049
        }
7050
        if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
7051
          invokeVNodeHook(vnodeHook, parent, initialVNode);
7052
        }
7053
        toggleRecurse(instance, true);
7054
        if (el && hydrateNode) {
7055
          const hydrateSubTree = () => {
7056
            {
7057
              startMeasure(instance, `render`);
7058
            }
7059
            instance.subTree = renderComponentRoot(instance);
7060
            {
7061
              endMeasure(instance, `render`);
7062
            }
7063
            {
7064
              startMeasure(instance, `hydrate`);
7065
            }
7066
            hydrateNode(
7067
              el,
7068
              instance.subTree,
7069
              instance,
7070
              parentSuspense,
7071
              null
7072
            );
7073
            {
7074
              endMeasure(instance, `hydrate`);
7075
            }
7076
          };
7077
          if (isAsyncWrapperVNode) {
7078
            initialVNode.type.__asyncLoader().then(
7079
              // note: we are moving the render call into an async callback,
7080
              // which means it won't track dependencies - but it's ok because
7081
              // a server-rendered async wrapper is already in resolved state
7082
              // and it will never need to change.
7083
              () => !instance.isUnmounted && hydrateSubTree()
7084
            );
7085
          } else {
7086
            hydrateSubTree();
7087
          }
7088
        } else {
7089
          {
7090
            startMeasure(instance, `render`);
7091
          }
7092
          const subTree = instance.subTree = renderComponentRoot(instance);
7093
          {
7094
            endMeasure(instance, `render`);
7095
          }
7096
          {
7097
            startMeasure(instance, `patch`);
7098
          }
7099
          patch(
7100
            null,
7101
            subTree,
7102
            container,
7103
            anchor,
7104
            instance,
7105
            parentSuspense,
7106
            isSVG
7107
          );
7108
          {
7109
            endMeasure(instance, `patch`);
7110
          }
7111
          initialVNode.el = subTree.el;
7112
        }
7113
        if (m) {
7114
          queuePostRenderEffect(m, parentSuspense);
7115
        }
7116
        if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
7117
          const scopedInitialVNode = initialVNode;
7118
          queuePostRenderEffect(
7119
            () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
7120
            parentSuspense
7121
          );
7122
        }
7123
        if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
7124
          instance.a && queuePostRenderEffect(instance.a, parentSuspense);
7125
        }
7126
        instance.isMounted = true;
7127
        {
7128
          devtoolsComponentAdded(instance);
7129
        }
7130
        initialVNode = container = anchor = null;
7131
      } else {
7132
        let { next, bu, u, parent, vnode } = instance;
7133
        let originNext = next;
7134
        let vnodeHook;
7135
        {
7136
          pushWarningContext(next || instance.vnode);
7137
        }
7138
        toggleRecurse(instance, false);
7139
        if (next) {
7140
          next.el = vnode.el;
7141
          updateComponentPreRender(instance, next, optimized);
7142
        } else {
7143
          next = vnode;
7144
        }
7145
        if (bu) {
7146
          invokeArrayFns(bu);
7147
        }
7148
        if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
7149
          invokeVNodeHook(vnodeHook, parent, next, vnode);
7150
        }
7151
        toggleRecurse(instance, true);
7152
        {
7153
          startMeasure(instance, `render`);
7154
        }
7155
        const nextTree = renderComponentRoot(instance);
7156
        {
7157
          endMeasure(instance, `render`);
7158
        }
7159
        const prevTree = instance.subTree;
7160
        instance.subTree = nextTree;
7161
        {
7162
          startMeasure(instance, `patch`);
7163
        }
7164
        patch(
7165
          prevTree,
7166
          nextTree,
7167
          // parent may have changed if it's in a teleport
7168
          hostParentNode(prevTree.el),
7169
          // anchor may have changed if it's in a fragment
7170
          getNextHostNode(prevTree),
7171
          instance,
7172
          parentSuspense,
7173
          isSVG
7174
        );
7175
        {
7176
          endMeasure(instance, `patch`);
7177
        }
7178
        next.el = nextTree.el;
7179
        if (originNext === null) {
7180
          updateHOCHostEl(instance, nextTree.el);
7181
        }
7182
        if (u) {
7183
          queuePostRenderEffect(u, parentSuspense);
7184
        }
7185
        if (vnodeHook = next.props && next.props.onVnodeUpdated) {
7186
          queuePostRenderEffect(
7187
            () => invokeVNodeHook(vnodeHook, parent, next, vnode),
7188
            parentSuspense
7189
          );
7190
        }
7191
        {
7192
          devtoolsComponentUpdated(instance);
7193
        }
7194
        {
7195
          popWarningContext();
7196
        }
7197
      }
7198
    };
7199
    const effect = instance.effect = new ReactiveEffect(
7200
      componentUpdateFn,
7201
      () => queueJob(update),
7202
      instance.scope
7203
      // track it in component's effect scope
7204
    );
7205
    const update = instance.update = () => effect.run();
7206
    update.id = instance.uid;
7207
    toggleRecurse(instance, true);
7208
    {
7209
      effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
7210
      effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
7211
      update.ownerInstance = instance;
7212
    }
7213
    update();
7214
  };
7215
  const updateComponentPreRender = (instance, nextVNode, optimized) => {
7216
    nextVNode.component = instance;
7217
    const prevProps = instance.vnode.props;
7218
    instance.vnode = nextVNode;
7219
    instance.next = null;
7220
    updateProps(instance, nextVNode.props, prevProps, optimized);
7221
    updateSlots(instance, nextVNode.children, optimized);
7222
    pauseTracking();
7223
    flushPreFlushCbs();
7224
    resetTracking();
7225
  };
7226
  const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
7227
    const c1 = n1 && n1.children;
7228
    const prevShapeFlag = n1 ? n1.shapeFlag : 0;
7229
    const c2 = n2.children;
7230
    const { patchFlag, shapeFlag } = n2;
7231
    if (patchFlag > 0) {
7232
      if (patchFlag & 128) {
7233
        patchKeyedChildren(
7234
          c1,
7235
          c2,
7236
          container,
7237
          anchor,
7238
          parentComponent,
7239
          parentSuspense,
7240
          isSVG,
7241
          slotScopeIds,
7242
          optimized
7243
        );
7244
        return;
7245
      } else if (patchFlag & 256) {
7246
        patchUnkeyedChildren(
7247
          c1,
7248
          c2,
7249
          container,
7250
          anchor,
7251
          parentComponent,
7252
          parentSuspense,
7253
          isSVG,
7254
          slotScopeIds,
7255
          optimized
7256
        );
7257
        return;
7258
      }
7259
    }
7260
    if (shapeFlag & 8) {
7261
      if (prevShapeFlag & 16) {
7262
        unmountChildren(c1, parentComponent, parentSuspense);
7263
      }
7264
      if (c2 !== c1) {
7265
        hostSetElementText(container, c2);
7266
      }
7267
    } else {
7268
      if (prevShapeFlag & 16) {
7269
        if (shapeFlag & 16) {
7270
          patchKeyedChildren(
7271
            c1,
7272
            c2,
7273
            container,
7274
            anchor,
7275
            parentComponent,
7276
            parentSuspense,
7277
            isSVG,
7278
            slotScopeIds,
7279
            optimized
7280
          );
7281
        } else {
7282
          unmountChildren(c1, parentComponent, parentSuspense, true);
7283
        }
7284
      } else {
7285
        if (prevShapeFlag & 8) {
7286
          hostSetElementText(container, "");
7287
        }
7288
        if (shapeFlag & 16) {
7289
          mountChildren(
7290
            c2,
7291
            container,
7292
            anchor,
7293
            parentComponent,
7294
            parentSuspense,
7295
            isSVG,
7296
            slotScopeIds,
7297
            optimized
7298
          );
7299
        }
7300
      }
7301
    }
7302
  };
7303
  const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
7304
    c1 = c1 || EMPTY_ARR;
7305
    c2 = c2 || EMPTY_ARR;
7306
    const oldLength = c1.length;
7307
    const newLength = c2.length;
7308
    const commonLength = Math.min(oldLength, newLength);
7309
    let i;
7310
    for (i = 0; i < commonLength; i++) {
7311
      const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
7312
      patch(
7313
        c1[i],
7314
        nextChild,
7315
        container,
7316
        null,
7317
        parentComponent,
7318
        parentSuspense,
7319
        isSVG,
7320
        slotScopeIds,
7321
        optimized
7322
      );
7323
    }
7324
    if (oldLength > newLength) {
7325
      unmountChildren(
7326
        c1,
7327
        parentComponent,
7328
        parentSuspense,
7329
        true,
7330
        false,
7331
        commonLength
7332
      );
7333
    } else {
7334
      mountChildren(
7335
        c2,
7336
        container,
7337
        anchor,
7338
        parentComponent,
7339
        parentSuspense,
7340
        isSVG,
7341
        slotScopeIds,
7342
        optimized,
7343
        commonLength
7344
      );
7345
    }
7346
  };
7347
  const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
7348
    let i = 0;
7349
    const l2 = c2.length;
7350
    let e1 = c1.length - 1;
7351
    let e2 = l2 - 1;
7352
    while (i <= e1 && i <= e2) {
7353
      const n1 = c1[i];
7354
      const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
7355
      if (isSameVNodeType(n1, n2)) {
7356
        patch(
7357
          n1,
7358
          n2,
7359
          container,
7360
          null,
7361
          parentComponent,
7362
          parentSuspense,
7363
          isSVG,
7364
          slotScopeIds,
7365
          optimized
7366
        );
7367
      } else {
7368
        break;
7369
      }
7370
      i++;
7371
    }
7372
    while (i <= e1 && i <= e2) {
7373
      const n1 = c1[e1];
7374
      const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
7375
      if (isSameVNodeType(n1, n2)) {
7376
        patch(
7377
          n1,
7378
          n2,
7379
          container,
7380
          null,
7381
          parentComponent,
7382
          parentSuspense,
7383
          isSVG,
7384
          slotScopeIds,
7385
          optimized
7386
        );
7387
      } else {
7388
        break;
7389
      }
7390
      e1--;
7391
      e2--;
7392
    }
7393
    if (i > e1) {
7394
      if (i <= e2) {
7395
        const nextPos = e2 + 1;
7396
        const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
7397
        while (i <= e2) {
7398
          patch(
7399
            null,
7400
            c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
7401
            container,
7402
            anchor,
7403
            parentComponent,
7404
            parentSuspense,
7405
            isSVG,
7406
            slotScopeIds,
7407
            optimized
7408
          );
7409
          i++;
7410
        }
7411
      }
7412
    } else if (i > e2) {
7413
      while (i <= e1) {
7414
        unmount(c1[i], parentComponent, parentSuspense, true);
7415
        i++;
7416
      }
7417
    } else {
7418
      const s1 = i;
7419
      const s2 = i;
7420
      const keyToNewIndexMap = /* @__PURE__ */ new Map();
7421
      for (i = s2; i <= e2; i++) {
7422
        const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
7423
        if (nextChild.key != null) {
7424
          if (keyToNewIndexMap.has(nextChild.key)) {
7425
            warn(
7426
              `Duplicate keys found during update:`,
7427
              JSON.stringify(nextChild.key),
7428
              `Make sure keys are unique.`
7429
            );
7430
          }
7431
          keyToNewIndexMap.set(nextChild.key, i);
7432
        }
7433
      }
7434
      let j;
7435
      let patched = 0;
7436
      const toBePatched = e2 - s2 + 1;
7437
      let moved = false;
7438
      let maxNewIndexSoFar = 0;
7439
      const newIndexToOldIndexMap = new Array(toBePatched);
7440
      for (i = 0; i < toBePatched; i++)
7441
        newIndexToOldIndexMap[i] = 0;
7442
      for (i = s1; i <= e1; i++) {
7443
        const prevChild = c1[i];
7444
        if (patched >= toBePatched) {
7445
          unmount(prevChild, parentComponent, parentSuspense, true);
7446
          continue;
7447
        }
7448
        let newIndex;
7449
        if (prevChild.key != null) {
7450
          newIndex = keyToNewIndexMap.get(prevChild.key);
7451
        } else {
7452
          for (j = s2; j <= e2; j++) {
7453
            if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
7454
              newIndex = j;
7455
              break;
7456
            }
7457
          }
7458
        }
7459
        if (newIndex === void 0) {
7460
          unmount(prevChild, parentComponent, parentSuspense, true);
7461
        } else {
7462
          newIndexToOldIndexMap[newIndex - s2] = i + 1;
7463
          if (newIndex >= maxNewIndexSoFar) {
7464
            maxNewIndexSoFar = newIndex;
7465
          } else {
7466
            moved = true;
7467
          }
7468
          patch(
7469
            prevChild,
7470
            c2[newIndex],
7471
            container,
7472
            null,
7473
            parentComponent,
7474
            parentSuspense,
7475
            isSVG,
7476
            slotScopeIds,
7477
            optimized
7478
          );
7479
          patched++;
7480
        }
7481
      }
7482
      const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
7483
      j = increasingNewIndexSequence.length - 1;
7484
      for (i = toBePatched - 1; i >= 0; i--) {
7485
        const nextIndex = s2 + i;
7486
        const nextChild = c2[nextIndex];
7487
        const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
7488
        if (newIndexToOldIndexMap[i] === 0) {
7489
          patch(
7490
            null,
7491
            nextChild,
7492
            container,
7493
            anchor,
7494
            parentComponent,
7495
            parentSuspense,
7496
            isSVG,
7497
            slotScopeIds,
7498
            optimized
7499
          );
7500
        } else if (moved) {
7501
          if (j < 0 || i !== increasingNewIndexSequence[j]) {
7502
            move(nextChild, container, anchor, 2);
7503
          } else {
7504
            j--;
7505
          }
7506
        }
7507
      }
7508
    }
7509
  };
7510
  const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
7511
    const { el, type, transition, children, shapeFlag } = vnode;
7512
    if (shapeFlag & 6) {
7513
      move(vnode.component.subTree, container, anchor, moveType);
7514
      return;
7515
    }
7516
    if (shapeFlag & 128) {
7517
      vnode.suspense.move(container, anchor, moveType);
7518
      return;
7519
    }
7520
    if (shapeFlag & 64) {
7521
      type.move(vnode, container, anchor, internals);
7522
      return;
7523
    }
7524
    if (type === Fragment) {
7525
      hostInsert(el, container, anchor);
7526
      for (let i = 0; i < children.length; i++) {
7527
        move(children[i], container, anchor, moveType);
7528
      }
7529
      hostInsert(vnode.anchor, container, anchor);
7530
      return;
7531
    }
7532
    if (type === Static) {
7533
      moveStaticNode(vnode, container, anchor);
7534
      return;
7535
    }
7536
    const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
7537
    if (needTransition) {
7538
      if (moveType === 0) {
7539
        transition.beforeEnter(el);
7540
        hostInsert(el, container, anchor);
7541
        queuePostRenderEffect(() => transition.enter(el), parentSuspense);
7542
      } else {
7543
        const { leave, delayLeave, afterLeave } = transition;
7544
        const remove2 = () => hostInsert(el, container, anchor);
7545
        const performLeave = () => {
7546
          leave(el, () => {
7547
            remove2();
7548
            afterLeave && afterLeave();
7549
          });
7550
        };
7551
        if (delayLeave) {
7552
          delayLeave(el, remove2, performLeave);
7553
        } else {
7554
          performLeave();
7555
        }
7556
      }
7557
    } else {
7558
      hostInsert(el, container, anchor);
7559
    }
7560
  };
7561
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
7562
    const {
7563
      type,
7564
      props,
7565
      ref,
7566
      children,
7567
      dynamicChildren,
7568
      shapeFlag,
7569
      patchFlag,
7570
      dirs
7571
    } = vnode;
7572
    if (ref != null) {
7573
      setRef(ref, null, parentSuspense, vnode, true);
7574
    }
7575
    if (shapeFlag & 256) {
7576
      parentComponent.ctx.deactivate(vnode);
7577
      return;
7578
    }
7579
    const shouldInvokeDirs = shapeFlag & 1 && dirs;
7580
    const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
7581
    let vnodeHook;
7582
    if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
7583
      invokeVNodeHook(vnodeHook, parentComponent, vnode);
7584
    }
7585
    if (shapeFlag & 6) {
7586
      unmountComponent(vnode.component, parentSuspense, doRemove);
7587
    } else {
7588
      if (shapeFlag & 128) {
7589
        vnode.suspense.unmount(parentSuspense, doRemove);
7590
        return;
7591
      }
7592
      if (shouldInvokeDirs) {
7593
        invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
7594
      }
7595
      if (shapeFlag & 64) {
7596
        vnode.type.remove(
7597
          vnode,
7598
          parentComponent,
7599
          parentSuspense,
7600
          optimized,
7601
          internals,
7602
          doRemove
7603
        );
7604
      } else if (dynamicChildren && // #1153: fast path should not be taken for non-stable (v-for) fragments
7605
      (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
7606
        unmountChildren(
7607
          dynamicChildren,
7608
          parentComponent,
7609
          parentSuspense,
7610
          false,
7611
          true
7612
        );
7613
      } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
7614
        unmountChildren(children, parentComponent, parentSuspense);
7615
      }
7616
      if (doRemove) {
7617
        remove(vnode);
7618
      }
7619
    }
7620
    if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
7621
      queuePostRenderEffect(() => {
7622
        vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7623
        shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
7624
      }, parentSuspense);
7625
    }
7626
  };
7627
  const remove = (vnode) => {
7628
    const { type, el, anchor, transition } = vnode;
7629
    if (type === Fragment) {
7630
      if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
7631
        vnode.children.forEach((child) => {
7632
          if (child.type === Comment) {
7633
            hostRemove(child.el);
7634
          } else {
7635
            remove(child);
7636
          }
7637
        });
7638
      } else {
7639
        removeFragment(el, anchor);
7640
      }
7641
      return;
7642
    }
7643
    if (type === Static) {
7644
      removeStaticNode(vnode);
7645
      return;
7646
    }
7647
    const performRemove = () => {
7648
      hostRemove(el);
7649
      if (transition && !transition.persisted && transition.afterLeave) {
7650
        transition.afterLeave();
7651
      }
7652
    };
7653
    if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
7654
      const { leave, delayLeave } = transition;
7655
      const performLeave = () => leave(el, performRemove);
7656
      if (delayLeave) {
7657
        delayLeave(vnode.el, performRemove, performLeave);
7658
      } else {
7659
        performLeave();
7660
      }
7661
    } else {
7662
      performRemove();
7663
    }
7664
  };
7665
  const removeFragment = (cur, end) => {
7666
    let next;
7667
    while (cur !== end) {
7668
      next = hostNextSibling(cur);
7669
      hostRemove(cur);
7670
      cur = next;
7671
    }
7672
    hostRemove(end);
7673
  };
7674
  const unmountComponent = (instance, parentSuspense, doRemove) => {
7675
    if (instance.type.__hmrId) {
7676
      unregisterHMR(instance);
7677
    }
7678
    const { bum, scope, update, subTree, um } = instance;
7679
    if (bum) {
7680
      invokeArrayFns(bum);
7681
    }
7682
    scope.stop();
7683
    if (update) {
7684
      update.active = false;
7685
      unmount(subTree, instance, parentSuspense, doRemove);
7686
    }
7687
    if (um) {
7688
      queuePostRenderEffect(um, parentSuspense);
7689
    }
7690
    queuePostRenderEffect(() => {
7691
      instance.isUnmounted = true;
7692
    }, parentSuspense);
7693
    if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
7694
      parentSuspense.deps--;
7695
      if (parentSuspense.deps === 0) {
7696
        parentSuspense.resolve();
7697
      }
7698
    }
7699
    {
7700
      devtoolsComponentRemoved(instance);
7701
    }
7702
  };
7703
  const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
7704
    for (let i = start; i < children.length; i++) {
7705
      unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
7706
    }
7707
  };
7708
  const getNextHostNode = (vnode) => {
7709
    if (vnode.shapeFlag & 6) {
7710
      return getNextHostNode(vnode.component.subTree);
7711
    }
7712
    if (vnode.shapeFlag & 128) {
7713
      return vnode.suspense.next();
7714
    }
7715
    return hostNextSibling(vnode.anchor || vnode.el);
7716
  };
7717
  const render = (vnode, container, isSVG) => {
7718
    if (vnode == null) {
7719
      if (container._vnode) {
7720
        unmount(container._vnode, null, null, true);
7721
      }
7722
    } else {
7723
      patch(container._vnode || null, vnode, container, null, null, null, isSVG);
7724
    }
7725
    flushPreFlushCbs();
7726
    flushPostFlushCbs();
7727
    container._vnode = vnode;
7728
  };
7729
  const internals = {
7730
    p: patch,
7731
    um: unmount,
7732
    m: move,
7733
    r: remove,
7734
    mt: mountComponent,
7735
    mc: mountChildren,
7736
    pc: patchChildren,
7737
    pbc: patchBlockChildren,
7738
    n: getNextHostNode,
7739
    o: options
7740
  };
7741
  let hydrate;
7742
  let hydrateNode;
7743
  if (createHydrationFns) {
7744
    [hydrate, hydrateNode] = createHydrationFns(
7745
      internals
7746
    );
7747
  }
7748
  return {
7749
    render,
7750
    hydrate,
7751
    createApp: createAppAPI(render, hydrate)
7752
  };
7753
}
7754
function toggleRecurse({ effect, update }, allowed) {
7755
  effect.allowRecurse = update.allowRecurse = allowed;
7756
}
7757
function traverseStaticChildren(n1, n2, shallow = false) {
7758
  const ch1 = n1.children;
7759
  const ch2 = n2.children;
7760
  if (isArray(ch1) && isArray(ch2)) {
7761
    for (let i = 0; i < ch1.length; i++) {
7762
      const c1 = ch1[i];
7763
      let c2 = ch2[i];
7764
      if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
7765
        if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
7766
          c2 = ch2[i] = cloneIfMounted(ch2[i]);
7767
          c2.el = c1.el;
7768
        }
7769
        if (!shallow)
7770
          traverseStaticChildren(c1, c2);
7771
      }
7772
      if (c2.type === Text) {
7773
        c2.el = c1.el;
7774
      }
7775
      if (c2.type === Comment && !c2.el) {
7776
        c2.el = c1.el;
7777
      }
7778
    }
7779
  }
7780
}
7781
function getSequence(arr) {
7782
  const p = arr.slice();
7783
  const result = [0];
7784
  let i, j, u, v, c;
7785
  const len = arr.length;
7786
  for (i = 0; i < len; i++) {
7787
    const arrI = arr[i];
7788
    if (arrI !== 0) {
7789
      j = result[result.length - 1];
7790
      if (arr[j] < arrI) {
7791
        p[i] = j;
7792
        result.push(i);
7793
        continue;
7794
      }
7795
      u = 0;
7796
      v = result.length - 1;
7797
      while (u < v) {
7798
        c = u + v >> 1;
7799
        if (arr[result[c]] < arrI) {
7800
          u = c + 1;
7801
        } else {
7802
          v = c;
7803
        }
7804
      }
7805
      if (arrI < arr[result[u]]) {
7806
        if (u > 0) {
7807
          p[i] = result[u - 1];
7808
        }
7809
        result[u] = i;
7810
      }
7811
    }
7812
  }
7813
  u = result.length;
7814
  v = result[u - 1];
7815
  while (u-- > 0) {
7816
    result[u] = v;
7817
    v = p[v];
7818
  }
7819
  return result;
7820
}
7821
 
7822
const isTeleport = (type) => type.__isTeleport;
7823
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
7824
const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
7825
const resolveTarget = (props, select) => {
7826
  const targetSelector = props && props.to;
7827
  if (isString(targetSelector)) {
7828
    if (!select) {
7829
      warn(
7830
        `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
7831
      );
7832
      return null;
7833
    } else {
7834
      const target = select(targetSelector);
7835
      if (!target) {
7836
        warn(
7837
          `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`
7838
        );
7839
      }
7840
      return target;
7841
    }
7842
  } else {
7843
    if (!targetSelector && !isTeleportDisabled(props)) {
7844
      warn(`Invalid Teleport target: ${targetSelector}`);
7845
    }
7846
    return targetSelector;
7847
  }
7848
};
7849
const TeleportImpl = {
7850
  __isTeleport: true,
7851
  process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
7852
    const {
7853
      mc: mountChildren,
7854
      pc: patchChildren,
7855
      pbc: patchBlockChildren,
7856
      o: { insert, querySelector, createText, createComment }
7857
    } = internals;
7858
    const disabled = isTeleportDisabled(n2.props);
7859
    let { shapeFlag, children, dynamicChildren } = n2;
7860
    if (isHmrUpdating) {
7861
      optimized = false;
7862
      dynamicChildren = null;
7863
    }
7864
    if (n1 == null) {
7865
      const placeholder = n2.el = createComment("teleport start") ;
7866
      const mainAnchor = n2.anchor = createComment("teleport end") ;
7867
      insert(placeholder, container, anchor);
7868
      insert(mainAnchor, container, anchor);
7869
      const target = n2.target = resolveTarget(n2.props, querySelector);
7870
      const targetAnchor = n2.targetAnchor = createText("");
7871
      if (target) {
7872
        insert(targetAnchor, target);
7873
        isSVG = isSVG || isTargetSVG(target);
7874
      } else if (!disabled) {
7875
        warn("Invalid Teleport target on mount:", target, `(${typeof target})`);
7876
      }
7877
      const mount = (container2, anchor2) => {
7878
        if (shapeFlag & 16) {
7879
          mountChildren(
7880
            children,
7881
            container2,
7882
            anchor2,
7883
            parentComponent,
7884
            parentSuspense,
7885
            isSVG,
7886
            slotScopeIds,
7887
            optimized
7888
          );
7889
        }
7890
      };
7891
      if (disabled) {
7892
        mount(container, mainAnchor);
7893
      } else if (target) {
7894
        mount(target, targetAnchor);
7895
      }
7896
    } else {
7897
      n2.el = n1.el;
7898
      const mainAnchor = n2.anchor = n1.anchor;
7899
      const target = n2.target = n1.target;
7900
      const targetAnchor = n2.targetAnchor = n1.targetAnchor;
7901
      const wasDisabled = isTeleportDisabled(n1.props);
7902
      const currentContainer = wasDisabled ? container : target;
7903
      const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
7904
      isSVG = isSVG || isTargetSVG(target);
7905
      if (dynamicChildren) {
7906
        patchBlockChildren(
7907
          n1.dynamicChildren,
7908
          dynamicChildren,
7909
          currentContainer,
7910
          parentComponent,
7911
          parentSuspense,
7912
          isSVG,
7913
          slotScopeIds
7914
        );
7915
        traverseStaticChildren(n1, n2, true);
7916
      } else if (!optimized) {
7917
        patchChildren(
7918
          n1,
7919
          n2,
7920
          currentContainer,
7921
          currentAnchor,
7922
          parentComponent,
7923
          parentSuspense,
7924
          isSVG,
7925
          slotScopeIds,
7926
          false
7927
        );
7928
      }
7929
      if (disabled) {
7930
        if (!wasDisabled) {
7931
          moveTeleport(
7932
            n2,
7933
            container,
7934
            mainAnchor,
7935
            internals,
7936
            1
7937
          );
7938
        } else {
7939
          if (n2.props && n1.props && n2.props.to !== n1.props.to) {
7940
            n2.props.to = n1.props.to;
7941
          }
7942
        }
7943
      } else {
7944
        if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
7945
          const nextTarget = n2.target = resolveTarget(
7946
            n2.props,
7947
            querySelector
7948
          );
7949
          if (nextTarget) {
7950
            moveTeleport(
7951
              n2,
7952
              nextTarget,
7953
              null,
7954
              internals,
7955
 
7956
            );
7957
          } else {
7958
            warn(
7959
              "Invalid Teleport target on update:",
7960
              target,
7961
              `(${typeof target})`
7962
            );
7963
          }
7964
        } else if (wasDisabled) {
7965
          moveTeleport(
7966
            n2,
7967
            target,
7968
            targetAnchor,
7969
            internals,
7970
            1
7971
          );
7972
        }
7973
      }
7974
    }
7975
    updateCssVars(n2);
7976
  },
7977
  remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
7978
    const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
7979
    if (target) {
7980
      hostRemove(targetAnchor);
7981
    }
7982
    doRemove && hostRemove(anchor);
7983
    if (shapeFlag & 16) {
7984
      const shouldRemove = doRemove || !isTeleportDisabled(props);
7985
      for (let i = 0; i < children.length; i++) {
7986
        const child = children[i];
7987
        unmount(
7988
          child,
7989
          parentComponent,
7990
          parentSuspense,
7991
          shouldRemove,
7992
          !!child.dynamicChildren
7993
        );
7994
      }
7995
    }
7996
  },
7997
  move: moveTeleport,
7998
  hydrate: hydrateTeleport
7999
};
8000
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
8001
  if (moveType === 0) {
8002
    insert(vnode.targetAnchor, container, parentAnchor);
8003
  }
8004
  const { el, anchor, shapeFlag, children, props } = vnode;
8005
  const isReorder = moveType === 2;
8006
  if (isReorder) {
8007
    insert(el, container, parentAnchor);
8008
  }
8009
  if (!isReorder || isTeleportDisabled(props)) {
8010
    if (shapeFlag & 16) {
8011
      for (let i = 0; i < children.length; i++) {
8012
        move(
8013
          children[i],
8014
          container,
8015
          parentAnchor,
8016
          2
8017
        );
8018
      }
8019
    }
8020
  }
8021
  if (isReorder) {
8022
    insert(anchor, container, parentAnchor);
8023
  }
8024
}
8025
function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
8026
  o: { nextSibling, parentNode, querySelector }
8027
}, hydrateChildren) {
8028
  const target = vnode.target = resolveTarget(
8029
    vnode.props,
8030
    querySelector
8031
  );
8032
  if (target) {
8033
    const targetNode = target._lpa || target.firstChild;
8034
    if (vnode.shapeFlag & 16) {
8035
      if (isTeleportDisabled(vnode.props)) {
8036
        vnode.anchor = hydrateChildren(
8037
          nextSibling(node),
8038
          vnode,
8039
          parentNode(node),
8040
          parentComponent,
8041
          parentSuspense,
8042
          slotScopeIds,
8043
          optimized
8044
        );
8045
        vnode.targetAnchor = targetNode;
8046
      } else {
8047
        vnode.anchor = nextSibling(node);
8048
        let targetAnchor = targetNode;
8049
        while (targetAnchor) {
8050
          targetAnchor = nextSibling(targetAnchor);
8051
          if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
8052
            vnode.targetAnchor = targetAnchor;
8053
            target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
8054
            break;
8055
          }
8056
        }
8057
        hydrateChildren(
8058
          targetNode,
8059
          vnode,
8060
          target,
8061
          parentComponent,
8062
          parentSuspense,
8063
          slotScopeIds,
8064
          optimized
8065
        );
8066
      }
8067
    }
8068
    updateCssVars(vnode);
8069
  }
8070
  return vnode.anchor && nextSibling(vnode.anchor);
8071
}
8072
const Teleport = TeleportImpl;
8073
function updateCssVars(vnode) {
8074
  const ctx = vnode.ctx;
8075
  if (ctx && ctx.ut) {
8076
    let node = vnode.children[0].el;
8077
    while (node && node !== vnode.targetAnchor) {
8078
      if (node.nodeType === 1)
8079
        node.setAttribute("data-v-owner", ctx.uid);
8080
      node = node.nextSibling;
8081
    }
8082
    ctx.ut();
8083
  }
8084
}
8085
 
8086
const Fragment = Symbol.for("v-fgt");
8087
const Text = Symbol.for("v-txt");
8088
const Comment = Symbol.for("v-cmt");
8089
const Static = Symbol.for("v-stc");
8090
const blockStack = [];
8091
let currentBlock = null;
8092
function openBlock(disableTracking = false) {
8093
  blockStack.push(currentBlock = disableTracking ? null : []);
8094
}
8095
function closeBlock() {
8096
  blockStack.pop();
8097
  currentBlock = blockStack[blockStack.length - 1] || null;
8098
}
8099
let isBlockTreeEnabled = 1;
8100
function setBlockTracking(value) {
8101
  isBlockTreeEnabled += value;
8102
}
8103
function setupBlock(vnode) {
8104
  vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
8105
  closeBlock();
8106
  if (isBlockTreeEnabled > 0 && currentBlock) {
8107
    currentBlock.push(vnode);
8108
  }
8109
  return vnode;
8110
}
8111
function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
8112
  return setupBlock(
8113
    createBaseVNode(
8114
      type,
8115
      props,
8116
      children,
8117
      patchFlag,
8118
      dynamicProps,
8119
      shapeFlag,
8120
      true
8121
      /* isBlock */
8122
    )
8123
  );
8124
}
8125
function createBlock(type, props, children, patchFlag, dynamicProps) {
8126
  return setupBlock(
8127
    createVNode(
8128
      type,
8129
      props,
8130
      children,
8131
      patchFlag,
8132
      dynamicProps,
8133
      true
8134
      /* isBlock: prevent a block from tracking itself */
8135
    )
8136
  );
8137
}
8138
function isVNode(value) {
8139
  return value ? value.__v_isVNode === true : false;
8140
}
8141
function isSameVNodeType(n1, n2) {
8142
  if (n2.shapeFlag & 6 && hmrDirtyComponents.has(n2.type)) {
8143
    n1.shapeFlag &= ~256;
8144
    n2.shapeFlag &= ~512;
8145
    return false;
8146
  }
8147
  return n1.type === n2.type && n1.key === n2.key;
8148
}
8149
let vnodeArgsTransformer;
8150
function transformVNodeArgs(transformer) {
8151
  vnodeArgsTransformer = transformer;
8152
}
8153
const createVNodeWithArgsTransform = (...args) => {
8154
  return _createVNode(
8155
    ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
8156
  );
8157
};
8158
const InternalObjectKey = `__vInternal`;
8159
const normalizeKey = ({ key }) => key != null ? key : null;
8160
const normalizeRef = ({
8161
  ref,
8162
  ref_key,
8163
  ref_for
8164
}) => {
8165
  if (typeof ref === "number") {
8166
    ref = "" + ref;
8167
  }
8168
  return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
8169
};
8170
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
8171
  const vnode = {
8172
    __v_isVNode: true,
8173
    __v_skip: true,
8174
    type,
8175
    props,
8176
    key: props && normalizeKey(props),
8177
    ref: props && normalizeRef(props),
8178
    scopeId: currentScopeId,
8179
    slotScopeIds: null,
8180
    children,
8181
    component: null,
8182
    suspense: null,
8183
    ssContent: null,
8184
    ssFallback: null,
8185
    dirs: null,
8186
    transition: null,
8187
    el: null,
8188
    anchor: null,
8189
    target: null,
8190
    targetAnchor: null,
8191
    staticCount: 0,
8192
    shapeFlag,
8193
    patchFlag,
8194
    dynamicProps,
8195
    dynamicChildren: null,
8196
    appContext: null,
8197
    ctx: currentRenderingInstance
8198
  };
8199
  if (needFullChildrenNormalization) {
8200
    normalizeChildren(vnode, children);
8201
    if (shapeFlag & 128) {
8202
      type.normalize(vnode);
8203
    }
8204
  } else if (children) {
8205
    vnode.shapeFlag |= isString(children) ? 8 : 16;
8206
  }
8207
  if (vnode.key !== vnode.key) {
8208
    warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
8209
  }
8210
  if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
8211
  !isBlockNode && // has current parent block
8212
  currentBlock && // presence of a patch flag indicates this node needs patching on updates.
8213
  // component nodes also should always be patched, because even if the
8214
  // component doesn't need to update, it needs to persist the instance on to
8215
  // the next vnode so that it can be properly unmounted later.
8216
  (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
8217
  // vnode should not be considered dynamic due to handler caching.
8218
  vnode.patchFlag !== 32) {
8219
    currentBlock.push(vnode);
8220
  }
8221
  return vnode;
8222
}
8223
const createVNode = createVNodeWithArgsTransform ;
8224
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
8225
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
8226
    if (!type) {
8227
      warn(`Invalid vnode type when creating vnode: ${type}.`);
8228
    }
8229
    type = Comment;
8230
  }
8231
  if (isVNode(type)) {
8232
    const cloned = cloneVNode(
8233
      type,
8234
      props,
8235
      true
8236
      /* mergeRef: true */
8237
    );
8238
    if (children) {
8239
      normalizeChildren(cloned, children);
8240
    }
8241
    if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
8242
      if (cloned.shapeFlag & 6) {
8243
        currentBlock[currentBlock.indexOf(type)] = cloned;
8244
      } else {
8245
        currentBlock.push(cloned);
8246
      }
8247
    }
8248
    cloned.patchFlag |= -2;
8249
    return cloned;
8250
  }
8251
  if (isClassComponent(type)) {
8252
    type = type.__vccOpts;
8253
  }
8254
  if (props) {
8255
    props = guardReactiveProps(props);
8256
    let { class: klass, style } = props;
8257
    if (klass && !isString(klass)) {
8258
      props.class = normalizeClass(klass);
8259
    }
8260
    if (isObject(style)) {
8261
      if (isProxy(style) && !isArray(style)) {
8262
        style = extend({}, style);
8263
      }
8264
      props.style = normalizeStyle(style);
8265
    }
8266
  }
8267
  const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
8268
  if (shapeFlag & 4 && isProxy(type)) {
8269
    type = toRaw(type);
8270
    warn(
8271
      `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\`.`,
8272
      `
8273
Component that was made reactive: `,
8274
      type
8275
    );
8276
  }
8277
  return createBaseVNode(
8278
    type,
8279
    props,
8280
    children,
8281
    patchFlag,
8282
    dynamicProps,
8283
    shapeFlag,
8284
    isBlockNode,
8285
    true
8286
  );
8287
}
8288
function guardReactiveProps(props) {
8289
  if (!props)
8290
    return null;
8291
  return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
8292
}
8293
function cloneVNode(vnode, extraProps, mergeRef = false) {
8294
  const { props, ref, patchFlag, children } = vnode;
8295
  const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
8296
  const cloned = {
8297
    __v_isVNode: true,
8298
    __v_skip: true,
8299
    type: vnode.type,
8300
    props: mergedProps,
8301
    key: mergedProps && normalizeKey(mergedProps),
8302
    ref: extraProps && extraProps.ref ? (
8303
      // #2078 in the case of <component :is="vnode" ref="extra"/>
8304
      // if the vnode itself already has a ref, cloneVNode will need to merge
8305
      // the refs so the single vnode can be set on multiple refs
8306
      mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
8307
    ) : ref,
8308
    scopeId: vnode.scopeId,
8309
    slotScopeIds: vnode.slotScopeIds,
8310
    children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
8311
    target: vnode.target,
8312
    targetAnchor: vnode.targetAnchor,
8313
    staticCount: vnode.staticCount,
8314
    shapeFlag: vnode.shapeFlag,
8315
    // if the vnode is cloned with extra props, we can no longer assume its
8316
    // existing patch flag to be reliable and need to add the FULL_PROPS flag.
8317
    // note: preserve flag for fragments since they use the flag for children
8318
    // fast paths only.
8319
    patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
8320
    dynamicProps: vnode.dynamicProps,
8321
    dynamicChildren: vnode.dynamicChildren,
8322
    appContext: vnode.appContext,
8323
    dirs: vnode.dirs,
8324
    transition: vnode.transition,
8325
    // These should technically only be non-null on mounted VNodes. However,
8326
    // they *should* be copied for kept-alive vnodes. So we just always copy
8327
    // them since them being non-null during a mount doesn't affect the logic as
8328
    // they will simply be overwritten.
8329
    component: vnode.component,
8330
    suspense: vnode.suspense,
8331
    ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
8332
    ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
8333
    el: vnode.el,
8334
    anchor: vnode.anchor,
8335
    ctx: vnode.ctx,
8336
    ce: vnode.ce
8337
  };
8338
  return cloned;
8339
}
8340
function deepCloneVNode(vnode) {
8341
  const cloned = cloneVNode(vnode);
8342
  if (isArray(vnode.children)) {
8343
    cloned.children = vnode.children.map(deepCloneVNode);
8344
  }
8345
  return cloned;
8346
}
8347
function createTextVNode(text = " ", flag = 0) {
8348
  return createVNode(Text, null, text, flag);
8349
}
8350
function createStaticVNode(content, numberOfNodes) {
8351
  const vnode = createVNode(Static, null, content);
8352
  vnode.staticCount = numberOfNodes;
8353
  return vnode;
8354
}
8355
function createCommentVNode(text = "", asBlock = false) {
8356
  return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
8357
}
8358
function normalizeVNode(child) {
8359
  if (child == null || typeof child === "boolean") {
8360
    return createVNode(Comment);
8361
  } else if (isArray(child)) {
8362
    return createVNode(
8363
      Fragment,
8364
      null,
8365
      // #3666, avoid reference pollution when reusing vnode
8366
      child.slice()
8367
    );
8368
  } else if (typeof child === "object") {
8369
    return cloneIfMounted(child);
8370
  } else {
8371
    return createVNode(Text, null, String(child));
8372
  }
8373
}
8374
function cloneIfMounted(child) {
8375
  return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
8376
}
8377
function normalizeChildren(vnode, children) {
8378
  let type = 0;
8379
  const { shapeFlag } = vnode;
8380
  if (children == null) {
8381
    children = null;
8382
  } else if (isArray(children)) {
8383
    type = 16;
8384
  } else if (typeof children === "object") {
8385
    if (shapeFlag & (1 | 64)) {
8386
      const slot = children.default;
8387
      if (slot) {
8388
        slot._c && (slot._d = false);
8389
        normalizeChildren(vnode, slot());
8390
        slot._c && (slot._d = true);
8391
      }
8392
      return;
8393
    } else {
8394
      type = 32;
8395
      const slotFlag = children._;
8396
      if (!slotFlag && !(InternalObjectKey in children)) {
8397
        children._ctx = currentRenderingInstance;
8398
      } else if (slotFlag === 3 && currentRenderingInstance) {
8399
        if (currentRenderingInstance.slots._ === 1) {
8400
          children._ = 1;
8401
        } else {
8402
          children._ = 2;
8403
          vnode.patchFlag |= 1024;
8404
        }
8405
      }
8406
    }
8407
  } else if (isFunction(children)) {
8408
    children = { default: children, _ctx: currentRenderingInstance };
8409
    type = 32;
8410
  } else {
8411
    children = String(children);
8412
    if (shapeFlag & 64) {
8413
      type = 16;
8414
      children = [createTextVNode(children)];
8415
    } else {
8416
      type = 8;
8417
    }
8418
  }
8419
  vnode.children = children;
8420
  vnode.shapeFlag |= type;
8421
}
8422
function mergeProps(...args) {
8423
  const ret = {};
8424
  for (let i = 0; i < args.length; i++) {
8425
    const toMerge = args[i];
8426
    for (const key in toMerge) {
8427
      if (key === "class") {
8428
        if (ret.class !== toMerge.class) {
8429
          ret.class = normalizeClass([ret.class, toMerge.class]);
8430
        }
8431
      } else if (key === "style") {
8432
        ret.style = normalizeStyle([ret.style, toMerge.style]);
8433
      } else if (isOn(key)) {
8434
        const existing = ret[key];
8435
        const incoming = toMerge[key];
8436
        if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
8437
          ret[key] = existing ? [].concat(existing, incoming) : incoming;
8438
        }
8439
      } else if (key !== "") {
8440
        ret[key] = toMerge[key];
8441
      }
8442
    }
8443
  }
8444
  return ret;
8445
}
8446
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
8447
  callWithAsyncErrorHandling(hook, instance, 7, [
8448
    vnode,
8449
    prevVNode
8450
  ]);
8451
}
8452
 
8453
const emptyAppContext = createAppContext();
8454
let uid = 0;
8455
function createComponentInstance(vnode, parent, suspense) {
8456
  const type = vnode.type;
8457
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
8458
  const instance = {
8459
    uid: uid++,
8460
    vnode,
8461
    type,
8462
    parent,
8463
    appContext,
8464
    root: null,
8465
    // to be immediately set
8466
    next: null,
8467
    subTree: null,
8468
    // will be set synchronously right after creation
8469
    effect: null,
8470
    update: null,
8471
    // will be set synchronously right after creation
8472
    scope: new EffectScope(
8473
      true
8474
      /* detached */
8475
    ),
8476
    render: null,
8477
    proxy: null,
8478
    exposed: null,
8479
    exposeProxy: null,
8480
    withProxy: null,
8481
    provides: parent ? parent.provides : Object.create(appContext.provides),
8482
    accessCache: null,
8483
    renderCache: [],
8484
    // local resolved assets
8485
    components: null,
8486
    directives: null,
8487
    // resolved props and emits options
8488
    propsOptions: normalizePropsOptions(type, appContext),
8489
    emitsOptions: normalizeEmitsOptions(type, appContext),
8490
    // emit
8491
    emit: null,
8492
    // to be set immediately
8493
    emitted: null,
8494
    // props default value
8495
    propsDefaults: EMPTY_OBJ,
8496
    // inheritAttrs
8497
    inheritAttrs: type.inheritAttrs,
8498
    // state
8499
    ctx: EMPTY_OBJ,
8500
    data: EMPTY_OBJ,
8501
    props: EMPTY_OBJ,
8502
    attrs: EMPTY_OBJ,
8503
    slots: EMPTY_OBJ,
8504
    refs: EMPTY_OBJ,
8505
    setupState: EMPTY_OBJ,
8506
    setupContext: null,
8507
    attrsProxy: null,
8508
    slotsProxy: null,
8509
    // suspense related
8510
    suspense,
8511
    suspenseId: suspense ? suspense.pendingId : 0,
8512
    asyncDep: null,
8513
    asyncResolved: false,
8514
    // lifecycle hooks
8515
    // not using enums here because it results in computed properties
8516
    isMounted: false,
8517
    isUnmounted: false,
8518
    isDeactivated: false,
8519
    bc: null,
8520
    c: null,
8521
    bm: null,
8522
    m: null,
8523
    bu: null,
8524
    u: null,
8525
    um: null,
8526
    bum: null,
8527
    da: null,
8528
    a: null,
8529
    rtg: null,
8530
    rtc: null,
8531
    ec: null,
8532
    sp: null
8533
  };
8534
  {
8535
    instance.ctx = createDevRenderContext(instance);
8536
  }
8537
  instance.root = parent ? parent.root : instance;
8538
  instance.emit = emit.bind(null, instance);
8539
  if (vnode.ce) {
8540
    vnode.ce(instance);
8541
  }
8542
  return instance;
8543
}
8544
let currentInstance = null;
8545
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
8546
let internalSetCurrentInstance;
8547
{
8548
  internalSetCurrentInstance = (i) => {
8549
    currentInstance = i;
8550
  };
8551
}
8552
const setCurrentInstance = (instance) => {
8553
  internalSetCurrentInstance(instance);
8554
  instance.scope.on();
8555
};
8556
const unsetCurrentInstance = () => {
8557
  currentInstance && currentInstance.scope.off();
8558
  internalSetCurrentInstance(null);
8559
};
8560
const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
8561
function validateComponentName(name, config) {
8562
  const appIsNativeTag = config.isNativeTag || NO;
8563
  if (isBuiltInTag(name) || appIsNativeTag(name)) {
8564
    warn(
8565
      "Do not use built-in or reserved HTML elements as component id: " + name
8566
    );
8567
  }
8568
}
8569
function isStatefulComponent(instance) {
8570
  return instance.vnode.shapeFlag & 4;
8571
}
8572
let isInSSRComponentSetup = false;
8573
function setupComponent(instance, isSSR = false) {
8574
  isInSSRComponentSetup = isSSR;
8575
  const { props, children } = instance.vnode;
8576
  const isStateful = isStatefulComponent(instance);
8577
  initProps(instance, props, isStateful, isSSR);
8578
  initSlots(instance, children);
8579
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
8580
  isInSSRComponentSetup = false;
8581
  return setupResult;
8582
}
8583
function setupStatefulComponent(instance, isSSR) {
8584
  var _a;
8585
  const Component = instance.type;
8586
  {
8587
    if (Component.name) {
8588
      validateComponentName(Component.name, instance.appContext.config);
8589
    }
8590
    if (Component.components) {
8591
      const names = Object.keys(Component.components);
8592
      for (let i = 0; i < names.length; i++) {
8593
        validateComponentName(names[i], instance.appContext.config);
8594
      }
8595
    }
8596
    if (Component.directives) {
8597
      const names = Object.keys(Component.directives);
8598
      for (let i = 0; i < names.length; i++) {
8599
        validateDirectiveName(names[i]);
8600
      }
8601
    }
8602
    if (Component.compilerOptions && isRuntimeOnly()) {
8603
      warn(
8604
        `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
8605
      );
8606
    }
8607
  }
8608
  instance.accessCache = /* @__PURE__ */ Object.create(null);
8609
  instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
8610
  {
8611
    exposePropsOnRenderContext(instance);
8612
  }
8613
  const { setup } = Component;
8614
  if (setup) {
8615
    const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
8616
    setCurrentInstance(instance);
8617
    pauseTracking();
8618
    const setupResult = callWithErrorHandling(
8619
      setup,
8620
      instance,
8621
      0,
8622
      [shallowReadonly(instance.props) , setupContext]
8623
    );
8624
    resetTracking();
8625
    unsetCurrentInstance();
8626
    if (isPromise(setupResult)) {
8627
      setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
8628
      if (isSSR) {
8629
        return setupResult.then((resolvedResult) => {
8630
          handleSetupResult(instance, resolvedResult, isSSR);
8631
        }).catch((e) => {
8632
          handleError(e, instance, 0);
8633
        });
8634
      } else {
8635
        instance.asyncDep = setupResult;
8636
        if (!instance.suspense) {
8637
          const name = (_a = Component.name) != null ? _a : "Anonymous";
8638
          warn(
8639
            `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
8640
          );
8641
        }
8642
      }
8643
    } else {
8644
      handleSetupResult(instance, setupResult, isSSR);
8645
    }
8646
  } else {
8647
    finishComponentSetup(instance, isSSR);
8648
  }
8649
}
8650
function handleSetupResult(instance, setupResult, isSSR) {
8651
  if (isFunction(setupResult)) {
8652
    {
8653
      instance.render = setupResult;
8654
    }
8655
  } else if (isObject(setupResult)) {
8656
    if (isVNode(setupResult)) {
8657
      warn(
8658
        `setup() should not return VNodes directly - return a render function instead.`
8659
      );
8660
    }
8661
    {
8662
      instance.devtoolsRawSetupState = setupResult;
8663
    }
8664
    instance.setupState = proxyRefs(setupResult);
8665
    {
8666
      exposeSetupStateOnRenderContext(instance);
8667
    }
8668
  } else if (setupResult !== void 0) {
8669
    warn(
8670
      `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
8671
    );
8672
  }
8673
  finishComponentSetup(instance, isSSR);
8674
}
8675
let compile$1;
8676
let installWithProxy;
8677
function registerRuntimeCompiler(_compile) {
8678
  compile$1 = _compile;
8679
  installWithProxy = (i) => {
8680
    if (i.render._rc) {
8681
      i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
8682
    }
8683
  };
8684
}
8685
const isRuntimeOnly = () => !compile$1;
8686
function finishComponentSetup(instance, isSSR, skipOptions) {
8687
  const Component = instance.type;
8688
  if (!instance.render) {
8689
    if (!isSSR && compile$1 && !Component.render) {
8690
      const template = Component.template || resolveMergedOptions(instance).template;
8691
      if (template) {
8692
        {
8693
          startMeasure(instance, `compile`);
8694
        }
8695
        const { isCustomElement, compilerOptions } = instance.appContext.config;
8696
        const { delimiters, compilerOptions: componentCompilerOptions } = Component;
8697
        const finalCompilerOptions = extend(
8698
          extend(
8699
            {
8700
              isCustomElement,
8701
              delimiters
8702
            },
8703
            compilerOptions
8704
          ),
8705
          componentCompilerOptions
8706
        );
8707
        Component.render = compile$1(template, finalCompilerOptions);
8708
        {
8709
          endMeasure(instance, `compile`);
8710
        }
8711
      }
8712
    }
8713
    instance.render = Component.render || NOOP;
8714
    if (installWithProxy) {
8715
      installWithProxy(instance);
8716
    }
8717
  }
8718
  {
8719
    setCurrentInstance(instance);
8720
    pauseTracking();
8721
    try {
8722
      applyOptions(instance);
8723
    } finally {
8724
      resetTracking();
8725
      unsetCurrentInstance();
8726
    }
8727
  }
8728
  if (!Component.render && instance.render === NOOP && !isSSR) {
8729
    if (!compile$1 && Component.template) {
8730
      warn(
8731
        `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.esm-browser.js" instead.` )
8732
        /* should not happen */
8733
      );
8734
    } else {
8735
      warn(`Component is missing template or render function.`);
8736
    }
8737
  }
8738
}
8739
function getAttrsProxy(instance) {
8740
  return instance.attrsProxy || (instance.attrsProxy = new Proxy(
8741
    instance.attrs,
8742
    {
8743
      get(target, key) {
8744
        markAttrsAccessed();
8745
        track(instance, "get", "$attrs");
8746
        return target[key];
8747
      },
8748
      set() {
8749
        warn(`setupContext.attrs is readonly.`);
8750
        return false;
8751
      },
8752
      deleteProperty() {
8753
        warn(`setupContext.attrs is readonly.`);
8754
        return false;
8755
      }
8756
    }
8757
  ));
8758
}
8759
function getSlotsProxy(instance) {
8760
  return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
8761
    get(target, key) {
8762
      track(instance, "get", "$slots");
8763
      return target[key];
8764
    }
8765
  }));
8766
}
8767
function createSetupContext(instance) {
8768
  const expose = (exposed) => {
8769
    {
8770
      if (instance.exposed) {
8771
        warn(`expose() should be called only once per setup().`);
8772
      }
8773
      if (exposed != null) {
8774
        let exposedType = typeof exposed;
8775
        if (exposedType === "object") {
8776
          if (isArray(exposed)) {
8777
            exposedType = "array";
8778
          } else if (isRef(exposed)) {
8779
            exposedType = "ref";
8780
          }
8781
        }
8782
        if (exposedType !== "object") {
8783
          warn(
8784
            `expose() should be passed a plain object, received ${exposedType}.`
8785
          );
8786
        }
8787
      }
8788
    }
8789
    instance.exposed = exposed || {};
8790
  };
8791
  {
8792
    return Object.freeze({
8793
      get attrs() {
8794
        return getAttrsProxy(instance);
8795
      },
8796
      get slots() {
8797
        return getSlotsProxy(instance);
8798
      },
8799
      get emit() {
8800
        return (event, ...args) => instance.emit(event, ...args);
8801
      },
8802
      expose
8803
    });
8804
  }
8805
}
8806
function getExposeProxy(instance) {
8807
  if (instance.exposed) {
8808
    return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
8809
      get(target, key) {
8810
        if (key in target) {
8811
          return target[key];
8812
        } else if (key in publicPropertiesMap) {
8813
          return publicPropertiesMap[key](instance);
8814
        }
8815
      },
8816
      has(target, key) {
8817
        return key in target || key in publicPropertiesMap;
8818
      }
8819
    }));
8820
  }
8821
}
8822
const classifyRE = /(?:^|[-_])(\w)/g;
8823
const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
8824
function getComponentName(Component, includeInferred = true) {
8825
  return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
8826
}
8827
function formatComponentName(instance, Component, isRoot = false) {
8828
  let name = getComponentName(Component);
8829
  if (!name && Component.__file) {
8830
    const match = Component.__file.match(/([^/\\]+)\.\w+$/);
8831
    if (match) {
8832
      name = match[1];
8833
    }
8834
  }
8835
  if (!name && instance && instance.parent) {
8836
    const inferFromRegistry = (registry) => {
8837
      for (const key in registry) {
8838
        if (registry[key] === Component) {
8839
          return key;
8840
        }
8841
      }
8842
    };
8843
    name = inferFromRegistry(
8844
      instance.components || instance.parent.type.components
8845
    ) || inferFromRegistry(instance.appContext.components);
8846
  }
8847
  return name ? classify(name) : isRoot ? `App` : `Anonymous`;
8848
}
8849
function isClassComponent(value) {
8850
  return isFunction(value) && "__vccOpts" in value;
8851
}
8852
 
8853
const computed = (getterOrOptions, debugOptions) => {
8854
  return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
8855
};
8856
 
8857
function h(type, propsOrChildren, children) {
8858
  const l = arguments.length;
8859
  if (l === 2) {
8860
    if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
8861
      if (isVNode(propsOrChildren)) {
8862
        return createVNode(type, null, [propsOrChildren]);
8863
      }
8864
      return createVNode(type, propsOrChildren);
8865
    } else {
8866
      return createVNode(type, null, propsOrChildren);
8867
    }
8868
  } else {
8869
    if (l > 3) {
8870
      children = Array.prototype.slice.call(arguments, 2);
8871
    } else if (l === 3 && isVNode(children)) {
8872
      children = [children];
8873
    }
8874
    return createVNode(type, propsOrChildren, children);
8875
  }
8876
}
8877
 
8878
const ssrContextKey = Symbol.for("v-scx");
8879
const useSSRContext = () => {
8880
  {
8881
    const ctx = inject(ssrContextKey);
8882
    if (!ctx) {
8883
      warn(
8884
        `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
8885
      );
8886
    }
8887
    return ctx;
8888
  }
8889
};
8890
 
8891
function initCustomFormatter() {
8892
  if (typeof window === "undefined") {
8893
    return;
8894
  }
8895
  const vueStyle = { style: "color:#3ba776" };
8896
  const numberStyle = { style: "color:#0b1bc9" };
8897
  const stringStyle = { style: "color:#b62e24" };
8898
  const keywordStyle = { style: "color:#9d288c" };
8899
  const formatter = {
8900
    header(obj) {
8901
      if (!isObject(obj)) {
8902
        return null;
8903
      }
8904
      if (obj.__isVue) {
8905
        return ["div", vueStyle, `VueInstance`];
8906
      } else if (isRef(obj)) {
8907
        return [
8908
          "div",
8909
          {},
8910
          ["span", vueStyle, genRefFlag(obj)],
8911
          "<",
8912
          formatValue(obj.value),
8913
          `>`
8914
        ];
8915
      } else if (isReactive(obj)) {
8916
        return [
8917
          "div",
8918
          {},
8919
          ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
8920
          "<",
8921
          formatValue(obj),
8922
          `>${isReadonly(obj) ? ` (readonly)` : ``}`
8923
        ];
8924
      } else if (isReadonly(obj)) {
8925
        return [
8926
          "div",
8927
          {},
8928
          ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
8929
          "<",
8930
          formatValue(obj),
8931
          ">"
8932
        ];
8933
      }
8934
      return null;
8935
    },
8936
    hasBody(obj) {
8937
      return obj && obj.__isVue;
8938
    },
8939
    body(obj) {
8940
      if (obj && obj.__isVue) {
8941
        return [
8942
          "div",
8943
          {},
8944
          ...formatInstance(obj.$)
8945
        ];
8946
      }
8947
    }
8948
  };
8949
  function formatInstance(instance) {
8950
    const blocks = [];
8951
    if (instance.type.props && instance.props) {
8952
      blocks.push(createInstanceBlock("props", toRaw(instance.props)));
8953
    }
8954
    if (instance.setupState !== EMPTY_OBJ) {
8955
      blocks.push(createInstanceBlock("setup", instance.setupState));
8956
    }
8957
    if (instance.data !== EMPTY_OBJ) {
8958
      blocks.push(createInstanceBlock("data", toRaw(instance.data)));
8959
    }
8960
    const computed = extractKeys(instance, "computed");
8961
    if (computed) {
8962
      blocks.push(createInstanceBlock("computed", computed));
8963
    }
8964
    const injected = extractKeys(instance, "inject");
8965
    if (injected) {
8966
      blocks.push(createInstanceBlock("injected", injected));
8967
    }
8968
    blocks.push([
8969
      "div",
8970
      {},
8971
      [
8972
        "span",
8973
        {
8974
          style: keywordStyle.style + ";opacity:0.66"
8975
        },
8976
        "$ (internal): "
8977
      ],
8978
      ["object", { object: instance }]
8979
    ]);
8980
    return blocks;
8981
  }
8982
  function createInstanceBlock(type, target) {
8983
    target = extend({}, target);
8984
    if (!Object.keys(target).length) {
8985
      return ["span", {}];
8986
    }
8987
    return [
8988
      "div",
8989
      { style: "line-height:1.25em;margin-bottom:0.6em" },
8990
      [
8991
        "div",
8992
        {
8993
          style: "color:#476582"
8994
        },
8995
        type
8996
      ],
8997
      [
8998
        "div",
8999
        {
9000
          style: "padding-left:1.25em"
9001
        },
9002
        ...Object.keys(target).map((key) => {
9003
          return [
9004
            "div",
9005
            {},
9006
            ["span", keywordStyle, key + ": "],
9007
            formatValue(target[key], false)
9008
          ];
9009
        })
9010
      ]
9011
    ];
9012
  }
9013
  function formatValue(v, asRaw = true) {
9014
    if (typeof v === "number") {
9015
      return ["span", numberStyle, v];
9016
    } else if (typeof v === "string") {
9017
      return ["span", stringStyle, JSON.stringify(v)];
9018
    } else if (typeof v === "boolean") {
9019
      return ["span", keywordStyle, v];
9020
    } else if (isObject(v)) {
9021
      return ["object", { object: asRaw ? toRaw(v) : v }];
9022
    } else {
9023
      return ["span", stringStyle, String(v)];
9024
    }
9025
  }
9026
  function extractKeys(instance, type) {
9027
    const Comp = instance.type;
9028
    if (isFunction(Comp)) {
9029
      return;
9030
    }
9031
    const extracted = {};
9032
    for (const key in instance.ctx) {
9033
      if (isKeyOfType(Comp, key, type)) {
9034
        extracted[key] = instance.ctx[key];
9035
      }
9036
    }
9037
    return extracted;
9038
  }
9039
  function isKeyOfType(Comp, key, type) {
9040
    const opts = Comp[type];
9041
    if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
9042
      return true;
9043
    }
9044
    if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
9045
      return true;
9046
    }
9047
    if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
9048
      return true;
9049
    }
9050
  }
9051
  function genRefFlag(v) {
9052
    if (isShallow(v)) {
9053
      return `ShallowRef`;
9054
    }
9055
    if (v.effect) {
9056
      return `ComputedRef`;
9057
    }
9058
    return `Ref`;
9059
  }
9060
  if (window.devtoolsFormatters) {
9061
    window.devtoolsFormatters.push(formatter);
9062
  } else {
9063
    window.devtoolsFormatters = [formatter];
9064
  }
9065
}
9066
 
9067
function withMemo(memo, render, cache, index) {
9068
  const cached = cache[index];
9069
  if (cached && isMemoSame(cached, memo)) {
9070
    return cached;
9071
  }
9072
  const ret = render();
9073
  ret.memo = memo.slice();
9074
  return cache[index] = ret;
9075
}
9076
function isMemoSame(cached, memo) {
9077
  const prev = cached.memo;
9078
  if (prev.length != memo.length) {
9079
    return false;
9080
  }
9081
  for (let i = 0; i < prev.length; i++) {
9082
    if (hasChanged(prev[i], memo[i])) {
9083
      return false;
9084
    }
9085
  }
9086
  if (isBlockTreeEnabled > 0 && currentBlock) {
9087
    currentBlock.push(cached);
9088
  }
9089
  return true;
9090
}
9091
 
9092
const version = "3.3.6";
9093
const ssrUtils = null;
9094
const resolveFilter = null;
9095
const compatUtils = null;
9096
 
9097
const svgNS = "http://www.w3.org/2000/svg";
9098
const doc = typeof document !== "undefined" ? document : null;
9099
const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
9100
const nodeOps = {
9101
  insert: (child, parent, anchor) => {
9102
    parent.insertBefore(child, anchor || null);
9103
  },
9104
  remove: (child) => {
9105
    const parent = child.parentNode;
9106
    if (parent) {
9107
      parent.removeChild(child);
9108
    }
9109
  },
9110
  createElement: (tag, isSVG, is, props) => {
9111
    const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0);
9112
    if (tag === "select" && props && props.multiple != null) {
9113
      el.setAttribute("multiple", props.multiple);
9114
    }
9115
    return el;
9116
  },
9117
  createText: (text) => doc.createTextNode(text),
9118
  createComment: (text) => doc.createComment(text),
9119
  setText: (node, text) => {
9120
    node.nodeValue = text;
9121
  },
9122
  setElementText: (el, text) => {
9123
    el.textContent = text;
9124
  },
9125
  parentNode: (node) => node.parentNode,
9126
  nextSibling: (node) => node.nextSibling,
9127
  querySelector: (selector) => doc.querySelector(selector),
9128
  setScopeId(el, id) {
9129
    el.setAttribute(id, "");
9130
  },
9131
  // __UNSAFE__
9132
  // Reason: innerHTML.
9133
  // Static content here can only come from compiled templates.
9134
  // As long as the user only uses trusted templates, this is safe.
9135
  insertStaticContent(content, parent, anchor, isSVG, start, end) {
9136
    const before = anchor ? anchor.previousSibling : parent.lastChild;
9137
    if (start && (start === end || start.nextSibling)) {
9138
      while (true) {
9139
        parent.insertBefore(start.cloneNode(true), anchor);
9140
        if (start === end || !(start = start.nextSibling))
9141
          break;
9142
      }
9143
    } else {
9144
      templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content;
9145
      const template = templateContainer.content;
9146
      if (isSVG) {
9147
        const wrapper = template.firstChild;
9148
        while (wrapper.firstChild) {
9149
          template.appendChild(wrapper.firstChild);
9150
        }
9151
        template.removeChild(wrapper);
9152
      }
9153
      parent.insertBefore(template, anchor);
9154
    }
9155
    return [
9156
      // first
9157
      before ? before.nextSibling : parent.firstChild,
9158
      // last
9159
      anchor ? anchor.previousSibling : parent.lastChild
9160
    ];
9161
  }
9162
};
9163
 
9164
const TRANSITION$1 = "transition";
9165
const ANIMATION = "animation";
9166
const vtcKey = Symbol("_vtc");
9167
const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
9168
Transition.displayName = "Transition";
9169
const DOMTransitionPropsValidators = {
9170
  name: String,
9171
  type: String,
9172
  css: {
9173
    type: Boolean,
9174
    default: true
9175
  },
9176
  duration: [String, Number, Object],
9177
  enterFromClass: String,
9178
  enterActiveClass: String,
9179
  enterToClass: String,
9180
  appearFromClass: String,
9181
  appearActiveClass: String,
9182
  appearToClass: String,
9183
  leaveFromClass: String,
9184
  leaveActiveClass: String,
9185
  leaveToClass: String
9186
};
9187
const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
9188
  {},
9189
  BaseTransitionPropsValidators,
9190
  DOMTransitionPropsValidators
9191
);
9192
const callHook = (hook, args = []) => {
9193
  if (isArray(hook)) {
9194
    hook.forEach((h2) => h2(...args));
9195
  } else if (hook) {
9196
    hook(...args);
9197
  }
9198
};
9199
const hasExplicitCallback = (hook) => {
9200
  return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
9201
};
9202
function resolveTransitionProps(rawProps) {
9203
  const baseProps = {};
9204
  for (const key in rawProps) {
9205
    if (!(key in DOMTransitionPropsValidators)) {
9206
      baseProps[key] = rawProps[key];
9207
    }
9208
  }
9209
  if (rawProps.css === false) {
9210
    return baseProps;
9211
  }
9212
  const {
9213
    name = "v",
9214
    type,
9215
    duration,
9216
    enterFromClass = `${name}-enter-from`,
9217
    enterActiveClass = `${name}-enter-active`,
9218
    enterToClass = `${name}-enter-to`,
9219
    appearFromClass = enterFromClass,
9220
    appearActiveClass = enterActiveClass,
9221
    appearToClass = enterToClass,
9222
    leaveFromClass = `${name}-leave-from`,
9223
    leaveActiveClass = `${name}-leave-active`,
9224
    leaveToClass = `${name}-leave-to`
9225
  } = rawProps;
9226
  const durations = normalizeDuration(duration);
9227
  const enterDuration = durations && durations[0];
9228
  const leaveDuration = durations && durations[1];
9229
  const {
9230
    onBeforeEnter,
9231
    onEnter,
9232
    onEnterCancelled,
9233
    onLeave,
9234
    onLeaveCancelled,
9235
    onBeforeAppear = onBeforeEnter,
9236
    onAppear = onEnter,
9237
    onAppearCancelled = onEnterCancelled
9238
  } = baseProps;
9239
  const finishEnter = (el, isAppear, done) => {
9240
    removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
9241
    removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
9242
    done && done();
9243
  };
9244
  const finishLeave = (el, done) => {
9245
    el._isLeaving = false;
9246
    removeTransitionClass(el, leaveFromClass);
9247
    removeTransitionClass(el, leaveToClass);
9248
    removeTransitionClass(el, leaveActiveClass);
9249
    done && done();
9250
  };
9251
  const makeEnterHook = (isAppear) => {
9252
    return (el, done) => {
9253
      const hook = isAppear ? onAppear : onEnter;
9254
      const resolve = () => finishEnter(el, isAppear, done);
9255
      callHook(hook, [el, resolve]);
9256
      nextFrame(() => {
9257
        removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
9258
        addTransitionClass(el, isAppear ? appearToClass : enterToClass);
9259
        if (!hasExplicitCallback(hook)) {
9260
          whenTransitionEnds(el, type, enterDuration, resolve);
9261
        }
9262
      });
9263
    };
9264
  };
9265
  return extend(baseProps, {
9266
    onBeforeEnter(el) {
9267
      callHook(onBeforeEnter, [el]);
9268
      addTransitionClass(el, enterFromClass);
9269
      addTransitionClass(el, enterActiveClass);
9270
    },
9271
    onBeforeAppear(el) {
9272
      callHook(onBeforeAppear, [el]);
9273
      addTransitionClass(el, appearFromClass);
9274
      addTransitionClass(el, appearActiveClass);
9275
    },
9276
    onEnter: makeEnterHook(false),
9277
    onAppear: makeEnterHook(true),
9278
    onLeave(el, done) {
9279
      el._isLeaving = true;
9280
      const resolve = () => finishLeave(el, done);
9281
      addTransitionClass(el, leaveFromClass);
9282
      forceReflow();
9283
      addTransitionClass(el, leaveActiveClass);
9284
      nextFrame(() => {
9285
        if (!el._isLeaving) {
9286
          return;
9287
        }
9288
        removeTransitionClass(el, leaveFromClass);
9289
        addTransitionClass(el, leaveToClass);
9290
        if (!hasExplicitCallback(onLeave)) {
9291
          whenTransitionEnds(el, type, leaveDuration, resolve);
9292
        }
9293
      });
9294
      callHook(onLeave, [el, resolve]);
9295
    },
9296
    onEnterCancelled(el) {
9297
      finishEnter(el, false);
9298
      callHook(onEnterCancelled, [el]);
9299
    },
9300
    onAppearCancelled(el) {
9301
      finishEnter(el, true);
9302
      callHook(onAppearCancelled, [el]);
9303
    },
9304
    onLeaveCancelled(el) {
9305
      finishLeave(el);
9306
      callHook(onLeaveCancelled, [el]);
9307
    }
9308
  });
9309
}
9310
function normalizeDuration(duration) {
9311
  if (duration == null) {
9312
    return null;
9313
  } else if (isObject(duration)) {
9314
    return [NumberOf(duration.enter), NumberOf(duration.leave)];
9315
  } else {
9316
    const n = NumberOf(duration);
9317
    return [n, n];
9318
  }
9319
}
9320
function NumberOf(val) {
9321
  const res = toNumber(val);
9322
  {
9323
    assertNumber(res, "<transition> explicit duration");
9324
  }
9325
  return res;
9326
}
9327
function addTransitionClass(el, cls) {
9328
  cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
9329
  (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
9330
}
9331
function removeTransitionClass(el, cls) {
9332
  cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
9333
  const _vtc = el[vtcKey];
9334
  if (_vtc) {
9335
    _vtc.delete(cls);
9336
    if (!_vtc.size) {
9337
      el[vtcKey] = void 0;
9338
    }
9339
  }
9340
}
9341
function nextFrame(cb) {
9342
  requestAnimationFrame(() => {
9343
    requestAnimationFrame(cb);
9344
  });
9345
}
9346
let endId = 0;
9347
function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
9348
  const id = el._endId = ++endId;
9349
  const resolveIfNotStale = () => {
9350
    if (id === el._endId) {
9351
      resolve();
9352
    }
9353
  };
9354
  if (explicitTimeout) {
9355
    return setTimeout(resolveIfNotStale, explicitTimeout);
9356
  }
9357
  const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
9358
  if (!type) {
9359
    return resolve();
9360
  }
9361
  const endEvent = type + "end";
9362
  let ended = 0;
9363
  const end = () => {
9364
    el.removeEventListener(endEvent, onEnd);
9365
    resolveIfNotStale();
9366
  };
9367
  const onEnd = (e) => {
9368
    if (e.target === el && ++ended >= propCount) {
9369
      end();
9370
    }
9371
  };
9372
  setTimeout(() => {
9373
    if (ended < propCount) {
9374
      end();
9375
    }
9376
  }, timeout + 1);
9377
  el.addEventListener(endEvent, onEnd);
9378
}
9379
function getTransitionInfo(el, expectedType) {
9380
  const styles = window.getComputedStyle(el);
9381
  const getStyleProperties = (key) => (styles[key] || "").split(", ");
9382
  const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
9383
  const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
9384
  const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
9385
  const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
9386
  const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
9387
  const animationTimeout = getTimeout(animationDelays, animationDurations);
9388
  let type = null;
9389
  let timeout = 0;
9390
  let propCount = 0;
9391
  if (expectedType === TRANSITION$1) {
9392
    if (transitionTimeout > 0) {
9393
      type = TRANSITION$1;
9394
      timeout = transitionTimeout;
9395
      propCount = transitionDurations.length;
9396
    }
9397
  } else if (expectedType === ANIMATION) {
9398
    if (animationTimeout > 0) {
9399
      type = ANIMATION;
9400
      timeout = animationTimeout;
9401
      propCount = animationDurations.length;
9402
    }
9403
  } else {
9404
    timeout = Math.max(transitionTimeout, animationTimeout);
9405
    type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION$1 : ANIMATION : null;
9406
    propCount = type ? type === TRANSITION$1 ? transitionDurations.length : animationDurations.length : 0;
9407
  }
9408
  const hasTransform = type === TRANSITION$1 && /\b(transform|all)(,|$)/.test(
9409
    getStyleProperties(`${TRANSITION$1}Property`).toString()
9410
  );
9411
  return {
9412
    type,
9413
    timeout,
9414
    propCount,
9415
    hasTransform
9416
  };
9417
}
9418
function getTimeout(delays, durations) {
9419
  while (delays.length < durations.length) {
9420
    delays = delays.concat(delays);
9421
  }
9422
  return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
9423
}
9424
function toMs(s) {
9425
  if (s === "auto")
9426
    return 0;
9427
  return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
9428
}
9429
function forceReflow() {
9430
  return document.body.offsetHeight;
9431
}
9432
 
9433
function patchClass(el, value, isSVG) {
9434
  const transitionClasses = el[vtcKey];
9435
  if (transitionClasses) {
9436
    value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
9437
  }
9438
  if (value == null) {
9439
    el.removeAttribute("class");
9440
  } else if (isSVG) {
9441
    el.setAttribute("class", value);
9442
  } else {
9443
    el.className = value;
9444
  }
9445
}
9446
 
9447
const vShowOldKey = Symbol("_vod");
9448
const vShow = {
9449
  beforeMount(el, { value }, { transition }) {
9450
    el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
9451
    if (transition && value) {
9452
      transition.beforeEnter(el);
9453
    } else {
9454
      setDisplay(el, value);
9455
    }
9456
  },
9457
  mounted(el, { value }, { transition }) {
9458
    if (transition && value) {
9459
      transition.enter(el);
9460
    }
9461
  },
9462
  updated(el, { value, oldValue }, { transition }) {
9463
    if (!value === !oldValue)
9464
      return;
9465
    if (transition) {
9466
      if (value) {
9467
        transition.beforeEnter(el);
9468
        setDisplay(el, true);
9469
        transition.enter(el);
9470
      } else {
9471
        transition.leave(el, () => {
9472
          setDisplay(el, false);
9473
        });
9474
      }
9475
    } else {
9476
      setDisplay(el, value);
9477
    }
9478
  },
9479
  beforeUnmount(el, { value }) {
9480
    setDisplay(el, value);
9481
  }
9482
};
9483
function setDisplay(el, value) {
9484
  el.style.display = value ? el[vShowOldKey] : "none";
9485
}
9486
 
9487
function patchStyle(el, prev, next) {
9488
  const style = el.style;
9489
  const isCssString = isString(next);
9490
  if (next && !isCssString) {
9491
    if (prev && !isString(prev)) {
9492
      for (const key in prev) {
9493
        if (next[key] == null) {
9494
          setStyle(style, key, "");
9495
        }
9496
      }
9497
    }
9498
    for (const key in next) {
9499
      setStyle(style, key, next[key]);
9500
    }
9501
  } else {
9502
    const currentDisplay = style.display;
9503
    if (isCssString) {
9504
      if (prev !== next) {
9505
        style.cssText = next;
9506
      }
9507
    } else if (prev) {
9508
      el.removeAttribute("style");
9509
    }
9510
    if (vShowOldKey in el) {
9511
      style.display = currentDisplay;
9512
    }
9513
  }
9514
}
9515
const semicolonRE = /[^\\];\s*$/;
9516
const importantRE = /\s*!important$/;
9517
function setStyle(style, name, val) {
9518
  if (isArray(val)) {
9519
    val.forEach((v) => setStyle(style, name, v));
9520
  } else {
9521
    if (val == null)
9522
      val = "";
9523
    {
9524
      if (semicolonRE.test(val)) {
9525
        warn(
9526
          `Unexpected semicolon at the end of '${name}' style value: '${val}'`
9527
        );
9528
      }
9529
    }
9530
    if (name.startsWith("--")) {
9531
      style.setProperty(name, val);
9532
    } else {
9533
      const prefixed = autoPrefix(style, name);
9534
      if (importantRE.test(val)) {
9535
        style.setProperty(
9536
          hyphenate(prefixed),
9537
          val.replace(importantRE, ""),
9538
          "important"
9539
        );
9540
      } else {
9541
        style[prefixed] = val;
9542
      }
9543
    }
9544
  }
9545
}
9546
const prefixes = ["Webkit", "Moz", "ms"];
9547
const prefixCache = {};
9548
function autoPrefix(style, rawName) {
9549
  const cached = prefixCache[rawName];
9550
  if (cached) {
9551
    return cached;
9552
  }
9553
  let name = camelize(rawName);
9554
  if (name !== "filter" && name in style) {
9555
    return prefixCache[rawName] = name;
9556
  }
9557
  name = capitalize(name);
9558
  for (let i = 0; i < prefixes.length; i++) {
9559
    const prefixed = prefixes[i] + name;
9560
    if (prefixed in style) {
9561
      return prefixCache[rawName] = prefixed;
9562
    }
9563
  }
9564
  return rawName;
9565
}
9566
 
9567
const xlinkNS = "http://www.w3.org/1999/xlink";
9568
function patchAttr(el, key, value, isSVG, instance) {
9569
  if (isSVG && key.startsWith("xlink:")) {
9570
    if (value == null) {
9571
      el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
9572
    } else {
9573
      el.setAttributeNS(xlinkNS, key, value);
9574
    }
9575
  } else {
9576
    const isBoolean = isSpecialBooleanAttr(key);
9577
    if (value == null || isBoolean && !includeBooleanAttr(value)) {
9578
      el.removeAttribute(key);
9579
    } else {
9580
      el.setAttribute(key, isBoolean ? "" : value);
9581
    }
9582
  }
9583
}
9584
 
9585
function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
9586
  if (key === "innerHTML" || key === "textContent") {
9587
    if (prevChildren) {
9588
      unmountChildren(prevChildren, parentComponent, parentSuspense);
9589
    }
9590
    el[key] = value == null ? "" : value;
9591
    return;
9592
  }
9593
  const tag = el.tagName;
9594
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
9595
  !tag.includes("-")) {
9596
    el._value = value;
9597
    const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
9598
    const newValue = value == null ? "" : value;
9599
    if (oldValue !== newValue) {
9600
      el.value = newValue;
9601
    }
9602
    if (value == null) {
9603
      el.removeAttribute(key);
9604
    }
9605
    return;
9606
  }
9607
  let needRemove = false;
9608
  if (value === "" || value == null) {
9609
    const type = typeof el[key];
9610
    if (type === "boolean") {
9611
      value = includeBooleanAttr(value);
9612
    } else if (value == null && type === "string") {
9613
      value = "";
9614
      needRemove = true;
9615
    } else if (type === "number") {
9616
      value = 0;
9617
      needRemove = true;
9618
    }
9619
  }
9620
  try {
9621
    el[key] = value;
9622
  } catch (e) {
9623
    if (!needRemove) {
9624
      warn(
9625
        `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
9626
        e
9627
      );
9628
    }
9629
  }
9630
  needRemove && el.removeAttribute(key);
9631
}
9632
 
9633
function addEventListener(el, event, handler, options) {
9634
  el.addEventListener(event, handler, options);
9635
}
9636
function removeEventListener(el, event, handler, options) {
9637
  el.removeEventListener(event, handler, options);
9638
}
9639
const veiKey = Symbol("_vei");
9640
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
9641
  const invokers = el[veiKey] || (el[veiKey] = {});
9642
  const existingInvoker = invokers[rawName];
9643
  if (nextValue && existingInvoker) {
9644
    existingInvoker.value = nextValue;
9645
  } else {
9646
    const [name, options] = parseName(rawName);
9647
    if (nextValue) {
9648
      const invoker = invokers[rawName] = createInvoker(nextValue, instance);
9649
      addEventListener(el, name, invoker, options);
9650
    } else if (existingInvoker) {
9651
      removeEventListener(el, name, existingInvoker, options);
9652
      invokers[rawName] = void 0;
9653
    }
9654
  }
9655
}
9656
const optionsModifierRE = /(?:Once|Passive|Capture)$/;
9657
function parseName(name) {
9658
  let options;
9659
  if (optionsModifierRE.test(name)) {
9660
    options = {};
9661
    let m;
9662
    while (m = name.match(optionsModifierRE)) {
9663
      name = name.slice(0, name.length - m[0].length);
9664
      options[m[0].toLowerCase()] = true;
9665
    }
9666
  }
9667
  const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
9668
  return [event, options];
9669
}
9670
let cachedNow = 0;
9671
const p = /* @__PURE__ */ Promise.resolve();
9672
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
9673
function createInvoker(initialValue, instance) {
9674
  const invoker = (e) => {
9675
    if (!e._vts) {
9676
      e._vts = Date.now();
9677
    } else if (e._vts <= invoker.attached) {
9678
      return;
9679
    }
9680
    callWithAsyncErrorHandling(
9681
      patchStopImmediatePropagation(e, invoker.value),
9682
      instance,
9683
      5,
9684
      [e]
9685
    );
9686
  };
9687
  invoker.value = initialValue;
9688
  invoker.attached = getNow();
9689
  return invoker;
9690
}
9691
function patchStopImmediatePropagation(e, value) {
9692
  if (isArray(value)) {
9693
    const originalStop = e.stopImmediatePropagation;
9694
    e.stopImmediatePropagation = () => {
9695
      originalStop.call(e);
9696
      e._stopped = true;
9697
    };
9698
    return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
9699
  } else {
9700
    return value;
9701
  }
9702
}
9703
 
9704
const nativeOnRE = /^on[a-z]/;
9705
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
9706
  if (key === "class") {
9707
    patchClass(el, nextValue, isSVG);
9708
  } else if (key === "style") {
9709
    patchStyle(el, prevValue, nextValue);
9710
  } else if (isOn(key)) {
9711
    if (!isModelListener(key)) {
9712
      patchEvent(el, key, prevValue, nextValue, parentComponent);
9713
    }
9714
  } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
9715
    patchDOMProp(
9716
      el,
9717
      key,
9718
      nextValue,
9719
      prevChildren,
9720
      parentComponent,
9721
      parentSuspense,
9722
      unmountChildren
9723
    );
9724
  } else {
9725
    if (key === "true-value") {
9726
      el._trueValue = nextValue;
9727
    } else if (key === "false-value") {
9728
      el._falseValue = nextValue;
9729
    }
9730
    patchAttr(el, key, nextValue, isSVG);
9731
  }
9732
};
9733
function shouldSetAsProp(el, key, value, isSVG) {
9734
  if (isSVG) {
9735
    if (key === "innerHTML" || key === "textContent") {
9736
      return true;
9737
    }
9738
    if (key in el && nativeOnRE.test(key) && isFunction(value)) {
9739
      return true;
9740
    }
9741
    return false;
9742
  }
9743
  if (key === "spellcheck" || key === "draggable" || key === "translate") {
9744
    return false;
9745
  }
9746
  if (key === "form") {
9747
    return false;
9748
  }
9749
  if (key === "list" && el.tagName === "INPUT") {
9750
    return false;
9751
  }
9752
  if (key === "type" && el.tagName === "TEXTAREA") {
9753
    return false;
9754
  }
9755
  if (nativeOnRE.test(key) && isString(value)) {
9756
    return false;
9757
  }
9758
  return key in el;
9759
}
9760
 
9761
/*! #__NO_SIDE_EFFECTS__ */
9762
// @__NO_SIDE_EFFECTS__
9763
function defineCustomElement(options, hydrate2) {
9764
  const Comp = defineComponent(options);
9765
  class VueCustomElement extends VueElement {
9766
    constructor(initialProps) {
9767
      super(Comp, initialProps, hydrate2);
9768
    }
9769
  }
9770
  VueCustomElement.def = Comp;
9771
  return VueCustomElement;
9772
}
9773
/*! #__NO_SIDE_EFFECTS__ */
9774
const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => {
9775
  return /* @__PURE__ */ defineCustomElement(options, hydrate);
9776
};
9777
const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
9778
};
9779
class VueElement extends BaseClass {
9780
  constructor(_def, _props = {}, hydrate2) {
9781
    super();
9782
    this._def = _def;
9783
    this._props = _props;
9784
    /**
9785
     * @internal
9786
     */
9787
    this._instance = null;
9788
    this._connected = false;
9789
    this._resolved = false;
9790
    this._numberProps = null;
9791
    this._ob = null;
9792
    if (this.shadowRoot && hydrate2) {
9793
      hydrate2(this._createVNode(), this.shadowRoot);
9794
    } else {
9795
      if (this.shadowRoot) {
9796
        warn(
9797
          `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
9798
        );
9799
      }
9800
      this.attachShadow({ mode: "open" });
9801
      if (!this._def.__asyncLoader) {
9802
        this._resolveProps(this._def);
9803
      }
9804
    }
9805
  }
9806
  connectedCallback() {
9807
    this._connected = true;
9808
    if (!this._instance) {
9809
      if (this._resolved) {
9810
        this._update();
9811
      } else {
9812
        this._resolveDef();
9813
      }
9814
    }
9815
  }
9816
  disconnectedCallback() {
9817
    this._connected = false;
9818
    if (this._ob) {
9819
      this._ob.disconnect();
9820
      this._ob = null;
9821
    }
9822
    nextTick(() => {
9823
      if (!this._connected) {
9824
        render(null, this.shadowRoot);
9825
        this._instance = null;
9826
      }
9827
    });
9828
  }
9829
  /**
9830
   * resolve inner component definition (handle possible async component)
9831
   */
9832
  _resolveDef() {
9833
    this._resolved = true;
9834
    for (let i = 0; i < this.attributes.length; i++) {
9835
      this._setAttr(this.attributes[i].name);
9836
    }
9837
    this._ob = new MutationObserver((mutations) => {
9838
      for (const m of mutations) {
9839
        this._setAttr(m.attributeName);
9840
      }
9841
    });
9842
    this._ob.observe(this, { attributes: true });
9843
    const resolve = (def, isAsync = false) => {
9844
      const { props, styles } = def;
9845
      let numberProps;
9846
      if (props && !isArray(props)) {
9847
        for (const key in props) {
9848
          const opt = props[key];
9849
          if (opt === Number || opt && opt.type === Number) {
9850
            if (key in this._props) {
9851
              this._props[key] = toNumber(this._props[key]);
9852
            }
9853
            (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
9854
          }
9855
        }
9856
      }
9857
      this._numberProps = numberProps;
9858
      if (isAsync) {
9859
        this._resolveProps(def);
9860
      }
9861
      this._applyStyles(styles);
9862
      this._update();
9863
    };
9864
    const asyncDef = this._def.__asyncLoader;
9865
    if (asyncDef) {
9866
      asyncDef().then((def) => resolve(def, true));
9867
    } else {
9868
      resolve(this._def);
9869
    }
9870
  }
9871
  _resolveProps(def) {
9872
    const { props } = def;
9873
    const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
9874
    for (const key of Object.keys(this)) {
9875
      if (key[0] !== "_" && declaredPropKeys.includes(key)) {
9876
        this._setProp(key, this[key], true, false);
9877
      }
9878
    }
9879
    for (const key of declaredPropKeys.map(camelize)) {
9880
      Object.defineProperty(this, key, {
9881
        get() {
9882
          return this._getProp(key);
9883
        },
9884
        set(val) {
9885
          this._setProp(key, val);
9886
        }
9887
      });
9888
    }
9889
  }
9890
  _setAttr(key) {
9891
    let value = this.getAttribute(key);
9892
    const camelKey = camelize(key);
9893
    if (this._numberProps && this._numberProps[camelKey]) {
9894
      value = toNumber(value);
9895
    }
9896
    this._setProp(camelKey, value, false);
9897
  }
9898
  /**
9899
   * @internal
9900
   */
9901
  _getProp(key) {
9902
    return this._props[key];
9903
  }
9904
  /**
9905
   * @internal
9906
   */
9907
  _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
9908
    if (val !== this._props[key]) {
9909
      this._props[key] = val;
9910
      if (shouldUpdate && this._instance) {
9911
        this._update();
9912
      }
9913
      if (shouldReflect) {
9914
        if (val === true) {
9915
          this.setAttribute(hyphenate(key), "");
9916
        } else if (typeof val === "string" || typeof val === "number") {
9917
          this.setAttribute(hyphenate(key), val + "");
9918
        } else if (!val) {
9919
          this.removeAttribute(hyphenate(key));
9920
        }
9921
      }
9922
    }
9923
  }
9924
  _update() {
9925
    render(this._createVNode(), this.shadowRoot);
9926
  }
9927
  _createVNode() {
9928
    const vnode = createVNode(this._def, extend({}, this._props));
9929
    if (!this._instance) {
9930
      vnode.ce = (instance) => {
9931
        this._instance = instance;
9932
        instance.isCE = true;
9933
        {
9934
          instance.ceReload = (newStyles) => {
9935
            if (this._styles) {
9936
              this._styles.forEach((s) => this.shadowRoot.removeChild(s));
9937
              this._styles.length = 0;
9938
            }
9939
            this._applyStyles(newStyles);
9940
            this._instance = null;
9941
            this._update();
9942
          };
9943
        }
9944
        const dispatch = (event, args) => {
9945
          this.dispatchEvent(
9946
            new CustomEvent(event, {
9947
              detail: args
9948
            })
9949
          );
9950
        };
9951
        instance.emit = (event, ...args) => {
9952
          dispatch(event, args);
9953
          if (hyphenate(event) !== event) {
9954
            dispatch(hyphenate(event), args);
9955
          }
9956
        };
9957
        let parent = this;
9958
        while (parent = parent && (parent.parentNode || parent.host)) {
9959
          if (parent instanceof VueElement) {
9960
            instance.parent = parent._instance;
9961
            instance.provides = parent._instance.provides;
9962
            break;
9963
          }
9964
        }
9965
      };
9966
    }
9967
    return vnode;
9968
  }
9969
  _applyStyles(styles) {
9970
    if (styles) {
9971
      styles.forEach((css) => {
9972
        const s = document.createElement("style");
9973
        s.textContent = css;
9974
        this.shadowRoot.appendChild(s);
9975
        {
9976
          (this._styles || (this._styles = [])).push(s);
9977
        }
9978
      });
9979
    }
9980
  }
9981
}
9982
 
9983
function useCssModule(name = "$style") {
9984
  {
9985
    const instance = getCurrentInstance();
9986
    if (!instance) {
9987
      warn(`useCssModule must be called inside setup()`);
9988
      return EMPTY_OBJ;
9989
    }
9990
    const modules = instance.type.__cssModules;
9991
    if (!modules) {
9992
      warn(`Current instance does not have CSS modules injected.`);
9993
      return EMPTY_OBJ;
9994
    }
9995
    const mod = modules[name];
9996
    if (!mod) {
9997
      warn(`Current instance does not have CSS module named "${name}".`);
9998
      return EMPTY_OBJ;
9999
    }
10000
    return mod;
10001
  }
10002
}
10003
 
10004
function useCssVars(getter) {
10005
  const instance = getCurrentInstance();
10006
  if (!instance) {
10007
    warn(`useCssVars is called without current active component instance.`);
10008
    return;
10009
  }
10010
  const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
10011
    Array.from(
10012
      document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
10013
    ).forEach((node) => setVarsOnNode(node, vars));
10014
  };
10015
  const setVars = () => {
10016
    const vars = getter(instance.proxy);
10017
    setVarsOnVNode(instance.subTree, vars);
10018
    updateTeleports(vars);
10019
  };
10020
  watchPostEffect(setVars);
10021
  onMounted(() => {
10022
    const ob = new MutationObserver(setVars);
10023
    ob.observe(instance.subTree.el.parentNode, { childList: true });
10024
    onUnmounted(() => ob.disconnect());
10025
  });
10026
}
10027
function setVarsOnVNode(vnode, vars) {
10028
  if (vnode.shapeFlag & 128) {
10029
    const suspense = vnode.suspense;
10030
    vnode = suspense.activeBranch;
10031
    if (suspense.pendingBranch && !suspense.isHydrating) {
10032
      suspense.effects.push(() => {
10033
        setVarsOnVNode(suspense.activeBranch, vars);
10034
      });
10035
    }
10036
  }
10037
  while (vnode.component) {
10038
    vnode = vnode.component.subTree;
10039
  }
10040
  if (vnode.shapeFlag & 1 && vnode.el) {
10041
    setVarsOnNode(vnode.el, vars);
10042
  } else if (vnode.type === Fragment) {
10043
    vnode.children.forEach((c) => setVarsOnVNode(c, vars));
10044
  } else if (vnode.type === Static) {
10045
    let { el, anchor } = vnode;
10046
    while (el) {
10047
      setVarsOnNode(el, vars);
10048
      if (el === anchor)
10049
        break;
10050
      el = el.nextSibling;
10051
    }
10052
  }
10053
}
10054
function setVarsOnNode(el, vars) {
10055
  if (el.nodeType === 1) {
10056
    const style = el.style;
10057
    for (const key in vars) {
10058
      style.setProperty(`--${key}`, vars[key]);
10059
    }
10060
  }
10061
}
10062
 
10063
const positionMap = /* @__PURE__ */ new WeakMap();
10064
const newPositionMap = /* @__PURE__ */ new WeakMap();
10065
const moveCbKey = Symbol("_moveCb");
10066
const enterCbKey = Symbol("_enterCb");
10067
const TransitionGroupImpl = {
10068
  name: "TransitionGroup",
10069
  props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
10070
    tag: String,
10071
    moveClass: String
10072
  }),
10073
  setup(props, { slots }) {
10074
    const instance = getCurrentInstance();
10075
    const state = useTransitionState();
10076
    let prevChildren;
10077
    let children;
10078
    onUpdated(() => {
10079
      if (!prevChildren.length) {
10080
        return;
10081
      }
10082
      const moveClass = props.moveClass || `${props.name || "v"}-move`;
10083
      if (!hasCSSTransform(
10084
        prevChildren[0].el,
10085
        instance.vnode.el,
10086
        moveClass
10087
      )) {
10088
        return;
10089
      }
10090
      prevChildren.forEach(callPendingCbs);
10091
      prevChildren.forEach(recordPosition);
10092
      const movedChildren = prevChildren.filter(applyTranslation);
10093
      forceReflow();
10094
      movedChildren.forEach((c) => {
10095
        const el = c.el;
10096
        const style = el.style;
10097
        addTransitionClass(el, moveClass);
10098
        style.transform = style.webkitTransform = style.transitionDuration = "";
10099
        const cb = el[moveCbKey] = (e) => {
10100
          if (e && e.target !== el) {
10101
            return;
10102
          }
10103
          if (!e || /transform$/.test(e.propertyName)) {
10104
            el.removeEventListener("transitionend", cb);
10105
            el[moveCbKey] = null;
10106
            removeTransitionClass(el, moveClass);
10107
          }
10108
        };
10109
        el.addEventListener("transitionend", cb);
10110
      });
10111
    });
10112
    return () => {
10113
      const rawProps = toRaw(props);
10114
      const cssTransitionProps = resolveTransitionProps(rawProps);
10115
      let tag = rawProps.tag || Fragment;
10116
      prevChildren = children;
10117
      children = slots.default ? getTransitionRawChildren(slots.default()) : [];
10118
      for (let i = 0; i < children.length; i++) {
10119
        const child = children[i];
10120
        if (child.key != null) {
10121
          setTransitionHooks(
10122
            child,
10123
            resolveTransitionHooks(child, cssTransitionProps, state, instance)
10124
          );
10125
        } else {
10126
          warn(`<TransitionGroup> children must be keyed.`);
10127
        }
10128
      }
10129
      if (prevChildren) {
10130
        for (let i = 0; i < prevChildren.length; i++) {
10131
          const child = prevChildren[i];
10132
          setTransitionHooks(
10133
            child,
10134
            resolveTransitionHooks(child, cssTransitionProps, state, instance)
10135
          );
10136
          positionMap.set(child, child.el.getBoundingClientRect());
10137
        }
10138
      }
10139
      return createVNode(tag, null, children);
10140
    };
10141
  }
10142
};
10143
const removeMode = (props) => delete props.mode;
10144
/* @__PURE__ */ removeMode(TransitionGroupImpl.props);
10145
const TransitionGroup = TransitionGroupImpl;
10146
function callPendingCbs(c) {
10147
  const el = c.el;
10148
  if (el[moveCbKey]) {
10149
    el[moveCbKey]();
10150
  }
10151
  if (el[enterCbKey]) {
10152
    el[enterCbKey]();
10153
  }
10154
}
10155
function recordPosition(c) {
10156
  newPositionMap.set(c, c.el.getBoundingClientRect());
10157
}
10158
function applyTranslation(c) {
10159
  const oldPos = positionMap.get(c);
10160
  const newPos = newPositionMap.get(c);
10161
  const dx = oldPos.left - newPos.left;
10162
  const dy = oldPos.top - newPos.top;
10163
  if (dx || dy) {
10164
    const s = c.el.style;
10165
    s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
10166
    s.transitionDuration = "0s";
10167
    return c;
10168
  }
10169
}
10170
function hasCSSTransform(el, root, moveClass) {
10171
  const clone = el.cloneNode();
10172
  const _vtc = el[vtcKey];
10173
  if (_vtc) {
10174
    _vtc.forEach((cls) => {
10175
      cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
10176
    });
10177
  }
10178
  moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
10179
  clone.style.display = "none";
10180
  const container = root.nodeType === 1 ? root : root.parentNode;
10181
  container.appendChild(clone);
10182
  const { hasTransform } = getTransitionInfo(clone);
10183
  container.removeChild(clone);
10184
  return hasTransform;
10185
}
10186
 
10187
const getModelAssigner = (vnode) => {
10188
  const fn = vnode.props["onUpdate:modelValue"] || false;
10189
  return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
10190
};
10191
function onCompositionStart(e) {
10192
  e.target.composing = true;
10193
}
10194
function onCompositionEnd(e) {
10195
  const target = e.target;
10196
  if (target.composing) {
10197
    target.composing = false;
10198
    target.dispatchEvent(new Event("input"));
10199
  }
10200
}
10201
const assignKey = Symbol("_assign");
10202
const vModelText = {
10203
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
10204
    el[assignKey] = getModelAssigner(vnode);
10205
    const castToNumber = number || vnode.props && vnode.props.type === "number";
10206
    addEventListener(el, lazy ? "change" : "input", (e) => {
10207
      if (e.target.composing)
10208
        return;
10209
      let domValue = el.value;
10210
      if (trim) {
10211
        domValue = domValue.trim();
10212
      }
10213
      if (castToNumber) {
10214
        domValue = looseToNumber(domValue);
10215
      }
10216
      el[assignKey](domValue);
10217
    });
10218
    if (trim) {
10219
      addEventListener(el, "change", () => {
10220
        el.value = el.value.trim();
10221
      });
10222
    }
10223
    if (!lazy) {
10224
      addEventListener(el, "compositionstart", onCompositionStart);
10225
      addEventListener(el, "compositionend", onCompositionEnd);
10226
      addEventListener(el, "change", onCompositionEnd);
10227
    }
10228
  },
10229
  // set value on mounted so it's after min/max for type="range"
10230
  mounted(el, { value }) {
10231
    el.value = value == null ? "" : value;
10232
  },
10233
  beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
10234
    el[assignKey] = getModelAssigner(vnode);
10235
    if (el.composing)
10236
      return;
10237
    if (document.activeElement === el && el.type !== "range") {
10238
      if (lazy) {
10239
        return;
10240
      }
10241
      if (trim && el.value.trim() === value) {
10242
        return;
10243
      }
10244
      if ((number || el.type === "number") && looseToNumber(el.value) === value) {
10245
        return;
10246
      }
10247
    }
10248
    const newValue = value == null ? "" : value;
10249
    if (el.value !== newValue) {
10250
      el.value = newValue;
10251
    }
10252
  }
10253
};
10254
const vModelCheckbox = {
10255
  // #4096 array checkboxes need to be deep traversed
10256
  deep: true,
10257
  created(el, _, vnode) {
10258
    el[assignKey] = getModelAssigner(vnode);
10259
    addEventListener(el, "change", () => {
10260
      const modelValue = el._modelValue;
10261
      const elementValue = getValue(el);
10262
      const checked = el.checked;
10263
      const assign = el[assignKey];
10264
      if (isArray(modelValue)) {
10265
        const index = looseIndexOf(modelValue, elementValue);
10266
        const found = index !== -1;
10267
        if (checked && !found) {
10268
          assign(modelValue.concat(elementValue));
10269
        } else if (!checked && found) {
10270
          const filtered = [...modelValue];
10271
          filtered.splice(index, 1);
10272
          assign(filtered);
10273
        }
10274
      } else if (isSet(modelValue)) {
10275
        const cloned = new Set(modelValue);
10276
        if (checked) {
10277
          cloned.add(elementValue);
10278
        } else {
10279
          cloned.delete(elementValue);
10280
        }
10281
        assign(cloned);
10282
      } else {
10283
        assign(getCheckboxValue(el, checked));
10284
      }
10285
    });
10286
  },
10287
  // set initial checked on mount to wait for true-value/false-value
10288
  mounted: setChecked,
10289
  beforeUpdate(el, binding, vnode) {
10290
    el[assignKey] = getModelAssigner(vnode);
10291
    setChecked(el, binding, vnode);
10292
  }
10293
};
10294
function setChecked(el, { value, oldValue }, vnode) {
10295
  el._modelValue = value;
10296
  if (isArray(value)) {
10297
    el.checked = looseIndexOf(value, vnode.props.value) > -1;
10298
  } else if (isSet(value)) {
10299
    el.checked = value.has(vnode.props.value);
10300
  } else if (value !== oldValue) {
10301
    el.checked = looseEqual(value, getCheckboxValue(el, true));
10302
  }
10303
}
10304
const vModelRadio = {
10305
  created(el, { value }, vnode) {
10306
    el.checked = looseEqual(value, vnode.props.value);
10307
    el[assignKey] = getModelAssigner(vnode);
10308
    addEventListener(el, "change", () => {
10309
      el[assignKey](getValue(el));
10310
    });
10311
  },
10312
  beforeUpdate(el, { value, oldValue }, vnode) {
10313
    el[assignKey] = getModelAssigner(vnode);
10314
    if (value !== oldValue) {
10315
      el.checked = looseEqual(value, vnode.props.value);
10316
    }
10317
  }
10318
};
10319
const vModelSelect = {
10320
  // <select multiple> value need to be deep traversed
10321
  deep: true,
10322
  created(el, { value, modifiers: { number } }, vnode) {
10323
    const isSetModel = isSet(value);
10324
    addEventListener(el, "change", () => {
10325
      const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
10326
        (o) => number ? looseToNumber(getValue(o)) : getValue(o)
10327
      );
10328
      el[assignKey](
10329
        el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
10330
      );
10331
    });
10332
    el[assignKey] = getModelAssigner(vnode);
10333
  },
10334
  // set value in mounted & updated because <select> relies on its children
10335
  // <option>s.
10336
  mounted(el, { value }) {
10337
    setSelected(el, value);
10338
  },
10339
  beforeUpdate(el, _binding, vnode) {
10340
    el[assignKey] = getModelAssigner(vnode);
10341
  },
10342
  updated(el, { value }) {
10343
    setSelected(el, value);
10344
  }
10345
};
10346
function setSelected(el, value) {
10347
  const isMultiple = el.multiple;
10348
  if (isMultiple && !isArray(value) && !isSet(value)) {
10349
    warn(
10350
      `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
10351
    );
10352
    return;
10353
  }
10354
  for (let i = 0, l = el.options.length; i < l; i++) {
10355
    const option = el.options[i];
10356
    const optionValue = getValue(option);
10357
    if (isMultiple) {
10358
      if (isArray(value)) {
10359
        option.selected = looseIndexOf(value, optionValue) > -1;
10360
      } else {
10361
        option.selected = value.has(optionValue);
10362
      }
10363
    } else {
10364
      if (looseEqual(getValue(option), value)) {
10365
        if (el.selectedIndex !== i)
10366
          el.selectedIndex = i;
10367
        return;
10368
      }
10369
    }
10370
  }
10371
  if (!isMultiple && el.selectedIndex !== -1) {
10372
    el.selectedIndex = -1;
10373
  }
10374
}
10375
function getValue(el) {
10376
  return "_value" in el ? el._value : el.value;
10377
}
10378
function getCheckboxValue(el, checked) {
10379
  const key = checked ? "_trueValue" : "_falseValue";
10380
  return key in el ? el[key] : checked;
10381
}
10382
const vModelDynamic = {
10383
  created(el, binding, vnode) {
10384
    callModelHook(el, binding, vnode, null, "created");
10385
  },
10386
  mounted(el, binding, vnode) {
10387
    callModelHook(el, binding, vnode, null, "mounted");
10388
  },
10389
  beforeUpdate(el, binding, vnode, prevVNode) {
10390
    callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
10391
  },
10392
  updated(el, binding, vnode, prevVNode) {
10393
    callModelHook(el, binding, vnode, prevVNode, "updated");
10394
  }
10395
};
10396
function resolveDynamicModel(tagName, type) {
10397
  switch (tagName) {
10398
    case "SELECT":
10399
      return vModelSelect;
10400
    case "TEXTAREA":
10401
      return vModelText;
10402
    default:
10403
      switch (type) {
10404
        case "checkbox":
10405
          return vModelCheckbox;
10406
        case "radio":
10407
          return vModelRadio;
10408
        default:
10409
          return vModelText;
10410
      }
10411
  }
10412
}
10413
function callModelHook(el, binding, vnode, prevVNode, hook) {
10414
  const modelToUse = resolveDynamicModel(
10415
    el.tagName,
10416
    vnode.props && vnode.props.type
10417
  );
10418
  const fn = modelToUse[hook];
10419
  fn && fn(el, binding, vnode, prevVNode);
10420
}
10421
 
10422
const systemModifiers = ["ctrl", "shift", "alt", "meta"];
10423
const modifierGuards = {
10424
  stop: (e) => e.stopPropagation(),
10425
  prevent: (e) => e.preventDefault(),
10426
  self: (e) => e.target !== e.currentTarget,
10427
  ctrl: (e) => !e.ctrlKey,
10428
  shift: (e) => !e.shiftKey,
10429
  alt: (e) => !e.altKey,
10430
  meta: (e) => !e.metaKey,
10431
  left: (e) => "button" in e && e.button !== 0,
10432
  middle: (e) => "button" in e && e.button !== 1,
10433
  right: (e) => "button" in e && e.button !== 2,
10434
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
10435
};
10436
const withModifiers = (fn, modifiers) => {
10437
  return (event, ...args) => {
10438
    for (let i = 0; i < modifiers.length; i++) {
10439
      const guard = modifierGuards[modifiers[i]];
10440
      if (guard && guard(event, modifiers))
10441
        return;
10442
    }
10443
    return fn(event, ...args);
10444
  };
10445
};
10446
const keyNames = {
10447
  esc: "escape",
10448
  space: " ",
10449
  up: "arrow-up",
10450
  left: "arrow-left",
10451
  right: "arrow-right",
10452
  down: "arrow-down",
10453
  delete: "backspace"
10454
};
10455
const withKeys = (fn, modifiers) => {
10456
  return (event) => {
10457
    if (!("key" in event)) {
10458
      return;
10459
    }
10460
    const eventKey = hyphenate(event.key);
10461
    if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
10462
      return fn(event);
10463
    }
10464
  };
10465
};
10466
 
10467
const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
10468
let renderer;
10469
let enabledHydration = false;
10470
function ensureRenderer() {
10471
  return renderer || (renderer = createRenderer(rendererOptions));
10472
}
10473
function ensureHydrationRenderer() {
10474
  renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
10475
  enabledHydration = true;
10476
  return renderer;
10477
}
10478
const render = (...args) => {
10479
  ensureRenderer().render(...args);
10480
};
10481
const hydrate = (...args) => {
10482
  ensureHydrationRenderer().hydrate(...args);
10483
};
10484
const createApp = (...args) => {
10485
  const app = ensureRenderer().createApp(...args);
10486
  {
10487
    injectNativeTagCheck(app);
10488
    injectCompilerOptionsCheck(app);
10489
  }
10490
  const { mount } = app;
10491
  app.mount = (containerOrSelector) => {
10492
    const container = normalizeContainer(containerOrSelector);
10493
    if (!container)
10494
      return;
10495
    const component = app._component;
10496
    if (!isFunction(component) && !component.render && !component.template) {
10497
      component.template = container.innerHTML;
10498
    }
10499
    container.innerHTML = "";
10500
    const proxy = mount(container, false, container instanceof SVGElement);
10501
    if (container instanceof Element) {
10502
      container.removeAttribute("v-cloak");
10503
      container.setAttribute("data-v-app", "");
10504
    }
10505
    return proxy;
10506
  };
10507
  return app;
10508
};
10509
const createSSRApp = (...args) => {
10510
  const app = ensureHydrationRenderer().createApp(...args);
10511
  {
10512
    injectNativeTagCheck(app);
10513
    injectCompilerOptionsCheck(app);
10514
  }
10515
  const { mount } = app;
10516
  app.mount = (containerOrSelector) => {
10517
    const container = normalizeContainer(containerOrSelector);
10518
    if (container) {
10519
      return mount(container, true, container instanceof SVGElement);
10520
    }
10521
  };
10522
  return app;
10523
};
10524
function injectNativeTagCheck(app) {
10525
  Object.defineProperty(app.config, "isNativeTag", {
10526
    value: (tag) => isHTMLTag(tag) || isSVGTag(tag),
10527
    writable: false
10528
  });
10529
}
10530
function injectCompilerOptionsCheck(app) {
10531
  if (isRuntimeOnly()) {
10532
    const isCustomElement = app.config.isCustomElement;
10533
    Object.defineProperty(app.config, "isCustomElement", {
10534
      get() {
10535
        return isCustomElement;
10536
      },
10537
      set() {
10538
        warn(
10539
          `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
10540
        );
10541
      }
10542
    });
10543
    const compilerOptions = app.config.compilerOptions;
10544
    const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
10545
- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
10546
- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
10547
- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
10548
    Object.defineProperty(app.config, "compilerOptions", {
10549
      get() {
10550
        warn(msg);
10551
        return compilerOptions;
10552
      },
10553
      set() {
10554
        warn(msg);
10555
      }
10556
    });
10557
  }
10558
}
10559
function normalizeContainer(container) {
10560
  if (isString(container)) {
10561
    const res = document.querySelector(container);
10562
    if (!res) {
10563
      warn(
10564
        `Failed to mount app: mount target selector "${container}" returned null.`
10565
      );
10566
    }
10567
    return res;
10568
  }
10569
  if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
10570
    warn(
10571
      `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
10572
    );
10573
  }
10574
  return container;
10575
}
10576
const initDirectivesForSSR = NOOP;
10577
 
10578
var runtimeDom = /*#__PURE__*/Object.freeze({
10579
  __proto__: null,
10580
  BaseTransition: BaseTransition,
10581
  BaseTransitionPropsValidators: BaseTransitionPropsValidators,
10582
  Comment: Comment,
10583
  EffectScope: EffectScope,
10584
  Fragment: Fragment,
10585
  KeepAlive: KeepAlive,
10586
  ReactiveEffect: ReactiveEffect,
10587
  Static: Static,
10588
  Suspense: Suspense,
10589
  Teleport: Teleport,
10590
  Text: Text,
10591
  Transition: Transition,
10592
  TransitionGroup: TransitionGroup,
10593
  VueElement: VueElement,
10594
  assertNumber: assertNumber,
10595
  callWithAsyncErrorHandling: callWithAsyncErrorHandling,
10596
  callWithErrorHandling: callWithErrorHandling,
10597
  camelize: camelize,
10598
  capitalize: capitalize,
10599
  cloneVNode: cloneVNode,
10600
  compatUtils: compatUtils,
10601
  computed: computed,
10602
  createApp: createApp,
10603
  createBlock: createBlock,
10604
  createCommentVNode: createCommentVNode,
10605
  createElementBlock: createElementBlock,
10606
  createElementVNode: createBaseVNode,
10607
  createHydrationRenderer: createHydrationRenderer,
10608
  createPropsRestProxy: createPropsRestProxy,
10609
  createRenderer: createRenderer,
10610
  createSSRApp: createSSRApp,
10611
  createSlots: createSlots,
10612
  createStaticVNode: createStaticVNode,
10613
  createTextVNode: createTextVNode,
10614
  createVNode: createVNode,
10615
  customRef: customRef,
10616
  defineAsyncComponent: defineAsyncComponent,
10617
  defineComponent: defineComponent,
10618
  defineCustomElement: defineCustomElement,
10619
  defineEmits: defineEmits,
10620
  defineExpose: defineExpose,
10621
  defineModel: defineModel,
10622
  defineOptions: defineOptions,
10623
  defineProps: defineProps,
10624
  defineSSRCustomElement: defineSSRCustomElement,
10625
  defineSlots: defineSlots,
10626
  get devtools () { return devtools; },
10627
  effect: effect,
10628
  effectScope: effectScope,
10629
  getCurrentInstance: getCurrentInstance,
10630
  getCurrentScope: getCurrentScope,
10631
  getTransitionRawChildren: getTransitionRawChildren,
10632
  guardReactiveProps: guardReactiveProps,
10633
  h: h,
10634
  handleError: handleError,
10635
  hasInjectionContext: hasInjectionContext,
10636
  hydrate: hydrate,
10637
  initCustomFormatter: initCustomFormatter,
10638
  initDirectivesForSSR: initDirectivesForSSR,
10639
  inject: inject,
10640
  isMemoSame: isMemoSame,
10641
  isProxy: isProxy,
10642
  isReactive: isReactive,
10643
  isReadonly: isReadonly,
10644
  isRef: isRef,
10645
  isRuntimeOnly: isRuntimeOnly,
10646
  isShallow: isShallow,
10647
  isVNode: isVNode,
10648
  markRaw: markRaw,
10649
  mergeDefaults: mergeDefaults,
10650
  mergeModels: mergeModels,
10651
  mergeProps: mergeProps,
10652
  nextTick: nextTick,
10653
  normalizeClass: normalizeClass,
10654
  normalizeProps: normalizeProps,
10655
  normalizeStyle: normalizeStyle,
10656
  onActivated: onActivated,
10657
  onBeforeMount: onBeforeMount,
10658
  onBeforeUnmount: onBeforeUnmount,
10659
  onBeforeUpdate: onBeforeUpdate,
10660
  onDeactivated: onDeactivated,
10661
  onErrorCaptured: onErrorCaptured,
10662
  onMounted: onMounted,
10663
  onRenderTracked: onRenderTracked,
10664
  onRenderTriggered: onRenderTriggered,
10665
  onScopeDispose: onScopeDispose,
10666
  onServerPrefetch: onServerPrefetch,
10667
  onUnmounted: onUnmounted,
10668
  onUpdated: onUpdated,
10669
  openBlock: openBlock,
10670
  popScopeId: popScopeId,
10671
  provide: provide,
10672
  proxyRefs: proxyRefs,
10673
  pushScopeId: pushScopeId,
10674
  queuePostFlushCb: queuePostFlushCb,
10675
  reactive: reactive,
10676
  readonly: readonly,
10677
  ref: ref,
10678
  registerRuntimeCompiler: registerRuntimeCompiler,
10679
  render: render,
10680
  renderList: renderList,
10681
  renderSlot: renderSlot,
10682
  resolveComponent: resolveComponent,
10683
  resolveDirective: resolveDirective,
10684
  resolveDynamicComponent: resolveDynamicComponent,
10685
  resolveFilter: resolveFilter,
10686
  resolveTransitionHooks: resolveTransitionHooks,
10687
  setBlockTracking: setBlockTracking,
10688
  setDevtoolsHook: setDevtoolsHook,
10689
  setTransitionHooks: setTransitionHooks,
10690
  shallowReactive: shallowReactive,
10691
  shallowReadonly: shallowReadonly,
10692
  shallowRef: shallowRef,
10693
  ssrContextKey: ssrContextKey,
10694
  ssrUtils: ssrUtils,
10695
  stop: stop,
10696
  toDisplayString: toDisplayString,
10697
  toHandlerKey: toHandlerKey,
10698
  toHandlers: toHandlers,
10699
  toRaw: toRaw,
10700
  toRef: toRef,
10701
  toRefs: toRefs,
10702
  toValue: toValue,
10703
  transformVNodeArgs: transformVNodeArgs,
10704
  triggerRef: triggerRef,
10705
  unref: unref,
10706
  useAttrs: useAttrs,
10707
  useCssModule: useCssModule,
10708
  useCssVars: useCssVars,
10709
  useModel: useModel,
10710
  useSSRContext: useSSRContext,
10711
  useSlots: useSlots,
10712
  useTransitionState: useTransitionState,
10713
  vModelCheckbox: vModelCheckbox,
10714
  vModelDynamic: vModelDynamic,
10715
  vModelRadio: vModelRadio,
10716
  vModelSelect: vModelSelect,
10717
  vModelText: vModelText,
10718
  vShow: vShow,
10719
  version: version,
10720
  warn: warn,
10721
  watch: watch,
10722
  watchEffect: watchEffect,
10723
  watchPostEffect: watchPostEffect,
10724
  watchSyncEffect: watchSyncEffect,
10725
  withAsyncContext: withAsyncContext,
10726
  withCtx: withCtx,
10727
  withDefaults: withDefaults,
10728
  withDirectives: withDirectives,
10729
  withKeys: withKeys,
10730
  withMemo: withMemo,
10731
  withModifiers: withModifiers,
10732
  withScopeId: withScopeId
10733
});
10734
 
10735
function initDev() {
10736
  {
10737
    {
10738
      console.info(
10739
        `You are running a development build of Vue.
10740
Make sure to use the production build (*.prod.js) when deploying for production.`
10741
      );
10742
    }
10743
    initCustomFormatter();
10744
  }
10745
}
10746
 
10747
function defaultOnError(error) {
10748
  throw error;
10749
}
10750
function defaultOnWarn(msg) {
10751
  console.warn(`[Vue warn] ${msg.message}`);
10752
}
10753
function createCompilerError(code, loc, messages, additionalMessage) {
10754
  const msg = (messages || errorMessages)[code] + (additionalMessage || ``) ;
10755
  const error = new SyntaxError(String(msg));
10756
  error.code = code;
10757
  error.loc = loc;
10758
  return error;
10759
}
10760
const errorMessages = {
10761
  // parse errors
10762
  [0]: "Illegal comment.",
10763
  [1]: "CDATA section is allowed only in XML context.",
10764
  [2]: "Duplicate attribute.",
10765
  [3]: "End tag cannot have attributes.",
10766
  [4]: "Illegal '/' in tags.",
10767
  [5]: "Unexpected EOF in tag.",
10768
  [6]: "Unexpected EOF in CDATA section.",
10769
  [7]: "Unexpected EOF in comment.",
10770
  [8]: "Unexpected EOF in script.",
10771
  [9]: "Unexpected EOF in tag.",
10772
  [10]: "Incorrectly closed comment.",
10773
  [11]: "Incorrectly opened comment.",
10774
  [12]: "Illegal tag name. Use '&lt;' to print '<'.",
10775
  [13]: "Attribute value was expected.",
10776
  [14]: "End tag name was expected.",
10777
  [15]: "Whitespace was expected.",
10778
  [16]: "Unexpected '<!--' in comment.",
10779
  [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
10780
  [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
10781
  [19]: "Attribute name cannot start with '='.",
10782
  [21]: "'<?' is allowed only in XML context.",
10783
  [20]: `Unexpected null character.`,
10784
  [22]: "Illegal '/' in tags.",
10785
  // Vue-specific parse errors
10786
  [23]: "Invalid end tag.",
10787
  [24]: "Element is missing end tag.",
10788
  [25]: "Interpolation end sign was not found.",
10789
  [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
10790
  [26]: "Legal directive name was expected.",
10791
  // transform errors
10792
  [28]: `v-if/v-else-if is missing expression.`,
10793
  [29]: `v-if/else branches must use unique keys.`,
10794
  [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
10795
  [31]: `v-for is missing expression.`,
10796
  [32]: `v-for has invalid expression.`,
10797
  [33]: `<template v-for> key should be placed on the <template> tag.`,
10798
  [34]: `v-bind is missing expression.`,
10799
  [35]: `v-on is missing expression.`,
10800
  [36]: `Unexpected custom directive on <slot> outlet.`,
10801
  [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
10802
  [38]: `Duplicate slot names found. `,
10803
  [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
10804
  [40]: `v-slot can only be used on components or <template> tags.`,
10805
  [41]: `v-model is missing expression.`,
10806
  [42]: `v-model value must be a valid JavaScript member expression.`,
10807
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
10808
  [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
10809
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
10810
  [45]: `Error parsing JavaScript expression: `,
10811
  [46]: `<KeepAlive> expects exactly one child component.`,
10812
  // generic errors
10813
  [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
10814
  [48]: `ES module mode is not supported in this build of compiler.`,
10815
  [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
10816
  [50]: `"scopeId" option is only supported in module mode.`,
10817
  // deprecations
10818
  [51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
10819
  [52]: `v-is="component-name" has been deprecated. Use is="vue:component-name" instead. v-is support will be removed in 3.4.`,
10820
  // just to fulfill types
10821
  [53]: ``
10822
};
10823
 
10824
const FRAGMENT = Symbol(`Fragment` );
10825
const TELEPORT = Symbol(`Teleport` );
10826
const SUSPENSE = Symbol(`Suspense` );
10827
const KEEP_ALIVE = Symbol(`KeepAlive` );
10828
const BASE_TRANSITION = Symbol(`BaseTransition` );
10829
const OPEN_BLOCK = Symbol(`openBlock` );
10830
const CREATE_BLOCK = Symbol(`createBlock` );
10831
const CREATE_ELEMENT_BLOCK = Symbol(`createElementBlock` );
10832
const CREATE_VNODE = Symbol(`createVNode` );
10833
const CREATE_ELEMENT_VNODE = Symbol(`createElementVNode` );
10834
const CREATE_COMMENT = Symbol(`createCommentVNode` );
10835
const CREATE_TEXT = Symbol(`createTextVNode` );
10836
const CREATE_STATIC = Symbol(`createStaticVNode` );
10837
const RESOLVE_COMPONENT = Symbol(`resolveComponent` );
10838
const RESOLVE_DYNAMIC_COMPONENT = Symbol(
10839
  `resolveDynamicComponent`
10840
);
10841
const RESOLVE_DIRECTIVE = Symbol(`resolveDirective` );
10842
const RESOLVE_FILTER = Symbol(`resolveFilter` );
10843
const WITH_DIRECTIVES = Symbol(`withDirectives` );
10844
const RENDER_LIST = Symbol(`renderList` );
10845
const RENDER_SLOT = Symbol(`renderSlot` );
10846
const CREATE_SLOTS = Symbol(`createSlots` );
10847
const TO_DISPLAY_STRING = Symbol(`toDisplayString` );
10848
const MERGE_PROPS = Symbol(`mergeProps` );
10849
const NORMALIZE_CLASS = Symbol(`normalizeClass` );
10850
const NORMALIZE_STYLE = Symbol(`normalizeStyle` );
10851
const NORMALIZE_PROPS = Symbol(`normalizeProps` );
10852
const GUARD_REACTIVE_PROPS = Symbol(`guardReactiveProps` );
10853
const TO_HANDLERS = Symbol(`toHandlers` );
10854
const CAMELIZE = Symbol(`camelize` );
10855
const CAPITALIZE = Symbol(`capitalize` );
10856
const TO_HANDLER_KEY = Symbol(`toHandlerKey` );
10857
const SET_BLOCK_TRACKING = Symbol(`setBlockTracking` );
10858
const PUSH_SCOPE_ID = Symbol(`pushScopeId` );
10859
const POP_SCOPE_ID = Symbol(`popScopeId` );
10860
const WITH_CTX = Symbol(`withCtx` );
10861
const UNREF = Symbol(`unref` );
10862
const IS_REF = Symbol(`isRef` );
10863
const WITH_MEMO = Symbol(`withMemo` );
10864
const IS_MEMO_SAME = Symbol(`isMemoSame` );
10865
const helperNameMap = {
10866
  [FRAGMENT]: `Fragment`,
10867
  [TELEPORT]: `Teleport`,
10868
  [SUSPENSE]: `Suspense`,
10869
  [KEEP_ALIVE]: `KeepAlive`,
10870
  [BASE_TRANSITION]: `BaseTransition`,
10871
  [OPEN_BLOCK]: `openBlock`,
10872
  [CREATE_BLOCK]: `createBlock`,
10873
  [CREATE_ELEMENT_BLOCK]: `createElementBlock`,
10874
  [CREATE_VNODE]: `createVNode`,
10875
  [CREATE_ELEMENT_VNODE]: `createElementVNode`,
10876
  [CREATE_COMMENT]: `createCommentVNode`,
10877
  [CREATE_TEXT]: `createTextVNode`,
10878
  [CREATE_STATIC]: `createStaticVNode`,
10879
  [RESOLVE_COMPONENT]: `resolveComponent`,
10880
  [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,
10881
  [RESOLVE_DIRECTIVE]: `resolveDirective`,
10882
  [RESOLVE_FILTER]: `resolveFilter`,
10883
  [WITH_DIRECTIVES]: `withDirectives`,
10884
  [RENDER_LIST]: `renderList`,
10885
  [RENDER_SLOT]: `renderSlot`,
10886
  [CREATE_SLOTS]: `createSlots`,
10887
  [TO_DISPLAY_STRING]: `toDisplayString`,
10888
  [MERGE_PROPS]: `mergeProps`,
10889
  [NORMALIZE_CLASS]: `normalizeClass`,
10890
  [NORMALIZE_STYLE]: `normalizeStyle`,
10891
  [NORMALIZE_PROPS]: `normalizeProps`,
10892
  [GUARD_REACTIVE_PROPS]: `guardReactiveProps`,
10893
  [TO_HANDLERS]: `toHandlers`,
10894
  [CAMELIZE]: `camelize`,
10895
  [CAPITALIZE]: `capitalize`,
10896
  [TO_HANDLER_KEY]: `toHandlerKey`,
10897
  [SET_BLOCK_TRACKING]: `setBlockTracking`,
10898
  [PUSH_SCOPE_ID]: `pushScopeId`,
10899
  [POP_SCOPE_ID]: `popScopeId`,
10900
  [WITH_CTX]: `withCtx`,
10901
  [UNREF]: `unref`,
10902
  [IS_REF]: `isRef`,
10903
  [WITH_MEMO]: `withMemo`,
10904
  [IS_MEMO_SAME]: `isMemoSame`
10905
};
10906
function registerRuntimeHelpers(helpers) {
10907
  Object.getOwnPropertySymbols(helpers).forEach((s) => {
10908
    helperNameMap[s] = helpers[s];
10909
  });
10910
}
10911
 
10912
const locStub = {
10913
  source: "",
10914
  start: { line: 1, column: 1, offset: 0 },
10915
  end: { line: 1, column: 1, offset: 0 }
10916
};
10917
function createRoot(children, loc = locStub) {
10918
  return {
10919
    type: 0,
10920
    children,
10921
    helpers: /* @__PURE__ */ new Set(),
10922
    components: [],
10923
    directives: [],
10924
    hoists: [],
10925
    imports: [],
10926
    cached: 0,
10927
    temps: 0,
10928
    codegenNode: void 0,
10929
    loc
10930
  };
10931
}
10932
function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) {
10933
  if (context) {
10934
    if (isBlock) {
10935
      context.helper(OPEN_BLOCK);
10936
      context.helper(getVNodeBlockHelper(context.inSSR, isComponent));
10937
    } else {
10938
      context.helper(getVNodeHelper(context.inSSR, isComponent));
10939
    }
10940
    if (directives) {
10941
      context.helper(WITH_DIRECTIVES);
10942
    }
10943
  }
10944
  return {
10945
    type: 13,
10946
    tag,
10947
    props,
10948
    children,
10949
    patchFlag,
10950
    dynamicProps,
10951
    directives,
10952
    isBlock,
10953
    disableTracking,
10954
    isComponent,
10955
    loc
10956
  };
10957
}
10958
function createArrayExpression(elements, loc = locStub) {
10959
  return {
10960
    type: 17,
10961
    loc,
10962
    elements
10963
  };
10964
}
10965
function createObjectExpression(properties, loc = locStub) {
10966
  return {
10967
    type: 15,
10968
    loc,
10969
    properties
10970
  };
10971
}
10972
function createObjectProperty(key, value) {
10973
  return {
10974
    type: 16,
10975
    loc: locStub,
10976
    key: isString(key) ? createSimpleExpression(key, true) : key,
10977
    value
10978
  };
10979
}
10980
function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
10981
  return {
10982
    type: 4,
10983
    loc,
10984
    content,
10985
    isStatic,
10986
    constType: isStatic ? 3 : constType
10987
  };
10988
}
10989
function createCompoundExpression(children, loc = locStub) {
10990
  return {
10991
    type: 8,
10992
    loc,
10993
    children
10994
  };
10995
}
10996
function createCallExpression(callee, args = [], loc = locStub) {
10997
  return {
10998
    type: 14,
10999
    loc,
11000
    callee,
11001
    arguments: args
11002
  };
11003
}
11004
function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
11005
  return {
11006
    type: 18,
11007
    params,
11008
    returns,
11009
    newline,
11010
    isSlot,
11011
    loc
11012
  };
11013
}
11014
function createConditionalExpression(test, consequent, alternate, newline = true) {
11015
  return {
11016
    type: 19,
11017
    test,
11018
    consequent,
11019
    alternate,
11020
    newline,
11021
    loc: locStub
11022
  };
11023
}
11024
function createCacheExpression(index, value, isVNode = false) {
11025
  return {
11026
    type: 20,
11027
    index,
11028
    value,
11029
    isVNode,
11030
    loc: locStub
11031
  };
11032
}
11033
function createBlockStatement(body) {
11034
  return {
11035
    type: 21,
11036
    body,
11037
    loc: locStub
11038
  };
11039
}
11040
function getVNodeHelper(ssr, isComponent) {
11041
  return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
11042
}
11043
function getVNodeBlockHelper(ssr, isComponent) {
11044
  return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
11045
}
11046
function convertToBlock(node, { helper, removeHelper, inSSR }) {
11047
  if (!node.isBlock) {
11048
    node.isBlock = true;
11049
    removeHelper(getVNodeHelper(inSSR, node.isComponent));
11050
    helper(OPEN_BLOCK);
11051
    helper(getVNodeBlockHelper(inSSR, node.isComponent));
11052
  }
11053
}
11054
 
11055
const isStaticExp = (p) => p.type === 4 && p.isStatic;
11056
const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
11057
function isCoreComponent(tag) {
11058
  if (isBuiltInType(tag, "Teleport")) {
11059
    return TELEPORT;
11060
  } else if (isBuiltInType(tag, "Suspense")) {
11061
    return SUSPENSE;
11062
  } else if (isBuiltInType(tag, "KeepAlive")) {
11063
    return KEEP_ALIVE;
11064
  } else if (isBuiltInType(tag, "BaseTransition")) {
11065
    return BASE_TRANSITION;
11066
  }
11067
}
11068
const nonIdentifierRE = /^\d|[^\$\w]/;
11069
const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
11070
const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
11071
const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
11072
const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
11073
const isMemberExpressionBrowser = (path) => {
11074
  path = path.trim().replace(whitespaceRE, (s) => s.trim());
11075
  let state = 0 /* inMemberExp */;
11076
  let stateStack = [];
11077
  let currentOpenBracketCount = 0;
11078
  let currentOpenParensCount = 0;
11079
  let currentStringType = null;
11080
  for (let i = 0; i < path.length; i++) {
11081
    const char = path.charAt(i);
11082
    switch (state) {
11083
      case 0 /* inMemberExp */:
11084
        if (char === "[") {
11085
          stateStack.push(state);
11086
          state = 1 /* inBrackets */;
11087
          currentOpenBracketCount++;
11088
        } else if (char === "(") {
11089
          stateStack.push(state);
11090
          state = 2 /* inParens */;
11091
          currentOpenParensCount++;
11092
        } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {
11093
          return false;
11094
        }
11095
        break;
11096
      case 1 /* inBrackets */:
11097
        if (char === `'` || char === `"` || char === "`") {
11098
          stateStack.push(state);
11099
          state = 3 /* inString */;
11100
          currentStringType = char;
11101
        } else if (char === `[`) {
11102
          currentOpenBracketCount++;
11103
        } else if (char === `]`) {
11104
          if (!--currentOpenBracketCount) {
11105
            state = stateStack.pop();
11106
          }
11107
        }
11108
        break;
11109
      case 2 /* inParens */:
11110
        if (char === `'` || char === `"` || char === "`") {
11111
          stateStack.push(state);
11112
          state = 3 /* inString */;
11113
          currentStringType = char;
11114
        } else if (char === `(`) {
11115
          currentOpenParensCount++;
11116
        } else if (char === `)`) {
11117
          if (i === path.length - 1) {
11118
            return false;
11119
          }
11120
          if (!--currentOpenParensCount) {
11121
            state = stateStack.pop();
11122
          }
11123
        }
11124
        break;
11125
      case 3 /* inString */:
11126
        if (char === currentStringType) {
11127
          state = stateStack.pop();
11128
          currentStringType = null;
11129
        }
11130
        break;
11131
    }
11132
  }
11133
  return !currentOpenBracketCount && !currentOpenParensCount;
11134
};
11135
const isMemberExpression = isMemberExpressionBrowser ;
11136
function getInnerRange(loc, offset, length) {
11137
  const source = loc.source.slice(offset, offset + length);
11138
  const newLoc = {
11139
    source,
11140
    start: advancePositionWithClone(loc.start, loc.source, offset),
11141
    end: loc.end
11142
  };
11143
  if (length != null) {
11144
    newLoc.end = advancePositionWithClone(
11145
      loc.start,
11146
      loc.source,
11147
      offset + length
11148
    );
11149
  }
11150
  return newLoc;
11151
}
11152
function advancePositionWithClone(pos, source, numberOfCharacters = source.length) {
11153
  return advancePositionWithMutation(
11154
    extend({}, pos),
11155
    source,
11156
    numberOfCharacters
11157
  );
11158
}
11159
function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {
11160
  let linesCount = 0;
11161
  let lastNewLinePos = -1;
11162
  for (let i = 0; i < numberOfCharacters; i++) {
11163
    if (source.charCodeAt(i) === 10) {
11164
      linesCount++;
11165
      lastNewLinePos = i;
11166
    }
11167
  }
11168
  pos.offset += numberOfCharacters;
11169
  pos.line += linesCount;
11170
  pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos;
11171
  return pos;
11172
}
11173
function assert(condition, msg) {
11174
  if (!condition) {
11175
    throw new Error(msg || `unexpected compiler condition`);
11176
  }
11177
}
11178
function findDir(node, name, allowEmpty = false) {
11179
  for (let i = 0; i < node.props.length; i++) {
11180
    const p = node.props[i];
11181
    if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
11182
      return p;
11183
    }
11184
  }
11185
}
11186
function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
11187
  for (let i = 0; i < node.props.length; i++) {
11188
    const p = node.props[i];
11189
    if (p.type === 6) {
11190
      if (dynamicOnly)
11191
        continue;
11192
      if (p.name === name && (p.value || allowEmpty)) {
11193
        return p;
11194
      }
11195
    } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) {
11196
      return p;
11197
    }
11198
  }
11199
}
11200
function isStaticArgOf(arg, name) {
11201
  return !!(arg && isStaticExp(arg) && arg.content === name);
11202
}
11203
function hasDynamicKeyVBind(node) {
11204
  return node.props.some(
11205
    (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj"
11206
    p.arg.type !== 4 || // v-bind:[_ctx.foo]
11207
    !p.arg.isStatic)
11208
    // v-bind:[foo]
11209
  );
11210
}
11211
function isText$1(node) {
11212
  return node.type === 5 || node.type === 2;
11213
}
11214
function isVSlot(p) {
11215
  return p.type === 7 && p.name === "slot";
11216
}
11217
function isTemplateNode(node) {
11218
  return node.type === 1 && node.tagType === 3;
11219
}
11220
function isSlotOutlet(node) {
11221
  return node.type === 1 && node.tagType === 2;
11222
}
11223
const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
11224
function getUnnormalizedProps(props, callPath = []) {
11225
  if (props && !isString(props) && props.type === 14) {
11226
    const callee = props.callee;
11227
    if (!isString(callee) && propsHelperSet.has(callee)) {
11228
      return getUnnormalizedProps(
11229
        props.arguments[0],
11230
        callPath.concat(props)
11231
      );
11232
    }
11233
  }
11234
  return [props, callPath];
11235
}
11236
function injectProp(node, prop, context) {
11237
  let propsWithInjection;
11238
  let props = node.type === 13 ? node.props : node.arguments[2];
11239
  let callPath = [];
11240
  let parentCall;
11241
  if (props && !isString(props) && props.type === 14) {
11242
    const ret = getUnnormalizedProps(props);
11243
    props = ret[0];
11244
    callPath = ret[1];
11245
    parentCall = callPath[callPath.length - 1];
11246
  }
11247
  if (props == null || isString(props)) {
11248
    propsWithInjection = createObjectExpression([prop]);
11249
  } else if (props.type === 14) {
11250
    const first = props.arguments[0];
11251
    if (!isString(first) && first.type === 15) {
11252
      if (!hasProp(prop, first)) {
11253
        first.properties.unshift(prop);
11254
      }
11255
    } else {
11256
      if (props.callee === TO_HANDLERS) {
11257
        propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
11258
          createObjectExpression([prop]),
11259
          props
11260
        ]);
11261
      } else {
11262
        props.arguments.unshift(createObjectExpression([prop]));
11263
      }
11264
    }
11265
    !propsWithInjection && (propsWithInjection = props);
11266
  } else if (props.type === 15) {
11267
    if (!hasProp(prop, props)) {
11268
      props.properties.unshift(prop);
11269
    }
11270
    propsWithInjection = props;
11271
  } else {
11272
    propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
11273
      createObjectExpression([prop]),
11274
      props
11275
    ]);
11276
    if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) {
11277
      parentCall = callPath[callPath.length - 2];
11278
    }
11279
  }
11280
  if (node.type === 13) {
11281
    if (parentCall) {
11282
      parentCall.arguments[0] = propsWithInjection;
11283
    } else {
11284
      node.props = propsWithInjection;
11285
    }
11286
  } else {
11287
    if (parentCall) {
11288
      parentCall.arguments[0] = propsWithInjection;
11289
    } else {
11290
      node.arguments[2] = propsWithInjection;
11291
    }
11292
  }
11293
}
11294
function hasProp(prop, props) {
11295
  let result = false;
11296
  if (prop.key.type === 4) {
11297
    const propKeyName = prop.key.content;
11298
    result = props.properties.some(
11299
      (p) => p.key.type === 4 && p.key.content === propKeyName
11300
    );
11301
  }
11302
  return result;
11303
}
11304
function toValidAssetId(name, type) {
11305
  return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => {
11306
    return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString();
11307
  })}`;
11308
}
11309
function getMemoedVNodeCall(node) {
11310
  if (node.type === 14 && node.callee === WITH_MEMO) {
11311
    return node.arguments[1].returns;
11312
  } else {
11313
    return node;
11314
  }
11315
}
11316
 
11317
const decodeRE = /&(gt|lt|amp|apos|quot);/g;
11318
const decodeMap = {
11319
  gt: ">",
11320
  lt: "<",
11321
  amp: "&",
11322
  apos: "'",
11323
  quot: '"'
11324
};
11325
const defaultParserOptions = {
11326
  delimiters: [`{{`, `}}`],
11327
  getNamespace: () => 0,
11328
  getTextMode: () => 0,
11329
  isVoidTag: NO,
11330
  isPreTag: NO,
11331
  isCustomElement: NO,
11332
  decodeEntities: (rawText) => rawText.replace(decodeRE, (_, p1) => decodeMap[p1]),
11333
  onError: defaultOnError,
11334
  onWarn: defaultOnWarn,
11335
  comments: true
11336
};
11337
function baseParse(content, options = {}) {
11338
  const context = createParserContext(content, options);
11339
  const start = getCursor(context);
11340
  return createRoot(
11341
    parseChildren(context, 0, []),
11342
    getSelection(context, start)
11343
  );
11344
}
11345
function createParserContext(content, rawOptions) {
11346
  const options = extend({}, defaultParserOptions);
11347
  let key;
11348
  for (key in rawOptions) {
11349
    options[key] = rawOptions[key] === void 0 ? defaultParserOptions[key] : rawOptions[key];
11350
  }
11351
  return {
11352
    options,
11353
    column: 1,
11354
    line: 1,
11355
    offset: 0,
11356
    originalSource: content,
11357
    source: content,
11358
    inPre: false,
11359
    inVPre: false,
11360
    onWarn: options.onWarn
11361
  };
11362
}
11363
function parseChildren(context, mode, ancestors) {
11364
  const parent = last(ancestors);
11365
  const ns = parent ? parent.ns : 0;
11366
  const nodes = [];
11367
  while (!isEnd(context, mode, ancestors)) {
11368
    const s = context.source;
11369
    let node = void 0;
11370
    if (mode === 0 || mode === 1) {
11371
      if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {
11372
        node = parseInterpolation(context, mode);
11373
      } else if (mode === 0 && s[0] === "<") {
11374
        if (s.length === 1) {
11375
          emitError(context, 5, 1);
11376
        } else if (s[1] === "!") {
11377
          if (startsWith(s, "<!--")) {
11378
            node = parseComment(context);
11379
          } else if (startsWith(s, "<!DOCTYPE")) {
11380
            node = parseBogusComment(context);
11381
          } else if (startsWith(s, "<![CDATA[")) {
11382
            if (ns !== 0) {
11383
              node = parseCDATA(context, ancestors);
11384
            } else {
11385
              emitError(context, 1);
11386
              node = parseBogusComment(context);
11387
            }
11388
          } else {
11389
            emitError(context, 11);
11390
            node = parseBogusComment(context);
11391
          }
11392
        } else if (s[1] === "/") {
11393
          if (s.length === 2) {
11394
            emitError(context, 5, 2);
11395
          } else if (s[2] === ">") {
11396
            emitError(context, 14, 2);
11397
            advanceBy(context, 3);
11398
            continue;
11399
          } else if (/[a-z]/i.test(s[2])) {
11400
            emitError(context, 23);
11401
            parseTag(context, 1 /* End */, parent);
11402
            continue;
11403
          } else {
11404
            emitError(
11405
              context,
11406
              12,
11407
              2
11408
            );
11409
            node = parseBogusComment(context);
11410
          }
11411
        } else if (/[a-z]/i.test(s[1])) {
11412
          node = parseElement(context, ancestors);
11413
        } else if (s[1] === "?") {
11414
          emitError(
11415
            context,
11416
            21,
11417
            1
11418
          );
11419
          node = parseBogusComment(context);
11420
        } else {
11421
          emitError(context, 12, 1);
11422
        }
11423
      }
11424
    }
11425
    if (!node) {
11426
      node = parseText(context, mode);
11427
    }
11428
    if (isArray(node)) {
11429
      for (let i = 0; i < node.length; i++) {
11430
        pushNode(nodes, node[i]);
11431
      }
11432
    } else {
11433
      pushNode(nodes, node);
11434
    }
11435
  }
11436
  let removedWhitespace = false;
11437
  if (mode !== 2 && mode !== 1) {
11438
    const shouldCondense = context.options.whitespace !== "preserve";
11439
    for (let i = 0; i < nodes.length; i++) {
11440
      const node = nodes[i];
11441
      if (node.type === 2) {
11442
        if (!context.inPre) {
11443
          if (!/[^\t\r\n\f ]/.test(node.content)) {
11444
            const prev = nodes[i - 1];
11445
            const next = nodes[i + 1];
11446
            if (!prev || !next || shouldCondense && (prev.type === 3 && next.type === 3 || prev.type === 3 && next.type === 1 || prev.type === 1 && next.type === 3 || prev.type === 1 && next.type === 1 && /[\r\n]/.test(node.content))) {
11447
              removedWhitespace = true;
11448
              nodes[i] = null;
11449
            } else {
11450
              node.content = " ";
11451
            }
11452
          } else if (shouldCondense) {
11453
            node.content = node.content.replace(/[\t\r\n\f ]+/g, " ");
11454
          }
11455
        } else {
11456
          node.content = node.content.replace(/\r\n/g, "\n");
11457
        }
11458
      } else if (node.type === 3 && !context.options.comments) {
11459
        removedWhitespace = true;
11460
        nodes[i] = null;
11461
      }
11462
    }
11463
    if (context.inPre && parent && context.options.isPreTag(parent.tag)) {
11464
      const first = nodes[0];
11465
      if (first && first.type === 2) {
11466
        first.content = first.content.replace(/^\r?\n/, "");
11467
      }
11468
    }
11469
  }
11470
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
11471
}
11472
function pushNode(nodes, node) {
11473
  if (node.type === 2) {
11474
    const prev = last(nodes);
11475
    if (prev && prev.type === 2 && prev.loc.end.offset === node.loc.start.offset) {
11476
      prev.content += node.content;
11477
      prev.loc.end = node.loc.end;
11478
      prev.loc.source += node.loc.source;
11479
      return;
11480
    }
11481
  }
11482
  nodes.push(node);
11483
}
11484
function parseCDATA(context, ancestors) {
11485
  advanceBy(context, 9);
11486
  const nodes = parseChildren(context, 3, ancestors);
11487
  if (context.source.length === 0) {
11488
    emitError(context, 6);
11489
  } else {
11490
    advanceBy(context, 3);
11491
  }
11492
  return nodes;
11493
}
11494
function parseComment(context) {
11495
  const start = getCursor(context);
11496
  let content;
11497
  const match = /--(\!)?>/.exec(context.source);
11498
  if (!match) {
11499
    content = context.source.slice(4);
11500
    advanceBy(context, context.source.length);
11501
    emitError(context, 7);
11502
  } else {
11503
    if (match.index <= 3) {
11504
      emitError(context, 0);
11505
    }
11506
    if (match[1]) {
11507
      emitError(context, 10);
11508
    }
11509
    content = context.source.slice(4, match.index);
11510
    const s = context.source.slice(0, match.index);
11511
    let prevIndex = 1, nestedIndex = 0;
11512
    while ((nestedIndex = s.indexOf("<!--", prevIndex)) !== -1) {
11513
      advanceBy(context, nestedIndex - prevIndex + 1);
11514
      if (nestedIndex + 4 < s.length) {
11515
        emitError(context, 16);
11516
      }
11517
      prevIndex = nestedIndex + 1;
11518
    }
11519
    advanceBy(context, match.index + match[0].length - prevIndex + 1);
11520
  }
11521
  return {
11522
    type: 3,
11523
    content,
11524
    loc: getSelection(context, start)
11525
  };
11526
}
11527
function parseBogusComment(context) {
11528
  const start = getCursor(context);
11529
  const contentStart = context.source[1] === "?" ? 1 : 2;
11530
  let content;
11531
  const closeIndex = context.source.indexOf(">");
11532
  if (closeIndex === -1) {
11533
    content = context.source.slice(contentStart);
11534
    advanceBy(context, context.source.length);
11535
  } else {
11536
    content = context.source.slice(contentStart, closeIndex);
11537
    advanceBy(context, closeIndex + 1);
11538
  }
11539
  return {
11540
    type: 3,
11541
    content,
11542
    loc: getSelection(context, start)
11543
  };
11544
}
11545
function parseElement(context, ancestors) {
11546
  const wasInPre = context.inPre;
11547
  const wasInVPre = context.inVPre;
11548
  const parent = last(ancestors);
11549
  const element = parseTag(context, 0 /* Start */, parent);
11550
  const isPreBoundary = context.inPre && !wasInPre;
11551
  const isVPreBoundary = context.inVPre && !wasInVPre;
11552
  if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {
11553
    if (isPreBoundary) {
11554
      context.inPre = false;
11555
    }
11556
    if (isVPreBoundary) {
11557
      context.inVPre = false;
11558
    }
11559
    return element;
11560
  }
11561
  ancestors.push(element);
11562
  const mode = context.options.getTextMode(element, parent);
11563
  const children = parseChildren(context, mode, ancestors);
11564
  ancestors.pop();
11565
  element.children = children;
11566
  if (startsWithEndTagOpen(context.source, element.tag)) {
11567
    parseTag(context, 1 /* End */, parent);
11568
  } else {
11569
    emitError(context, 24, 0, element.loc.start);
11570
    if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
11571
      const first = children[0];
11572
      if (first && startsWith(first.loc.source, "<!--")) {
11573
        emitError(context, 8);
11574
      }
11575
    }
11576
  }
11577
  element.loc = getSelection(context, element.loc.start);
11578
  if (isPreBoundary) {
11579
    context.inPre = false;
11580
  }
11581
  if (isVPreBoundary) {
11582
    context.inVPre = false;
11583
  }
11584
  return element;
11585
}
11586
const isSpecialTemplateDirective = /* @__PURE__ */ makeMap(
11587
  `if,else,else-if,for,slot`
11588
);
11589
function parseTag(context, type, parent) {
11590
  const start = getCursor(context);
11591
  const match = /^<\/?([a-z][^\t\r\n\f />]*)/i.exec(context.source);
11592
  const tag = match[1];
11593
  const ns = context.options.getNamespace(tag, parent);
11594
  advanceBy(context, match[0].length);
11595
  advanceSpaces(context);
11596
  const cursor = getCursor(context);
11597
  const currentSource = context.source;
11598
  if (context.options.isPreTag(tag)) {
11599
    context.inPre = true;
11600
  }
11601
  let props = parseAttributes(context, type);
11602
  if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === 7 && p.name === "pre")) {
11603
    context.inVPre = true;
11604
    extend(context, cursor);
11605
    context.source = currentSource;
11606
    props = parseAttributes(context, type).filter((p) => p.name !== "v-pre");
11607
  }
11608
  let isSelfClosing = false;
11609
  if (context.source.length === 0) {
11610
    emitError(context, 9);
11611
  } else {
11612
    isSelfClosing = startsWith(context.source, "/>");
11613
    if (type === 1 /* End */ && isSelfClosing) {
11614
      emitError(context, 4);
11615
    }
11616
    advanceBy(context, isSelfClosing ? 2 : 1);
11617
  }
11618
  if (type === 1 /* End */) {
11619
    return;
11620
  }
11621
  let tagType = 0;
11622
  if (!context.inVPre) {
11623
    if (tag === "slot") {
11624
      tagType = 2;
11625
    } else if (tag === "template") {
11626
      if (props.some(
11627
        (p) => p.type === 7 && isSpecialTemplateDirective(p.name)
11628
      )) {
11629
        tagType = 3;
11630
      }
11631
    } else if (isComponent(tag, props, context)) {
11632
      tagType = 1;
11633
    }
11634
  }
11635
  return {
11636
    type: 1,
11637
    ns,
11638
    tag,
11639
    tagType,
11640
    props,
11641
    isSelfClosing,
11642
    children: [],
11643
    loc: getSelection(context, start),
11644
    codegenNode: void 0
11645
    // to be created during transform phase
11646
  };
11647
}
11648
function isComponent(tag, props, context) {
11649
  const options = context.options;
11650
  if (options.isCustomElement(tag)) {
11651
    return false;
11652
  }
11653
  if (tag === "component" || /^[A-Z]/.test(tag) || isCoreComponent(tag) || options.isBuiltInComponent && options.isBuiltInComponent(tag) || options.isNativeTag && !options.isNativeTag(tag)) {
11654
    return true;
11655
  }
11656
  for (let i = 0; i < props.length; i++) {
11657
    const p = props[i];
11658
    if (p.type === 6) {
11659
      if (p.name === "is" && p.value) {
11660
        if (p.value.content.startsWith("vue:")) {
11661
          return true;
11662
        }
11663
      }
11664
    } else {
11665
      if (p.name === "is") {
11666
        return true;
11667
      } else if (
11668
        // :is on plain element - only treat as component in compat mode
11669
        p.name === "bind" && isStaticArgOf(p.arg, "is") && false
11670
      ) {
11671
        return true;
11672
      }
11673
    }
11674
  }
11675
}
11676
function parseAttributes(context, type) {
11677
  const props = [];
11678
  const attributeNames = /* @__PURE__ */ new Set();
11679
  while (context.source.length > 0 && !startsWith(context.source, ">") && !startsWith(context.source, "/>")) {
11680
    if (startsWith(context.source, "/")) {
11681
      emitError(context, 22);
11682
      advanceBy(context, 1);
11683
      advanceSpaces(context);
11684
      continue;
11685
    }
11686
    if (type === 1 /* End */) {
11687
      emitError(context, 3);
11688
    }
11689
    const attr = parseAttribute(context, attributeNames);
11690
    if (attr.type === 6 && attr.value && attr.name === "class") {
11691
      attr.value.content = attr.value.content.replace(/\s+/g, " ").trim();
11692
    }
11693
    if (type === 0 /* Start */) {
11694
      props.push(attr);
11695
    }
11696
    if (/^[^\t\r\n\f />]/.test(context.source)) {
11697
      emitError(context, 15);
11698
    }
11699
    advanceSpaces(context);
11700
  }
11701
  return props;
11702
}
11703
function parseAttribute(context, nameSet) {
11704
  var _a;
11705
  const start = getCursor(context);
11706
  const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source);
11707
  const name = match[0];
11708
  if (nameSet.has(name)) {
11709
    emitError(context, 2);
11710
  }
11711
  nameSet.add(name);
11712
  if (name[0] === "=") {
11713
    emitError(context, 19);
11714
  }
11715
  {
11716
    const pattern = /["'<]/g;
11717
    let m;
11718
    while (m = pattern.exec(name)) {
11719
      emitError(
11720
        context,
11721
        17,
11722
        m.index
11723
      );
11724
    }
11725
  }
11726
  advanceBy(context, name.length);
11727
  let value = void 0;
11728
  if (/^[\t\r\n\f ]*=/.test(context.source)) {
11729
    advanceSpaces(context);
11730
    advanceBy(context, 1);
11731
    advanceSpaces(context);
11732
    value = parseAttributeValue(context);
11733
    if (!value) {
11734
      emitError(context, 13);
11735
    }
11736
  }
11737
  const loc = getSelection(context, start);
11738
  if (!context.inVPre && /^(v-[A-Za-z0-9-]|:|\.|@|#)/.test(name)) {
11739
    const match2 = /(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(
11740
      name
11741
    );
11742
    let isPropShorthand = startsWith(name, ".");
11743
    let dirName = match2[1] || (isPropShorthand || startsWith(name, ":") ? "bind" : startsWith(name, "@") ? "on" : "slot");
11744
    let arg;
11745
    if (match2[2]) {
11746
      const isSlot = dirName === "slot";
11747
      const startOffset = name.lastIndexOf(
11748
        match2[2],
11749
        name.length - (((_a = match2[3]) == null ? void 0 : _a.length) || 0)
11750
      );
11751
      const loc2 = getSelection(
11752
        context,
11753
        getNewPosition(context, start, startOffset),
11754
        getNewPosition(
11755
          context,
11756
          start,
11757
          startOffset + match2[2].length + (isSlot && match2[3] || "").length
11758
        )
11759
      );
11760
      let content = match2[2];
11761
      let isStatic = true;
11762
      if (content.startsWith("[")) {
11763
        isStatic = false;
11764
        if (!content.endsWith("]")) {
11765
          emitError(
11766
            context,
11767
            27
11768
          );
11769
          content = content.slice(1);
11770
        } else {
11771
          content = content.slice(1, content.length - 1);
11772
        }
11773
      } else if (isSlot) {
11774
        content += match2[3] || "";
11775
      }
11776
      arg = {
11777
        type: 4,
11778
        content,
11779
        isStatic,
11780
        constType: isStatic ? 3 : 0,
11781
        loc: loc2
11782
      };
11783
    }
11784
    if (value && value.isQuoted) {
11785
      const valueLoc = value.loc;
11786
      valueLoc.start.offset++;
11787
      valueLoc.start.column++;
11788
      valueLoc.end = advancePositionWithClone(valueLoc.start, value.content);
11789
      valueLoc.source = valueLoc.source.slice(1, -1);
11790
    }
11791
    const modifiers = match2[3] ? match2[3].slice(1).split(".") : [];
11792
    if (isPropShorthand)
11793
      modifiers.push("prop");
11794
    return {
11795
      type: 7,
11796
      name: dirName,
11797
      exp: value && {
11798
        type: 4,
11799
        content: value.content,
11800
        isStatic: false,
11801
        // Treat as non-constant by default. This can be potentially set to
11802
        // other values by `transformExpression` to make it eligible for hoisting.
11803
        constType: 0,
11804
        loc: value.loc
11805
      },
11806
      arg,
11807
      modifiers,
11808
      loc
11809
    };
11810
  }
11811
  if (!context.inVPre && startsWith(name, "v-")) {
11812
    emitError(context, 26);
11813
  }
11814
  return {
11815
    type: 6,
11816
    name,
11817
    value: value && {
11818
      type: 2,
11819
      content: value.content,
11820
      loc: value.loc
11821
    },
11822
    loc
11823
  };
11824
}
11825
function parseAttributeValue(context) {
11826
  const start = getCursor(context);
11827
  let content;
11828
  const quote = context.source[0];
11829
  const isQuoted = quote === `"` || quote === `'`;
11830
  if (isQuoted) {
11831
    advanceBy(context, 1);
11832
    const endIndex = context.source.indexOf(quote);
11833
    if (endIndex === -1) {
11834
      content = parseTextData(
11835
        context,
11836
        context.source.length,
11837
        4
11838
      );
11839
    } else {
11840
      content = parseTextData(context, endIndex, 4);
11841
      advanceBy(context, 1);
11842
    }
11843
  } else {
11844
    const match = /^[^\t\r\n\f >]+/.exec(context.source);
11845
    if (!match) {
11846
      return void 0;
11847
    }
11848
    const unexpectedChars = /["'<=`]/g;
11849
    let m;
11850
    while (m = unexpectedChars.exec(match[0])) {
11851
      emitError(
11852
        context,
11853
        18,
11854
        m.index
11855
      );
11856
    }
11857
    content = parseTextData(context, match[0].length, 4);
11858
  }
11859
  return { content, isQuoted, loc: getSelection(context, start) };
11860
}
11861
function parseInterpolation(context, mode) {
11862
  const [open, close] = context.options.delimiters;
11863
  const closeIndex = context.source.indexOf(close, open.length);
11864
  if (closeIndex === -1) {
11865
    emitError(context, 25);
11866
    return void 0;
11867
  }
11868
  const start = getCursor(context);
11869
  advanceBy(context, open.length);
11870
  const innerStart = getCursor(context);
11871
  const innerEnd = getCursor(context);
11872
  const rawContentLength = closeIndex - open.length;
11873
  const rawContent = context.source.slice(0, rawContentLength);
11874
  const preTrimContent = parseTextData(context, rawContentLength, mode);
11875
  const content = preTrimContent.trim();
11876
  const startOffset = preTrimContent.indexOf(content);
11877
  if (startOffset > 0) {
11878
    advancePositionWithMutation(innerStart, rawContent, startOffset);
11879
  }
11880
  const endOffset = rawContentLength - (preTrimContent.length - content.length - startOffset);
11881
  advancePositionWithMutation(innerEnd, rawContent, endOffset);
11882
  advanceBy(context, close.length);
11883
  return {
11884
    type: 5,
11885
    content: {
11886
      type: 4,
11887
      isStatic: false,
11888
      // Set `isConstant` to false by default and will decide in transformExpression
11889
      constType: 0,
11890
      content,
11891
      loc: getSelection(context, innerStart, innerEnd)
11892
    },
11893
    loc: getSelection(context, start)
11894
  };
11895
}
11896
function parseText(context, mode) {
11897
  const endTokens = mode === 3 ? ["]]>"] : ["<", context.options.delimiters[0]];
11898
  let endIndex = context.source.length;
11899
  for (let i = 0; i < endTokens.length; i++) {
11900
    const index = context.source.indexOf(endTokens[i], 1);
11901
    if (index !== -1 && endIndex > index) {
11902
      endIndex = index;
11903
    }
11904
  }
11905
  const start = getCursor(context);
11906
  const content = parseTextData(context, endIndex, mode);
11907
  return {
11908
    type: 2,
11909
    content,
11910
    loc: getSelection(context, start)
11911
  };
11912
}
11913
function parseTextData(context, length, mode) {
11914
  const rawText = context.source.slice(0, length);
11915
  advanceBy(context, length);
11916
  if (mode === 2 || mode === 3 || !rawText.includes("&")) {
11917
    return rawText;
11918
  } else {
11919
    return context.options.decodeEntities(
11920
      rawText,
11921
      mode === 4
11922
    );
11923
  }
11924
}
11925
function getCursor(context) {
11926
  const { column, line, offset } = context;
11927
  return { column, line, offset };
11928
}
11929
function getSelection(context, start, end) {
11930
  end = end || getCursor(context);
11931
  return {
11932
    start,
11933
    end,
11934
    source: context.originalSource.slice(start.offset, end.offset)
11935
  };
11936
}
11937
function last(xs) {
11938
  return xs[xs.length - 1];
11939
}
11940
function startsWith(source, searchString) {
11941
  return source.startsWith(searchString);
11942
}
11943
function advanceBy(context, numberOfCharacters) {
11944
  const { source } = context;
11945
  advancePositionWithMutation(context, source, numberOfCharacters);
11946
  context.source = source.slice(numberOfCharacters);
11947
}
11948
function advanceSpaces(context) {
11949
  const match = /^[\t\r\n\f ]+/.exec(context.source);
11950
  if (match) {
11951
    advanceBy(context, match[0].length);
11952
  }
11953
}
11954
function getNewPosition(context, start, numberOfCharacters) {
11955
  return advancePositionWithClone(
11956
    start,
11957
    context.originalSource.slice(start.offset, numberOfCharacters),
11958
    numberOfCharacters
11959
  );
11960
}
11961
function emitError(context, code, offset, loc = getCursor(context)) {
11962
  if (offset) {
11963
    loc.offset += offset;
11964
    loc.column += offset;
11965
  }
11966
  context.options.onError(
11967
    createCompilerError(code, {
11968
      start: loc,
11969
      end: loc,
11970
      source: ""
11971
    })
11972
  );
11973
}
11974
function isEnd(context, mode, ancestors) {
11975
  const s = context.source;
11976
  switch (mode) {
11977
    case 0:
11978
      if (startsWith(s, "</")) {
11979
        for (let i = ancestors.length - 1; i >= 0; --i) {
11980
          if (startsWithEndTagOpen(s, ancestors[i].tag)) {
11981
            return true;
11982
          }
11983
        }
11984
      }
11985
      break;
11986
    case 1:
11987
    case 2: {
11988
      const parent = last(ancestors);
11989
      if (parent && startsWithEndTagOpen(s, parent.tag)) {
11990
        return true;
11991
      }
11992
      break;
11993
    }
11994
    case 3:
11995
      if (startsWith(s, "]]>")) {
11996
        return true;
11997
      }
11998
      break;
11999
  }
12000
  return !s;
12001
}
12002
function startsWithEndTagOpen(source, tag) {
12003
  return startsWith(source, "</") && source.slice(2, 2 + tag.length).toLowerCase() === tag.toLowerCase() && /[\t\r\n\f />]/.test(source[2 + tag.length] || ">");
12004
}
12005
 
12006
function hoistStatic(root, context) {
12007
  walk(
12008
    root,
12009
    context,
12010
    // Root node is unfortunately non-hoistable due to potential parent
12011
    // fallthrough attributes.
12012
    isSingleElementRoot(root, root.children[0])
12013
  );
12014
}
12015
function isSingleElementRoot(root, child) {
12016
  const { children } = root;
12017
  return children.length === 1 && child.type === 1 && !isSlotOutlet(child);
12018
}
12019
function walk(node, context, doNotHoistNode = false) {
12020
  const { children } = node;
12021
  const originalCount = children.length;
12022
  let hoistedCount = 0;
12023
  for (let i = 0; i < children.length; i++) {
12024
    const child = children[i];
12025
    if (child.type === 1 && child.tagType === 0) {
12026
      const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
12027
      if (constantType > 0) {
12028
        if (constantType >= 2) {
12029
          child.codegenNode.patchFlag = -1 + (` /* HOISTED */` );
12030
          child.codegenNode = context.hoist(child.codegenNode);
12031
          hoistedCount++;
12032
          continue;
12033
        }
12034
      } else {
12035
        const codegenNode = child.codegenNode;
12036
        if (codegenNode.type === 13) {
12037
          const flag = getPatchFlag(codegenNode);
12038
          if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
12039
            const props = getNodeProps(child);
12040
            if (props) {
12041
              codegenNode.props = context.hoist(props);
12042
            }
12043
          }
12044
          if (codegenNode.dynamicProps) {
12045
            codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps);
12046
          }
12047
        }
12048
      }
12049
    }
12050
    if (child.type === 1) {
12051
      const isComponent = child.tagType === 1;
12052
      if (isComponent) {
12053
        context.scopes.vSlot++;
12054
      }
12055
      walk(child, context);
12056
      if (isComponent) {
12057
        context.scopes.vSlot--;
12058
      }
12059
    } else if (child.type === 11) {
12060
      walk(child, context, child.children.length === 1);
12061
    } else if (child.type === 9) {
12062
      for (let i2 = 0; i2 < child.branches.length; i2++) {
12063
        walk(
12064
          child.branches[i2],
12065
          context,
12066
          child.branches[i2].children.length === 1
12067
        );
12068
      }
12069
    }
12070
  }
12071
  if (hoistedCount && context.transformHoist) {
12072
    context.transformHoist(children, context, node);
12073
  }
12074
  if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
12075
    node.codegenNode.children = context.hoist(
12076
      createArrayExpression(node.codegenNode.children)
12077
    );
12078
  }
12079
}
12080
function getConstantType(node, context) {
12081
  const { constantCache } = context;
12082
  switch (node.type) {
12083
    case 1:
12084
      if (node.tagType !== 0) {
12085
        return 0;
12086
      }
12087
      const cached = constantCache.get(node);
12088
      if (cached !== void 0) {
12089
        return cached;
12090
      }
12091
      const codegenNode = node.codegenNode;
12092
      if (codegenNode.type !== 13) {
12093
        return 0;
12094
      }
12095
      if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject") {
12096
        return 0;
12097
      }
12098
      const flag = getPatchFlag(codegenNode);
12099
      if (!flag) {
12100
        let returnType2 = 3;
12101
        const generatedPropsType = getGeneratedPropsConstantType(node, context);
12102
        if (generatedPropsType === 0) {
12103
          constantCache.set(node, 0);
12104
          return 0;
12105
        }
12106
        if (generatedPropsType < returnType2) {
12107
          returnType2 = generatedPropsType;
12108
        }
12109
        for (let i = 0; i < node.children.length; i++) {
12110
          const childType = getConstantType(node.children[i], context);
12111
          if (childType === 0) {
12112
            constantCache.set(node, 0);
12113
            return 0;
12114
          }
12115
          if (childType < returnType2) {
12116
            returnType2 = childType;
12117
          }
12118
        }
12119
        if (returnType2 > 1) {
12120
          for (let i = 0; i < node.props.length; i++) {
12121
            const p = node.props[i];
12122
            if (p.type === 7 && p.name === "bind" && p.exp) {
12123
              const expType = getConstantType(p.exp, context);
12124
              if (expType === 0) {
12125
                constantCache.set(node, 0);
12126
                return 0;
12127
              }
12128
              if (expType < returnType2) {
12129
                returnType2 = expType;
12130
              }
12131
            }
12132
          }
12133
        }
12134
        if (codegenNode.isBlock) {
12135
          for (let i = 0; i < node.props.length; i++) {
12136
            const p = node.props[i];
12137
            if (p.type === 7) {
12138
              constantCache.set(node, 0);
12139
              return 0;
12140
            }
12141
          }
12142
          context.removeHelper(OPEN_BLOCK);
12143
          context.removeHelper(
12144
            getVNodeBlockHelper(context.inSSR, codegenNode.isComponent)
12145
          );
12146
          codegenNode.isBlock = false;
12147
          context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent));
12148
        }
12149
        constantCache.set(node, returnType2);
12150
        return returnType2;
12151
      } else {
12152
        constantCache.set(node, 0);
12153
        return 0;
12154
      }
12155
    case 2:
12156
    case 3:
12157
      return 3;
12158
    case 9:
12159
    case 11:
12160
    case 10:
12161
      return 0;
12162
    case 5:
12163
    case 12:
12164
      return getConstantType(node.content, context);
12165
    case 4:
12166
      return node.constType;
12167
    case 8:
12168
      let returnType = 3;
12169
      for (let i = 0; i < node.children.length; i++) {
12170
        const child = node.children[i];
12171
        if (isString(child) || isSymbol(child)) {
12172
          continue;
12173
        }
12174
        const childType = getConstantType(child, context);
12175
        if (childType === 0) {
12176
          return 0;
12177
        } else if (childType < returnType) {
12178
          returnType = childType;
12179
        }
12180
      }
12181
      return returnType;
12182
    default:
12183
      return 0;
12184
  }
12185
}
12186
const allowHoistedHelperSet = /* @__PURE__ */ new Set([
12187
  NORMALIZE_CLASS,
12188
  NORMALIZE_STYLE,
12189
  NORMALIZE_PROPS,
12190
  GUARD_REACTIVE_PROPS
12191
]);
12192
function getConstantTypeOfHelperCall(value, context) {
12193
  if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
12194
    const arg = value.arguments[0];
12195
    if (arg.type === 4) {
12196
      return getConstantType(arg, context);
12197
    } else if (arg.type === 14) {
12198
      return getConstantTypeOfHelperCall(arg, context);
12199
    }
12200
  }
12201
  return 0;
12202
}
12203
function getGeneratedPropsConstantType(node, context) {
12204
  let returnType = 3;
12205
  const props = getNodeProps(node);
12206
  if (props && props.type === 15) {
12207
    const { properties } = props;
12208
    for (let i = 0; i < properties.length; i++) {
12209
      const { key, value } = properties[i];
12210
      const keyType = getConstantType(key, context);
12211
      if (keyType === 0) {
12212
        return keyType;
12213
      }
12214
      if (keyType < returnType) {
12215
        returnType = keyType;
12216
      }
12217
      let valueType;
12218
      if (value.type === 4) {
12219
        valueType = getConstantType(value, context);
12220
      } else if (value.type === 14) {
12221
        valueType = getConstantTypeOfHelperCall(value, context);
12222
      } else {
12223
        valueType = 0;
12224
      }
12225
      if (valueType === 0) {
12226
        return valueType;
12227
      }
12228
      if (valueType < returnType) {
12229
        returnType = valueType;
12230
      }
12231
    }
12232
  }
12233
  return returnType;
12234
}
12235
function getNodeProps(node) {
12236
  const codegenNode = node.codegenNode;
12237
  if (codegenNode.type === 13) {
12238
    return codegenNode.props;
12239
  }
12240
}
12241
function getPatchFlag(node) {
12242
  const flag = node.patchFlag;
12243
  return flag ? parseInt(flag, 10) : void 0;
12244
}
12245
 
12246
function createTransformContext(root, {
12247
  filename = "",
12248
  prefixIdentifiers = false,
12249
  hoistStatic: hoistStatic2 = false,
12250
  cacheHandlers = false,
12251
  nodeTransforms = [],
12252
  directiveTransforms = {},
12253
  transformHoist = null,
12254
  isBuiltInComponent = NOOP,
12255
  isCustomElement = NOOP,
12256
  expressionPlugins = [],
12257
  scopeId = null,
12258
  slotted = true,
12259
  ssr = false,
12260
  inSSR = false,
12261
  ssrCssVars = ``,
12262
  bindingMetadata = EMPTY_OBJ,
12263
  inline = false,
12264
  isTS = false,
12265
  onError = defaultOnError,
12266
  onWarn = defaultOnWarn,
12267
  compatConfig
12268
}) {
12269
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
12270
  const context = {
12271
    // options
12272
    selfName: nameMatch && capitalize(camelize(nameMatch[1])),
12273
    prefixIdentifiers,
12274
    hoistStatic: hoistStatic2,
12275
    cacheHandlers,
12276
    nodeTransforms,
12277
    directiveTransforms,
12278
    transformHoist,
12279
    isBuiltInComponent,
12280
    isCustomElement,
12281
    expressionPlugins,
12282
    scopeId,
12283
    slotted,
12284
    ssr,
12285
    inSSR,
12286
    ssrCssVars,
12287
    bindingMetadata,
12288
    inline,
12289
    isTS,
12290
    onError,
12291
    onWarn,
12292
    compatConfig,
12293
    // state
12294
    root,
12295
    helpers: /* @__PURE__ */ new Map(),
12296
    components: /* @__PURE__ */ new Set(),
12297
    directives: /* @__PURE__ */ new Set(),
12298
    hoists: [],
12299
    imports: [],
12300
    constantCache: /* @__PURE__ */ new WeakMap(),
12301
    temps: 0,
12302
    cached: 0,
12303
    identifiers: /* @__PURE__ */ Object.create(null),
12304
    scopes: {
12305
      vFor: 0,
12306
      vSlot: 0,
12307
      vPre: 0,
12308
      vOnce: 0
12309
    },
12310
    parent: null,
12311
    currentNode: root,
12312
    childIndex: 0,
12313
    inVOnce: false,
12314
    // methods
12315
    helper(name) {
12316
      const count = context.helpers.get(name) || 0;
12317
      context.helpers.set(name, count + 1);
12318
      return name;
12319
    },
12320
    removeHelper(name) {
12321
      const count = context.helpers.get(name);
12322
      if (count) {
12323
        const currentCount = count - 1;
12324
        if (!currentCount) {
12325
          context.helpers.delete(name);
12326
        } else {
12327
          context.helpers.set(name, currentCount);
12328
        }
12329
      }
12330
    },
12331
    helperString(name) {
12332
      return `_${helperNameMap[context.helper(name)]}`;
12333
    },
12334
    replaceNode(node) {
12335
      {
12336
        if (!context.currentNode) {
12337
          throw new Error(`Node being replaced is already removed.`);
12338
        }
12339
        if (!context.parent) {
12340
          throw new Error(`Cannot replace root node.`);
12341
        }
12342
      }
12343
      context.parent.children[context.childIndex] = context.currentNode = node;
12344
    },
12345
    removeNode(node) {
12346
      if (!context.parent) {
12347
        throw new Error(`Cannot remove root node.`);
12348
      }
12349
      const list = context.parent.children;
12350
      const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1;
12351
      if (removalIndex < 0) {
12352
        throw new Error(`node being removed is not a child of current parent`);
12353
      }
12354
      if (!node || node === context.currentNode) {
12355
        context.currentNode = null;
12356
        context.onNodeRemoved();
12357
      } else {
12358
        if (context.childIndex > removalIndex) {
12359
          context.childIndex--;
12360
          context.onNodeRemoved();
12361
        }
12362
      }
12363
      context.parent.children.splice(removalIndex, 1);
12364
    },
12365
    onNodeRemoved: () => {
12366
    },
12367
    addIdentifiers(exp) {
12368
    },
12369
    removeIdentifiers(exp) {
12370
    },
12371
    hoist(exp) {
12372
      if (isString(exp))
12373
        exp = createSimpleExpression(exp);
12374
      context.hoists.push(exp);
12375
      const identifier = createSimpleExpression(
12376
        `_hoisted_${context.hoists.length}`,
12377
        false,
12378
        exp.loc,
12379
        2
12380
      );
12381
      identifier.hoisted = exp;
12382
      return identifier;
12383
    },
12384
    cache(exp, isVNode = false) {
12385
      return createCacheExpression(context.cached++, exp, isVNode);
12386
    }
12387
  };
12388
  return context;
12389
}
12390
function transform(root, options) {
12391
  const context = createTransformContext(root, options);
12392
  traverseNode(root, context);
12393
  if (options.hoistStatic) {
12394
    hoistStatic(root, context);
12395
  }
12396
  if (!options.ssr) {
12397
    createRootCodegen(root, context);
12398
  }
12399
  root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]);
12400
  root.components = [...context.components];
12401
  root.directives = [...context.directives];
12402
  root.imports = context.imports;
12403
  root.hoists = context.hoists;
12404
  root.temps = context.temps;
12405
  root.cached = context.cached;
12406
}
12407
function createRootCodegen(root, context) {
12408
  const { helper } = context;
12409
  const { children } = root;
12410
  if (children.length === 1) {
12411
    const child = children[0];
12412
    if (isSingleElementRoot(root, child) && child.codegenNode) {
12413
      const codegenNode = child.codegenNode;
12414
      if (codegenNode.type === 13) {
12415
        convertToBlock(codegenNode, context);
12416
      }
12417
      root.codegenNode = codegenNode;
12418
    } else {
12419
      root.codegenNode = child;
12420
    }
12421
  } else if (children.length > 1) {
12422
    let patchFlag = 64;
12423
    let patchFlagText = PatchFlagNames[64];
12424
    if (children.filter((c) => c.type !== 3).length === 1) {
12425
      patchFlag |= 2048;
12426
      patchFlagText += `, ${PatchFlagNames[2048]}`;
12427
    }
12428
    root.codegenNode = createVNodeCall(
12429
      context,
12430
      helper(FRAGMENT),
12431
      void 0,
12432
      root.children,
12433
      patchFlag + (` /* ${patchFlagText} */` ),
12434
      void 0,
12435
      void 0,
12436
      true,
12437
      void 0,
12438
      false
12439
      /* isComponent */
12440
    );
12441
  } else ;
12442
}
12443
function traverseChildren(parent, context) {
12444
  let i = 0;
12445
  const nodeRemoved = () => {
12446
    i--;
12447
  };
12448
  for (; i < parent.children.length; i++) {
12449
    const child = parent.children[i];
12450
    if (isString(child))
12451
      continue;
12452
    context.parent = parent;
12453
    context.childIndex = i;
12454
    context.onNodeRemoved = nodeRemoved;
12455
    traverseNode(child, context);
12456
  }
12457
}
12458
function traverseNode(node, context) {
12459
  context.currentNode = node;
12460
  const { nodeTransforms } = context;
12461
  const exitFns = [];
12462
  for (let i2 = 0; i2 < nodeTransforms.length; i2++) {
12463
    const onExit = nodeTransforms[i2](node, context);
12464
    if (onExit) {
12465
      if (isArray(onExit)) {
12466
        exitFns.push(...onExit);
12467
      } else {
12468
        exitFns.push(onExit);
12469
      }
12470
    }
12471
    if (!context.currentNode) {
12472
      return;
12473
    } else {
12474
      node = context.currentNode;
12475
    }
12476
  }
12477
  switch (node.type) {
12478
    case 3:
12479
      if (!context.ssr) {
12480
        context.helper(CREATE_COMMENT);
12481
      }
12482
      break;
12483
    case 5:
12484
      if (!context.ssr) {
12485
        context.helper(TO_DISPLAY_STRING);
12486
      }
12487
      break;
12488
    case 9:
12489
      for (let i2 = 0; i2 < node.branches.length; i2++) {
12490
        traverseNode(node.branches[i2], context);
12491
      }
12492
      break;
12493
    case 10:
12494
    case 11:
12495
    case 1:
12496
    case 0:
12497
      traverseChildren(node, context);
12498
      break;
12499
  }
12500
  context.currentNode = node;
12501
  let i = exitFns.length;
12502
  while (i--) {
12503
    exitFns[i]();
12504
  }
12505
}
12506
function createStructuralDirectiveTransform(name, fn) {
12507
  const matches = isString(name) ? (n) => n === name : (n) => name.test(n);
12508
  return (node, context) => {
12509
    if (node.type === 1) {
12510
      const { props } = node;
12511
      if (node.tagType === 3 && props.some(isVSlot)) {
12512
        return;
12513
      }
12514
      const exitFns = [];
12515
      for (let i = 0; i < props.length; i++) {
12516
        const prop = props[i];
12517
        if (prop.type === 7 && matches(prop.name)) {
12518
          props.splice(i, 1);
12519
          i--;
12520
          const onExit = fn(node, prop, context);
12521
          if (onExit)
12522
            exitFns.push(onExit);
12523
        }
12524
      }
12525
      return exitFns;
12526
    }
12527
  };
12528
}
12529
 
12530
const PURE_ANNOTATION = `/*#__PURE__*/`;
12531
const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
12532
function createCodegenContext(ast, {
12533
  mode = "function",
12534
  prefixIdentifiers = mode === "module",
12535
  sourceMap = false,
12536
  filename = `template.vue.html`,
12537
  scopeId = null,
12538
  optimizeImports = false,
12539
  runtimeGlobalName = `Vue`,
12540
  runtimeModuleName = `vue`,
12541
  ssrRuntimeModuleName = "vue/server-renderer",
12542
  ssr = false,
12543
  isTS = false,
12544
  inSSR = false
12545
}) {
12546
  const context = {
12547
    mode,
12548
    prefixIdentifiers,
12549
    sourceMap,
12550
    filename,
12551
    scopeId,
12552
    optimizeImports,
12553
    runtimeGlobalName,
12554
    runtimeModuleName,
12555
    ssrRuntimeModuleName,
12556
    ssr,
12557
    isTS,
12558
    inSSR,
12559
    source: ast.loc.source,
12560
    code: ``,
12561
    column: 1,
12562
    line: 1,
12563
    offset: 0,
12564
    indentLevel: 0,
12565
    pure: false,
12566
    map: void 0,
12567
    helper(key) {
12568
      return `_${helperNameMap[key]}`;
12569
    },
12570
    push(code, node) {
12571
      context.code += code;
12572
    },
12573
    indent() {
12574
      newline(++context.indentLevel);
12575
    },
12576
    deindent(withoutNewLine = false) {
12577
      if (withoutNewLine) {
12578
        --context.indentLevel;
12579
      } else {
12580
        newline(--context.indentLevel);
12581
      }
12582
    },
12583
    newline() {
12584
      newline(context.indentLevel);
12585
    }
12586
  };
12587
  function newline(n) {
12588
    context.push("\n" + `  `.repeat(n));
12589
  }
12590
  return context;
12591
}
12592
function generate(ast, options = {}) {
12593
  const context = createCodegenContext(ast, options);
12594
  if (options.onContextCreated)
12595
    options.onContextCreated(context);
12596
  const {
12597
    mode,
12598
    push,
12599
    prefixIdentifiers,
12600
    indent,
12601
    deindent,
12602
    newline,
12603
    scopeId,
12604
    ssr
12605
  } = context;
12606
  const helpers = Array.from(ast.helpers);
12607
  const hasHelpers = helpers.length > 0;
12608
  const useWithBlock = !prefixIdentifiers && mode !== "module";
12609
  const isSetupInlined = false;
12610
  const preambleContext = isSetupInlined ? createCodegenContext(ast, options) : context;
12611
  {
12612
    genFunctionPreamble(ast, preambleContext);
12613
  }
12614
  const functionName = ssr ? `ssrRender` : `render`;
12615
  const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"];
12616
  const signature = args.join(", ");
12617
  {
12618
    push(`function ${functionName}(${signature}) {`);
12619
  }
12620
  indent();
12621
  if (useWithBlock) {
12622
    push(`with (_ctx) {`);
12623
    indent();
12624
    if (hasHelpers) {
12625
      push(`const { ${helpers.map(aliasHelper).join(", ")} } = _Vue`);
12626
      push(`
12627
`);
12628
      newline();
12629
    }
12630
  }
12631
  if (ast.components.length) {
12632
    genAssets(ast.components, "component", context);
12633
    if (ast.directives.length || ast.temps > 0) {
12634
      newline();
12635
    }
12636
  }
12637
  if (ast.directives.length) {
12638
    genAssets(ast.directives, "directive", context);
12639
    if (ast.temps > 0) {
12640
      newline();
12641
    }
12642
  }
12643
  if (ast.temps > 0) {
12644
    push(`let `);
12645
    for (let i = 0; i < ast.temps; i++) {
12646
      push(`${i > 0 ? `, ` : ``}_temp${i}`);
12647
    }
12648
  }
12649
  if (ast.components.length || ast.directives.length || ast.temps) {
12650
    push(`
12651
`);
12652
    newline();
12653
  }
12654
  if (!ssr) {
12655
    push(`return `);
12656
  }
12657
  if (ast.codegenNode) {
12658
    genNode(ast.codegenNode, context);
12659
  } else {
12660
    push(`null`);
12661
  }
12662
  if (useWithBlock) {
12663
    deindent();
12664
    push(`}`);
12665
  }
12666
  deindent();
12667
  push(`}`);
12668
  return {
12669
    ast,
12670
    code: context.code,
12671
    preamble: isSetupInlined ? preambleContext.code : ``,
12672
    // SourceMapGenerator does have toJSON() method but it's not in the types
12673
    map: context.map ? context.map.toJSON() : void 0
12674
  };
12675
}
12676
function genFunctionPreamble(ast, context) {
12677
  const {
12678
    ssr,
12679
    prefixIdentifiers,
12680
    push,
12681
    newline,
12682
    runtimeModuleName,
12683
    runtimeGlobalName,
12684
    ssrRuntimeModuleName
12685
  } = context;
12686
  const VueBinding = runtimeGlobalName;
12687
  const helpers = Array.from(ast.helpers);
12688
  if (helpers.length > 0) {
12689
    {
12690
      push(`const _Vue = ${VueBinding}
12691
`);
12692
      if (ast.hoists.length) {
12693
        const staticHelpers = [
12694
          CREATE_VNODE,
12695
          CREATE_ELEMENT_VNODE,
12696
          CREATE_COMMENT,
12697
          CREATE_TEXT,
12698
          CREATE_STATIC
12699
        ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", ");
12700
        push(`const { ${staticHelpers} } = _Vue
12701
`);
12702
      }
12703
    }
12704
  }
12705
  genHoists(ast.hoists, context);
12706
  newline();
12707
  push(`return `);
12708
}
12709
function genAssets(assets, type, { helper, push, newline, isTS }) {
12710
  const resolver = helper(
12711
    type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE
12712
  );
12713
  for (let i = 0; i < assets.length; i++) {
12714
    let id = assets[i];
12715
    const maybeSelfReference = id.endsWith("__self");
12716
    if (maybeSelfReference) {
12717
      id = id.slice(0, -6);
12718
    }
12719
    push(
12720
      `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}`
12721
    );
12722
    if (i < assets.length - 1) {
12723
      newline();
12724
    }
12725
  }
12726
}
12727
function genHoists(hoists, context) {
12728
  if (!hoists.length) {
12729
    return;
12730
  }
12731
  context.pure = true;
12732
  const { push, newline, helper, scopeId, mode } = context;
12733
  newline();
12734
  for (let i = 0; i < hoists.length; i++) {
12735
    const exp = hoists[i];
12736
    if (exp) {
12737
      push(
12738
        `const _hoisted_${i + 1} = ${``}`
12739
      );
12740
      genNode(exp, context);
12741
      newline();
12742
    }
12743
  }
12744
  context.pure = false;
12745
}
12746
function isText(n) {
12747
  return isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8;
12748
}
12749
function genNodeListAsArray(nodes, context) {
12750
  const multilines = nodes.length > 3 || nodes.some((n) => isArray(n) || !isText(n));
12751
  context.push(`[`);
12752
  multilines && context.indent();
12753
  genNodeList(nodes, context, multilines);
12754
  multilines && context.deindent();
12755
  context.push(`]`);
12756
}
12757
function genNodeList(nodes, context, multilines = false, comma = true) {
12758
  const { push, newline } = context;
12759
  for (let i = 0; i < nodes.length; i++) {
12760
    const node = nodes[i];
12761
    if (isString(node)) {
12762
      push(node);
12763
    } else if (isArray(node)) {
12764
      genNodeListAsArray(node, context);
12765
    } else {
12766
      genNode(node, context);
12767
    }
12768
    if (i < nodes.length - 1) {
12769
      if (multilines) {
12770
        comma && push(",");
12771
        newline();
12772
      } else {
12773
        comma && push(", ");
12774
      }
12775
    }
12776
  }
12777
}
12778
function genNode(node, context) {
12779
  if (isString(node)) {
12780
    context.push(node);
12781
    return;
12782
  }
12783
  if (isSymbol(node)) {
12784
    context.push(context.helper(node));
12785
    return;
12786
  }
12787
  switch (node.type) {
12788
    case 1:
12789
    case 9:
12790
    case 11:
12791
      assert(
12792
        node.codegenNode != null,
12793
        `Codegen node is missing for element/if/for node. Apply appropriate transforms first.`
12794
      );
12795
      genNode(node.codegenNode, context);
12796
      break;
12797
    case 2:
12798
      genText(node, context);
12799
      break;
12800
    case 4:
12801
      genExpression(node, context);
12802
      break;
12803
    case 5:
12804
      genInterpolation(node, context);
12805
      break;
12806
    case 12:
12807
      genNode(node.codegenNode, context);
12808
      break;
12809
    case 8:
12810
      genCompoundExpression(node, context);
12811
      break;
12812
    case 3:
12813
      genComment(node, context);
12814
      break;
12815
    case 13:
12816
      genVNodeCall(node, context);
12817
      break;
12818
    case 14:
12819
      genCallExpression(node, context);
12820
      break;
12821
    case 15:
12822
      genObjectExpression(node, context);
12823
      break;
12824
    case 17:
12825
      genArrayExpression(node, context);
12826
      break;
12827
    case 18:
12828
      genFunctionExpression(node, context);
12829
      break;
12830
    case 19:
12831
      genConditionalExpression(node, context);
12832
      break;
12833
    case 20:
12834
      genCacheExpression(node, context);
12835
      break;
12836
    case 21:
12837
      genNodeList(node.body, context, true, false);
12838
      break;
12839
    case 22:
12840
      break;
12841
    case 23:
12842
      break;
12843
    case 24:
12844
      break;
12845
    case 25:
12846
      break;
12847
    case 26:
12848
      break;
12849
    case 10:
12850
      break;
12851
    default:
12852
      {
12853
        assert(false, `unhandled codegen node type: ${node.type}`);
12854
        const exhaustiveCheck = node;
12855
        return exhaustiveCheck;
12856
      }
12857
  }
12858
}
12859
function genText(node, context) {
12860
  context.push(JSON.stringify(node.content), node);
12861
}
12862
function genExpression(node, context) {
12863
  const { content, isStatic } = node;
12864
  context.push(isStatic ? JSON.stringify(content) : content, node);
12865
}
12866
function genInterpolation(node, context) {
12867
  const { push, helper, pure } = context;
12868
  if (pure)
12869
    push(PURE_ANNOTATION);
12870
  push(`${helper(TO_DISPLAY_STRING)}(`);
12871
  genNode(node.content, context);
12872
  push(`)`);
12873
}
12874
function genCompoundExpression(node, context) {
12875
  for (let i = 0; i < node.children.length; i++) {
12876
    const child = node.children[i];
12877
    if (isString(child)) {
12878
      context.push(child);
12879
    } else {
12880
      genNode(child, context);
12881
    }
12882
  }
12883
}
12884
function genExpressionAsPropertyKey(node, context) {
12885
  const { push } = context;
12886
  if (node.type === 8) {
12887
    push(`[`);
12888
    genCompoundExpression(node, context);
12889
    push(`]`);
12890
  } else if (node.isStatic) {
12891
    const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content);
12892
    push(text, node);
12893
  } else {
12894
    push(`[${node.content}]`, node);
12895
  }
12896
}
12897
function genComment(node, context) {
12898
  const { push, helper, pure } = context;
12899
  if (pure) {
12900
    push(PURE_ANNOTATION);
12901
  }
12902
  push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node);
12903
}
12904
function genVNodeCall(node, context) {
12905
  const { push, helper, pure } = context;
12906
  const {
12907
    tag,
12908
    props,
12909
    children,
12910
    patchFlag,
12911
    dynamicProps,
12912
    directives,
12913
    isBlock,
12914
    disableTracking,
12915
    isComponent
12916
  } = node;
12917
  if (directives) {
12918
    push(helper(WITH_DIRECTIVES) + `(`);
12919
  }
12920
  if (isBlock) {
12921
    push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);
12922
  }
12923
  if (pure) {
12924
    push(PURE_ANNOTATION);
12925
  }
12926
  const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent);
12927
  push(helper(callHelper) + `(`, node);
12928
  genNodeList(
12929
    genNullableArgs([tag, props, children, patchFlag, dynamicProps]),
12930
    context
12931
  );
12932
  push(`)`);
12933
  if (isBlock) {
12934
    push(`)`);
12935
  }
12936
  if (directives) {
12937
    push(`, `);
12938
    genNode(directives, context);
12939
    push(`)`);
12940
  }
12941
}
12942
function genNullableArgs(args) {
12943
  let i = args.length;
12944
  while (i--) {
12945
    if (args[i] != null)
12946
      break;
12947
  }
12948
  return args.slice(0, i + 1).map((arg) => arg || `null`);
12949
}
12950
function genCallExpression(node, context) {
12951
  const { push, helper, pure } = context;
12952
  const callee = isString(node.callee) ? node.callee : helper(node.callee);
12953
  if (pure) {
12954
    push(PURE_ANNOTATION);
12955
  }
12956
  push(callee + `(`, node);
12957
  genNodeList(node.arguments, context);
12958
  push(`)`);
12959
}
12960
function genObjectExpression(node, context) {
12961
  const { push, indent, deindent, newline } = context;
12962
  const { properties } = node;
12963
  if (!properties.length) {
12964
    push(`{}`, node);
12965
    return;
12966
  }
12967
  const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4);
12968
  push(multilines ? `{` : `{ `);
12969
  multilines && indent();
12970
  for (let i = 0; i < properties.length; i++) {
12971
    const { key, value } = properties[i];
12972
    genExpressionAsPropertyKey(key, context);
12973
    push(`: `);
12974
    genNode(value, context);
12975
    if (i < properties.length - 1) {
12976
      push(`,`);
12977
      newline();
12978
    }
12979
  }
12980
  multilines && deindent();
12981
  push(multilines ? `}` : ` }`);
12982
}
12983
function genArrayExpression(node, context) {
12984
  genNodeListAsArray(node.elements, context);
12985
}
12986
function genFunctionExpression(node, context) {
12987
  const { push, indent, deindent } = context;
12988
  const { params, returns, body, newline, isSlot } = node;
12989
  if (isSlot) {
12990
    push(`_${helperNameMap[WITH_CTX]}(`);
12991
  }
12992
  push(`(`, node);
12993
  if (isArray(params)) {
12994
    genNodeList(params, context);
12995
  } else if (params) {
12996
    genNode(params, context);
12997
  }
12998
  push(`) => `);
12999
  if (newline || body) {
13000
    push(`{`);
13001
    indent();
13002
  }
13003
  if (returns) {
13004
    if (newline) {
13005
      push(`return `);
13006
    }
13007
    if (isArray(returns)) {
13008
      genNodeListAsArray(returns, context);
13009
    } else {
13010
      genNode(returns, context);
13011
    }
13012
  } else if (body) {
13013
    genNode(body, context);
13014
  }
13015
  if (newline || body) {
13016
    deindent();
13017
    push(`}`);
13018
  }
13019
  if (isSlot) {
13020
    push(`)`);
13021
  }
13022
}
13023
function genConditionalExpression(node, context) {
13024
  const { test, consequent, alternate, newline: needNewline } = node;
13025
  const { push, indent, deindent, newline } = context;
13026
  if (test.type === 4) {
13027
    const needsParens = !isSimpleIdentifier(test.content);
13028
    needsParens && push(`(`);
13029
    genExpression(test, context);
13030
    needsParens && push(`)`);
13031
  } else {
13032
    push(`(`);
13033
    genNode(test, context);
13034
    push(`)`);
13035
  }
13036
  needNewline && indent();
13037
  context.indentLevel++;
13038
  needNewline || push(` `);
13039
  push(`? `);
13040
  genNode(consequent, context);
13041
  context.indentLevel--;
13042
  needNewline && newline();
13043
  needNewline || push(` `);
13044
  push(`: `);
13045
  const isNested = alternate.type === 19;
13046
  if (!isNested) {
13047
    context.indentLevel++;
13048
  }
13049
  genNode(alternate, context);
13050
  if (!isNested) {
13051
    context.indentLevel--;
13052
  }
13053
  needNewline && deindent(
13054
    true
13055
    /* without newline */
13056
  );
13057
}
13058
function genCacheExpression(node, context) {
13059
  const { push, helper, indent, deindent, newline } = context;
13060
  push(`_cache[${node.index}] || (`);
13061
  if (node.isVNode) {
13062
    indent();
13063
    push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
13064
    newline();
13065
  }
13066
  push(`_cache[${node.index}] = `);
13067
  genNode(node.value, context);
13068
  if (node.isVNode) {
13069
    push(`,`);
13070
    newline();
13071
    push(`${helper(SET_BLOCK_TRACKING)}(1),`);
13072
    newline();
13073
    push(`_cache[${node.index}]`);
13074
    deindent();
13075
  }
13076
  push(`)`);
13077
}
13078
 
13079
const prohibitedKeywordRE = new RegExp(
13080
  "\\b" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b") + "\\b"
13081
);
13082
const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
13083
function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) {
13084
  const exp = node.content;
13085
  if (!exp.trim()) {
13086
    return;
13087
  }
13088
  try {
13089
    new Function(
13090
      asRawStatements ? ` ${exp} ` : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}`
13091
    );
13092
  } catch (e) {
13093
    let message = e.message;
13094
    const keywordMatch = exp.replace(stripStringRE, "").match(prohibitedKeywordRE);
13095
    if (keywordMatch) {
13096
      message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
13097
    }
13098
    context.onError(
13099
      createCompilerError(
13100
        45,
13101
        node.loc,
13102
        void 0,
13103
        message
13104
      )
13105
    );
13106
  }
13107
}
13108
 
13109
const transformExpression = (node, context) => {
13110
  if (node.type === 5) {
13111
    node.content = processExpression(
13112
      node.content,
13113
      context
13114
    );
13115
  } else if (node.type === 1) {
13116
    for (let i = 0; i < node.props.length; i++) {
13117
      const dir = node.props[i];
13118
      if (dir.type === 7 && dir.name !== "for") {
13119
        const exp = dir.exp;
13120
        const arg = dir.arg;
13121
        if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
13122
          dir.exp = processExpression(
13123
            exp,
13124
            context,
13125
            // slot args must be processed as function params
13126
            dir.name === "slot"
13127
          );
13128
        }
13129
        if (arg && arg.type === 4 && !arg.isStatic) {
13130
          dir.arg = processExpression(arg, context);
13131
        }
13132
      }
13133
    }
13134
  }
13135
};
13136
function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) {
13137
  {
13138
    {
13139
      validateBrowserExpression(node, context, asParams, asRawStatements);
13140
    }
13141
    return node;
13142
  }
13143
}
13144
 
13145
const transformIf = createStructuralDirectiveTransform(
13146
  /^(if|else|else-if)$/,
13147
  (node, dir, context) => {
13148
    return processIf(node, dir, context, (ifNode, branch, isRoot) => {
13149
      const siblings = context.parent.children;
13150
      let i = siblings.indexOf(ifNode);
13151
      let key = 0;
13152
      while (i-- >= 0) {
13153
        const sibling = siblings[i];
13154
        if (sibling && sibling.type === 9) {
13155
          key += sibling.branches.length;
13156
        }
13157
      }
13158
      return () => {
13159
        if (isRoot) {
13160
          ifNode.codegenNode = createCodegenNodeForBranch(
13161
            branch,
13162
            key,
13163
            context
13164
          );
13165
        } else {
13166
          const parentCondition = getParentCondition(ifNode.codegenNode);
13167
          parentCondition.alternate = createCodegenNodeForBranch(
13168
            branch,
13169
            key + ifNode.branches.length - 1,
13170
            context
13171
          );
13172
        }
13173
      };
13174
    });
13175
  }
13176
);
13177
function processIf(node, dir, context, processCodegen) {
13178
  if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
13179
    const loc = dir.exp ? dir.exp.loc : node.loc;
13180
    context.onError(
13181
      createCompilerError(28, dir.loc)
13182
    );
13183
    dir.exp = createSimpleExpression(`true`, false, loc);
13184
  }
13185
  if (dir.exp) {
13186
    validateBrowserExpression(dir.exp, context);
13187
  }
13188
  if (dir.name === "if") {
13189
    const branch = createIfBranch(node, dir);
13190
    const ifNode = {
13191
      type: 9,
13192
      loc: node.loc,
13193
      branches: [branch]
13194
    };
13195
    context.replaceNode(ifNode);
13196
    if (processCodegen) {
13197
      return processCodegen(ifNode, branch, true);
13198
    }
13199
  } else {
13200
    const siblings = context.parent.children;
13201
    const comments = [];
13202
    let i = siblings.indexOf(node);
13203
    while (i-- >= -1) {
13204
      const sibling = siblings[i];
13205
      if (sibling && sibling.type === 3) {
13206
        context.removeNode(sibling);
13207
        comments.unshift(sibling);
13208
        continue;
13209
      }
13210
      if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
13211
        context.removeNode(sibling);
13212
        continue;
13213
      }
13214
      if (sibling && sibling.type === 9) {
13215
        if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
13216
          context.onError(
13217
            createCompilerError(30, node.loc)
13218
          );
13219
        }
13220
        context.removeNode();
13221
        const branch = createIfBranch(node, dir);
13222
        if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition>
13223
        !(context.parent && context.parent.type === 1 && isBuiltInType(context.parent.tag, "transition"))) {
13224
          branch.children = [...comments, ...branch.children];
13225
        }
13226
        {
13227
          const key = branch.userKey;
13228
          if (key) {
13229
            sibling.branches.forEach(({ userKey }) => {
13230
              if (isSameKey(userKey, key)) {
13231
                context.onError(
13232
                  createCompilerError(
13233
                    29,
13234
                    branch.userKey.loc
13235
                  )
13236
                );
13237
              }
13238
            });
13239
          }
13240
        }
13241
        sibling.branches.push(branch);
13242
        const onExit = processCodegen && processCodegen(sibling, branch, false);
13243
        traverseNode(branch, context);
13244
        if (onExit)
13245
          onExit();
13246
        context.currentNode = null;
13247
      } else {
13248
        context.onError(
13249
          createCompilerError(30, node.loc)
13250
        );
13251
      }
13252
      break;
13253
    }
13254
  }
13255
}
13256
function createIfBranch(node, dir) {
13257
  const isTemplateIf = node.tagType === 3;
13258
  return {
13259
    type: 10,
13260
    loc: node.loc,
13261
    condition: dir.name === "else" ? void 0 : dir.exp,
13262
    children: isTemplateIf && !findDir(node, "for") ? node.children : [node],
13263
    userKey: findProp(node, `key`),
13264
    isTemplateIf
13265
  };
13266
}
13267
function createCodegenNodeForBranch(branch, keyIndex, context) {
13268
  if (branch.condition) {
13269
    return createConditionalExpression(
13270
      branch.condition,
13271
      createChildrenCodegenNode(branch, keyIndex, context),
13272
      // make sure to pass in asBlock: true so that the comment node call
13273
      // closes the current block.
13274
      createCallExpression(context.helper(CREATE_COMMENT), [
13275
        '"v-if"' ,
13276
        "true"
13277
      ])
13278
    );
13279
  } else {
13280
    return createChildrenCodegenNode(branch, keyIndex, context);
13281
  }
13282
}
13283
function createChildrenCodegenNode(branch, keyIndex, context) {
13284
  const { helper } = context;
13285
  const keyProperty = createObjectProperty(
13286
    `key`,
13287
    createSimpleExpression(
13288
      `${keyIndex}`,
13289
      false,
13290
      locStub,
13291
      2
13292
    )
13293
  );
13294
  const { children } = branch;
13295
  const firstChild = children[0];
13296
  const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1;
13297
  if (needFragmentWrapper) {
13298
    if (children.length === 1 && firstChild.type === 11) {
13299
      const vnodeCall = firstChild.codegenNode;
13300
      injectProp(vnodeCall, keyProperty, context);
13301
      return vnodeCall;
13302
    } else {
13303
      let patchFlag = 64;
13304
      let patchFlagText = PatchFlagNames[64];
13305
      if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) {
13306
        patchFlag |= 2048;
13307
        patchFlagText += `, ${PatchFlagNames[2048]}`;
13308
      }
13309
      return createVNodeCall(
13310
        context,
13311
        helper(FRAGMENT),
13312
        createObjectExpression([keyProperty]),
13313
        children,
13314
        patchFlag + (` /* ${patchFlagText} */` ),
13315
        void 0,
13316
        void 0,
13317
        true,
13318
        false,
13319
        false,
13320
        branch.loc
13321
      );
13322
    }
13323
  } else {
13324
    const ret = firstChild.codegenNode;
13325
    const vnodeCall = getMemoedVNodeCall(ret);
13326
    if (vnodeCall.type === 13) {
13327
      convertToBlock(vnodeCall, context);
13328
    }
13329
    injectProp(vnodeCall, keyProperty, context);
13330
    return ret;
13331
  }
13332
}
13333
function isSameKey(a, b) {
13334
  if (!a || a.type !== b.type) {
13335
    return false;
13336
  }
13337
  if (a.type === 6) {
13338
    if (a.value.content !== b.value.content) {
13339
      return false;
13340
    }
13341
  } else {
13342
    const exp = a.exp;
13343
    const branchExp = b.exp;
13344
    if (exp.type !== branchExp.type) {
13345
      return false;
13346
    }
13347
    if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
13348
      return false;
13349
    }
13350
  }
13351
  return true;
13352
}
13353
function getParentCondition(node) {
13354
  while (true) {
13355
    if (node.type === 19) {
13356
      if (node.alternate.type === 19) {
13357
        node = node.alternate;
13358
      } else {
13359
        return node;
13360
      }
13361
    } else if (node.type === 20) {
13362
      node = node.value;
13363
    }
13364
  }
13365
}
13366
 
13367
const transformFor = createStructuralDirectiveTransform(
13368
  "for",
13369
  (node, dir, context) => {
13370
    const { helper, removeHelper } = context;
13371
    return processFor(node, dir, context, (forNode) => {
13372
      const renderExp = createCallExpression(helper(RENDER_LIST), [
13373
        forNode.source
13374
      ]);
13375
      const isTemplate = isTemplateNode(node);
13376
      const memo = findDir(node, "memo");
13377
      const keyProp = findProp(node, `key`);
13378
      const keyExp = keyProp && (keyProp.type === 6 ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp);
13379
      const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
13380
      const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
13381
      const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
13382
      forNode.codegenNode = createVNodeCall(
13383
        context,
13384
        helper(FRAGMENT),
13385
        void 0,
13386
        renderExp,
13387
        fragmentFlag + (` /* ${PatchFlagNames[fragmentFlag]} */` ),
13388
        void 0,
13389
        void 0,
13390
        true,
13391
        !isStableFragment,
13392
        false,
13393
        node.loc
13394
      );
13395
      return () => {
13396
        let childBlock;
13397
        const { children } = forNode;
13398
        if (isTemplate) {
13399
          node.children.some((c) => {
13400
            if (c.type === 1) {
13401
              const key = findProp(c, "key");
13402
              if (key) {
13403
                context.onError(
13404
                  createCompilerError(
13405
                    33,
13406
                    key.loc
13407
                  )
13408
                );
13409
                return true;
13410
              }
13411
            }
13412
          });
13413
        }
13414
        const needFragmentWrapper = children.length !== 1 || children[0].type !== 1;
13415
        const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;
13416
        if (slotOutlet) {
13417
          childBlock = slotOutlet.codegenNode;
13418
          if (isTemplate && keyProperty) {
13419
            injectProp(childBlock, keyProperty, context);
13420
          }
13421
        } else if (needFragmentWrapper) {
13422
          childBlock = createVNodeCall(
13423
            context,
13424
            helper(FRAGMENT),
13425
            keyProperty ? createObjectExpression([keyProperty]) : void 0,
13426
            node.children,
13427
            64 + (` /* ${PatchFlagNames[64]} */` ),
13428
            void 0,
13429
            void 0,
13430
            true,
13431
            void 0,
13432
            false
13433
            /* isComponent */
13434
          );
13435
        } else {
13436
          childBlock = children[0].codegenNode;
13437
          if (isTemplate && keyProperty) {
13438
            injectProp(childBlock, keyProperty, context);
13439
          }
13440
          if (childBlock.isBlock !== !isStableFragment) {
13441
            if (childBlock.isBlock) {
13442
              removeHelper(OPEN_BLOCK);
13443
              removeHelper(
13444
                getVNodeBlockHelper(context.inSSR, childBlock.isComponent)
13445
              );
13446
            } else {
13447
              removeHelper(
13448
                getVNodeHelper(context.inSSR, childBlock.isComponent)
13449
              );
13450
            }
13451
          }
13452
          childBlock.isBlock = !isStableFragment;
13453
          if (childBlock.isBlock) {
13454
            helper(OPEN_BLOCK);
13455
            helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
13456
          } else {
13457
            helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
13458
          }
13459
        }
13460
        if (memo) {
13461
          const loop = createFunctionExpression(
13462
            createForLoopParams(forNode.parseResult, [
13463
              createSimpleExpression(`_cached`)
13464
            ])
13465
          );
13466
          loop.body = createBlockStatement([
13467
            createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
13468
            createCompoundExpression([
13469
              `if (_cached`,
13470
              ...keyExp ? [` && _cached.key === `, keyExp] : [],
13471
              ` && ${context.helperString(
13472
                IS_MEMO_SAME
13473
              )}(_cached, _memo)) return _cached`
13474
            ]),
13475
            createCompoundExpression([`const _item = `, childBlock]),
13476
            createSimpleExpression(`_item.memo = _memo`),
13477
            createSimpleExpression(`return _item`)
13478
          ]);
13479
          renderExp.arguments.push(
13480
            loop,
13481
            createSimpleExpression(`_cache`),
13482
            createSimpleExpression(String(context.cached++))
13483
          );
13484
        } else {
13485
          renderExp.arguments.push(
13486
            createFunctionExpression(
13487
              createForLoopParams(forNode.parseResult),
13488
              childBlock,
13489
              true
13490
              /* force newline */
13491
            )
13492
          );
13493
        }
13494
      };
13495
    });
13496
  }
13497
);
13498
function processFor(node, dir, context, processCodegen) {
13499
  if (!dir.exp) {
13500
    context.onError(
13501
      createCompilerError(31, dir.loc)
13502
    );
13503
    return;
13504
  }
13505
  const parseResult = parseForExpression(
13506
    // can only be simple expression because vFor transform is applied
13507
    // before expression transform.
13508
    dir.exp,
13509
    context
13510
  );
13511
  if (!parseResult) {
13512
    context.onError(
13513
      createCompilerError(32, dir.loc)
13514
    );
13515
    return;
13516
  }
13517
  const { addIdentifiers, removeIdentifiers, scopes } = context;
13518
  const { source, value, key, index } = parseResult;
13519
  const forNode = {
13520
    type: 11,
13521
    loc: dir.loc,
13522
    source,
13523
    valueAlias: value,
13524
    keyAlias: key,
13525
    objectIndexAlias: index,
13526
    parseResult,
13527
    children: isTemplateNode(node) ? node.children : [node]
13528
  };
13529
  context.replaceNode(forNode);
13530
  scopes.vFor++;
13531
  const onExit = processCodegen && processCodegen(forNode);
13532
  return () => {
13533
    scopes.vFor--;
13534
    if (onExit)
13535
      onExit();
13536
  };
13537
}
13538
const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
13539
const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
13540
const stripParensRE = /^\(|\)$/g;
13541
function parseForExpression(input, context) {
13542
  const loc = input.loc;
13543
  const exp = input.content;
13544
  const inMatch = exp.match(forAliasRE);
13545
  if (!inMatch)
13546
    return;
13547
  const [, LHS, RHS] = inMatch;
13548
  const result = {
13549
    source: createAliasExpression(
13550
      loc,
13551
      RHS.trim(),
13552
      exp.indexOf(RHS, LHS.length)
13553
    ),
13554
    value: void 0,
13555
    key: void 0,
13556
    index: void 0
13557
  };
13558
  {
13559
    validateBrowserExpression(result.source, context);
13560
  }
13561
  let valueContent = LHS.trim().replace(stripParensRE, "").trim();
13562
  const trimmedOffset = LHS.indexOf(valueContent);
13563
  const iteratorMatch = valueContent.match(forIteratorRE);
13564
  if (iteratorMatch) {
13565
    valueContent = valueContent.replace(forIteratorRE, "").trim();
13566
    const keyContent = iteratorMatch[1].trim();
13567
    let keyOffset;
13568
    if (keyContent) {
13569
      keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
13570
      result.key = createAliasExpression(loc, keyContent, keyOffset);
13571
      {
13572
        validateBrowserExpression(
13573
          result.key,
13574
          context,
13575
          true
13576
        );
13577
      }
13578
    }
13579
    if (iteratorMatch[2]) {
13580
      const indexContent = iteratorMatch[2].trim();
13581
      if (indexContent) {
13582
        result.index = createAliasExpression(
13583
          loc,
13584
          indexContent,
13585
          exp.indexOf(
13586
            indexContent,
13587
            result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length
13588
          )
13589
        );
13590
        {
13591
          validateBrowserExpression(
13592
            result.index,
13593
            context,
13594
            true
13595
          );
13596
        }
13597
      }
13598
    }
13599
  }
13600
  if (valueContent) {
13601
    result.value = createAliasExpression(loc, valueContent, trimmedOffset);
13602
    {
13603
      validateBrowserExpression(
13604
        result.value,
13605
        context,
13606
        true
13607
      );
13608
    }
13609
  }
13610
  return result;
13611
}
13612
function createAliasExpression(range, content, offset) {
13613
  return createSimpleExpression(
13614
    content,
13615
    false,
13616
    getInnerRange(range, offset, content.length)
13617
  );
13618
}
13619
function createForLoopParams({ value, key, index }, memoArgs = []) {
13620
  return createParamsList([value, key, index, ...memoArgs]);
13621
}
13622
function createParamsList(args) {
13623
  let i = args.length;
13624
  while (i--) {
13625
    if (args[i])
13626
      break;
13627
  }
13628
  return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false));
13629
}
13630
 
13631
const defaultFallback = createSimpleExpression(`undefined`, false);
13632
const trackSlotScopes = (node, context) => {
13633
  if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) {
13634
    const vSlot = findDir(node, "slot");
13635
    if (vSlot) {
13636
      vSlot.exp;
13637
      context.scopes.vSlot++;
13638
      return () => {
13639
        context.scopes.vSlot--;
13640
      };
13641
    }
13642
  }
13643
};
13644
const buildClientSlotFn = (props, children, loc) => createFunctionExpression(
13645
  props,
13646
  children,
13647
  false,
13648
  true,
13649
  children.length ? children[0].loc : loc
13650
);
13651
function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13652
  context.helper(WITH_CTX);
13653
  const { children, loc } = node;
13654
  const slotsProperties = [];
13655
  const dynamicSlots = [];
13656
  let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;
13657
  const onComponentSlot = findDir(node, "slot", true);
13658
  if (onComponentSlot) {
13659
    const { arg, exp } = onComponentSlot;
13660
    if (arg && !isStaticExp(arg)) {
13661
      hasDynamicSlots = true;
13662
    }
13663
    slotsProperties.push(
13664
      createObjectProperty(
13665
        arg || createSimpleExpression("default", true),
13666
        buildSlotFn(exp, children, loc)
13667
      )
13668
    );
13669
  }
13670
  let hasTemplateSlots = false;
13671
  let hasNamedDefaultSlot = false;
13672
  const implicitDefaultChildren = [];
13673
  const seenSlotNames = /* @__PURE__ */ new Set();
13674
  let conditionalBranchIndex = 0;
13675
  for (let i = 0; i < children.length; i++) {
13676
    const slotElement = children[i];
13677
    let slotDir;
13678
    if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) {
13679
      if (slotElement.type !== 3) {
13680
        implicitDefaultChildren.push(slotElement);
13681
      }
13682
      continue;
13683
    }
13684
    if (onComponentSlot) {
13685
      context.onError(
13686
        createCompilerError(37, slotDir.loc)
13687
      );
13688
      break;
13689
    }
13690
    hasTemplateSlots = true;
13691
    const { children: slotChildren, loc: slotLoc } = slotElement;
13692
    const {
13693
      arg: slotName = createSimpleExpression(`default`, true),
13694
      exp: slotProps,
13695
      loc: dirLoc
13696
    } = slotDir;
13697
    let staticSlotName;
13698
    if (isStaticExp(slotName)) {
13699
      staticSlotName = slotName ? slotName.content : `default`;
13700
    } else {
13701
      hasDynamicSlots = true;
13702
    }
13703
    const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);
13704
    let vIf;
13705
    let vElse;
13706
    let vFor;
13707
    if (vIf = findDir(slotElement, "if")) {
13708
      hasDynamicSlots = true;
13709
      dynamicSlots.push(
13710
        createConditionalExpression(
13711
          vIf.exp,
13712
          buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++),
13713
          defaultFallback
13714
        )
13715
      );
13716
    } else if (vElse = findDir(
13717
      slotElement,
13718
      /^else(-if)?$/,
13719
      true
13720
      /* allowEmpty */
13721
    )) {
13722
      let j = i;
13723
      let prev;
13724
      while (j--) {
13725
        prev = children[j];
13726
        if (prev.type !== 3) {
13727
          break;
13728
        }
13729
      }
13730
      if (prev && isTemplateNode(prev) && findDir(prev, "if")) {
13731
        children.splice(i, 1);
13732
        i--;
13733
        let conditional = dynamicSlots[dynamicSlots.length - 1];
13734
        while (conditional.alternate.type === 19) {
13735
          conditional = conditional.alternate;
13736
        }
13737
        conditional.alternate = vElse.exp ? createConditionalExpression(
13738
          vElse.exp,
13739
          buildDynamicSlot(
13740
            slotName,
13741
            slotFunction,
13742
            conditionalBranchIndex++
13743
          ),
13744
          defaultFallback
13745
        ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++);
13746
      } else {
13747
        context.onError(
13748
          createCompilerError(30, vElse.loc)
13749
        );
13750
      }
13751
    } else if (vFor = findDir(slotElement, "for")) {
13752
      hasDynamicSlots = true;
13753
      const parseResult = vFor.parseResult || parseForExpression(vFor.exp, context);
13754
      if (parseResult) {
13755
        dynamicSlots.push(
13756
          createCallExpression(context.helper(RENDER_LIST), [
13757
            parseResult.source,
13758
            createFunctionExpression(
13759
              createForLoopParams(parseResult),
13760
              buildDynamicSlot(slotName, slotFunction),
13761
              true
13762
              /* force newline */
13763
            )
13764
          ])
13765
        );
13766
      } else {
13767
        context.onError(
13768
          createCompilerError(32, vFor.loc)
13769
        );
13770
      }
13771
    } else {
13772
      if (staticSlotName) {
13773
        if (seenSlotNames.has(staticSlotName)) {
13774
          context.onError(
13775
            createCompilerError(
13776
              38,
13777
              dirLoc
13778
            )
13779
          );
13780
          continue;
13781
        }
13782
        seenSlotNames.add(staticSlotName);
13783
        if (staticSlotName === "default") {
13784
          hasNamedDefaultSlot = true;
13785
        }
13786
      }
13787
      slotsProperties.push(createObjectProperty(slotName, slotFunction));
13788
    }
13789
  }
13790
  if (!onComponentSlot) {
13791
    const buildDefaultSlotProperty = (props, children2) => {
13792
      const fn = buildSlotFn(props, children2, loc);
13793
      return createObjectProperty(`default`, fn);
13794
    };
13795
    if (!hasTemplateSlots) {
13796
      slotsProperties.push(buildDefaultSlotProperty(void 0, children));
13797
    } else if (implicitDefaultChildren.length && // #3766
13798
    // with whitespace: 'preserve', whitespaces between slots will end up in
13799
    // implicitDefaultChildren. Ignore if all implicit children are whitespaces.
13800
    implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) {
13801
      if (hasNamedDefaultSlot) {
13802
        context.onError(
13803
          createCompilerError(
13804
            39,
13805
            implicitDefaultChildren[0].loc
13806
          )
13807
        );
13808
      } else {
13809
        slotsProperties.push(
13810
          buildDefaultSlotProperty(void 0, implicitDefaultChildren)
13811
        );
13812
      }
13813
    }
13814
  }
13815
  const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1;
13816
  let slots = createObjectExpression(
13817
    slotsProperties.concat(
13818
      createObjectProperty(
13819
        `_`,
13820
        // 2 = compiled but dynamic = can skip normalization, but must run diff
13821
        // 1 = compiled and static = can skip normalization AND diff as optimized
13822
        createSimpleExpression(
13823
          slotFlag + (` /* ${slotFlagsText[slotFlag]} */` ),
13824
          false
13825
        )
13826
      )
13827
    ),
13828
    loc
13829
  );
13830
  if (dynamicSlots.length) {
13831
    slots = createCallExpression(context.helper(CREATE_SLOTS), [
13832
      slots,
13833
      createArrayExpression(dynamicSlots)
13834
    ]);
13835
  }
13836
  return {
13837
    slots,
13838
    hasDynamicSlots
13839
  };
13840
}
13841
function buildDynamicSlot(name, fn, index) {
13842
  const props = [
13843
    createObjectProperty(`name`, name),
13844
    createObjectProperty(`fn`, fn)
13845
  ];
13846
  if (index != null) {
13847
    props.push(
13848
      createObjectProperty(`key`, createSimpleExpression(String(index), true))
13849
    );
13850
  }
13851
  return createObjectExpression(props);
13852
}
13853
function hasForwardedSlots(children) {
13854
  for (let i = 0; i < children.length; i++) {
13855
    const child = children[i];
13856
    switch (child.type) {
13857
      case 1:
13858
        if (child.tagType === 2 || hasForwardedSlots(child.children)) {
13859
          return true;
13860
        }
13861
        break;
13862
      case 9:
13863
        if (hasForwardedSlots(child.branches))
13864
          return true;
13865
        break;
13866
      case 10:
13867
      case 11:
13868
        if (hasForwardedSlots(child.children))
13869
          return true;
13870
        break;
13871
    }
13872
  }
13873
  return false;
13874
}
13875
function isNonWhitespaceContent(node) {
13876
  if (node.type !== 2 && node.type !== 12)
13877
    return true;
13878
  return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
13879
}
13880
 
13881
const directiveImportMap = /* @__PURE__ */ new WeakMap();
13882
const transformElement = (node, context) => {
13883
  return function postTransformElement() {
13884
    node = context.currentNode;
13885
    if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) {
13886
      return;
13887
    }
13888
    const { tag, props } = node;
13889
    const isComponent = node.tagType === 1;
13890
    let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`;
13891
    const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
13892
    let vnodeProps;
13893
    let vnodeChildren;
13894
    let vnodePatchFlag;
13895
    let patchFlag = 0;
13896
    let vnodeDynamicProps;
13897
    let dynamicPropNames;
13898
    let vnodeDirectives;
13899
    let shouldUseBlock = (
13900
      // dynamic component may resolve to plain elements
13901
      isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
13902
      // updates inside get proper isSVG flag at runtime. (#639, #643)
13903
      // This is technically web-specific, but splitting the logic out of core
13904
      // leads to too much unnecessary complexity.
13905
      (tag === "svg" || tag === "foreignObject")
13906
    );
13907
    if (props.length > 0) {
13908
      const propsBuildResult = buildProps(
13909
        node,
13910
        context,
13911
        void 0,
13912
        isComponent,
13913
        isDynamicComponent
13914
      );
13915
      vnodeProps = propsBuildResult.props;
13916
      patchFlag = propsBuildResult.patchFlag;
13917
      dynamicPropNames = propsBuildResult.dynamicPropNames;
13918
      const directives = propsBuildResult.directives;
13919
      vnodeDirectives = directives && directives.length ? createArrayExpression(
13920
        directives.map((dir) => buildDirectiveArgs(dir, context))
13921
      ) : void 0;
13922
      if (propsBuildResult.shouldUseBlock) {
13923
        shouldUseBlock = true;
13924
      }
13925
    }
13926
    if (node.children.length > 0) {
13927
      if (vnodeTag === KEEP_ALIVE) {
13928
        shouldUseBlock = true;
13929
        patchFlag |= 1024;
13930
        if (node.children.length > 1) {
13931
          context.onError(
13932
            createCompilerError(46, {
13933
              start: node.children[0].loc.start,
13934
              end: node.children[node.children.length - 1].loc.end,
13935
              source: ""
13936
            })
13937
          );
13938
        }
13939
      }
13940
      const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling
13941
      vnodeTag !== TELEPORT && // explained above.
13942
      vnodeTag !== KEEP_ALIVE;
13943
      if (shouldBuildAsSlots) {
13944
        const { slots, hasDynamicSlots } = buildSlots(node, context);
13945
        vnodeChildren = slots;
13946
        if (hasDynamicSlots) {
13947
          patchFlag |= 1024;
13948
        }
13949
      } else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
13950
        const child = node.children[0];
13951
        const type = child.type;
13952
        const hasDynamicTextChild = type === 5 || type === 8;
13953
        if (hasDynamicTextChild && getConstantType(child, context) === 0) {
13954
          patchFlag |= 1;
13955
        }
13956
        if (hasDynamicTextChild || type === 2) {
13957
          vnodeChildren = child;
13958
        } else {
13959
          vnodeChildren = node.children;
13960
        }
13961
      } else {
13962
        vnodeChildren = node.children;
13963
      }
13964
    }
13965
    if (patchFlag !== 0) {
13966
      {
13967
        if (patchFlag < 0) {
13968
          vnodePatchFlag = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
13969
        } else {
13970
          const flagNames = Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `);
13971
          vnodePatchFlag = patchFlag + ` /* ${flagNames} */`;
13972
        }
13973
      }
13974
      if (dynamicPropNames && dynamicPropNames.length) {
13975
        vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
13976
      }
13977
    }
13978
    node.codegenNode = createVNodeCall(
13979
      context,
13980
      vnodeTag,
13981
      vnodeProps,
13982
      vnodeChildren,
13983
      vnodePatchFlag,
13984
      vnodeDynamicProps,
13985
      vnodeDirectives,
13986
      !!shouldUseBlock,
13987
      false,
13988
      isComponent,
13989
      node.loc
13990
    );
13991
  };
13992
};
13993
function resolveComponentType(node, context, ssr = false) {
13994
  let { tag } = node;
13995
  const isExplicitDynamic = isComponentTag(tag);
13996
  const isProp = findProp(node, "is");
13997
  if (isProp) {
13998
    if (isExplicitDynamic || false) {
13999
      const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
14000
      if (exp) {
14001
        return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
14002
          exp
14003
        ]);
14004
      }
14005
    } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) {
14006
      tag = isProp.value.content.slice(4);
14007
    }
14008
  }
14009
  const isDir = !isExplicitDynamic && findDir(node, "is");
14010
  if (isDir && isDir.exp) {
14011
    {
14012
      context.onWarn(
14013
        createCompilerError(52, isDir.loc)
14014
      );
14015
    }
14016
    return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
14017
      isDir.exp
14018
    ]);
14019
  }
14020
  const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);
14021
  if (builtIn) {
14022
    if (!ssr)
14023
      context.helper(builtIn);
14024
    return builtIn;
14025
  }
14026
  context.helper(RESOLVE_COMPONENT);
14027
  context.components.add(tag);
14028
  return toValidAssetId(tag, `component`);
14029
}
14030
function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
14031
  const { tag, loc: elementLoc, children } = node;
14032
  let properties = [];
14033
  const mergeArgs = [];
14034
  const runtimeDirectives = [];
14035
  const hasChildren = children.length > 0;
14036
  let shouldUseBlock = false;
14037
  let patchFlag = 0;
14038
  let hasRef = false;
14039
  let hasClassBinding = false;
14040
  let hasStyleBinding = false;
14041
  let hasHydrationEventBinding = false;
14042
  let hasDynamicKeys = false;
14043
  let hasVnodeHook = false;
14044
  const dynamicPropNames = [];
14045
  const pushMergeArg = (arg) => {
14046
    if (properties.length) {
14047
      mergeArgs.push(
14048
        createObjectExpression(dedupeProperties(properties), elementLoc)
14049
      );
14050
      properties = [];
14051
    }
14052
    if (arg)
14053
      mergeArgs.push(arg);
14054
  };
14055
  const analyzePatchFlag = ({ key, value }) => {
14056
    if (isStaticExp(key)) {
14057
      const name = key.content;
14058
      const isEventHandler = isOn(name);
14059
      if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click
14060
      // dedicated fast path.
14061
      name.toLowerCase() !== "onclick" && // omit v-model handlers
14062
      name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks
14063
      !isReservedProp(name)) {
14064
        hasHydrationEventBinding = true;
14065
      }
14066
      if (isEventHandler && isReservedProp(name)) {
14067
        hasVnodeHook = true;
14068
      }
14069
      if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
14070
        return;
14071
      }
14072
      if (name === "ref") {
14073
        hasRef = true;
14074
      } else if (name === "class") {
14075
        hasClassBinding = true;
14076
      } else if (name === "style") {
14077
        hasStyleBinding = true;
14078
      } else if (name !== "key" && !dynamicPropNames.includes(name)) {
14079
        dynamicPropNames.push(name);
14080
      }
14081
      if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
14082
        dynamicPropNames.push(name);
14083
      }
14084
    } else {
14085
      hasDynamicKeys = true;
14086
    }
14087
  };
14088
  for (let i = 0; i < props.length; i++) {
14089
    const prop = props[i];
14090
    if (prop.type === 6) {
14091
      const { loc, name, value } = prop;
14092
      let isStatic = true;
14093
      if (name === "ref") {
14094
        hasRef = true;
14095
        if (context.scopes.vFor > 0) {
14096
          properties.push(
14097
            createObjectProperty(
14098
              createSimpleExpression("ref_for", true),
14099
              createSimpleExpression("true")
14100
            )
14101
          );
14102
        }
14103
      }
14104
      if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || false)) {
14105
        continue;
14106
      }
14107
      properties.push(
14108
        createObjectProperty(
14109
          createSimpleExpression(
14110
            name,
14111
            true,
14112
            getInnerRange(loc, 0, name.length)
14113
          ),
14114
          createSimpleExpression(
14115
            value ? value.content : "",
14116
            isStatic,
14117
            value ? value.loc : loc
14118
          )
14119
        )
14120
      );
14121
    } else {
14122
      const { name, arg, exp, loc } = prop;
14123
      const isVBind = name === "bind";
14124
      const isVOn = name === "on";
14125
      if (name === "slot") {
14126
        if (!isComponent) {
14127
          context.onError(
14128
            createCompilerError(40, loc)
14129
          );
14130
        }
14131
        continue;
14132
      }
14133
      if (name === "once" || name === "memo") {
14134
        continue;
14135
      }
14136
      if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || false)) {
14137
        continue;
14138
      }
14139
      if (isVOn && ssr) {
14140
        continue;
14141
      }
14142
      if (
14143
        // #938: elements with dynamic keys should be forced into blocks
14144
        isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked
14145
        // before children
14146
        isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
14147
      ) {
14148
        shouldUseBlock = true;
14149
      }
14150
      if (isVBind && isStaticArgOf(arg, "ref") && context.scopes.vFor > 0) {
14151
        properties.push(
14152
          createObjectProperty(
14153
            createSimpleExpression("ref_for", true),
14154
            createSimpleExpression("true")
14155
          )
14156
        );
14157
      }
14158
      if (!arg && (isVBind || isVOn)) {
14159
        hasDynamicKeys = true;
14160
        if (exp) {
14161
          if (isVBind) {
14162
            pushMergeArg();
14163
            mergeArgs.push(exp);
14164
          } else {
14165
            pushMergeArg({
14166
              type: 14,
14167
              loc,
14168
              callee: context.helper(TO_HANDLERS),
14169
              arguments: isComponent ? [exp] : [exp, `true`]
14170
            });
14171
          }
14172
        } else {
14173
          context.onError(
14174
            createCompilerError(
14175
              isVBind ? 34 : 35,
14176
              loc
14177
            )
14178
          );
14179
        }
14180
        continue;
14181
      }
14182
      const directiveTransform = context.directiveTransforms[name];
14183
      if (directiveTransform) {
14184
        const { props: props2, needRuntime } = directiveTransform(prop, node, context);
14185
        !ssr && props2.forEach(analyzePatchFlag);
14186
        if (isVOn && arg && !isStaticExp(arg)) {
14187
          pushMergeArg(createObjectExpression(props2, elementLoc));
14188
        } else {
14189
          properties.push(...props2);
14190
        }
14191
        if (needRuntime) {
14192
          runtimeDirectives.push(prop);
14193
          if (isSymbol(needRuntime)) {
14194
            directiveImportMap.set(prop, needRuntime);
14195
          }
14196
        }
14197
      } else if (!isBuiltInDirective(name)) {
14198
        runtimeDirectives.push(prop);
14199
        if (hasChildren) {
14200
          shouldUseBlock = true;
14201
        }
14202
      }
14203
    }
14204
  }
14205
  let propsExpression = void 0;
14206
  if (mergeArgs.length) {
14207
    pushMergeArg();
14208
    if (mergeArgs.length > 1) {
14209
      propsExpression = createCallExpression(
14210
        context.helper(MERGE_PROPS),
14211
        mergeArgs,
14212
        elementLoc
14213
      );
14214
    } else {
14215
      propsExpression = mergeArgs[0];
14216
    }
14217
  } else if (properties.length) {
14218
    propsExpression = createObjectExpression(
14219
      dedupeProperties(properties),
14220
      elementLoc
14221
    );
14222
  }
14223
  if (hasDynamicKeys) {
14224
    patchFlag |= 16;
14225
  } else {
14226
    if (hasClassBinding && !isComponent) {
14227
      patchFlag |= 2;
14228
    }
14229
    if (hasStyleBinding && !isComponent) {
14230
      patchFlag |= 4;
14231
    }
14232
    if (dynamicPropNames.length) {
14233
      patchFlag |= 8;
14234
    }
14235
    if (hasHydrationEventBinding) {
14236
      patchFlag |= 32;
14237
    }
14238
  }
14239
  if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
14240
    patchFlag |= 512;
14241
  }
14242
  if (!context.inSSR && propsExpression) {
14243
    switch (propsExpression.type) {
14244
      case 15:
14245
        let classKeyIndex = -1;
14246
        let styleKeyIndex = -1;
14247
        let hasDynamicKey = false;
14248
        for (let i = 0; i < propsExpression.properties.length; i++) {
14249
          const key = propsExpression.properties[i].key;
14250
          if (isStaticExp(key)) {
14251
            if (key.content === "class") {
14252
              classKeyIndex = i;
14253
            } else if (key.content === "style") {
14254
              styleKeyIndex = i;
14255
            }
14256
          } else if (!key.isHandlerKey) {
14257
            hasDynamicKey = true;
14258
          }
14259
        }
14260
        const classProp = propsExpression.properties[classKeyIndex];
14261
        const styleProp = propsExpression.properties[styleKeyIndex];
14262
        if (!hasDynamicKey) {
14263
          if (classProp && !isStaticExp(classProp.value)) {
14264
            classProp.value = createCallExpression(
14265
              context.helper(NORMALIZE_CLASS),
14266
              [classProp.value]
14267
            );
14268
          }
14269
          if (styleProp && // the static style is compiled into an object,
14270
          // so use `hasStyleBinding` to ensure that it is a dynamic style binding
14271
          (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
14272
          // v-bind:style with static literal object
14273
          styleProp.value.type === 17)) {
14274
            styleProp.value = createCallExpression(
14275
              context.helper(NORMALIZE_STYLE),
14276
              [styleProp.value]
14277
            );
14278
          }
14279
        } else {
14280
          propsExpression = createCallExpression(
14281
            context.helper(NORMALIZE_PROPS),
14282
            [propsExpression]
14283
          );
14284
        }
14285
        break;
14286
      case 14:
14287
        break;
14288
      default:
14289
        propsExpression = createCallExpression(
14290
          context.helper(NORMALIZE_PROPS),
14291
          [
14292
            createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [
14293
              propsExpression
14294
            ])
14295
          ]
14296
        );
14297
        break;
14298
    }
14299
  }
14300
  return {
14301
    props: propsExpression,
14302
    directives: runtimeDirectives,
14303
    patchFlag,
14304
    dynamicPropNames,
14305
    shouldUseBlock
14306
  };
14307
}
14308
function dedupeProperties(properties) {
14309
  const knownProps = /* @__PURE__ */ new Map();
14310
  const deduped = [];
14311
  for (let i = 0; i < properties.length; i++) {
14312
    const prop = properties[i];
14313
    if (prop.key.type === 8 || !prop.key.isStatic) {
14314
      deduped.push(prop);
14315
      continue;
14316
    }
14317
    const name = prop.key.content;
14318
    const existing = knownProps.get(name);
14319
    if (existing) {
14320
      if (name === "style" || name === "class" || isOn(name)) {
14321
        mergeAsArray(existing, prop);
14322
      }
14323
    } else {
14324
      knownProps.set(name, prop);
14325
      deduped.push(prop);
14326
    }
14327
  }
14328
  return deduped;
14329
}
14330
function mergeAsArray(existing, incoming) {
14331
  if (existing.value.type === 17) {
14332
    existing.value.elements.push(incoming.value);
14333
  } else {
14334
    existing.value = createArrayExpression(
14335
      [existing.value, incoming.value],
14336
      existing.loc
14337
    );
14338
  }
14339
}
14340
function buildDirectiveArgs(dir, context) {
14341
  const dirArgs = [];
14342
  const runtime = directiveImportMap.get(dir);
14343
  if (runtime) {
14344
    dirArgs.push(context.helperString(runtime));
14345
  } else {
14346
    {
14347
      context.helper(RESOLVE_DIRECTIVE);
14348
      context.directives.add(dir.name);
14349
      dirArgs.push(toValidAssetId(dir.name, `directive`));
14350
    }
14351
  }
14352
  const { loc } = dir;
14353
  if (dir.exp)
14354
    dirArgs.push(dir.exp);
14355
  if (dir.arg) {
14356
    if (!dir.exp) {
14357
      dirArgs.push(`void 0`);
14358
    }
14359
    dirArgs.push(dir.arg);
14360
  }
14361
  if (Object.keys(dir.modifiers).length) {
14362
    if (!dir.arg) {
14363
      if (!dir.exp) {
14364
        dirArgs.push(`void 0`);
14365
      }
14366
      dirArgs.push(`void 0`);
14367
    }
14368
    const trueExpression = createSimpleExpression(`true`, false, loc);
14369
    dirArgs.push(
14370
      createObjectExpression(
14371
        dir.modifiers.map(
14372
          (modifier) => createObjectProperty(modifier, trueExpression)
14373
        ),
14374
        loc
14375
      )
14376
    );
14377
  }
14378
  return createArrayExpression(dirArgs, dir.loc);
14379
}
14380
function stringifyDynamicPropNames(props) {
14381
  let propsNamesString = `[`;
14382
  for (let i = 0, l = props.length; i < l; i++) {
14383
    propsNamesString += JSON.stringify(props[i]);
14384
    if (i < l - 1)
14385
      propsNamesString += ", ";
14386
  }
14387
  return propsNamesString + `]`;
14388
}
14389
function isComponentTag(tag) {
14390
  return tag === "component" || tag === "Component";
14391
}
14392
 
14393
const transformSlotOutlet = (node, context) => {
14394
  if (isSlotOutlet(node)) {
14395
    const { children, loc } = node;
14396
    const { slotName, slotProps } = processSlotOutlet(node, context);
14397
    const slotArgs = [
14398
      context.prefixIdentifiers ? `_ctx.$slots` : `$slots`,
14399
      slotName,
14400
      "{}",
14401
      "undefined",
14402
      "true"
14403
    ];
14404
    let expectedLen = 2;
14405
    if (slotProps) {
14406
      slotArgs[2] = slotProps;
14407
      expectedLen = 3;
14408
    }
14409
    if (children.length) {
14410
      slotArgs[3] = createFunctionExpression([], children, false, false, loc);
14411
      expectedLen = 4;
14412
    }
14413
    if (context.scopeId && !context.slotted) {
14414
      expectedLen = 5;
14415
    }
14416
    slotArgs.splice(expectedLen);
14417
    node.codegenNode = createCallExpression(
14418
      context.helper(RENDER_SLOT),
14419
      slotArgs,
14420
      loc
14421
    );
14422
  }
14423
};
14424
function processSlotOutlet(node, context) {
14425
  let slotName = `"default"`;
14426
  let slotProps = void 0;
14427
  const nonNameProps = [];
14428
  for (let i = 0; i < node.props.length; i++) {
14429
    const p = node.props[i];
14430
    if (p.type === 6) {
14431
      if (p.value) {
14432
        if (p.name === "name") {
14433
          slotName = JSON.stringify(p.value.content);
14434
        } else {
14435
          p.name = camelize(p.name);
14436
          nonNameProps.push(p);
14437
        }
14438
      }
14439
    } else {
14440
      if (p.name === "bind" && isStaticArgOf(p.arg, "name")) {
14441
        if (p.exp)
14442
          slotName = p.exp;
14443
      } else {
14444
        if (p.name === "bind" && p.arg && isStaticExp(p.arg)) {
14445
          p.arg.content = camelize(p.arg.content);
14446
        }
14447
        nonNameProps.push(p);
14448
      }
14449
    }
14450
  }
14451
  if (nonNameProps.length > 0) {
14452
    const { props, directives } = buildProps(
14453
      node,
14454
      context,
14455
      nonNameProps,
14456
      false,
14457
      false
14458
    );
14459
    slotProps = props;
14460
    if (directives.length) {
14461
      context.onError(
14462
        createCompilerError(
14463
          36,
14464
          directives[0].loc
14465
        )
14466
      );
14467
    }
14468
  }
14469
  return {
14470
    slotName,
14471
    slotProps
14472
  };
14473
}
14474
 
14475
const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
14476
const transformOn$1 = (dir, node, context, augmentor) => {
14477
  const { loc, modifiers, arg } = dir;
14478
  if (!dir.exp && !modifiers.length) {
14479
    context.onError(createCompilerError(35, loc));
14480
  }
14481
  let eventName;
14482
  if (arg.type === 4) {
14483
    if (arg.isStatic) {
14484
      let rawName = arg.content;
14485
      if (rawName.startsWith("vnode")) {
14486
        context.onWarn(
14487
          createCompilerError(51, arg.loc)
14488
        );
14489
      }
14490
      if (rawName.startsWith("vue:")) {
14491
        rawName = `vnode-${rawName.slice(4)}`;
14492
      }
14493
      const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
14494
        // for non-element and vnode lifecycle event listeners, auto convert
14495
        // it to camelCase. See issue #2249
14496
        toHandlerKey(camelize(rawName))
14497
      ) : (
14498
        // preserve case for plain element listeners that have uppercase
14499
        // letters, as these may be custom elements' custom events
14500
        `on:${rawName}`
14501
      );
14502
      eventName = createSimpleExpression(eventString, true, arg.loc);
14503
    } else {
14504
      eventName = createCompoundExpression([
14505
        `${context.helperString(TO_HANDLER_KEY)}(`,
14506
        arg,
14507
        `)`
14508
      ]);
14509
    }
14510
  } else {
14511
    eventName = arg;
14512
    eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);
14513
    eventName.children.push(`)`);
14514
  }
14515
  let exp = dir.exp;
14516
  if (exp && !exp.content.trim()) {
14517
    exp = void 0;
14518
  }
14519
  let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;
14520
  if (exp) {
14521
    const isMemberExp = isMemberExpression(exp.content);
14522
    const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));
14523
    const hasMultipleStatements = exp.content.includes(`;`);
14524
    {
14525
      validateBrowserExpression(
14526
        exp,
14527
        context,
14528
        false,
14529
        hasMultipleStatements
14530
      );
14531
    }
14532
    if (isInlineStatement || shouldCache && isMemberExp) {
14533
      exp = createCompoundExpression([
14534
        `${isInlineStatement ? `$event` : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`,
14535
        exp,
14536
        hasMultipleStatements ? `}` : `)`
14537
      ]);
14538
    }
14539
  }
14540
  let ret = {
14541
    props: [
14542
      createObjectProperty(
14543
        eventName,
14544
        exp || createSimpleExpression(`() => {}`, false, loc)
14545
      )
14546
    ]
14547
  };
14548
  if (augmentor) {
14549
    ret = augmentor(ret);
14550
  }
14551
  if (shouldCache) {
14552
    ret.props[0].value = context.cache(ret.props[0].value);
14553
  }
14554
  ret.props.forEach((p) => p.key.isHandlerKey = true);
14555
  return ret;
14556
};
14557
 
14558
const transformBind = (dir, _node, context) => {
14559
  const { exp, modifiers, loc } = dir;
14560
  const arg = dir.arg;
14561
  if (arg.type !== 4) {
14562
    arg.children.unshift(`(`);
14563
    arg.children.push(`) || ""`);
14564
  } else if (!arg.isStatic) {
14565
    arg.content = `${arg.content} || ""`;
14566
  }
14567
  if (modifiers.includes("camel")) {
14568
    if (arg.type === 4) {
14569
      if (arg.isStatic) {
14570
        arg.content = camelize(arg.content);
14571
      } else {
14572
        arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
14573
      }
14574
    } else {
14575
      arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
14576
      arg.children.push(`)`);
14577
    }
14578
  }
14579
  if (!context.inSSR) {
14580
    if (modifiers.includes("prop")) {
14581
      injectPrefix(arg, ".");
14582
    }
14583
    if (modifiers.includes("attr")) {
14584
      injectPrefix(arg, "^");
14585
    }
14586
  }
14587
  if (!exp || exp.type === 4 && !exp.content.trim()) {
14588
    context.onError(createCompilerError(34, loc));
14589
    return {
14590
      props: [createObjectProperty(arg, createSimpleExpression("", true, loc))]
14591
    };
14592
  }
14593
  return {
14594
    props: [createObjectProperty(arg, exp)]
14595
  };
14596
};
14597
const injectPrefix = (arg, prefix) => {
14598
  if (arg.type === 4) {
14599
    if (arg.isStatic) {
14600
      arg.content = prefix + arg.content;
14601
    } else {
14602
      arg.content = `\`${prefix}\${${arg.content}}\``;
14603
    }
14604
  } else {
14605
    arg.children.unshift(`'${prefix}' + (`);
14606
    arg.children.push(`)`);
14607
  }
14608
};
14609
 
14610
const transformText = (node, context) => {
14611
  if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
14612
    return () => {
14613
      const children = node.children;
14614
      let currentContainer = void 0;
14615
      let hasText = false;
14616
      for (let i = 0; i < children.length; i++) {
14617
        const child = children[i];
14618
        if (isText$1(child)) {
14619
          hasText = true;
14620
          for (let j = i + 1; j < children.length; j++) {
14621
            const next = children[j];
14622
            if (isText$1(next)) {
14623
              if (!currentContainer) {
14624
                currentContainer = children[i] = createCompoundExpression(
14625
                  [child],
14626
                  child.loc
14627
                );
14628
              }
14629
              currentContainer.children.push(` + `, next);
14630
              children.splice(j, 1);
14631
              j--;
14632
            } else {
14633
              currentContainer = void 0;
14634
              break;
14635
            }
14636
          }
14637
        }
14638
      }
14639
      if (!hasText || // if this is a plain element with a single text child, leave it
14640
      // as-is since the runtime has dedicated fast path for this by directly
14641
      // setting textContent of the element.
14642
      // for component root it's always normalized anyway.
14643
      children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756
14644
      // custom directives can potentially add DOM elements arbitrarily,
14645
      // we need to avoid setting textContent of the element at runtime
14646
      // to avoid accidentally overwriting the DOM elements added
14647
      // by the user through custom directives.
14648
      !node.props.find(
14649
        (p) => p.type === 7 && !context.directiveTransforms[p.name]
14650
      ) && // in compat mode, <template> tags with no special directives
14651
      // will be rendered as a fragment so its children must be
14652
      // converted into vnodes.
14653
      true)) {
14654
        return;
14655
      }
14656
      for (let i = 0; i < children.length; i++) {
14657
        const child = children[i];
14658
        if (isText$1(child) || child.type === 8) {
14659
          const callArgs = [];
14660
          if (child.type !== 2 || child.content !== " ") {
14661
            callArgs.push(child);
14662
          }
14663
          if (!context.ssr && getConstantType(child, context) === 0) {
14664
            callArgs.push(
14665
              1 + (` /* ${PatchFlagNames[1]} */` )
14666
            );
14667
          }
14668
          children[i] = {
14669
            type: 12,
14670
            content: child,
14671
            loc: child.loc,
14672
            codegenNode: createCallExpression(
14673
              context.helper(CREATE_TEXT),
14674
              callArgs
14675
            )
14676
          };
14677
        }
14678
      }
14679
    };
14680
  }
14681
};
14682
 
14683
const seen$1 = /* @__PURE__ */ new WeakSet();
14684
const transformOnce = (node, context) => {
14685
  if (node.type === 1 && findDir(node, "once", true)) {
14686
    if (seen$1.has(node) || context.inVOnce || context.inSSR) {
14687
      return;
14688
    }
14689
    seen$1.add(node);
14690
    context.inVOnce = true;
14691
    context.helper(SET_BLOCK_TRACKING);
14692
    return () => {
14693
      context.inVOnce = false;
14694
      const cur = context.currentNode;
14695
      if (cur.codegenNode) {
14696
        cur.codegenNode = context.cache(
14697
          cur.codegenNode,
14698
          true
14699
          /* isVNode */
14700
        );
14701
      }
14702
    };
14703
  }
14704
};
14705
 
14706
const transformModel$1 = (dir, node, context) => {
14707
  const { exp, arg } = dir;
14708
  if (!exp) {
14709
    context.onError(
14710
      createCompilerError(41, dir.loc)
14711
    );
14712
    return createTransformProps();
14713
  }
14714
  const rawExp = exp.loc.source;
14715
  const expString = exp.type === 4 ? exp.content : rawExp;
14716
  const bindingType = context.bindingMetadata[rawExp];
14717
  if (bindingType === "props" || bindingType === "props-aliased") {
14718
    context.onError(createCompilerError(44, exp.loc));
14719
    return createTransformProps();
14720
  }
14721
  const maybeRef = false;
14722
  if (!expString.trim() || !isMemberExpression(expString) && !maybeRef) {
14723
    context.onError(
14724
      createCompilerError(42, exp.loc)
14725
    );
14726
    return createTransformProps();
14727
  }
14728
  const propName = arg ? arg : createSimpleExpression("modelValue", true);
14729
  const eventName = arg ? isStaticExp(arg) ? `onUpdate:${camelize(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`;
14730
  let assignmentExp;
14731
  const eventArg = context.isTS ? `($event: any)` : `$event`;
14732
  {
14733
    assignmentExp = createCompoundExpression([
14734
      `${eventArg} => ((`,
14735
      exp,
14736
      `) = $event)`
14737
    ]);
14738
  }
14739
  const props = [
14740
    // modelValue: foo
14741
    createObjectProperty(propName, dir.exp),
14742
    // "onUpdate:modelValue": $event => (foo = $event)
14743
    createObjectProperty(eventName, assignmentExp)
14744
  ];
14745
  if (dir.modifiers.length && node.tagType === 1) {
14746
    const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
14747
    const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
14748
    props.push(
14749
      createObjectProperty(
14750
        modifiersKey,
14751
        createSimpleExpression(
14752
          `{ ${modifiers} }`,
14753
          false,
14754
          dir.loc,
14755
          2
14756
        )
14757
      )
14758
    );
14759
  }
14760
  return createTransformProps(props);
14761
};
14762
function createTransformProps(props = []) {
14763
  return { props };
14764
}
14765
 
14766
const seen = /* @__PURE__ */ new WeakSet();
14767
const transformMemo = (node, context) => {
14768
  if (node.type === 1) {
14769
    const dir = findDir(node, "memo");
14770
    if (!dir || seen.has(node)) {
14771
      return;
14772
    }
14773
    seen.add(node);
14774
    return () => {
14775
      const codegenNode = node.codegenNode || context.currentNode.codegenNode;
14776
      if (codegenNode && codegenNode.type === 13) {
14777
        if (node.tagType !== 1) {
14778
          convertToBlock(codegenNode, context);
14779
        }
14780
        node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
14781
          dir.exp,
14782
          createFunctionExpression(void 0, codegenNode),
14783
          `_cache`,
14784
          String(context.cached++)
14785
        ]);
14786
      }
14787
    };
14788
  }
14789
};
14790
 
14791
function getBaseTransformPreset(prefixIdentifiers) {
14792
  return [
14793
    [
14794
      transformOnce,
14795
      transformIf,
14796
      transformMemo,
14797
      transformFor,
14798
      ...[],
14799
      ...[transformExpression] ,
14800
      transformSlotOutlet,
14801
      transformElement,
14802
      trackSlotScopes,
14803
      transformText
14804
    ],
14805
    {
14806
      on: transformOn$1,
14807
      bind: transformBind,
14808
      model: transformModel$1
14809
    }
14810
  ];
14811
}
14812
function baseCompile(template, options = {}) {
14813
  const onError = options.onError || defaultOnError;
14814
  const isModuleMode = options.mode === "module";
14815
  {
14816
    if (options.prefixIdentifiers === true) {
14817
      onError(createCompilerError(47));
14818
    } else if (isModuleMode) {
14819
      onError(createCompilerError(48));
14820
    }
14821
  }
14822
  const prefixIdentifiers = false;
14823
  if (options.cacheHandlers) {
14824
    onError(createCompilerError(49));
14825
  }
14826
  if (options.scopeId && !isModuleMode) {
14827
    onError(createCompilerError(50));
14828
  }
14829
  const ast = isString(template) ? baseParse(template, options) : template;
14830
  const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
14831
  transform(
14832
    ast,
14833
    extend({}, options, {
14834
      prefixIdentifiers,
14835
      nodeTransforms: [
14836
        ...nodeTransforms,
14837
        ...options.nodeTransforms || []
14838
        // user transforms
14839
      ],
14840
      directiveTransforms: extend(
14841
        {},
14842
        directiveTransforms,
14843
        options.directiveTransforms || {}
14844
        // user transforms
14845
      )
14846
    })
14847
  );
14848
  return generate(
14849
    ast,
14850
    extend({}, options, {
14851
      prefixIdentifiers
14852
    })
14853
  );
14854
}
14855
 
14856
const noopDirectiveTransform = () => ({ props: [] });
14857
 
14858
const V_MODEL_RADIO = Symbol(`vModelRadio` );
14859
const V_MODEL_CHECKBOX = Symbol(`vModelCheckbox` );
14860
const V_MODEL_TEXT = Symbol(`vModelText` );
14861
const V_MODEL_SELECT = Symbol(`vModelSelect` );
14862
const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
14863
const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
14864
const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
14865
const V_SHOW = Symbol(`vShow` );
14866
const TRANSITION = Symbol(`Transition` );
14867
const TRANSITION_GROUP = Symbol(`TransitionGroup` );
14868
registerRuntimeHelpers({
14869
  [V_MODEL_RADIO]: `vModelRadio`,
14870
  [V_MODEL_CHECKBOX]: `vModelCheckbox`,
14871
  [V_MODEL_TEXT]: `vModelText`,
14872
  [V_MODEL_SELECT]: `vModelSelect`,
14873
  [V_MODEL_DYNAMIC]: `vModelDynamic`,
14874
  [V_ON_WITH_MODIFIERS]: `withModifiers`,
14875
  [V_ON_WITH_KEYS]: `withKeys`,
14876
  [V_SHOW]: `vShow`,
14877
  [TRANSITION]: `Transition`,
14878
  [TRANSITION_GROUP]: `TransitionGroup`
14879
});
14880
 
14881
let decoder;
14882
function decodeHtmlBrowser(raw, asAttr = false) {
14883
  if (!decoder) {
14884
    decoder = document.createElement("div");
14885
  }
14886
  if (asAttr) {
14887
    decoder.innerHTML = `<div foo="${raw.replace(/"/g, "&quot;")}">`;
14888
    return decoder.children[0].getAttribute("foo");
14889
  } else {
14890
    decoder.innerHTML = raw;
14891
    return decoder.textContent;
14892
  }
14893
}
14894
 
14895
const isRawTextContainer = /* @__PURE__ */ makeMap(
14896
  "style,iframe,script,noscript",
14897
  true
14898
);
14899
const parserOptions = {
14900
  isVoidTag,
14901
  isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag),
14902
  isPreTag: (tag) => tag === "pre",
14903
  decodeEntities: decodeHtmlBrowser ,
14904
  isBuiltInComponent: (tag) => {
14905
    if (isBuiltInType(tag, `Transition`)) {
14906
      return TRANSITION;
14907
    } else if (isBuiltInType(tag, `TransitionGroup`)) {
14908
      return TRANSITION_GROUP;
14909
    }
14910
  },
14911
  // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
14912
  getNamespace(tag, parent) {
14913
    let ns = parent ? parent.ns : 0;
14914
    if (parent && ns === 2) {
14915
      if (parent.tag === "annotation-xml") {
14916
        if (tag === "svg") {
14917
          return 1;
14918
        }
14919
        if (parent.props.some(
14920
          (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
14921
        )) {
14922
          ns = 0;
14923
        }
14924
      } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
14925
        ns = 0;
14926
      }
14927
    } else if (parent && ns === 1) {
14928
      if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
14929
        ns = 0;
14930
      }
14931
    }
14932
    if (ns === 0) {
14933
      if (tag === "svg") {
14934
        return 1;
14935
      }
14936
      if (tag === "math") {
14937
        return 2;
14938
      }
14939
    }
14940
    return ns;
14941
  },
14942
  // https://html.spec.whatwg.org/multipage/parsing.html#parsing-html-fragments
14943
  getTextMode({ tag, ns }) {
14944
    if (ns === 0) {
14945
      if (tag === "textarea" || tag === "title") {
14946
        return 1;
14947
      }
14948
      if (isRawTextContainer(tag)) {
14949
        return 2;
14950
      }
14951
    }
14952
    return 0;
14953
  }
14954
};
14955
 
14956
const transformStyle = (node) => {
14957
  if (node.type === 1) {
14958
    node.props.forEach((p, i) => {
14959
      if (p.type === 6 && p.name === "style" && p.value) {
14960
        node.props[i] = {
14961
          type: 7,
14962
          name: `bind`,
14963
          arg: createSimpleExpression(`style`, true, p.loc),
14964
          exp: parseInlineCSS(p.value.content, p.loc),
14965
          modifiers: [],
14966
          loc: p.loc
14967
        };
14968
      }
14969
    });
14970
  }
14971
};
14972
const parseInlineCSS = (cssText, loc) => {
14973
  const normalized = parseStringStyle(cssText);
14974
  return createSimpleExpression(
14975
    JSON.stringify(normalized),
14976
    false,
14977
    loc,
14978
    3
14979
  );
14980
};
14981
 
14982
function createDOMCompilerError(code, loc) {
14983
  return createCompilerError(
14984
    code,
14985
    loc,
14986
    DOMErrorMessages
14987
  );
14988
}
14989
const DOMErrorMessages = {
14990
  [53]: `v-html is missing expression.`,
14991
  [54]: `v-html will override element children.`,
14992
  [55]: `v-text is missing expression.`,
14993
  [56]: `v-text will override element children.`,
14994
  [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
14995
  [58]: `v-model argument is not supported on plain elements.`,
14996
  [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
14997
  [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
14998
  [61]: `v-show is missing expression.`,
14999
  [62]: `<Transition> expects exactly one child element or component.`,
15000
  [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
15001
};
15002
 
15003
const transformVHtml = (dir, node, context) => {
15004
  const { exp, loc } = dir;
15005
  if (!exp) {
15006
    context.onError(
15007
      createDOMCompilerError(53, loc)
15008
    );
15009
  }
15010
  if (node.children.length) {
15011
    context.onError(
15012
      createDOMCompilerError(54, loc)
15013
    );
15014
    node.children.length = 0;
15015
  }
15016
  return {
15017
    props: [
15018
      createObjectProperty(
15019
        createSimpleExpression(`innerHTML`, true, loc),
15020
        exp || createSimpleExpression("", true)
15021
      )
15022
    ]
15023
  };
15024
};
15025
 
15026
const transformVText = (dir, node, context) => {
15027
  const { exp, loc } = dir;
15028
  if (!exp) {
15029
    context.onError(
15030
      createDOMCompilerError(55, loc)
15031
    );
15032
  }
15033
  if (node.children.length) {
15034
    context.onError(
15035
      createDOMCompilerError(56, loc)
15036
    );
15037
    node.children.length = 0;
15038
  }
15039
  return {
15040
    props: [
15041
      createObjectProperty(
15042
        createSimpleExpression(`textContent`, true),
15043
        exp ? getConstantType(exp, context) > 0 ? exp : createCallExpression(
15044
          context.helperString(TO_DISPLAY_STRING),
15045
          [exp],
15046
          loc
15047
        ) : createSimpleExpression("", true)
15048
      )
15049
    ]
15050
  };
15051
};
15052
 
15053
const transformModel = (dir, node, context) => {
15054
  const baseResult = transformModel$1(dir, node, context);
15055
  if (!baseResult.props.length || node.tagType === 1) {
15056
    return baseResult;
15057
  }
15058
  if (dir.arg) {
15059
    context.onError(
15060
      createDOMCompilerError(
15061
        58,
15062
        dir.arg.loc
15063
      )
15064
    );
15065
  }
15066
  function checkDuplicatedValue() {
15067
    const value = findProp(node, "value");
15068
    if (value) {
15069
      context.onError(
15070
        createDOMCompilerError(
15071
          60,
15072
          value.loc
15073
        )
15074
      );
15075
    }
15076
  }
15077
  const { tag } = node;
15078
  const isCustomElement = context.isCustomElement(tag);
15079
  if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) {
15080
    let directiveToUse = V_MODEL_TEXT;
15081
    let isInvalidType = false;
15082
    if (tag === "input" || isCustomElement) {
15083
      const type = findProp(node, `type`);
15084
      if (type) {
15085
        if (type.type === 7) {
15086
          directiveToUse = V_MODEL_DYNAMIC;
15087
        } else if (type.value) {
15088
          switch (type.value.content) {
15089
            case "radio":
15090
              directiveToUse = V_MODEL_RADIO;
15091
              break;
15092
            case "checkbox":
15093
              directiveToUse = V_MODEL_CHECKBOX;
15094
              break;
15095
            case "file":
15096
              isInvalidType = true;
15097
              context.onError(
15098
                createDOMCompilerError(
15099
                  59,
15100
                  dir.loc
15101
                )
15102
              );
15103
              break;
15104
            default:
15105
              checkDuplicatedValue();
15106
              break;
15107
          }
15108
        }
15109
      } else if (hasDynamicKeyVBind(node)) {
15110
        directiveToUse = V_MODEL_DYNAMIC;
15111
      } else {
15112
        checkDuplicatedValue();
15113
      }
15114
    } else if (tag === "select") {
15115
      directiveToUse = V_MODEL_SELECT;
15116
    } else {
15117
      checkDuplicatedValue();
15118
    }
15119
    if (!isInvalidType) {
15120
      baseResult.needRuntime = context.helper(directiveToUse);
15121
    }
15122
  } else {
15123
    context.onError(
15124
      createDOMCompilerError(
15125
        57,
15126
        dir.loc
15127
      )
15128
    );
15129
  }
15130
  baseResult.props = baseResult.props.filter(
15131
    (p) => !(p.key.type === 4 && p.key.content === "modelValue")
15132
  );
15133
  return baseResult;
15134
};
15135
 
15136
const isEventOptionModifier = /* @__PURE__ */ makeMap(`passive,once,capture`);
15137
const isNonKeyModifier = /* @__PURE__ */ makeMap(
15138
  // event propagation management
15139
  `stop,prevent,self,ctrl,shift,alt,meta,exact,middle`
15140
);
15141
const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right");
15142
const isKeyboardEvent = /* @__PURE__ */ makeMap(
15143
  `onkeyup,onkeydown,onkeypress`,
15144
  true
15145
);
15146
const resolveModifiers = (key, modifiers, context, loc) => {
15147
  const keyModifiers = [];
15148
  const nonKeyModifiers = [];
15149
  const eventOptionModifiers = [];
15150
  for (let i = 0; i < modifiers.length; i++) {
15151
    const modifier = modifiers[i];
15152
    if (isEventOptionModifier(modifier)) {
15153
      eventOptionModifiers.push(modifier);
15154
    } else {
15155
      if (maybeKeyModifier(modifier)) {
15156
        if (isStaticExp(key)) {
15157
          if (isKeyboardEvent(key.content)) {
15158
            keyModifiers.push(modifier);
15159
          } else {
15160
            nonKeyModifiers.push(modifier);
15161
          }
15162
        } else {
15163
          keyModifiers.push(modifier);
15164
          nonKeyModifiers.push(modifier);
15165
        }
15166
      } else {
15167
        if (isNonKeyModifier(modifier)) {
15168
          nonKeyModifiers.push(modifier);
15169
        } else {
15170
          keyModifiers.push(modifier);
15171
        }
15172
      }
15173
    }
15174
  }
15175
  return {
15176
    keyModifiers,
15177
    nonKeyModifiers,
15178
    eventOptionModifiers
15179
  };
15180
};
15181
const transformClick = (key, event) => {
15182
  const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick";
15183
  return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([
15184
    `(`,
15185
    key,
15186
    `) === "onClick" ? "${event}" : (`,
15187
    key,
15188
    `)`
15189
  ]) : key;
15190
};
15191
const transformOn = (dir, node, context) => {
15192
  return transformOn$1(dir, node, context, (baseResult) => {
15193
    const { modifiers } = dir;
15194
    if (!modifiers.length)
15195
      return baseResult;
15196
    let { key, value: handlerExp } = baseResult.props[0];
15197
    const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
15198
    if (nonKeyModifiers.includes("right")) {
15199
      key = transformClick(key, `onContextmenu`);
15200
    }
15201
    if (nonKeyModifiers.includes("middle")) {
15202
      key = transformClick(key, `onMouseup`);
15203
    }
15204
    if (nonKeyModifiers.length) {
15205
      handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [
15206
        handlerExp,
15207
        JSON.stringify(nonKeyModifiers)
15208
      ]);
15209
    }
15210
    if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard
15211
    (!isStaticExp(key) || isKeyboardEvent(key.content))) {
15212
      handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [
15213
        handlerExp,
15214
        JSON.stringify(keyModifiers)
15215
      ]);
15216
    }
15217
    if (eventOptionModifiers.length) {
15218
      const modifierPostfix = eventOptionModifiers.map(capitalize).join("");
15219
      key = isStaticExp(key) ? createSimpleExpression(`${key.content}${modifierPostfix}`, true) : createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]);
15220
    }
15221
    return {
15222
      props: [createObjectProperty(key, handlerExp)]
15223
    };
15224
  });
15225
};
15226
 
15227
const transformShow = (dir, node, context) => {
15228
  const { exp, loc } = dir;
15229
  if (!exp) {
15230
    context.onError(
15231
      createDOMCompilerError(61, loc)
15232
    );
15233
  }
15234
  return {
15235
    props: [],
15236
    needRuntime: context.helper(V_SHOW)
15237
  };
15238
};
15239
 
15240
const transformTransition = (node, context) => {
15241
  if (node.type === 1 && node.tagType === 1) {
15242
    const component = context.isBuiltInComponent(node.tag);
15243
    if (component === TRANSITION) {
15244
      return () => {
15245
        if (!node.children.length) {
15246
          return;
15247
        }
15248
        if (hasMultipleChildren(node)) {
15249
          context.onError(
15250
            createDOMCompilerError(
15251
              62,
15252
              {
15253
                start: node.children[0].loc.start,
15254
                end: node.children[node.children.length - 1].loc.end,
15255
                source: ""
15256
              }
15257
            )
15258
          );
15259
        }
15260
        const child = node.children[0];
15261
        if (child.type === 1) {
15262
          for (const p of child.props) {
15263
            if (p.type === 7 && p.name === "show") {
15264
              node.props.push({
15265
                type: 6,
15266
                name: "persisted",
15267
                value: void 0,
15268
                loc: node.loc
15269
              });
15270
            }
15271
          }
15272
        }
15273
      };
15274
    }
15275
  }
15276
};
15277
function hasMultipleChildren(node) {
15278
  const children = node.children = node.children.filter(
15279
    (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim())
15280
  );
15281
  const child = children[0];
15282
  return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren);
15283
}
15284
 
15285
const ignoreSideEffectTags = (node, context) => {
15286
  if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
15287
    context.onError(
15288
      createDOMCompilerError(
15289
        63,
15290
        node.loc
15291
      )
15292
    );
15293
    context.removeNode();
15294
  }
15295
};
15296
 
15297
const DOMNodeTransforms = [
15298
  transformStyle,
15299
  ...[transformTransition]
15300
];
15301
const DOMDirectiveTransforms = {
15302
  cloak: noopDirectiveTransform,
15303
  html: transformVHtml,
15304
  text: transformVText,
15305
  model: transformModel,
15306
  // override compiler-core
15307
  on: transformOn,
15308
  // override compiler-core
15309
  show: transformShow
15310
};
15311
function compile(template, options = {}) {
15312
  return baseCompile(
15313
    template,
15314
    extend({}, parserOptions, options, {
15315
      nodeTransforms: [
15316
        // ignore <script> and <tag>
15317
        // this is not put inside DOMNodeTransforms because that list is used
15318
        // by compiler-ssr to generate vnode fallback branches
15319
        ignoreSideEffectTags,
15320
        ...DOMNodeTransforms,
15321
        ...options.nodeTransforms || []
15322
      ],
15323
      directiveTransforms: extend(
15324
        {},
15325
        DOMDirectiveTransforms,
15326
        options.directiveTransforms || {}
15327
      ),
15328
      transformHoist: null
15329
    })
15330
  );
15331
}
15332
 
15333
{
15334
  initDev();
15335
}
15336
const compileCache = /* @__PURE__ */ Object.create(null);
15337
function compileToFunction(template, options) {
15338
  if (!isString(template)) {
15339
    if (template.nodeType) {
15340
      template = template.innerHTML;
15341
    } else {
15342
      warn(`invalid template option: `, template);
15343
      return NOOP;
15344
    }
15345
  }
15346
  const key = template;
15347
  const cached = compileCache[key];
15348
  if (cached) {
15349
    return cached;
15350
  }
15351
  if (template[0] === "#") {
15352
    const el = document.querySelector(template);
15353
    if (!el) {
15354
      warn(`Template element not found or is empty: ${template}`);
15355
    }
15356
    template = el ? el.innerHTML : ``;
15357
  }
15358
  const opts = extend(
15359
    {
15360
      hoistStatic: true,
15361
      onError: onError ,
15362
      onWarn: (e) => onError(e, true)
15363
    },
15364
    options
15365
  );
15366
  if (!opts.isCustomElement && typeof customElements !== "undefined") {
15367
    opts.isCustomElement = (tag) => !!customElements.get(tag);
15368
  }
15369
  const { code } = compile(template, opts);
15370
  function onError(err, asWarning = false) {
15371
    const message = asWarning ? err.message : `Template compilation error: ${err.message}`;
15372
    const codeFrame = err.loc && generateCodeFrame(
15373
      template,
15374
      err.loc.start.offset,
15375
      err.loc.end.offset
15376
    );
15377
    warn(codeFrame ? `${message}
15378
${codeFrame}` : message);
15379
  }
15380
  const render = new Function("Vue", code)(runtimeDom);
15381
  render._rc = true;
15382
  return compileCache[key] = render;
15383
}
15384
registerRuntimeCompiler(compileToFunction);
15385
 
15386
export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };