3 * (c) 2018-present Yuxi (Evan) You and Vue contributors
6 var Vue = (function (exports) {
9 /*! #__NO_SIDE_EFFECTS__ */
10 // @__NO_SIDE_EFFECTS__
11 function makeMap(str, expectsLowerCase) {
12 const set = new Set(str.split(","));
13 return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
16 const EMPTY_OBJ = Object.freeze({}) ;
17 const EMPTY_ARR = Object.freeze([]) ;
20 const NO = () => false;
21 const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
22 (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
23 const isModelListener = (key) => key.startsWith("onUpdate:");
24 const extend = Object.assign;
25 const remove = (arr, el) => {
26 const i = arr.indexOf(el);
31 const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
32 const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
33 const isArray = Array.isArray;
34 const isMap = (val) => toTypeString(val) === "[object Map]";
35 const isSet = (val) => toTypeString(val) === "[object Set]";
36 const isDate = (val) => toTypeString(val) === "[object Date]";
37 const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
38 const isFunction = (val) => typeof val === "function";
39 const isString = (val) => typeof val === "string";
40 const isSymbol = (val) => typeof val === "symbol";
41 const isObject = (val) => val !== null && typeof val === "object";
42 const isPromise = (val) => {
43 return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
45 const objectToString = Object.prototype.toString;
46 const toTypeString = (value) => objectToString.call(value);
47 const toRawType = (value) => {
48 return toTypeString(value).slice(8, -1);
50 const isPlainObject = (val) => toTypeString(val) === "[object Object]";
51 const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
52 const isReservedProp = /* @__PURE__ */ makeMap(
53 // the leading comma is intentional so empty string "" is also included
54 ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
56 const isBuiltInDirective = /* @__PURE__ */ makeMap(
57 "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
59 const cacheStringFunction = (fn) => {
60 const cache = /* @__PURE__ */ Object.create(null);
62 const hit = cache[str];
63 return hit || (cache[str] = fn(str));
66 const camelizeRE = /-(\w)/g;
67 const camelize = cacheStringFunction((str) => {
68 return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
70 const hyphenateRE = /\B([A-Z])/g;
71 const hyphenate = cacheStringFunction(
72 (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
74 const capitalize = cacheStringFunction((str) => {
75 return str.charAt(0).toUpperCase() + str.slice(1);
77 const toHandlerKey = cacheStringFunction((str) => {
78 const s = str ? `on${capitalize(str)}` : ``;
81 const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
82 const invokeArrayFns = (fns, arg) => {
83 for (let i = 0; i < fns.length; i++) {
87 const def = (obj, key, value, writable = false) => {
88 Object.defineProperty(obj, key, {
95 const looseToNumber = (val) => {
96 const n = parseFloat(val);
97 return isNaN(n) ? val : n;
99 const toNumber = (val) => {
100 const n = isString(val) ? Number(val) : NaN;
101 return isNaN(n) ? val : n;
104 const getGlobalThis = () => {
105 return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
108 const PatchFlagNames = {
114 [32]: `NEED_HYDRATION`,
115 [64]: `STABLE_FRAGMENT`,
116 [128]: `KEYED_FRAGMENT`,
117 [256]: `UNKEYED_FRAGMENT`,
119 [1024]: `DYNAMIC_SLOTS`,
120 [2048]: `DEV_ROOT_FRAGMENT`,
125 const slotFlagsText = {
131 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,Error";
132 const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
135 function generateCodeFrame(source, start = 0, end = source.length) {
136 let lines = source.split(/(\r?\n)/);
137 const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
138 lines = lines.filter((_, idx) => idx % 2 === 0);
141 for (let i = 0; i < lines.length; i++) {
142 count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);
143 if (count >= start) {
144 for (let j = i - range; j <= i + range || end > count; j++) {
145 if (j < 0 || j >= lines.length)
149 `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`
151 const lineLength = lines[j].length;
152 const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;
154 const pad = start - (count - (lineLength + newLineSeqLength));
155 const length = Math.max(
157 end > count ? lineLength - pad : end - start
159 res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
162 const length = Math.max(Math.min(end - count, lineLength), 1);
163 res.push(` | ` + "^".repeat(length));
165 count += lineLength + newLineSeqLength;
171 return res.join("\n");
174 function normalizeStyle(value) {
175 if (isArray(value)) {
177 for (let i = 0; i < value.length; i++) {
178 const item = value[i];
179 const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
181 for (const key in normalized) {
182 res[key] = normalized[key];
187 } else if (isString(value) || isObject(value)) {
191 const listDelimiterRE = /;(?![^(]*\))/g;
192 const propertyDelimiterRE = /:([^]+)/;
193 const styleCommentRE = /\/\*[^]*?\*\//g;
194 function parseStringStyle(cssText) {
196 cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
198 const tmp = item.split(propertyDelimiterRE);
199 tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
204 function stringifyStyle(styles) {
206 if (!styles || isString(styles)) {
209 for (const key in styles) {
210 const value = styles[key];
211 if (isString(value) || typeof value === "number") {
212 const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
213 ret += `${normalizedKey}:${value};`;
218 function normalizeClass(value) {
220 if (isString(value)) {
222 } else if (isArray(value)) {
223 for (let i = 0; i < value.length; i++) {
224 const normalized = normalizeClass(value[i]);
226 res += normalized + " ";
229 } else if (isObject(value)) {
230 for (const name in value) {
238 function normalizeProps(props) {
241 let { class: klass, style } = props;
242 if (klass && !isString(klass)) {
243 props.class = normalizeClass(klass);
246 props.style = normalizeStyle(style);
251 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";
252 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";
253 const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
254 const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
255 const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
256 const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
257 const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
258 const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
260 const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
261 const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
262 const isBooleanAttr = /* @__PURE__ */ makeMap(
263 specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
265 function includeBooleanAttr(value) {
266 return !!value || value === "";
268 const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
269 `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
271 const isKnownSvgAttr = /* @__PURE__ */ makeMap(
272 `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
274 function isRenderableAttrValue(value) {
278 const type = typeof value;
279 return type === "string" || type === "number" || type === "boolean";
282 function looseCompareArrays(a, b) {
283 if (a.length !== b.length)
286 for (let i = 0; equal && i < a.length; i++) {
287 equal = looseEqual(a[i], b[i]);
291 function looseEqual(a, b) {
294 let aValidType = isDate(a);
295 let bValidType = isDate(b);
296 if (aValidType || bValidType) {
297 return aValidType && bValidType ? a.getTime() === b.getTime() : false;
299 aValidType = isSymbol(a);
300 bValidType = isSymbol(b);
301 if (aValidType || bValidType) {
304 aValidType = isArray(a);
305 bValidType = isArray(b);
306 if (aValidType || bValidType) {
307 return aValidType && bValidType ? looseCompareArrays(a, b) : false;
309 aValidType = isObject(a);
310 bValidType = isObject(b);
311 if (aValidType || bValidType) {
312 if (!aValidType || !bValidType) {
315 const aKeysCount = Object.keys(a).length;
316 const bKeysCount = Object.keys(b).length;
317 if (aKeysCount !== bKeysCount) {
320 for (const key in a) {
321 const aHasKey = a.hasOwnProperty(key);
322 const bHasKey = b.hasOwnProperty(key);
323 if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
328 return String(a) === String(b);
330 function looseIndexOf(arr, val) {
331 return arr.findIndex((item) => looseEqual(item, val));
334 const toDisplayString = (val) => {
335 return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
337 const replacer = (_key, val) => {
338 if (val && val.__v_isRef) {
339 return replacer(_key, val.value);
340 } else if (isMap(val)) {
342 [`Map(${val.size})`]: [...val.entries()].reduce(
343 (entries, [key, val2], i) => {
344 entries[stringifySymbol(key, i) + " =>"] = val2;
350 } else if (isSet(val)) {
352 [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
354 } else if (isSymbol(val)) {
355 return stringifySymbol(val);
356 } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
361 const stringifySymbol = (v, i = "") => {
364 // Symbol.description in es2019+ so we need to cast here to pass
365 // the lib: es2016 check
366 isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
370 function warn$2(msg, ...args) {
371 console.warn(`[Vue warn] ${msg}`, ...args);
374 let activeEffectScope;
376 constructor(detached = false) {
377 this.detached = detached;
390 this.parent = activeEffectScope;
391 if (!detached && activeEffectScope) {
392 this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
402 const currentEffectScope = activeEffectScope;
404 activeEffectScope = this;
407 activeEffectScope = currentEffectScope;
410 warn$2(`cannot run an inactive effect scope.`);
414 * This should only be called on non-detached scopes
418 activeEffectScope = this;
421 * This should only be called on non-detached scopes
425 activeEffectScope = this.parent;
430 for (i = 0, l = this.effects.length; i < l; i++) {
431 this.effects[i].stop();
433 for (i = 0, l = this.cleanups.length; i < l; i++) {
437 for (i = 0, l = this.scopes.length; i < l; i++) {
438 this.scopes[i].stop(true);
441 if (!this.detached && this.parent && !fromParent) {
442 const last = this.parent.scopes.pop();
443 if (last && last !== this) {
444 this.parent.scopes[this.index] = last;
445 last.index = this.index;
448 this.parent = void 0;
449 this._active = false;
453 function effectScope(detached) {
454 return new EffectScope(detached);
456 function recordEffectScope(effect, scope = activeEffectScope) {
457 if (scope && scope.active) {
458 scope.effects.push(effect);
461 function getCurrentScope() {
462 return activeEffectScope;
464 function onScopeDispose(fn) {
465 if (activeEffectScope) {
466 activeEffectScope.cleanups.push(fn);
469 `onScopeDispose() is called when there is no active effect scope to be associated with.`
475 class ReactiveEffect {
476 constructor(fn, trigger, scheduler, scope) {
478 this.trigger = trigger;
479 this.scheduler = scheduler;
485 this._dirtyLevel = 4;
497 this._shouldSchedule = false;
501 this._depsLength = 0;
502 recordEffectScope(this, scope);
505 if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
506 this._dirtyLevel = 1;
508 for (let i = 0; i < this._depsLength; i++) {
509 const dep = this.deps[i];
511 triggerComputed(dep.computed);
512 if (this._dirtyLevel >= 4) {
517 if (this._dirtyLevel === 1) {
518 this._dirtyLevel = 0;
522 return this._dirtyLevel >= 4;
525 this._dirtyLevel = v ? 4 : 0;
528 this._dirtyLevel = 0;
532 let lastShouldTrack = shouldTrack;
533 let lastEffect = activeEffect;
538 preCleanupEffect(this);
541 postCleanupEffect(this);
543 activeEffect = lastEffect;
544 shouldTrack = lastShouldTrack;
549 preCleanupEffect(this);
550 postCleanupEffect(this);
551 this.onStop && this.onStop();
556 function triggerComputed(computed) {
557 return computed.value;
559 function preCleanupEffect(effect2) {
561 effect2._depsLength = 0;
563 function postCleanupEffect(effect2) {
564 if (effect2.deps.length > effect2._depsLength) {
565 for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
566 cleanupDepEffect(effect2.deps[i], effect2);
568 effect2.deps.length = effect2._depsLength;
571 function cleanupDepEffect(dep, effect2) {
572 const trackId = dep.get(effect2);
573 if (trackId !== void 0 && effect2._trackId !== trackId) {
575 if (dep.size === 0) {
580 function effect(fn, options) {
581 if (fn.effect instanceof ReactiveEffect) {
584 const _effect = new ReactiveEffect(fn, NOOP, () => {
590 extend(_effect, options);
592 recordEffectScope(_effect, options.scope);
594 if (!options || !options.lazy) {
597 const runner = _effect.run.bind(_effect);
598 runner.effect = _effect;
601 function stop(runner) {
602 runner.effect.stop();
604 let shouldTrack = true;
605 let pauseScheduleStack = 0;
606 const trackStack = [];
607 function pauseTracking() {
608 trackStack.push(shouldTrack);
611 function resetTracking() {
612 const last = trackStack.pop();
613 shouldTrack = last === void 0 ? true : last;
615 function pauseScheduling() {
616 pauseScheduleStack++;
618 function resetScheduling() {
619 pauseScheduleStack--;
620 while (!pauseScheduleStack && queueEffectSchedulers.length) {
621 queueEffectSchedulers.shift()();
624 function trackEffect(effect2, dep, debuggerEventExtraInfo) {
626 if (dep.get(effect2) !== effect2._trackId) {
627 dep.set(effect2, effect2._trackId);
628 const oldDep = effect2.deps[effect2._depsLength];
629 if (oldDep !== dep) {
631 cleanupDepEffect(oldDep, effect2);
633 effect2.deps[effect2._depsLength++] = dep;
635 effect2._depsLength++;
638 (_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
642 const queueEffectSchedulers = [];
643 function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
646 for (const effect2 of dep.keys()) {
648 if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
649 effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
650 effect2._dirtyLevel = dirtyLevel;
652 if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
654 (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
657 if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
658 effect2._shouldSchedule = false;
659 if (effect2.scheduler) {
660 queueEffectSchedulers.push(effect2.scheduler);
668 const createDep = (cleanup, computed) => {
669 const dep = /* @__PURE__ */ new Map();
670 dep.cleanup = cleanup;
671 dep.computed = computed;
675 const targetMap = /* @__PURE__ */ new WeakMap();
676 const ITERATE_KEY = Symbol("iterate" );
677 const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" );
678 function track(target, type, key) {
679 if (shouldTrack && activeEffect) {
680 let depsMap = targetMap.get(target);
682 targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
684 let dep = depsMap.get(key);
686 depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
699 function trigger(target, type, key, newValue, oldValue, oldTarget) {
700 const depsMap = targetMap.get(target);
705 if (type === "clear") {
706 deps = [...depsMap.values()];
707 } else if (key === "length" && isArray(target)) {
708 const newLength = Number(newValue);
709 depsMap.forEach((dep, key2) => {
710 if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
715 if (key !== void 0) {
716 deps.push(depsMap.get(key));
720 if (!isArray(target)) {
721 deps.push(depsMap.get(ITERATE_KEY));
723 deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
725 } else if (isIntegerKey(key)) {
726 deps.push(depsMap.get("length"));
730 if (!isArray(target)) {
731 deps.push(depsMap.get(ITERATE_KEY));
733 deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
739 deps.push(depsMap.get(ITERATE_KEY));
745 for (const dep of deps) {
763 function getDepFromReactive(object, key) {
764 const depsMap = targetMap.get(object);
765 return depsMap && depsMap.get(key);
768 const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
769 const builtInSymbols = new Set(
770 /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
772 const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
773 function createArrayInstrumentations() {
774 const instrumentations = {};
775 ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
776 instrumentations[key] = function(...args) {
777 const arr = toRaw(this);
778 for (let i = 0, l = this.length; i < l; i++) {
779 track(arr, "get", i + "");
781 const res = arr[key](...args);
782 if (res === -1 || res === false) {
783 return arr[key](...args.map(toRaw));
789 ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
790 instrumentations[key] = function(...args) {
793 const res = toRaw(this)[key].apply(this, args);
799 return instrumentations;
801 function hasOwnProperty(key) {
804 const obj = toRaw(this);
805 track(obj, "has", key);
806 return obj.hasOwnProperty(key);
808 class BaseReactiveHandler {
809 constructor(_isReadonly = false, _isShallow = false) {
810 this._isReadonly = _isReadonly;
811 this._isShallow = _isShallow;
813 get(target, key, receiver) {
814 const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
815 if (key === "__v_isReactive") {
817 } else if (key === "__v_isReadonly") {
819 } else if (key === "__v_isShallow") {
821 } else if (key === "__v_raw") {
822 if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
823 // this means the reciever is a user proxy of the reactive proxy
824 Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
829 const targetIsArray = isArray(target);
831 if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
832 return Reflect.get(arrayInstrumentations, key, receiver);
834 if (key === "hasOwnProperty") {
835 return hasOwnProperty;
838 const res = Reflect.get(target, key, receiver);
839 if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
843 track(target, "get", key);
849 return targetIsArray && isIntegerKey(key) ? res : res.value;
852 return isReadonly2 ? readonly(res) : reactive(res);
857 class MutableReactiveHandler extends BaseReactiveHandler {
858 constructor(isShallow2 = false) {
859 super(false, isShallow2);
861 set(target, key, value, receiver) {
862 let oldValue = target[key];
863 if (!this._isShallow) {
864 const isOldValueReadonly = isReadonly(oldValue);
865 if (!isShallow(value) && !isReadonly(value)) {
866 oldValue = toRaw(oldValue);
867 value = toRaw(value);
869 if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
870 if (isOldValueReadonly) {
873 oldValue.value = value;
878 const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
879 const result = Reflect.set(target, key, value, receiver);
880 if (target === toRaw(receiver)) {
882 trigger(target, "add", key, value);
883 } else if (hasChanged(value, oldValue)) {
884 trigger(target, "set", key, value, oldValue);
889 deleteProperty(target, key) {
890 const hadKey = hasOwn(target, key);
891 const oldValue = target[key];
892 const result = Reflect.deleteProperty(target, key);
893 if (result && hadKey) {
894 trigger(target, "delete", key, void 0, oldValue);
899 const result = Reflect.has(target, key);
900 if (!isSymbol(key) || !builtInSymbols.has(key)) {
901 track(target, "has", key);
909 isArray(target) ? "length" : ITERATE_KEY
911 return Reflect.ownKeys(target);
914 class ReadonlyReactiveHandler extends BaseReactiveHandler {
915 constructor(isShallow2 = false) {
916 super(true, isShallow2);
921 `Set operation on key "${String(key)}" failed: target is readonly.`,
927 deleteProperty(target, key) {
930 `Delete operation on key "${String(key)}" failed: target is readonly.`,
937 const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
938 const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
939 const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
942 const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
944 const toShallow = (value) => value;
945 const getProto = (v) => Reflect.getPrototypeOf(v);
946 function get(target, key, isReadonly = false, isShallow = false) {
947 target = target["__v_raw"];
948 const rawTarget = toRaw(target);
949 const rawKey = toRaw(key);
951 if (hasChanged(key, rawKey)) {
952 track(rawTarget, "get", key);
954 track(rawTarget, "get", rawKey);
956 const { has: has2 } = getProto(rawTarget);
957 const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
958 if (has2.call(rawTarget, key)) {
959 return wrap(target.get(key));
960 } else if (has2.call(rawTarget, rawKey)) {
961 return wrap(target.get(rawKey));
962 } else if (target !== rawTarget) {
966 function has(key, isReadonly = false) {
967 const target = this["__v_raw"];
968 const rawTarget = toRaw(target);
969 const rawKey = toRaw(key);
971 if (hasChanged(key, rawKey)) {
972 track(rawTarget, "has", key);
974 track(rawTarget, "has", rawKey);
976 return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
978 function size(target, isReadonly = false) {
979 target = target["__v_raw"];
980 !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY);
981 return Reflect.get(target, "size", target);
983 function add(value) {
984 value = toRaw(value);
985 const target = toRaw(this);
986 const proto = getProto(target);
987 const hadKey = proto.has.call(target, value);
990 trigger(target, "add", value, value);
994 function set(key, value) {
995 value = toRaw(value);
996 const target = toRaw(this);
997 const { has: has2, get: get2 } = getProto(target);
998 let hadKey = has2.call(target, key);
1001 hadKey = has2.call(target, key);
1003 checkIdentityKeys(target, has2, key);
1005 const oldValue = get2.call(target, key);
1006 target.set(key, value);
1008 trigger(target, "add", key, value);
1009 } else if (hasChanged(value, oldValue)) {
1010 trigger(target, "set", key, value, oldValue);
1014 function deleteEntry(key) {
1015 const target = toRaw(this);
1016 const { has: has2, get: get2 } = getProto(target);
1017 let hadKey = has2.call(target, key);
1020 hadKey = has2.call(target, key);
1022 checkIdentityKeys(target, has2, key);
1024 const oldValue = get2 ? get2.call(target, key) : void 0;
1025 const result = target.delete(key);
1027 trigger(target, "delete", key, void 0, oldValue);
1032 const target = toRaw(this);
1033 const hadItems = target.size !== 0;
1034 const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
1035 const result = target.clear();
1037 trigger(target, "clear", void 0, void 0, oldTarget);
1041 function createForEach(isReadonly, isShallow) {
1042 return function forEach(callback, thisArg) {
1043 const observed = this;
1044 const target = observed["__v_raw"];
1045 const rawTarget = toRaw(target);
1046 const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
1047 !isReadonly && track(rawTarget, "iterate", ITERATE_KEY);
1048 return target.forEach((value, key) => {
1049 return callback.call(thisArg, wrap(value), wrap(key), observed);
1053 function createIterableMethod(method, isReadonly, isShallow) {
1054 return function(...args) {
1055 const target = this["__v_raw"];
1056 const rawTarget = toRaw(target);
1057 const targetIsMap = isMap(rawTarget);
1058 const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
1059 const isKeyOnly = method === "keys" && targetIsMap;
1060 const innerIterator = target[method](...args);
1061 const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
1062 !isReadonly && track(
1065 isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
1068 // iterator protocol
1070 const { value, done } = innerIterator.next();
1071 return done ? { value, done } : {
1072 value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
1076 // iterable protocol
1077 [Symbol.iterator]() {
1083 function createReadonlyMethod(type) {
1084 return function(...args) {
1086 const key = args[0] ? `on key "${args[0]}" ` : ``;
1088 `${capitalize(type)} operation ${key}failed: target is readonly.`,
1092 return type === "delete" ? false : type === "clear" ? void 0 : this;
1095 function createInstrumentations() {
1096 const mutableInstrumentations2 = {
1098 return get(this, key);
1106 delete: deleteEntry,
1108 forEach: createForEach(false, false)
1110 const shallowInstrumentations2 = {
1112 return get(this, key, false, true);
1120 delete: deleteEntry,
1122 forEach: createForEach(false, true)
1124 const readonlyInstrumentations2 = {
1126 return get(this, key, true);
1129 return size(this, true);
1132 return has.call(this, key, true);
1134 add: createReadonlyMethod("add"),
1135 set: createReadonlyMethod("set"),
1136 delete: createReadonlyMethod("delete"),
1137 clear: createReadonlyMethod("clear"),
1138 forEach: createForEach(true, false)
1140 const shallowReadonlyInstrumentations2 = {
1142 return get(this, key, true, true);
1145 return size(this, true);
1148 return has.call(this, key, true);
1150 add: createReadonlyMethod("add"),
1151 set: createReadonlyMethod("set"),
1152 delete: createReadonlyMethod("delete"),
1153 clear: createReadonlyMethod("clear"),
1154 forEach: createForEach(true, true)
1156 const iteratorMethods = [
1162 iteratorMethods.forEach((method) => {
1163 mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1164 readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1165 shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1166 shallowReadonlyInstrumentations2[method] = createIterableMethod(
1173 mutableInstrumentations2,
1174 readonlyInstrumentations2,
1175 shallowInstrumentations2,
1176 shallowReadonlyInstrumentations2
1180 mutableInstrumentations,
1181 readonlyInstrumentations,
1182 shallowInstrumentations,
1183 shallowReadonlyInstrumentations
1184 ] = /* @__PURE__ */ createInstrumentations();
1185 function createInstrumentationGetter(isReadonly, shallow) {
1186 const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations;
1187 return (target, key, receiver) => {
1188 if (key === "__v_isReactive") {
1190 } else if (key === "__v_isReadonly") {
1192 } else if (key === "__v_raw") {
1196 hasOwn(instrumentations, key) && key in target ? instrumentations : target,
1202 const mutableCollectionHandlers = {
1203 get: /* @__PURE__ */ createInstrumentationGetter(false, false)
1205 const shallowCollectionHandlers = {
1206 get: /* @__PURE__ */ createInstrumentationGetter(false, true)
1208 const readonlyCollectionHandlers = {
1209 get: /* @__PURE__ */ createInstrumentationGetter(true, false)
1211 const shallowReadonlyCollectionHandlers = {
1212 get: /* @__PURE__ */ createInstrumentationGetter(true, true)
1214 function checkIdentityKeys(target, has2, key) {
1215 const rawKey = toRaw(key);
1216 if (rawKey !== key && has2.call(target, rawKey)) {
1217 const type = toRawType(target);
1219 `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.`
1224 const reactiveMap = /* @__PURE__ */ new WeakMap();
1225 const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
1226 const readonlyMap = /* @__PURE__ */ new WeakMap();
1227 const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
1228 function targetTypeMap(rawType) {
1232 return 1 /* COMMON */;
1237 return 2 /* COLLECTION */;
1239 return 0 /* INVALID */;
1242 function getTargetType(value) {
1243 return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1245 function reactive(target) {
1246 if (isReadonly(target)) {
1249 return createReactiveObject(
1253 mutableCollectionHandlers,
1257 function shallowReactive(target) {
1258 return createReactiveObject(
1261 shallowReactiveHandlers,
1262 shallowCollectionHandlers,
1266 function readonly(target) {
1267 return createReactiveObject(
1271 readonlyCollectionHandlers,
1275 function shallowReadonly(target) {
1276 return createReactiveObject(
1279 shallowReadonlyHandlers,
1280 shallowReadonlyCollectionHandlers,
1284 function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
1285 if (!isObject(target)) {
1287 warn$2(`value cannot be made reactive: ${String(target)}`);
1291 if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1294 const existingProxy = proxyMap.get(target);
1295 if (existingProxy) {
1296 return existingProxy;
1298 const targetType = getTargetType(target);
1299 if (targetType === 0 /* INVALID */) {
1302 const proxy = new Proxy(
1304 targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
1306 proxyMap.set(target, proxy);
1309 function isReactive(value) {
1310 if (isReadonly(value)) {
1311 return isReactive(value["__v_raw"]);
1313 return !!(value && value["__v_isReactive"]);
1315 function isReadonly(value) {
1316 return !!(value && value["__v_isReadonly"]);
1318 function isShallow(value) {
1319 return !!(value && value["__v_isShallow"]);
1321 function isProxy(value) {
1322 return value ? !!value["__v_raw"] : false;
1324 function toRaw(observed) {
1325 const raw = observed && observed["__v_raw"];
1326 return raw ? toRaw(raw) : observed;
1328 function markRaw(value) {
1329 if (Object.isExtensible(value)) {
1330 def(value, "__v_skip", true);
1334 const toReactive = (value) => isObject(value) ? reactive(value) : value;
1335 const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1337 const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
1338 class ComputedRefImpl {
1339 constructor(getter, _setter, isReadonly, isSSR) {
1340 this.getter = getter;
1341 this._setter = _setter;
1343 this.__v_isRef = true;
1344 this["__v_isReadonly"] = false;
1345 this.effect = new ReactiveEffect(
1346 () => getter(this._value),
1347 () => triggerRefValue(
1349 this.effect._dirtyLevel === 2 ? 2 : 3
1352 this.effect.computed = this;
1353 this.effect.active = this._cacheable = !isSSR;
1354 this["__v_isReadonly"] = isReadonly;
1357 const self = toRaw(this);
1358 if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
1359 triggerRefValue(self, 4);
1361 trackRefValue(self);
1362 if (self.effect._dirtyLevel >= 2) {
1363 if (this._warnRecursive) {
1364 warn$2(COMPUTED_SIDE_EFFECT_WARN, `
1366 getter: `, this.getter);
1368 triggerRefValue(self, 2);
1372 set value(newValue) {
1373 this._setter(newValue);
1375 // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
1377 return this.effect.dirty;
1380 this.effect.dirty = v;
1384 function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1387 const onlyGetter = isFunction(getterOrOptions);
1389 getter = getterOrOptions;
1391 warn$2("Write operation failed: computed value is readonly");
1394 getter = getterOrOptions.get;
1395 setter = getterOrOptions.set;
1397 const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
1398 if (debugOptions && !isSSR) {
1399 cRef.effect.onTrack = debugOptions.onTrack;
1400 cRef.effect.onTrigger = debugOptions.onTrigger;
1405 function trackRefValue(ref2) {
1407 if (shouldTrack && activeEffect) {
1411 (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
1412 () => ref2.dep = void 0,
1413 ref2 instanceof ComputedRefImpl ? ref2 : void 0
1423 function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
1425 const dep = ref2.dep;
1440 return !!(r && r.__v_isRef === true);
1442 function ref(value) {
1443 return createRef(value, false);
1445 function shallowRef(value) {
1446 return createRef(value, true);
1448 function createRef(rawValue, shallow) {
1449 if (isRef(rawValue)) {
1452 return new RefImpl(rawValue, shallow);
1455 constructor(value, __v_isShallow) {
1456 this.__v_isShallow = __v_isShallow;
1458 this.__v_isRef = true;
1459 this._rawValue = __v_isShallow ? value : toRaw(value);
1460 this._value = __v_isShallow ? value : toReactive(value);
1463 trackRefValue(this);
1467 const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
1468 newVal = useDirectValue ? newVal : toRaw(newVal);
1469 if (hasChanged(newVal, this._rawValue)) {
1470 this._rawValue = newVal;
1471 this._value = useDirectValue ? newVal : toReactive(newVal);
1472 triggerRefValue(this, 4, newVal);
1476 function triggerRef(ref2) {
1477 triggerRefValue(ref2, 4, ref2.value );
1479 function unref(ref2) {
1480 return isRef(ref2) ? ref2.value : ref2;
1482 function toValue(source) {
1483 return isFunction(source) ? source() : unref(source);
1485 const shallowUnwrapHandlers = {
1486 get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
1487 set: (target, key, value, receiver) => {
1488 const oldValue = target[key];
1489 if (isRef(oldValue) && !isRef(value)) {
1490 oldValue.value = value;
1493 return Reflect.set(target, key, value, receiver);
1497 function proxyRefs(objectWithRefs) {
1498 return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
1500 class CustomRefImpl {
1501 constructor(factory) {
1503 this.__v_isRef = true;
1504 const { get, set } = factory(
1505 () => trackRefValue(this),
1506 () => triggerRefValue(this)
1518 function customRef(factory) {
1519 return new CustomRefImpl(factory);
1521 function toRefs(object) {
1522 if (!isProxy(object)) {
1523 warn$2(`toRefs() expects a reactive object but received a plain one.`);
1525 const ret = isArray(object) ? new Array(object.length) : {};
1526 for (const key in object) {
1527 ret[key] = propertyToRef(object, key);
1531 class ObjectRefImpl {
1532 constructor(_object, _key, _defaultValue) {
1533 this._object = _object;
1535 this._defaultValue = _defaultValue;
1536 this.__v_isRef = true;
1539 const val = this._object[this._key];
1540 return val === void 0 ? this._defaultValue : val;
1543 this._object[this._key] = newVal;
1546 return getDepFromReactive(toRaw(this._object), this._key);
1549 class GetterRefImpl {
1550 constructor(_getter) {
1551 this._getter = _getter;
1552 this.__v_isRef = true;
1553 this.__v_isReadonly = true;
1556 return this._getter();
1559 function toRef(source, key, defaultValue) {
1560 if (isRef(source)) {
1562 } else if (isFunction(source)) {
1563 return new GetterRefImpl(source);
1564 } else if (isObject(source) && arguments.length > 1) {
1565 return propertyToRef(source, key, defaultValue);
1570 function propertyToRef(source, key, defaultValue) {
1571 const val = source[key];
1572 return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1575 const TrackOpTypes = {
1578 "ITERATE": "iterate"
1580 const TriggerOpTypes = {
1588 function pushWarningContext(vnode) {
1589 stack$1.push(vnode);
1591 function popWarningContext() {
1594 function warn$1(msg, ...args) {
1596 const instance = stack$1.length ? stack$1[stack$1.length - 1].component : null;
1597 const appWarnHandler = instance && instance.appContext.config.warnHandler;
1598 const trace = getComponentTrace();
1599 if (appWarnHandler) {
1600 callWithErrorHandling(
1605 msg + args.map((a) => {
1607 return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
1609 instance && instance.proxy,
1611 ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
1617 const warnArgs = [`[Vue warn]: ${msg}`, ...args];
1618 if (trace.length && // avoid spamming console during tests
1621 `, ...formatTrace(trace));
1623 console.warn(...warnArgs);
1627 function getComponentTrace() {
1628 let currentVNode = stack$1[stack$1.length - 1];
1629 if (!currentVNode) {
1632 const normalizedStack = [];
1633 while (currentVNode) {
1634 const last = normalizedStack[0];
1635 if (last && last.vnode === currentVNode) {
1636 last.recurseCount++;
1638 normalizedStack.push({
1639 vnode: currentVNode,
1643 const parentInstance = currentVNode.component && currentVNode.component.parent;
1644 currentVNode = parentInstance && parentInstance.vnode;
1646 return normalizedStack;
1648 function formatTrace(trace) {
1650 trace.forEach((entry, i) => {
1651 logs.push(...i === 0 ? [] : [`
1652 `], ...formatTraceEntry(entry));
1656 function formatTraceEntry({ vnode, recurseCount }) {
1657 const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
1658 const isRoot = vnode.component ? vnode.component.parent == null : false;
1659 const open = ` at <${formatComponentName(
1664 const close = `>` + postfix;
1665 return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
1667 function formatProps(props) {
1669 const keys = Object.keys(props);
1670 keys.slice(0, 3).forEach((key) => {
1671 res.push(...formatProp(key, props[key]));
1673 if (keys.length > 3) {
1678 function formatProp(key, value, raw) {
1679 if (isString(value)) {
1680 value = JSON.stringify(value);
1681 return raw ? value : [`${key}=${value}`];
1682 } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
1683 return raw ? value : [`${key}=${value}`];
1684 } else if (isRef(value)) {
1685 value = formatProp(key, toRaw(value.value), true);
1686 return raw ? value : [`${key}=Ref<`, value, `>`];
1687 } else if (isFunction(value)) {
1688 return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
1690 value = toRaw(value);
1691 return raw ? value : [`${key}=`, value];
1694 function assertNumber(val, type) {
1695 if (val === void 0) {
1697 } else if (typeof val !== "number") {
1698 warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
1699 } else if (isNaN(val)) {
1700 warn$1(`${type} is NaN - the duration expression might be incorrect.`);
1704 const ErrorCodes = {
1705 "SETUP_FUNCTION": 0,
1706 "0": "SETUP_FUNCTION",
1707 "RENDER_FUNCTION": 1,
1708 "1": "RENDER_FUNCTION",
1710 "2": "WATCH_GETTER",
1711 "WATCH_CALLBACK": 3,
1712 "3": "WATCH_CALLBACK",
1714 "4": "WATCH_CLEANUP",
1715 "NATIVE_EVENT_HANDLER": 5,
1716 "5": "NATIVE_EVENT_HANDLER",
1717 "COMPONENT_EVENT_HANDLER": 6,
1718 "6": "COMPONENT_EVENT_HANDLER",
1721 "DIRECTIVE_HOOK": 8,
1722 "8": "DIRECTIVE_HOOK",
1723 "TRANSITION_HOOK": 9,
1724 "9": "TRANSITION_HOOK",
1725 "APP_ERROR_HANDLER": 10,
1726 "10": "APP_ERROR_HANDLER",
1727 "APP_WARN_HANDLER": 11,
1728 "11": "APP_WARN_HANDLER",
1730 "12": "FUNCTION_REF",
1731 "ASYNC_COMPONENT_LOADER": 13,
1732 "13": "ASYNC_COMPONENT_LOADER",
1736 const ErrorTypeStrings$1 = {
1737 ["sp"]: "serverPrefetch hook",
1738 ["bc"]: "beforeCreate hook",
1739 ["c"]: "created hook",
1740 ["bm"]: "beforeMount hook",
1741 ["m"]: "mounted hook",
1742 ["bu"]: "beforeUpdate hook",
1744 ["bum"]: "beforeUnmount hook",
1745 ["um"]: "unmounted hook",
1746 ["a"]: "activated hook",
1747 ["da"]: "deactivated hook",
1748 ["ec"]: "errorCaptured hook",
1749 ["rtc"]: "renderTracked hook",
1750 ["rtg"]: "renderTriggered hook",
1751 [0]: "setup function",
1752 [1]: "render function",
1753 [2]: "watcher getter",
1754 [3]: "watcher callback",
1755 [4]: "watcher cleanup function",
1756 [5]: "native event handler",
1757 [6]: "component event handler",
1759 [8]: "directive hook",
1760 [9]: "transition hook",
1761 [10]: "app errorHandler",
1762 [11]: "app warnHandler",
1763 [12]: "ref function",
1764 [13]: "async component loader",
1765 [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
1767 function callWithErrorHandling(fn, instance, type, args) {
1769 return args ? fn(...args) : fn();
1771 handleError(err, instance, type);
1774 function callWithAsyncErrorHandling(fn, instance, type, args) {
1775 if (isFunction(fn)) {
1776 const res = callWithErrorHandling(fn, instance, type, args);
1777 if (res && isPromise(res)) {
1778 res.catch((err) => {
1779 handleError(err, instance, type);
1786 for (let i = 0; i < fn.length; i++) {
1787 values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1792 `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
1796 function handleError(err, instance, type, throwInDev = true) {
1797 const contextVNode = instance ? instance.vnode : null;
1799 let cur = instance.parent;
1800 const exposedInstance = instance.proxy;
1801 const errorInfo = ErrorTypeStrings$1[type] ;
1803 const errorCapturedHooks = cur.ec;
1804 if (errorCapturedHooks) {
1805 for (let i = 0; i < errorCapturedHooks.length; i++) {
1806 if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
1813 const appErrorHandler = instance.appContext.config.errorHandler;
1814 if (appErrorHandler) {
1816 callWithErrorHandling(
1820 [err, exposedInstance, errorInfo]
1826 logError(err, type, contextVNode, throwInDev);
1828 function logError(err, type, contextVNode, throwInDev = true) {
1830 const info = ErrorTypeStrings$1[type];
1832 pushWarningContext(contextVNode);
1834 warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
1836 popWarningContext();
1846 let isFlushing = false;
1847 let isFlushPending = false;
1850 const pendingPostFlushCbs = [];
1851 let activePostFlushCbs = null;
1852 let postFlushIndex = 0;
1853 const resolvedPromise = /* @__PURE__ */ Promise.resolve();
1854 let currentFlushPromise = null;
1855 const RECURSION_LIMIT = 100;
1856 function nextTick(fn) {
1857 const p = currentFlushPromise || resolvedPromise;
1858 return fn ? p.then(this ? fn.bind(this) : fn) : p;
1860 function findInsertionIndex(id) {
1861 let start = flushIndex + 1;
1862 let end = queue.length;
1863 while (start < end) {
1864 const middle = start + end >>> 1;
1865 const middleJob = queue[middle];
1866 const middleJobId = getId(middleJob);
1867 if (middleJobId < id || middleJobId === id && middleJob.pre) {
1875 function queueJob(job) {
1876 if (!queue.length || !queue.includes(
1878 isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
1880 if (job.id == null) {
1883 queue.splice(findInsertionIndex(job.id), 0, job);
1888 function queueFlush() {
1889 if (!isFlushing && !isFlushPending) {
1890 isFlushPending = true;
1891 currentFlushPromise = resolvedPromise.then(flushJobs);
1894 function invalidateJob(job) {
1895 const i = queue.indexOf(job);
1896 if (i > flushIndex) {
1900 function queuePostFlushCb(cb) {
1902 if (!activePostFlushCbs || !activePostFlushCbs.includes(
1904 cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
1906 pendingPostFlushCbs.push(cb);
1909 pendingPostFlushCbs.push(...cb);
1913 function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1915 seen = seen || /* @__PURE__ */ new Map();
1917 for (; i < queue.length; i++) {
1918 const cb = queue[i];
1920 if (instance && cb.id !== instance.uid) {
1923 if (checkRecursiveUpdates(seen, cb)) {
1932 function flushPostFlushCbs(seen) {
1933 if (pendingPostFlushCbs.length) {
1934 const deduped = [...new Set(pendingPostFlushCbs)].sort(
1935 (a, b) => getId(a) - getId(b)
1937 pendingPostFlushCbs.length = 0;
1938 if (activePostFlushCbs) {
1939 activePostFlushCbs.push(...deduped);
1942 activePostFlushCbs = deduped;
1944 seen = seen || /* @__PURE__ */ new Map();
1946 for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
1947 if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
1950 activePostFlushCbs[postFlushIndex]();
1952 activePostFlushCbs = null;
1956 const getId = (job) => job.id == null ? Infinity : job.id;
1957 const comparator = (a, b) => {
1958 const diff = getId(a) - getId(b);
1960 if (a.pre && !b.pre)
1962 if (b.pre && !a.pre)
1967 function flushJobs(seen) {
1968 isFlushPending = false;
1971 seen = seen || /* @__PURE__ */ new Map();
1973 queue.sort(comparator);
1974 const check = (job) => checkRecursiveUpdates(seen, job) ;
1976 for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
1977 const job = queue[flushIndex];
1978 if (job && job.active !== false) {
1982 callWithErrorHandling(job, null, 14);
1988 flushPostFlushCbs(seen);
1990 currentFlushPromise = null;
1991 if (queue.length || pendingPostFlushCbs.length) {
1996 function checkRecursiveUpdates(seen, fn) {
1997 if (!seen.has(fn)) {
2000 const count = seen.get(fn);
2001 if (count > RECURSION_LIMIT) {
2002 const instance = fn.ownerInstance;
2003 const componentName = instance && getComponentName(instance.type);
2005 `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.`,
2011 seen.set(fn, count + 1);
2016 let isHmrUpdating = false;
2017 const hmrDirtyComponents = /* @__PURE__ */ new Set();
2019 getGlobalThis().__VUE_HMR_RUNTIME__ = {
2020 createRecord: tryWrap(createRecord),
2021 rerender: tryWrap(rerender),
2022 reload: tryWrap(reload)
2025 const map = /* @__PURE__ */ new Map();
2026 function registerHMR(instance) {
2027 const id = instance.type.__hmrId;
2028 let record = map.get(id);
2030 createRecord(id, instance.type);
2031 record = map.get(id);
2033 record.instances.add(instance);
2035 function unregisterHMR(instance) {
2036 map.get(instance.type.__hmrId).instances.delete(instance);
2038 function createRecord(id, initialDef) {
2043 initialDef: normalizeClassComponent(initialDef),
2044 instances: /* @__PURE__ */ new Set()
2048 function normalizeClassComponent(component) {
2049 return isClassComponent(component) ? component.__vccOpts : component;
2051 function rerender(id, newRender) {
2052 const record = map.get(id);
2056 record.initialDef.render = newRender;
2057 [...record.instances].forEach((instance) => {
2059 instance.render = newRender;
2060 normalizeClassComponent(instance.type).render = newRender;
2062 instance.renderCache = [];
2063 isHmrUpdating = true;
2064 instance.effect.dirty = true;
2066 isHmrUpdating = false;
2069 function reload(id, newComp) {
2070 const record = map.get(id);
2073 newComp = normalizeClassComponent(newComp);
2074 updateComponentDef(record.initialDef, newComp);
2075 const instances = [...record.instances];
2076 for (const instance of instances) {
2077 const oldComp = normalizeClassComponent(instance.type);
2078 if (!hmrDirtyComponents.has(oldComp)) {
2079 if (oldComp !== record.initialDef) {
2080 updateComponentDef(oldComp, newComp);
2082 hmrDirtyComponents.add(oldComp);
2084 instance.appContext.propsCache.delete(instance.type);
2085 instance.appContext.emitsCache.delete(instance.type);
2086 instance.appContext.optionsCache.delete(instance.type);
2087 if (instance.ceReload) {
2088 hmrDirtyComponents.add(oldComp);
2089 instance.ceReload(newComp.styles);
2090 hmrDirtyComponents.delete(oldComp);
2091 } else if (instance.parent) {
2092 instance.parent.effect.dirty = true;
2093 queueJob(instance.parent.update);
2094 } else if (instance.appContext.reload) {
2095 instance.appContext.reload();
2096 } else if (typeof window !== "undefined") {
2097 window.location.reload();
2100 "[HMR] Root or manually mounted instance modified. Full reload required."
2104 queuePostFlushCb(() => {
2105 for (const instance of instances) {
2106 hmrDirtyComponents.delete(
2107 normalizeClassComponent(instance.type)
2112 function updateComponentDef(oldComp, newComp) {
2113 extend(oldComp, newComp);
2114 for (const key in oldComp) {
2115 if (key !== "__file" && !(key in newComp)) {
2116 delete oldComp[key];
2120 function tryWrap(fn) {
2121 return (id, arg) => {
2127 `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
2135 let devtoolsNotInstalled = false;
2136 function emit$1(event, ...args) {
2138 devtools$1.emit(event, ...args);
2139 } else if (!devtoolsNotInstalled) {
2140 buffer.push({ event, args });
2143 function setDevtoolsHook$1(hook, target) {
2147 devtools$1.enabled = true;
2148 buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
2151 // handle late devtools injection - only do this if we are in an actual
2152 // browser environment to avoid the timer handle stalling test runner exit
2154 typeof window !== "undefined" && // some envs mock window but not fully
2155 window.HTMLElement && // also exclude jsdom
2156 !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
2158 const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
2159 replay.push((newHook) => {
2160 setDevtoolsHook$1(newHook, target);
2164 target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
2165 devtoolsNotInstalled = true;
2170 devtoolsNotInstalled = true;
2174 function devtoolsInitApp(app, version) {
2175 emit$1("app:init" /* APP_INIT */, app, version, {
2182 function devtoolsUnmountApp(app) {
2183 emit$1("app:unmount" /* APP_UNMOUNT */, app);
2185 const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
2186 "component:added" /* COMPONENT_ADDED */
2188 const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
2189 const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
2190 "component:removed" /* COMPONENT_REMOVED */
2192 const devtoolsComponentRemoved = (component) => {
2193 if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
2194 !devtools$1.cleanupBuffer(component)) {
2195 _devtoolsComponentRemoved(component);
2198 /*! #__NO_SIDE_EFFECTS__ */
2199 // @__NO_SIDE_EFFECTS__
2200 function createDevtoolsComponentHook(hook) {
2201 return (component) => {
2204 component.appContext.app,
2206 component.parent ? component.parent.uid : void 0,
2211 const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
2212 "perf:start" /* PERFORMANCE_START */
2214 const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
2215 "perf:end" /* PERFORMANCE_END */
2217 function createDevtoolsPerformanceHook(hook) {
2218 return (component, type, time) => {
2219 emit$1(hook, component.appContext.app, component.uid, component, type, time);
2222 function devtoolsComponentEmit(component, event, params) {
2224 "component:emit" /* COMPONENT_EMIT */,
2225 component.appContext.app,
2232 function emit(instance, event, ...rawArgs) {
2233 if (instance.isUnmounted)
2235 const props = instance.vnode.props || EMPTY_OBJ;
2239 propsOptions: [propsOptions]
2242 if (!(event in emitsOptions) && true) {
2243 if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
2245 `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
2249 const validator = emitsOptions[event];
2250 if (isFunction(validator)) {
2251 const isValid = validator(...rawArgs);
2254 `Invalid event arguments: event validation failed for event "${event}".`
2262 const isModelListener = event.startsWith("update:");
2263 const modelArg = isModelListener && event.slice(7);
2264 if (modelArg && modelArg in props) {
2265 const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
2266 const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
2268 args = rawArgs.map((a) => isString(a) ? a.trim() : a);
2271 args = rawArgs.map(looseToNumber);
2275 devtoolsComponentEmit(instance, event, args);
2278 const lowerCaseEvent = event.toLowerCase();
2279 if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
2281 `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
2284 )} 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(
2286 )}" instead of "${event}".`
2291 let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
2292 props[handlerName = toHandlerKey(camelize(event))];
2293 if (!handler && isModelListener) {
2294 handler = props[handlerName = toHandlerKey(hyphenate(event))];
2297 callWithAsyncErrorHandling(
2304 const onceHandler = props[handlerName + `Once`];
2306 if (!instance.emitted) {
2307 instance.emitted = {};
2308 } else if (instance.emitted[handlerName]) {
2311 instance.emitted[handlerName] = true;
2312 callWithAsyncErrorHandling(
2320 function normalizeEmitsOptions(comp, appContext, asMixin = false) {
2321 const cache = appContext.emitsCache;
2322 const cached = cache.get(comp);
2323 if (cached !== void 0) {
2326 const raw = comp.emits;
2327 let normalized = {};
2328 let hasExtends = false;
2329 if (!isFunction(comp)) {
2330 const extendEmits = (raw2) => {
2331 const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
2332 if (normalizedFromExtend) {
2334 extend(normalized, normalizedFromExtend);
2337 if (!asMixin && appContext.mixins.length) {
2338 appContext.mixins.forEach(extendEmits);
2341 extendEmits(comp.extends);
2344 comp.mixins.forEach(extendEmits);
2347 if (!raw && !hasExtends) {
2348 if (isObject(comp)) {
2349 cache.set(comp, null);
2354 raw.forEach((key) => normalized[key] = null);
2356 extend(normalized, raw);
2358 if (isObject(comp)) {
2359 cache.set(comp, normalized);
2363 function isEmitListener(options, key) {
2364 if (!options || !isOn(key)) {
2367 key = key.slice(2).replace(/Once$/, "");
2368 return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
2371 let currentRenderingInstance = null;
2372 let currentScopeId = null;
2373 function setCurrentRenderingInstance(instance) {
2374 const prev = currentRenderingInstance;
2375 currentRenderingInstance = instance;
2376 currentScopeId = instance && instance.type.__scopeId || null;
2379 function pushScopeId(id) {
2380 currentScopeId = id;
2382 function popScopeId() {
2383 currentScopeId = null;
2385 const withScopeId = (_id) => withCtx;
2386 function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
2392 const renderFnWithContext = (...args) => {
2393 if (renderFnWithContext._d) {
2394 setBlockTracking(-1);
2396 const prevInstance = setCurrentRenderingInstance(ctx);
2401 setCurrentRenderingInstance(prevInstance);
2402 if (renderFnWithContext._d) {
2403 setBlockTracking(1);
2407 devtoolsComponentUpdated(ctx);
2411 renderFnWithContext._n = true;
2412 renderFnWithContext._c = true;
2413 renderFnWithContext._d = true;
2414 return renderFnWithContext;
2417 let accessedAttrs = false;
2418 function markAttrsAccessed() {
2419 accessedAttrs = true;
2421 function renderComponentRoot(instance) {
2427 propsOptions: [propsOptions],
2439 const prev = setCurrentRenderingInstance(instance);
2441 let fallthroughAttrs;
2443 accessedAttrs = false;
2446 if (vnode.shapeFlag & 4) {
2447 const proxyToUse = withProxy || proxy;
2448 const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
2449 get(target, key, receiver) {
2451 `Property '${String(
2453 )}' was accessed via 'this'. Avoid using 'this' in templates.`
2455 return Reflect.get(target, key, receiver);
2458 result = normalizeVNode(
2463 true ? shallowReadonly(props) : props,
2469 fallthroughAttrs = attrs;
2471 const render2 = Component;
2472 if (attrs === props) {
2473 markAttrsAccessed();
2475 result = normalizeVNode(
2476 render2.length > 1 ? render2(
2477 true ? shallowReadonly(props) : props,
2480 markAttrsAccessed();
2481 return shallowReadonly(attrs);
2485 } : { attrs, slots, emit }
2487 true ? shallowReadonly(props) : props,
2491 fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
2494 blockStack.length = 0;
2495 handleError(err, instance, 1);
2496 result = createVNode(Comment);
2499 let setRoot = void 0;
2500 if (result.patchFlag > 0 && result.patchFlag & 2048) {
2501 [root, setRoot] = getChildRoot(result);
2503 if (fallthroughAttrs && inheritAttrs !== false) {
2504 const keys = Object.keys(fallthroughAttrs);
2505 const { shapeFlag } = root;
2507 if (shapeFlag & (1 | 6)) {
2508 if (propsOptions && keys.some(isModelListener)) {
2509 fallthroughAttrs = filterModelListeners(
2514 root = cloneVNode(root, fallthroughAttrs, false, true);
2515 } else if (!accessedAttrs && root.type !== Comment) {
2516 const allAttrs = Object.keys(attrs);
2517 const eventAttrs = [];
2518 const extraAttrs = [];
2519 for (let i = 0, l = allAttrs.length; i < l; i++) {
2520 const key = allAttrs[i];
2522 if (!isModelListener(key)) {
2523 eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2526 extraAttrs.push(key);
2529 if (extraAttrs.length) {
2531 `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
2534 if (eventAttrs.length) {
2536 `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.`
2543 if (!isElementRoot(root)) {
2545 `Runtime directive used on component with non-element root node. The directives will not function as intended.`
2548 root = cloneVNode(root, null, false, true);
2549 root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2551 if (vnode.transition) {
2552 if (!isElementRoot(root)) {
2554 `Component inside <Transition> renders non-element root node that cannot be animated.`
2557 root.transition = vnode.transition;
2564 setCurrentRenderingInstance(prev);
2567 const getChildRoot = (vnode) => {
2568 const rawChildren = vnode.children;
2569 const dynamicChildren = vnode.dynamicChildren;
2570 const childRoot = filterSingleRoot(rawChildren, false);
2572 return [vnode, void 0];
2573 } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
2574 return getChildRoot(childRoot);
2576 const index = rawChildren.indexOf(childRoot);
2577 const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
2578 const setRoot = (updatedRoot) => {
2579 rawChildren[index] = updatedRoot;
2580 if (dynamicChildren) {
2581 if (dynamicIndex > -1) {
2582 dynamicChildren[dynamicIndex] = updatedRoot;
2583 } else if (updatedRoot.patchFlag > 0) {
2584 vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
2588 return [normalizeVNode(childRoot), setRoot];
2590 function filterSingleRoot(children, recurse = true) {
2592 for (let i = 0; i < children.length; i++) {
2593 const child = children[i];
2594 if (isVNode(child)) {
2595 if (child.type !== Comment || child.children === "v-if") {
2600 if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
2601 return filterSingleRoot(singleRoot.children);
2611 const getFunctionalFallthrough = (attrs) => {
2613 for (const key in attrs) {
2614 if (key === "class" || key === "style" || isOn(key)) {
2615 (res || (res = {}))[key] = attrs[key];
2620 const filterModelListeners = (attrs, props) => {
2622 for (const key in attrs) {
2623 if (!isModelListener(key) || !(key.slice(9) in props)) {
2624 res[key] = attrs[key];
2629 const isElementRoot = (vnode) => {
2630 return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
2632 function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
2633 const { props: prevProps, children: prevChildren, component } = prevVNode;
2634 const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
2635 const emits = component.emitsOptions;
2636 if ((prevChildren || nextChildren) && isHmrUpdating) {
2639 if (nextVNode.dirs || nextVNode.transition) {
2642 if (optimized && patchFlag >= 0) {
2643 if (patchFlag & 1024) {
2646 if (patchFlag & 16) {
2650 return hasPropsChanged(prevProps, nextProps, emits);
2651 } else if (patchFlag & 8) {
2652 const dynamicProps = nextVNode.dynamicProps;
2653 for (let i = 0; i < dynamicProps.length; i++) {
2654 const key = dynamicProps[i];
2655 if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
2661 if (prevChildren || nextChildren) {
2662 if (!nextChildren || !nextChildren.$stable) {
2666 if (prevProps === nextProps) {
2675 return hasPropsChanged(prevProps, nextProps, emits);
2679 function hasPropsChanged(prevProps, nextProps, emitsOptions) {
2680 const nextKeys = Object.keys(nextProps);
2681 if (nextKeys.length !== Object.keys(prevProps).length) {
2684 for (let i = 0; i < nextKeys.length; i++) {
2685 const key = nextKeys[i];
2686 if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
2692 function updateHOCHostEl({ vnode, parent }, el) {
2694 const root = parent.subTree;
2695 if (root.suspense && root.suspense.activeBranch === vnode) {
2698 if (root === vnode) {
2699 (vnode = parent.vnode).el = el;
2700 parent = parent.parent;
2707 const COMPONENTS = "components";
2708 const DIRECTIVES = "directives";
2709 function resolveComponent(name, maybeSelfReference) {
2710 return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
2712 const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
2713 function resolveDynamicComponent(component) {
2714 if (isString(component)) {
2715 return resolveAsset(COMPONENTS, component, false) || component;
2717 return component || NULL_DYNAMIC_COMPONENT;
2720 function resolveDirective(name) {
2721 return resolveAsset(DIRECTIVES, name);
2723 function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
2724 const instance = currentRenderingInstance || currentInstance;
2726 const Component = instance.type;
2727 if (type === COMPONENTS) {
2728 const selfName = getComponentName(
2732 if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
2737 // local registration
2738 // check instance[type] first which is resolved for options API
2739 resolve(instance[type] || Component[type], name) || // global registration
2740 resolve(instance.appContext[type], name)
2742 if (!res && maybeSelfReference) {
2745 if (warnMissing && !res) {
2746 const extra = type === COMPONENTS ? `
2747 If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
2748 warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
2753 `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
2757 function resolve(registry, name) {
2758 return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
2761 const isSuspense = (type) => type.__isSuspense;
2763 const SuspenseImpl = {
2765 // In order to make Suspense tree-shakable, we need to avoid importing it
2766 // directly in the renderer. The renderer checks for the __isSuspense flag
2767 // on a vnode's type and calls the `process` method, passing in renderer
2770 process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
2784 if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
2785 n2.suspense = n1.suspense;
2786 n2.suspense.vnode = n2;
2803 hydrate: hydrateSuspense,
2804 create: createSuspenseBoundary,
2805 normalize: normalizeSuspenseChildren
2807 const Suspense = SuspenseImpl ;
2808 function triggerEvent(vnode, name) {
2809 const eventListener = vnode.props && vnode.props[name];
2810 if (isFunction(eventListener)) {
2814 function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
2817 o: { createElement }
2818 } = rendererInternals;
2819 const hiddenContainer = createElement("div");
2820 const suspense = vnode.suspense = createSuspenseBoundary(
2834 suspense.pendingBranch = vnode.ssContent,
2842 if (suspense.deps > 0) {
2843 triggerEvent(vnode, "onPending");
2844 triggerEvent(vnode, "onFallback");
2852 // fallback tree will not have suspense context
2856 setActiveBranch(suspense, vnode.ssFallback);
2858 suspense.resolve(false, true);
2861 function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
2862 const suspense = n2.suspense = n1.suspense;
2863 suspense.vnode = n2;
2865 const newBranch = n2.ssContent;
2866 const newFallback = n2.ssFallback;
2867 const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
2868 if (pendingBranch) {
2869 suspense.pendingBranch = newBranch;
2870 if (isSameVNodeType(newBranch, pendingBranch)) {
2874 suspense.hiddenContainer,
2882 if (suspense.deps <= 0) {
2884 } else if (isInFallback) {
2893 // fallback tree will not have suspense context
2898 setActiveBranch(suspense, newFallback);
2902 suspense.pendingId = suspenseId++;
2904 suspense.isHydrating = false;
2905 suspense.activeBranch = pendingBranch;
2907 unmount(pendingBranch, parentComponent, suspense);
2910 suspense.effects.length = 0;
2911 suspense.hiddenContainer = createElement("div");
2916 suspense.hiddenContainer,
2924 if (suspense.deps <= 0) {
2934 // fallback tree will not have suspense context
2939 setActiveBranch(suspense, newFallback);
2941 } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
2953 suspense.resolve(true);
2958 suspense.hiddenContainer,
2966 if (suspense.deps <= 0) {
2972 if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
2984 setActiveBranch(suspense, newBranch);
2986 triggerEvent(n2, "onPending");
2987 suspense.pendingBranch = newBranch;
2988 if (newBranch.shapeFlag & 512) {
2989 suspense.pendingId = newBranch.component.suspenseId;
2991 suspense.pendingId = suspenseId++;
2996 suspense.hiddenContainer,
3004 if (suspense.deps <= 0) {
3007 const { timeout, pendingId } = suspense;
3010 if (suspense.pendingId === pendingId) {
3011 suspense.fallback(newFallback);
3014 } else if (timeout === 0) {
3015 suspense.fallback(newFallback);
3021 let hasWarned = false;
3022 function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3025 console[console.info ? "info" : "log"](
3026 `<Suspense> is an experimental feature and its API will likely change.`
3034 o: { parentNode, remove }
3035 } = rendererInternals;
3036 let parentSuspenseId;
3037 const isSuspensible = isVNodeSuspensible(vnode);
3038 if (isSuspensible) {
3039 if (parentSuspense && parentSuspense.pendingBranch) {
3040 parentSuspenseId = parentSuspense.pendingId;
3041 parentSuspense.deps++;
3044 const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
3046 assertNumber(timeout, `Suspense timeout`);
3048 const initialAnchor = anchor;
3051 parent: parentSuspense,
3057 pendingId: suspenseId++,
3058 timeout: typeof timeout === "number" ? timeout : -1,
3060 pendingBranch: null,
3061 isInFallback: !isHydrating,
3065 resolve(resume = false, sync = false) {
3067 if (!resume && !suspense.pendingBranch) {
3069 `suspense.resolve() is called without a pending branch.`
3072 if (suspense.isUnmounted) {
3074 `suspense.resolve() is called on an already unmounted suspense boundary.`
3084 parentComponent: parentComponent2,
3085 container: container2
3087 let delayEnter = false;
3088 if (suspense.isHydrating) {
3089 suspense.isHydrating = false;
3090 } else if (!resume) {
3091 delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
3093 activeBranch.transition.afterLeave = () => {
3094 if (pendingId === suspense.pendingId) {
3098 anchor === initialAnchor ? next(activeBranch) : anchor,
3101 queuePostFlushCb(effects);
3106 if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
3107 anchor = next(activeBranch);
3109 unmount(activeBranch, parentComponent2, suspense, true);
3112 move(pendingBranch, container2, anchor, 0);
3115 setActiveBranch(suspense, pendingBranch);
3116 suspense.pendingBranch = null;
3117 suspense.isInFallback = false;
3118 let parent = suspense.parent;
3119 let hasUnresolvedAncestor = false;
3121 if (parent.pendingBranch) {
3122 parent.effects.push(...effects);
3123 hasUnresolvedAncestor = true;
3126 parent = parent.parent;
3128 if (!hasUnresolvedAncestor && !delayEnter) {
3129 queuePostFlushCb(effects);
3131 suspense.effects = [];
3132 if (isSuspensible) {
3133 if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
3134 parentSuspense.deps--;
3135 if (parentSuspense.deps === 0 && !sync) {
3136 parentSuspense.resolve();
3140 triggerEvent(vnode2, "onResolve");
3142 fallback(fallbackVNode) {
3143 if (!suspense.pendingBranch) {
3146 const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
3147 triggerEvent(vnode2, "onFallback");
3148 const anchor2 = next(activeBranch);
3149 const mountFallback = () => {
3150 if (!suspense.isInFallback) {
3160 // fallback tree will not have suspense context
3165 setActiveBranch(suspense, fallbackVNode);
3167 const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
3169 activeBranch.transition.afterLeave = mountFallback;
3171 suspense.isInFallback = true;
3176 // no suspense so unmount hooks fire now
3184 move(container2, anchor2, type) {
3185 suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
3186 suspense.container = container2;
3189 return suspense.activeBranch && next(suspense.activeBranch);
3191 registerDep(instance, setupRenderEffect) {
3192 const isInPendingSuspense = !!suspense.pendingBranch;
3193 if (isInPendingSuspense) {
3196 const hydratedEl = instance.vnode.el;
3197 instance.asyncDep.catch((err) => {
3198 handleError(err, instance, 0);
3199 }).then((asyncSetupResult) => {
3200 if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
3203 instance.asyncResolved = true;
3204 const { vnode: vnode2 } = instance;
3206 pushWarningContext(vnode2);
3208 handleSetupResult(instance, asyncSetupResult, false);
3210 vnode2.el = hydratedEl;
3212 const placeholder = !hydratedEl && instance.subTree.el;
3216 // component may have been moved before resolve.
3217 // if this is not a hydration, instance.subTree will be the comment
3219 parentNode(hydratedEl || instance.subTree.el),
3220 // anchor will not be used if this is hydration, so only need to
3221 // consider the comment placeholder case.
3222 hydratedEl ? null : next(instance.subTree),
3228 remove(placeholder);
3230 updateHOCHostEl(instance, vnode2.el);
3232 popWarningContext();
3234 if (isInPendingSuspense && --suspense.deps === 0) {
3239 unmount(parentSuspense2, doRemove) {
3240 suspense.isUnmounted = true;
3241 if (suspense.activeBranch) {
3243 suspense.activeBranch,
3249 if (suspense.pendingBranch) {
3251 suspense.pendingBranch,
3261 function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3262 const suspense = vnode.suspense = createSuspenseBoundary(
3267 // eslint-disable-next-line no-restricted-globals
3268 document.createElement("div"),
3276 const result = hydrateNode(
3278 suspense.pendingBranch = vnode.ssContent,
3284 if (suspense.deps === 0) {
3285 suspense.resolve(false, true);
3289 function normalizeSuspenseChildren(vnode) {
3290 const { shapeFlag, children } = vnode;
3291 const isSlotChildren = shapeFlag & 32;
3292 vnode.ssContent = normalizeSuspenseSlot(
3293 isSlotChildren ? children.default : children
3295 vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
3297 function normalizeSuspenseSlot(s) {
3299 if (isFunction(s)) {
3300 const trackBlock = isBlockTreeEnabled && s._c;
3308 block = currentBlock;
3313 const singleChild = filterSingleRoot(s);
3314 if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
3315 warn$1(`<Suspense> slots expect a single root node.`);
3319 s = normalizeVNode(s);
3320 if (block && !s.dynamicChildren) {
3321 s.dynamicChildren = block.filter((c) => c !== s);
3325 function queueEffectWithSuspense(fn, suspense) {
3326 if (suspense && suspense.pendingBranch) {
3328 suspense.effects.push(...fn);
3330 suspense.effects.push(fn);
3333 queuePostFlushCb(fn);
3336 function setActiveBranch(suspense, branch) {
3337 suspense.activeBranch = branch;
3338 const { vnode, parentComponent } = suspense;
3340 while (!el && branch.component) {
3341 branch = branch.component.subTree;
3345 if (parentComponent && parentComponent.subTree === vnode) {
3346 parentComponent.vnode.el = el;
3347 updateHOCHostEl(parentComponent, el);
3350 function isVNodeSuspensible(vnode) {
3351 const suspensible = vnode.props && vnode.props.suspensible;
3352 return suspensible != null && suspensible !== false;
3355 const ssrContextKey = Symbol.for("v-scx");
3356 const useSSRContext = () => {
3358 warn$1(`useSSRContext() is not supported in the global build.`);
3362 function watchEffect(effect, options) {
3363 return doWatch(effect, null, options);
3365 function watchPostEffect(effect, options) {
3369 extend({}, options, { flush: "post" })
3372 function watchSyncEffect(effect, options) {
3376 extend({}, options, { flush: "sync" })
3379 const INITIAL_WATCHER_VALUE = {};
3380 function watch(source, cb, options) {
3381 if (!isFunction(cb)) {
3383 `\`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.`
3386 return doWatch(source, cb, options);
3388 function doWatch(source, cb, {
3403 if (deep !== void 0 && typeof deep === "number") {
3405 `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
3409 if (immediate !== void 0) {
3411 `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
3414 if (deep !== void 0) {
3416 `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
3419 if (once !== void 0) {
3421 `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
3425 const warnInvalidSource = (s) => {
3427 `Invalid watch source: `,
3429 `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
3432 const instance = currentInstance;
3433 const reactiveGetter = (source2) => deep === true ? source2 : (
3434 // for deep: false, only traverse root-level properties
3435 traverse(source2, deep === false ? 1 : void 0)
3438 let forceTrigger = false;
3439 let isMultiSource = false;
3440 if (isRef(source)) {
3441 getter = () => source.value;
3442 forceTrigger = isShallow(source);
3443 } else if (isReactive(source)) {
3444 getter = () => reactiveGetter(source);
3445 forceTrigger = true;
3446 } else if (isArray(source)) {
3447 isMultiSource = true;
3448 forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
3449 getter = () => source.map((s) => {
3452 } else if (isReactive(s)) {
3453 return reactiveGetter(s);
3454 } else if (isFunction(s)) {
3455 return callWithErrorHandling(s, instance, 2);
3457 warnInvalidSource(s);
3460 } else if (isFunction(source)) {
3462 getter = () => callWithErrorHandling(source, instance, 2);
3468 return callWithAsyncErrorHandling(
3478 warnInvalidSource(source);
3481 const baseGetter = getter;
3482 getter = () => traverse(baseGetter());
3485 let onCleanup = (fn) => {
3486 cleanup = effect.onStop = () => {
3487 callWithErrorHandling(fn, instance, 4);
3488 cleanup = effect.onStop = void 0;
3491 let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
3493 if (!effect.active || !effect.dirty) {
3497 const newValue = effect.run();
3498 if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
3502 callWithAsyncErrorHandling(cb, instance, 3, [
3504 // pass undefined as the old value when it's changed for the first time
3505 oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
3508 oldValue = newValue;
3514 job.allowRecurse = !!cb;
3516 if (flush === "sync") {
3518 } else if (flush === "post") {
3519 scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
3523 job.id = instance.uid;
3524 scheduler = () => queueJob(job);
3526 const effect = new ReactiveEffect(getter, NOOP, scheduler);
3527 const scope = getCurrentScope();
3528 const unwatch = () => {
3531 remove(scope.effects, effect);
3535 effect.onTrack = onTrack;
3536 effect.onTrigger = onTrigger;
3542 oldValue = effect.run();
3544 } else if (flush === "post") {
3545 queuePostRenderEffect(
3546 effect.run.bind(effect),
3547 instance && instance.suspense
3554 function instanceWatch(source, value, options) {
3555 const publicThis = this.proxy;
3556 const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
3558 if (isFunction(value)) {
3564 const reset = setCurrentInstance(this);
3565 const res = doWatch(getter, cb.bind(publicThis), options);
3569 function createPathGetter(ctx, path) {
3570 const segments = path.split(".");
3573 for (let i = 0; i < segments.length && cur; i++) {
3574 cur = cur[segments[i]];
3579 function traverse(value, depth = Infinity, seen) {
3580 if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
3583 seen = seen || /* @__PURE__ */ new Set();
3584 if (seen.has(value)) {
3590 traverse(value.value, depth, seen);
3591 } else if (isArray(value)) {
3592 for (let i = 0; i < value.length; i++) {
3593 traverse(value[i], depth, seen);
3595 } else if (isSet(value) || isMap(value)) {
3596 value.forEach((v) => {
3597 traverse(v, depth, seen);
3599 } else if (isPlainObject(value)) {
3600 for (const key in value) {
3601 traverse(value[key], depth, seen);
3607 function validateDirectiveName(name) {
3608 if (isBuiltInDirective(name)) {
3609 warn$1("Do not use built-in directive ids as custom directive id: " + name);
3612 function withDirectives(vnode, directives) {
3613 if (currentRenderingInstance === null) {
3614 warn$1(`withDirectives can only be used inside render functions.`);
3617 const instance = getExposeProxy(currentRenderingInstance) || currentRenderingInstance.proxy;
3618 const bindings = vnode.dirs || (vnode.dirs = []);
3619 for (let i = 0; i < directives.length; i++) {
3620 let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
3622 if (isFunction(dir)) {
3643 function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3644 const bindings = vnode.dirs;
3645 const oldBindings = prevVNode && prevVNode.dirs;
3646 for (let i = 0; i < bindings.length; i++) {
3647 const binding = bindings[i];
3649 binding.oldValue = oldBindings[i].value;
3651 let hook = binding.dir[name];
3654 callWithAsyncErrorHandling(hook, instance, 8, [
3665 const leaveCbKey = Symbol("_leaveCb");
3666 const enterCbKey$1 = Symbol("_enterCb");
3667 function useTransitionState() {
3671 isUnmounting: false,
3672 leavingVNodes: /* @__PURE__ */ new Map()
3675 state.isMounted = true;
3677 onBeforeUnmount(() => {
3678 state.isUnmounting = true;
3682 const TransitionHookValidator = [Function, Array];
3683 const BaseTransitionPropsValidators = {
3688 onBeforeEnter: TransitionHookValidator,
3689 onEnter: TransitionHookValidator,
3690 onAfterEnter: TransitionHookValidator,
3691 onEnterCancelled: TransitionHookValidator,
3693 onBeforeLeave: TransitionHookValidator,
3694 onLeave: TransitionHookValidator,
3695 onAfterLeave: TransitionHookValidator,
3696 onLeaveCancelled: TransitionHookValidator,
3698 onBeforeAppear: TransitionHookValidator,
3699 onAppear: TransitionHookValidator,
3700 onAfterAppear: TransitionHookValidator,
3701 onAppearCancelled: TransitionHookValidator
3703 const BaseTransitionImpl = {
3704 name: `BaseTransition`,
3705 props: BaseTransitionPropsValidators,
3706 setup(props, { slots }) {
3707 const instance = getCurrentInstance();
3708 const state = useTransitionState();
3710 const children = slots.default && getTransitionRawChildren(slots.default(), true);
3711 if (!children || !children.length) {
3714 let child = children[0];
3715 if (children.length > 1) {
3716 let hasFound = false;
3717 for (const c of children) {
3718 if (c.type !== Comment) {
3721 "<transition> can only be used on a single element or component. Use <transition-group> for lists."
3730 const rawProps = toRaw(props);
3731 const { mode } = rawProps;
3732 if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
3733 warn$1(`invalid <transition> mode: ${mode}`);
3735 if (state.isLeaving) {
3736 return emptyPlaceholder(child);
3738 const innerChild = getKeepAliveChild(child);
3740 return emptyPlaceholder(child);
3742 const enterHooks = resolveTransitionHooks(
3748 setTransitionHooks(innerChild, enterHooks);
3749 const oldChild = instance.subTree;
3750 const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
3751 if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild)) {
3752 const leavingHooks = resolveTransitionHooks(
3758 setTransitionHooks(oldInnerChild, leavingHooks);
3759 if (mode === "out-in" && innerChild.type !== Comment) {
3760 state.isLeaving = true;
3761 leavingHooks.afterLeave = () => {
3762 state.isLeaving = false;
3763 if (instance.update.active !== false) {
3764 instance.effect.dirty = true;
3768 return emptyPlaceholder(child);
3769 } else if (mode === "in-out" && innerChild.type !== Comment) {
3770 leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3771 const leavingVNodesCache = getLeavingNodesForType(
3775 leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3776 el[leaveCbKey] = () => {
3778 el[leaveCbKey] = void 0;
3779 delete enterHooks.delayedLeave;
3781 enterHooks.delayedLeave = delayedLeave;
3789 const BaseTransition = BaseTransitionImpl;
3790 function getLeavingNodesForType(state, vnode) {
3791 const { leavingVNodes } = state;
3792 let leavingVNodesCache = leavingVNodes.get(vnode.type);
3793 if (!leavingVNodesCache) {
3794 leavingVNodesCache = /* @__PURE__ */ Object.create(null);
3795 leavingVNodes.set(vnode.type, leavingVNodesCache);
3797 return leavingVNodesCache;
3799 function resolveTransitionHooks(vnode, props, state, instance) {
3817 const key = String(vnode.key);
3818 const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3819 const callHook = (hook, args) => {
3820 hook && callWithAsyncErrorHandling(
3827 const callAsyncHook = (hook, args) => {
3828 const done = args[1];
3829 callHook(hook, args);
3830 if (isArray(hook)) {
3831 if (hook.every((hook2) => hook2.length <= 1))
3833 } else if (hook.length <= 1) {
3841 let hook = onBeforeEnter;
3842 if (!state.isMounted) {
3844 hook = onBeforeAppear || onBeforeEnter;
3849 if (el[leaveCbKey]) {
3855 const leavingVNode = leavingVNodesCache[key];
3856 if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3857 leavingVNode.el[leaveCbKey]();
3859 callHook(hook, [el]);
3863 let afterHook = onAfterEnter;
3864 let cancelHook = onEnterCancelled;
3865 if (!state.isMounted) {
3867 hook = onAppear || onEnter;
3868 afterHook = onAfterAppear || onAfterEnter;
3869 cancelHook = onAppearCancelled || onEnterCancelled;
3875 const done = el[enterCbKey$1] = (cancelled) => {
3880 callHook(cancelHook, [el]);
3882 callHook(afterHook, [el]);
3884 if (hooks.delayedLeave) {
3885 hooks.delayedLeave();
3887 el[enterCbKey$1] = void 0;
3890 callAsyncHook(hook, [el, done]);
3896 const key2 = String(vnode.key);
3897 if (el[enterCbKey$1]) {
3903 if (state.isUnmounting) {
3906 callHook(onBeforeLeave, [el]);
3908 const done = el[leaveCbKey] = (cancelled) => {
3914 callHook(onLeaveCancelled, [el]);
3916 callHook(onAfterLeave, [el]);
3918 el[leaveCbKey] = void 0;
3919 if (leavingVNodesCache[key2] === vnode) {
3920 delete leavingVNodesCache[key2];
3923 leavingVNodesCache[key2] = vnode;
3925 callAsyncHook(onLeave, [el, done]);
3931 return resolveTransitionHooks(vnode2, props, state, instance);
3936 function emptyPlaceholder(vnode) {
3937 if (isKeepAlive(vnode)) {
3938 vnode = cloneVNode(vnode);
3939 vnode.children = null;
3943 function getKeepAliveChild(vnode) {
3944 if (!isKeepAlive(vnode)) {
3947 if (vnode.component) {
3948 return vnode.component.subTree;
3950 const { shapeFlag, children } = vnode;
3952 if (shapeFlag & 16) {
3955 if (shapeFlag & 32 && isFunction(children.default)) {
3956 return children.default();
3960 function setTransitionHooks(vnode, hooks) {
3961 if (vnode.shapeFlag & 6 && vnode.component) {
3962 setTransitionHooks(vnode.component.subTree, hooks);
3963 } else if (vnode.shapeFlag & 128) {
3964 vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3965 vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3967 vnode.transition = hooks;
3970 function getTransitionRawChildren(children, keepComment = false, parentKey) {
3972 let keyedFragmentCount = 0;
3973 for (let i = 0; i < children.length; i++) {
3974 let child = children[i];
3975 const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
3976 if (child.type === Fragment) {
3977 if (child.patchFlag & 128)
3978 keyedFragmentCount++;
3980 getTransitionRawChildren(child.children, keepComment, key)
3982 } else if (keepComment || child.type !== Comment) {
3983 ret.push(key != null ? cloneVNode(child, { key }) : child);
3986 if (keyedFragmentCount > 1) {
3987 for (let i = 0; i < ret.length; i++) {
3988 ret[i].patchFlag = -2;
3994 /*! #__NO_SIDE_EFFECTS__ */
3995 // @__NO_SIDE_EFFECTS__
3996 function defineComponent(options, extraOptions) {
3997 return isFunction(options) ? (
3998 // #8326: extend call and options.name access are considered side-effects
3999 // by Rollup, so we have to wrap it in a pure-annotated IIFE.
4000 /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
4004 const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4005 /*! #__NO_SIDE_EFFECTS__ */
4006 // @__NO_SIDE_EFFECTS__
4007 function defineAsyncComponent(source) {
4008 if (isFunction(source)) {
4009 source = { loader: source };
4017 // undefined = never times out
4019 onError: userOnError
4021 let pendingRequest = null;
4024 const retry = () => {
4026 pendingRequest = null;
4029 const load = () => {
4031 return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
4032 err = err instanceof Error ? err : new Error(String(err));
4034 return new Promise((resolve, reject) => {
4035 const userRetry = () => resolve(retry());
4036 const userFail = () => reject(err);
4037 userOnError(err, userRetry, userFail, retries + 1);
4043 if (thisRequest !== pendingRequest && pendingRequest) {
4044 return pendingRequest;
4048 `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
4051 if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
4052 comp = comp.default;
4054 if (comp && !isObject(comp) && !isFunction(comp)) {
4055 throw new Error(`Invalid async component load result: ${comp}`);
4057 resolvedComp = comp;
4061 return defineComponent({
4062 name: "AsyncComponentWrapper",
4063 __asyncLoader: load,
4064 get __asyncResolved() {
4065 return resolvedComp;
4068 const instance = currentInstance;
4070 return () => createInnerComp(resolvedComp, instance);
4072 const onError = (err) => {
4073 pendingRequest = null;
4081 if (suspensible && instance.suspense || false) {
4082 return load().then((comp) => {
4083 return () => createInnerComp(comp, instance);
4086 return () => errorComponent ? createVNode(errorComponent, {
4091 const loaded = ref(false);
4092 const error = ref();
4093 const delayed = ref(!!delay);
4096 delayed.value = false;
4099 if (timeout != null) {
4101 if (!loaded.value && !error.value) {
4102 const err = new Error(
4103 `Async component timed out after ${timeout}ms.`
4111 loaded.value = true;
4112 if (instance.parent && isKeepAlive(instance.parent.vnode)) {
4113 instance.parent.effect.dirty = true;
4114 queueJob(instance.parent.update);
4121 if (loaded.value && resolvedComp) {
4122 return createInnerComp(resolvedComp, instance);
4123 } else if (error.value && errorComponent) {
4124 return createVNode(errorComponent, {
4127 } else if (loadingComponent && !delayed.value) {
4128 return createVNode(loadingComponent);
4134 function createInnerComp(comp, parent) {
4135 const { ref: ref2, props, children, ce } = parent.vnode;
4136 const vnode = createVNode(comp, props, children);
4139 delete parent.vnode.ce;
4143 const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
4144 const KeepAliveImpl = {
4146 // Marker for special handling inside the renderer. We are not using a ===
4147 // check directly on KeepAlive in the renderer, because importing it directly
4148 // would prevent it from being tree-shaken.
4149 __isKeepAlive: true,
4151 include: [String, RegExp, Array],
4152 exclude: [String, RegExp, Array],
4153 max: [String, Number]
4155 setup(props, { slots }) {
4156 const instance = getCurrentInstance();
4157 const sharedContext = instance.ctx;
4158 const cache = /* @__PURE__ */ new Map();
4159 const keys = /* @__PURE__ */ new Set();
4162 instance.__v_cache = cache;
4164 const parentSuspense = instance.suspense;
4170 o: { createElement }
4173 const storageContainer = createElement("div");
4174 sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4175 const instance2 = vnode.component;
4176 move(vnode, container, anchor, 0, parentSuspense);
4188 queuePostRenderEffect(() => {
4189 instance2.isDeactivated = false;
4191 invokeArrayFns(instance2.a);
4193 const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
4195 invokeVNodeHook(vnodeHook, instance2.parent, vnode);
4199 devtoolsComponentAdded(instance2);
4202 sharedContext.deactivate = (vnode) => {
4203 const instance2 = vnode.component;
4204 move(vnode, storageContainer, null, 1, parentSuspense);
4205 queuePostRenderEffect(() => {
4207 invokeArrayFns(instance2.da);
4209 const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
4211 invokeVNodeHook(vnodeHook, instance2.parent, vnode);
4213 instance2.isDeactivated = true;
4216 devtoolsComponentAdded(instance2);
4219 function unmount(vnode) {
4220 resetShapeFlag(vnode);
4221 _unmount(vnode, instance, parentSuspense, true);
4223 function pruneCache(filter) {
4224 cache.forEach((vnode, key) => {
4225 const name = getComponentName(vnode.type);
4226 if (name && (!filter || !filter(name))) {
4227 pruneCacheEntry(key);
4231 function pruneCacheEntry(key) {
4232 const cached = cache.get(key);
4233 if (!current || !isSameVNodeType(cached, current)) {
4235 } else if (current) {
4236 resetShapeFlag(current);
4242 () => [props.include, props.exclude],
4243 ([include, exclude]) => {
4244 include && pruneCache((name) => matches(include, name));
4245 exclude && pruneCache((name) => !matches(exclude, name));
4247 // prune post-render after `current` has been updated
4248 { flush: "post", deep: true }
4250 let pendingCacheKey = null;
4251 const cacheSubtree = () => {
4252 if (pendingCacheKey != null) {
4253 cache.set(pendingCacheKey, getInnerChild(instance.subTree));
4256 onMounted(cacheSubtree);
4257 onUpdated(cacheSubtree);
4258 onBeforeUnmount(() => {
4259 cache.forEach((cached) => {
4260 const { subTree, suspense } = instance;
4261 const vnode = getInnerChild(subTree);
4262 if (cached.type === vnode.type && cached.key === vnode.key) {
4263 resetShapeFlag(vnode);
4264 const da = vnode.component.da;
4265 da && queuePostRenderEffect(da, suspense);
4272 pendingCacheKey = null;
4273 if (!slots.default) {
4276 const children = slots.default();
4277 const rawVNode = children[0];
4278 if (children.length > 1) {
4280 warn$1(`KeepAlive should contain exactly one component child.`);
4284 } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
4288 let vnode = getInnerChild(rawVNode);
4289 const comp = vnode.type;
4290 const name = getComponentName(
4291 isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
4293 const { include, exclude, max } = props;
4294 if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
4298 const key = vnode.key == null ? comp : vnode.key;
4299 const cachedVNode = cache.get(key);
4301 vnode = cloneVNode(vnode);
4302 if (rawVNode.shapeFlag & 128) {
4303 rawVNode.ssContent = vnode;
4306 pendingCacheKey = key;
4308 vnode.el = cachedVNode.el;
4309 vnode.component = cachedVNode.component;
4310 if (vnode.transition) {
4311 setTransitionHooks(vnode, vnode.transition);
4313 vnode.shapeFlag |= 512;
4318 if (max && keys.size > parseInt(max, 10)) {
4319 pruneCacheEntry(keys.values().next().value);
4322 vnode.shapeFlag |= 256;
4324 return isSuspense(rawVNode.type) ? rawVNode : vnode;
4328 const KeepAlive = KeepAliveImpl;
4329 function matches(pattern, name) {
4330 if (isArray(pattern)) {
4331 return pattern.some((p) => matches(p, name));
4332 } else if (isString(pattern)) {
4333 return pattern.split(",").includes(name);
4334 } else if (isRegExp(pattern)) {
4335 return pattern.test(name);
4339 function onActivated(hook, target) {
4340 registerKeepAliveHook(hook, "a", target);
4342 function onDeactivated(hook, target) {
4343 registerKeepAliveHook(hook, "da", target);
4345 function registerKeepAliveHook(hook, type, target = currentInstance) {
4346 const wrappedHook = hook.__wdc || (hook.__wdc = () => {
4347 let current = target;
4349 if (current.isDeactivated) {
4352 current = current.parent;
4356 injectHook(type, wrappedHook, target);
4358 let current = target.parent;
4359 while (current && current.parent) {
4360 if (isKeepAlive(current.parent.vnode)) {
4361 injectToKeepAliveRoot(wrappedHook, type, target, current);
4363 current = current.parent;
4367 function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4368 const injected = injectHook(
4376 remove(keepAliveRoot[type], injected);
4379 function resetShapeFlag(vnode) {
4380 vnode.shapeFlag &= ~256;
4381 vnode.shapeFlag &= ~512;
4383 function getInnerChild(vnode) {
4384 return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
4387 function injectHook(type, hook, target = currentInstance, prepend = false) {
4389 const hooks = target[type] || (target[type] = []);
4390 const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
4391 if (target.isUnmounted) {
4395 const reset = setCurrentInstance(target);
4396 const res = callWithAsyncErrorHandling(hook, target, type, args);
4402 hooks.unshift(wrappedHook);
4404 hooks.push(wrappedHook);
4408 const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
4410 `${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.` )
4414 const createHook = (lifecycle) => (hook, target = currentInstance) => (
4415 // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
4416 (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
4418 const onBeforeMount = createHook("bm");
4419 const onMounted = createHook("m");
4420 const onBeforeUpdate = createHook("bu");
4421 const onUpdated = createHook("u");
4422 const onBeforeUnmount = createHook("bum");
4423 const onUnmounted = createHook("um");
4424 const onServerPrefetch = createHook("sp");
4425 const onRenderTriggered = createHook(
4428 const onRenderTracked = createHook(
4431 function onErrorCaptured(hook, target = currentInstance) {
4432 injectHook("ec", hook, target);
4435 function renderList(source, renderItem, cache, index) {
4437 const cached = cache && cache[index];
4438 if (isArray(source) || isString(source)) {
4439 ret = new Array(source.length);
4440 for (let i = 0, l = source.length; i < l; i++) {
4441 ret[i] = renderItem(source[i], i, void 0, cached && cached[i]);
4443 } else if (typeof source === "number") {
4444 if (!Number.isInteger(source)) {
4445 warn$1(`The v-for range expect an integer value but got ${source}.`);
4447 ret = new Array(source);
4448 for (let i = 0; i < source; i++) {
4449 ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
4451 } else if (isObject(source)) {
4452 if (source[Symbol.iterator]) {
4455 (item, i) => renderItem(item, i, void 0, cached && cached[i])
4458 const keys = Object.keys(source);
4459 ret = new Array(keys.length);
4460 for (let i = 0, l = keys.length; i < l; i++) {
4461 const key = keys[i];
4462 ret[i] = renderItem(source[key], key, i, cached && cached[i]);
4474 function createSlots(slots, dynamicSlots) {
4475 for (let i = 0; i < dynamicSlots.length; i++) {
4476 const slot = dynamicSlots[i];
4477 if (isArray(slot)) {
4478 for (let j = 0; j < slot.length; j++) {
4479 slots[slot[j].name] = slot[j].fn;
4482 slots[slot.name] = slot.key ? (...args) => {
4483 const res = slot.fn(...args);
4493 function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4494 if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
4495 if (name !== "default")
4497 return createVNode("slot", props, fallback && fallback());
4499 let slot = slots[name];
4500 if (slot && slot.length > 1) {
4502 `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.`
4506 if (slot && slot._c) {
4510 const validSlotContent = slot && ensureValidVNode(slot(props));
4511 const rendered = createBlock(
4514 key: props.key || // slot content array of a dynamic conditional slot may have a branch
4515 // key attached in the `createSlots` helper, respect that
4516 validSlotContent && validSlotContent.key || `_${name}`
4518 validSlotContent || (fallback ? fallback() : []),
4519 validSlotContent && slots._ === 1 ? 64 : -2
4521 if (!noSlotted && rendered.scopeId) {
4522 rendered.slotScopeIds = [rendered.scopeId + "-s"];
4524 if (slot && slot._c) {
4529 function ensureValidVNode(vnodes) {
4530 return vnodes.some((child) => {
4531 if (!isVNode(child))
4533 if (child.type === Comment)
4535 if (child.type === Fragment && !ensureValidVNode(child.children))
4541 function toHandlers(obj, preserveCaseIfNecessary) {
4543 if (!isObject(obj)) {
4544 warn$1(`v-on with no argument expects an object value.`);
4547 for (const key in obj) {
4548 ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
4553 const getPublicInstance = (i) => {
4556 if (isStatefulComponent(i))
4557 return getExposeProxy(i) || i.proxy;
4558 return getPublicInstance(i.parent);
4560 const publicPropertiesMap = (
4561 // Move PURE marker to new line to workaround compiler discarding it
4562 // due to type annotation
4563 /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
4565 $el: (i) => i.vnode.el,
4566 $data: (i) => i.data,
4567 $props: (i) => shallowReadonly(i.props) ,
4568 $attrs: (i) => shallowReadonly(i.attrs) ,
4569 $slots: (i) => shallowReadonly(i.slots) ,
4570 $refs: (i) => shallowReadonly(i.refs) ,
4571 $parent: (i) => getPublicInstance(i.parent),
4572 $root: (i) => getPublicInstance(i.root),
4573 $emit: (i) => i.emit,
4574 $options: (i) => resolveMergedOptions(i) ,
4575 $forceUpdate: (i) => i.f || (i.f = () => {
4576 i.effect.dirty = true;
4579 $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
4580 $watch: (i) => instanceWatch.bind(i)
4583 const isReservedPrefix = (key) => key === "_" || key === "$";
4584 const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
4585 const PublicInstanceProxyHandlers = {
4586 get({ _: instance }, key) {
4587 if (key === "__v_skip") {
4590 const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
4591 if (key === "__isVue") {
4594 let normalizedProps;
4595 if (key[0] !== "$") {
4596 const n = accessCache[key];
4600 return setupState[key];
4603 case 4 /* CONTEXT */:
4608 } else if (hasSetupBinding(setupState, key)) {
4609 accessCache[key] = 1 /* SETUP */;
4610 return setupState[key];
4611 } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
4612 accessCache[key] = 2 /* DATA */;
4615 // only cache other properties when instance has declared (thus stable)
4617 (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
4619 accessCache[key] = 3 /* PROPS */;
4621 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
4622 accessCache[key] = 4 /* CONTEXT */;
4624 } else if (shouldCacheAccess) {
4625 accessCache[key] = 0 /* OTHER */;
4628 const publicGetter = publicPropertiesMap[key];
4629 let cssModule, globalProperties;
4631 if (key === "$attrs") {
4632 track(instance.attrs, "get", "");
4633 markAttrsAccessed();
4634 } else if (key === "$slots") {
4635 track(instance, "get", key);
4637 return publicGetter(instance);
4639 // css module (injected by vue-loader)
4640 (cssModule = type.__cssModules) && (cssModule = cssModule[key])
4643 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
4644 accessCache[key] = 4 /* CONTEXT */;
4647 // global properties
4648 globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
4651 return globalProperties[key];
4653 } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
4654 // to infinite warning loop
4655 key.indexOf("__v") !== 0)) {
4656 if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
4658 `Property ${JSON.stringify(
4660 )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
4662 } else if (instance === currentRenderingInstance) {
4664 `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
4669 set({ _: instance }, key, value) {
4670 const { data, setupState, ctx } = instance;
4671 if (hasSetupBinding(setupState, key)) {
4672 setupState[key] = value;
4674 } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
4675 warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
4677 } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
4680 } else if (hasOwn(instance.props, key)) {
4681 warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
4684 if (key[0] === "$" && key.slice(1) in instance) {
4686 `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
4690 if (key in instance.appContext.config.globalProperties) {
4691 Object.defineProperty(ctx, key, {
4703 _: { data, setupState, accessCache, ctx, appContext, propsOptions }
4705 let normalizedProps;
4706 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);
4708 defineProperty(target, key, descriptor) {
4709 if (descriptor.get != null) {
4710 target._.accessCache[key] = 0;
4711 } else if (hasOwn(descriptor, "value")) {
4712 this.set(target, key, descriptor.value, null);
4714 return Reflect.defineProperty(target, key, descriptor);
4718 PublicInstanceProxyHandlers.ownKeys = (target) => {
4720 `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
4722 return Reflect.ownKeys(target);
4725 const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
4727 PublicInstanceProxyHandlers,
4730 if (key === Symbol.unscopables) {
4733 return PublicInstanceProxyHandlers.get(target, key, target);
4736 const has = key[0] !== "_" && !isGloballyAllowed(key);
4737 if (!has && PublicInstanceProxyHandlers.has(_, key)) {
4739 `Property ${JSON.stringify(
4741 )} should not start with _ which is a reserved prefix for Vue internals.`
4748 function createDevRenderContext(instance) {
4750 Object.defineProperty(target, `_`, {
4755 Object.keys(publicPropertiesMap).forEach((key) => {
4756 Object.defineProperty(target, key, {
4759 get: () => publicPropertiesMap[key](instance),
4760 // intercepted by the proxy so no need for implementation,
4761 // but needed to prevent set errors
4767 function exposePropsOnRenderContext(instance) {
4770 propsOptions: [propsOptions]
4773 Object.keys(propsOptions).forEach((key) => {
4774 Object.defineProperty(ctx, key, {
4777 get: () => instance.props[key],
4783 function exposeSetupStateOnRenderContext(instance) {
4784 const { ctx, setupState } = instance;
4785 Object.keys(toRaw(setupState)).forEach((key) => {
4786 if (!setupState.__isScriptSetup) {
4787 if (isReservedPrefix(key[0])) {
4789 `setup() return property ${JSON.stringify(
4791 )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
4795 Object.defineProperty(ctx, key, {
4798 get: () => setupState[key],
4805 const warnRuntimeUsage = (method) => warn$1(
4806 `${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.`
4808 function defineProps() {
4810 warnRuntimeUsage(`defineProps`);
4814 function defineEmits() {
4816 warnRuntimeUsage(`defineEmits`);
4820 function defineExpose(exposed) {
4822 warnRuntimeUsage(`defineExpose`);
4825 function defineOptions(options) {
4827 warnRuntimeUsage(`defineOptions`);
4830 function defineSlots() {
4832 warnRuntimeUsage(`defineSlots`);
4836 function defineModel() {
4838 warnRuntimeUsage("defineModel");
4841 function withDefaults(props, defaults) {
4843 warnRuntimeUsage(`withDefaults`);
4847 function useSlots() {
4848 return getContext().slots;
4850 function useAttrs() {
4851 return getContext().attrs;
4853 function getContext() {
4854 const i = getCurrentInstance();
4856 warn$1(`useContext() called without active instance.`);
4858 return i.setupContext || (i.setupContext = createSetupContext(i));
4860 function normalizePropsOrEmits(props) {
4861 return isArray(props) ? props.reduce(
4862 (normalized, p) => (normalized[p] = null, normalized),
4866 function mergeDefaults(raw, defaults) {
4867 const props = normalizePropsOrEmits(raw);
4868 for (const key in defaults) {
4869 if (key.startsWith("__skip"))
4871 let opt = props[key];
4873 if (isArray(opt) || isFunction(opt)) {
4874 opt = props[key] = { type: opt, default: defaults[key] };
4876 opt.default = defaults[key];
4878 } else if (opt === null) {
4879 opt = props[key] = { default: defaults[key] };
4881 warn$1(`props default key "${key}" has no corresponding declaration.`);
4883 if (opt && defaults[`__skip_${key}`]) {
4884 opt.skipFactory = true;
4889 function mergeModels(a, b) {
4892 if (isArray(a) && isArray(b))
4894 return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
4896 function createPropsRestProxy(props, excludedKeys) {
4898 for (const key in props) {
4899 if (!excludedKeys.includes(key)) {
4900 Object.defineProperty(ret, key, {
4902 get: () => props[key]
4908 function withAsyncContext(getAwaitable) {
4909 const ctx = getCurrentInstance();
4912 `withAsyncContext called without active current instance. This is likely a bug.`
4915 let awaitable = getAwaitable();
4916 unsetCurrentInstance();
4917 if (isPromise(awaitable)) {
4918 awaitable = awaitable.catch((e) => {
4919 setCurrentInstance(ctx);
4923 return [awaitable, () => setCurrentInstance(ctx)];
4926 function createDuplicateChecker() {
4927 const cache = /* @__PURE__ */ Object.create(null);
4928 return (type, key) => {
4930 warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
4936 let shouldCacheAccess = true;
4937 function applyOptions(instance) {
4938 const options = resolveMergedOptions(instance);
4939 const publicThis = instance.proxy;
4940 const ctx = instance.ctx;
4941 shouldCacheAccess = false;
4942 if (options.beforeCreate) {
4943 callHook$1(options.beforeCreate, instance, "bc");
4948 computed: computedOptions,
4950 watch: watchOptions,
4951 provide: provideOptions,
4952 inject: injectOptions,
4978 const checkDuplicateProperties = createDuplicateChecker() ;
4980 const [propsOptions] = instance.propsOptions;
4982 for (const key in propsOptions) {
4983 checkDuplicateProperties("Props" /* PROPS */, key);
4987 if (injectOptions) {
4988 resolveInjections(injectOptions, ctx, checkDuplicateProperties);
4991 for (const key in methods) {
4992 const methodHandler = methods[key];
4993 if (isFunction(methodHandler)) {
4995 Object.defineProperty(ctx, key, {
4996 value: methodHandler.bind(publicThis),
5003 checkDuplicateProperties("Methods" /* METHODS */, key);
5007 `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
5013 if (!isFunction(dataOptions)) {
5015 `The data option must be a function. Plain object usage is no longer supported.`
5018 const data = dataOptions.call(publicThis, publicThis);
5019 if (isPromise(data)) {
5021 `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
5024 if (!isObject(data)) {
5025 warn$1(`data() should return an object.`);
5027 instance.data = reactive(data);
5029 for (const key in data) {
5030 checkDuplicateProperties("Data" /* DATA */, key);
5031 if (!isReservedPrefix(key[0])) {
5032 Object.defineProperty(ctx, key, {
5035 get: () => data[key],
5043 shouldCacheAccess = true;
5044 if (computedOptions) {
5045 for (const key in computedOptions) {
5046 const opt = computedOptions[key];
5047 const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
5049 warn$1(`Computed property "${key}" has no getter.`);
5051 const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
5053 `Write operation failed: computed property "${key}" is readonly.`
5056 const c = computed({
5060 Object.defineProperty(ctx, key, {
5064 set: (v) => c.value = v
5067 checkDuplicateProperties("Computed" /* COMPUTED */, key);
5072 for (const key in watchOptions) {
5073 createWatcher(watchOptions[key], ctx, publicThis, key);
5076 if (provideOptions) {
5077 const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
5078 Reflect.ownKeys(provides).forEach((key) => {
5079 provide(key, provides[key]);
5083 callHook$1(created, instance, "c");
5085 function registerLifecycleHook(register, hook) {
5086 if (isArray(hook)) {
5087 hook.forEach((_hook) => register(_hook.bind(publicThis)));
5089 register(hook.bind(publicThis));
5092 registerLifecycleHook(onBeforeMount, beforeMount);
5093 registerLifecycleHook(onMounted, mounted);
5094 registerLifecycleHook(onBeforeUpdate, beforeUpdate);
5095 registerLifecycleHook(onUpdated, updated);
5096 registerLifecycleHook(onActivated, activated);
5097 registerLifecycleHook(onDeactivated, deactivated);
5098 registerLifecycleHook(onErrorCaptured, errorCaptured);
5099 registerLifecycleHook(onRenderTracked, renderTracked);
5100 registerLifecycleHook(onRenderTriggered, renderTriggered);
5101 registerLifecycleHook(onBeforeUnmount, beforeUnmount);
5102 registerLifecycleHook(onUnmounted, unmounted);
5103 registerLifecycleHook(onServerPrefetch, serverPrefetch);
5104 if (isArray(expose)) {
5105 if (expose.length) {
5106 const exposed = instance.exposed || (instance.exposed = {});
5107 expose.forEach((key) => {
5108 Object.defineProperty(exposed, key, {
5109 get: () => publicThis[key],
5110 set: (val) => publicThis[key] = val
5113 } else if (!instance.exposed) {
5114 instance.exposed = {};
5117 if (render && instance.render === NOOP) {
5118 instance.render = render;
5120 if (inheritAttrs != null) {
5121 instance.inheritAttrs = inheritAttrs;
5124 instance.components = components;
5126 instance.directives = directives;
5128 function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
5129 if (isArray(injectOptions)) {
5130 injectOptions = normalizeInject(injectOptions);
5132 for (const key in injectOptions) {
5133 const opt = injectOptions[key];
5135 if (isObject(opt)) {
5136 if ("default" in opt) {
5143 injected = inject(opt.from || key);
5146 injected = inject(opt);
5148 if (isRef(injected)) {
5149 Object.defineProperty(ctx, key, {
5152 get: () => injected.value,
5153 set: (v) => injected.value = v
5156 ctx[key] = injected;
5159 checkDuplicateProperties("Inject" /* INJECT */, key);
5163 function callHook$1(hook, instance, type) {
5164 callWithAsyncErrorHandling(
5165 isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
5170 function createWatcher(raw, ctx, publicThis, key) {
5171 const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
5172 if (isString(raw)) {
5173 const handler = ctx[raw];
5174 if (isFunction(handler)) {
5175 watch(getter, handler);
5177 warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
5179 } else if (isFunction(raw)) {
5180 watch(getter, raw.bind(publicThis));
5181 } else if (isObject(raw)) {
5183 raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
5185 const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
5186 if (isFunction(handler)) {
5187 watch(getter, handler, raw);
5189 warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
5193 warn$1(`Invalid watch option: "${key}"`, raw);
5196 function resolveMergedOptions(instance) {
5197 const base = instance.type;
5198 const { mixins, extends: extendsOptions } = base;
5200 mixins: globalMixins,
5201 optionsCache: cache,
5202 config: { optionMergeStrategies }
5203 } = instance.appContext;
5204 const cached = cache.get(base);
5208 } else if (!globalMixins.length && !mixins && !extendsOptions) {
5214 if (globalMixins.length) {
5215 globalMixins.forEach(
5216 (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
5219 mergeOptions(resolved, base, optionMergeStrategies);
5221 if (isObject(base)) {
5222 cache.set(base, resolved);
5226 function mergeOptions(to, from, strats, asMixin = false) {
5227 const { mixins, extends: extendsOptions } = from;
5228 if (extendsOptions) {
5229 mergeOptions(to, extendsOptions, strats, true);
5233 (m) => mergeOptions(to, m, strats, true)
5236 for (const key in from) {
5237 if (asMixin && key === "expose") {
5239 `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
5242 const strat = internalOptionMergeStrats[key] || strats && strats[key];
5243 to[key] = strat ? strat(to[key], from[key]) : from[key];
5248 const internalOptionMergeStrats = {
5250 props: mergeEmitsOrPropsOptions,
5251 emits: mergeEmitsOrPropsOptions,
5253 methods: mergeObjectOptions,
5254 computed: mergeObjectOptions,
5256 beforeCreate: mergeAsArray$1,
5257 created: mergeAsArray$1,
5258 beforeMount: mergeAsArray$1,
5259 mounted: mergeAsArray$1,
5260 beforeUpdate: mergeAsArray$1,
5261 updated: mergeAsArray$1,
5262 beforeDestroy: mergeAsArray$1,
5263 beforeUnmount: mergeAsArray$1,
5264 destroyed: mergeAsArray$1,
5265 unmounted: mergeAsArray$1,
5266 activated: mergeAsArray$1,
5267 deactivated: mergeAsArray$1,
5268 errorCaptured: mergeAsArray$1,
5269 serverPrefetch: mergeAsArray$1,
5271 components: mergeObjectOptions,
5272 directives: mergeObjectOptions,
5274 watch: mergeWatchOptions,
5276 provide: mergeDataFn,
5279 function mergeDataFn(to, from) {
5286 return function mergedDataFn() {
5288 isFunction(to) ? to.call(this, this) : to,
5289 isFunction(from) ? from.call(this, this) : from
5293 function mergeInject(to, from) {
5294 return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
5296 function normalizeInject(raw) {
5299 for (let i = 0; i < raw.length; i++) {
5300 res[raw[i]] = raw[i];
5306 function mergeAsArray$1(to, from) {
5307 return to ? [...new Set([].concat(to, from))] : from;
5309 function mergeObjectOptions(to, from) {
5310 return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
5312 function mergeEmitsOrPropsOptions(to, from) {
5314 if (isArray(to) && isArray(from)) {
5315 return [.../* @__PURE__ */ new Set([...to, ...from])];
5318 /* @__PURE__ */ Object.create(null),
5319 normalizePropsOrEmits(to),
5320 normalizePropsOrEmits(from != null ? from : {})
5326 function mergeWatchOptions(to, from) {
5331 const merged = extend(/* @__PURE__ */ Object.create(null), to);
5332 for (const key in from) {
5333 merged[key] = mergeAsArray$1(to[key], from[key]);
5338 function createAppContext() {
5344 globalProperties: {},
5345 optionMergeStrategies: {},
5346 errorHandler: void 0,
5347 warnHandler: void 0,
5353 provides: /* @__PURE__ */ Object.create(null),
5354 optionsCache: /* @__PURE__ */ new WeakMap(),
5355 propsCache: /* @__PURE__ */ new WeakMap(),
5356 emitsCache: /* @__PURE__ */ new WeakMap()
5360 function createAppAPI(render, hydrate) {
5361 return function createApp(rootComponent, rootProps = null) {
5362 if (!isFunction(rootComponent)) {
5363 rootComponent = extend({}, rootComponent);
5365 if (rootProps != null && !isObject(rootProps)) {
5366 warn$1(`root props passed to app.mount() must be an object.`);
5369 const context = createAppContext();
5370 const installedPlugins = /* @__PURE__ */ new WeakSet();
5371 let isMounted = false;
5372 const app = context.app = {
5374 _component: rootComponent,
5381 return context.config;
5386 `app.config cannot be replaced. Modify individual options instead.`
5390 use(plugin, ...options) {
5391 if (installedPlugins.has(plugin)) {
5392 warn$1(`Plugin has already been applied to target app.`);
5393 } else if (plugin && isFunction(plugin.install)) {
5394 installedPlugins.add(plugin);
5395 plugin.install(app, ...options);
5396 } else if (isFunction(plugin)) {
5397 installedPlugins.add(plugin);
5398 plugin(app, ...options);
5401 `A plugin must either be a function or an object with an "install" function.`
5408 if (!context.mixins.includes(mixin)) {
5409 context.mixins.push(mixin);
5412 "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
5418 component(name, component) {
5420 validateComponentName(name, context.config);
5423 return context.components[name];
5425 if (context.components[name]) {
5426 warn$1(`Component "${name}" has already been registered in target app.`);
5428 context.components[name] = component;
5431 directive(name, directive) {
5433 validateDirectiveName(name);
5436 return context.directives[name];
5438 if (context.directives[name]) {
5439 warn$1(`Directive "${name}" has already been registered in target app.`);
5441 context.directives[name] = directive;
5444 mount(rootContainer, isHydrate, namespace) {
5446 if (rootContainer.__vue_app__) {
5448 `There is already an app instance mounted on the host container.
5449 If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
5452 const vnode = createVNode(rootComponent, rootProps);
5453 vnode.appContext = context;
5454 if (namespace === true) {
5456 } else if (namespace === false) {
5460 context.reload = () => {
5468 if (isHydrate && hydrate) {
5469 hydrate(vnode, rootContainer);
5471 render(vnode, rootContainer, namespace);
5474 app._container = rootContainer;
5475 rootContainer.__vue_app__ = app;
5477 app._instance = vnode.component;
5478 devtoolsInitApp(app, version);
5480 return getExposeProxy(vnode.component) || vnode.component.proxy;
5483 `App has already been mounted.
5484 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)\``
5490 render(null, app._container);
5492 app._instance = null;
5493 devtoolsUnmountApp(app);
5495 delete app._container.__vue_app__;
5497 warn$1(`Cannot unmount an app that is not mounted.`);
5500 provide(key, value) {
5501 if (key in context.provides) {
5503 `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
5506 context.provides[key] = value;
5509 runWithContext(fn) {
5510 const lastApp = currentApp;
5515 currentApp = lastApp;
5522 let currentApp = null;
5524 function provide(key, value) {
5525 if (!currentInstance) {
5527 warn$1(`provide() can only be used inside setup().`);
5530 let provides = currentInstance.provides;
5531 const parentProvides = currentInstance.parent && currentInstance.parent.provides;
5532 if (parentProvides === provides) {
5533 provides = currentInstance.provides = Object.create(parentProvides);
5535 provides[key] = value;
5538 function inject(key, defaultValue, treatDefaultAsFactory = false) {
5539 const instance = currentInstance || currentRenderingInstance;
5540 if (instance || currentApp) {
5541 const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
5542 if (provides && key in provides) {
5543 return provides[key];
5544 } else if (arguments.length > 1) {
5545 return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
5547 warn$1(`injection "${String(key)}" not found.`);
5550 warn$1(`inject() can only be used inside setup() or functional components.`);
5553 function hasInjectionContext() {
5554 return !!(currentInstance || currentRenderingInstance || currentApp);
5557 const internalObjectProto = {};
5558 const createInternalObject = () => Object.create(internalObjectProto);
5559 const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
5561 function initProps(instance, rawProps, isStateful, isSSR = false) {
5563 const attrs = createInternalObject();
5564 instance.propsDefaults = /* @__PURE__ */ Object.create(null);
5565 setFullProps(instance, rawProps, props, attrs);
5566 for (const key in instance.propsOptions[0]) {
5567 if (!(key in props)) {
5568 props[key] = void 0;
5572 validateProps(rawProps || {}, props, instance);
5575 instance.props = isSSR ? props : shallowReactive(props);
5577 if (!instance.type.props) {
5578 instance.props = attrs;
5580 instance.props = props;
5583 instance.attrs = attrs;
5585 function isInHmrContext(instance) {
5587 if (instance.type.__hmrId)
5589 instance = instance.parent;
5592 function updateProps(instance, rawProps, rawPrevProps, optimized) {
5596 vnode: { patchFlag }
5598 const rawCurrentProps = toRaw(props);
5599 const [options] = instance.propsOptions;
5600 let hasAttrsChanged = false;
5602 // always force full diff in dev
5603 // - #1942 if hmr is enabled with sfc component
5604 // - vite#872 non-sfc component used by sfc component
5605 !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
5607 if (patchFlag & 8) {
5608 const propsToUpdate = instance.vnode.dynamicProps;
5609 for (let i = 0; i < propsToUpdate.length; i++) {
5610 let key = propsToUpdate[i];
5611 if (isEmitListener(instance.emitsOptions, key)) {
5614 const value = rawProps[key];
5616 if (hasOwn(attrs, key)) {
5617 if (value !== attrs[key]) {
5619 hasAttrsChanged = true;
5622 const camelizedKey = camelize(key);
5623 props[camelizedKey] = resolvePropValue(
5633 if (value !== attrs[key]) {
5635 hasAttrsChanged = true;
5641 if (setFullProps(instance, rawProps, props, attrs)) {
5642 hasAttrsChanged = true;
5645 for (const key in rawCurrentProps) {
5646 if (!rawProps || // for camelCase
5647 !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
5648 // and converted to camelCase (#955)
5649 ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
5651 if (rawPrevProps && // for camelCase
5652 (rawPrevProps[key] !== void 0 || // for kebab-case
5653 rawPrevProps[kebabKey] !== void 0)) {
5654 props[key] = resolvePropValue(
5668 if (attrs !== rawCurrentProps) {
5669 for (const key in attrs) {
5670 if (!rawProps || !hasOwn(rawProps, key) && true) {
5672 hasAttrsChanged = true;
5677 if (hasAttrsChanged) {
5678 trigger(instance.attrs, "set", "");
5681 validateProps(rawProps || {}, props, instance);
5684 function setFullProps(instance, rawProps, props, attrs) {
5685 const [options, needCastKeys] = instance.propsOptions;
5686 let hasAttrsChanged = false;
5689 for (let key in rawProps) {
5690 if (isReservedProp(key)) {
5693 const value = rawProps[key];
5695 if (options && hasOwn(options, camelKey = camelize(key))) {
5696 if (!needCastKeys || !needCastKeys.includes(camelKey)) {
5697 props[camelKey] = value;
5699 (rawCastValues || (rawCastValues = {}))[camelKey] = value;
5701 } else if (!isEmitListener(instance.emitsOptions, key)) {
5702 if (!(key in attrs) || value !== attrs[key]) {
5704 hasAttrsChanged = true;
5710 const rawCurrentProps = toRaw(props);
5711 const castValues = rawCastValues || EMPTY_OBJ;
5712 for (let i = 0; i < needCastKeys.length; i++) {
5713 const key = needCastKeys[i];
5714 props[key] = resolvePropValue(
5720 !hasOwn(castValues, key)
5724 return hasAttrsChanged;
5726 function resolvePropValue(options, props, key, value, instance, isAbsent) {
5727 const opt = options[key];
5729 const hasDefault = hasOwn(opt, "default");
5730 if (hasDefault && value === void 0) {
5731 const defaultValue = opt.default;
5732 if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
5733 const { propsDefaults } = instance;
5734 if (key in propsDefaults) {
5735 value = propsDefaults[key];
5737 const reset = setCurrentInstance(instance);
5738 value = propsDefaults[key] = defaultValue.call(
5745 value = defaultValue;
5748 if (opt[0 /* shouldCast */]) {
5749 if (isAbsent && !hasDefault) {
5751 } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
5758 function normalizePropsOptions(comp, appContext, asMixin = false) {
5759 const cache = appContext.propsCache;
5760 const cached = cache.get(comp);
5764 const raw = comp.props;
5765 const normalized = {};
5766 const needCastKeys = [];
5767 let hasExtends = false;
5768 if (!isFunction(comp)) {
5769 const extendProps = (raw2) => {
5771 const [props, keys] = normalizePropsOptions(raw2, appContext, true);
5772 extend(normalized, props);
5774 needCastKeys.push(...keys);
5776 if (!asMixin && appContext.mixins.length) {
5777 appContext.mixins.forEach(extendProps);
5780 extendProps(comp.extends);
5783 comp.mixins.forEach(extendProps);
5786 if (!raw && !hasExtends) {
5787 if (isObject(comp)) {
5788 cache.set(comp, EMPTY_ARR);
5793 for (let i = 0; i < raw.length; i++) {
5794 if (!isString(raw[i])) {
5795 warn$1(`props must be strings when using array syntax.`, raw[i]);
5797 const normalizedKey = camelize(raw[i]);
5798 if (validatePropName(normalizedKey)) {
5799 normalized[normalizedKey] = EMPTY_OBJ;
5803 if (!isObject(raw)) {
5804 warn$1(`invalid props options`, raw);
5806 for (const key in raw) {
5807 const normalizedKey = camelize(key);
5808 if (validatePropName(normalizedKey)) {
5809 const opt = raw[key];
5810 const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
5812 const booleanIndex = getTypeIndex(Boolean, prop.type);
5813 const stringIndex = getTypeIndex(String, prop.type);
5814 prop[0 /* shouldCast */] = booleanIndex > -1;
5815 prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
5816 if (booleanIndex > -1 || hasOwn(prop, "default")) {
5817 needCastKeys.push(normalizedKey);
5823 const res = [normalized, needCastKeys];
5824 if (isObject(comp)) {
5825 cache.set(comp, res);
5829 function validatePropName(key) {
5830 if (key[0] !== "$" && !isReservedProp(key)) {
5833 warn$1(`Invalid prop name: "${key}" is a reserved property.`);
5837 function getType(ctor) {
5838 if (ctor === null) {
5841 if (typeof ctor === "function") {
5842 return ctor.name || "";
5843 } else if (typeof ctor === "object") {
5844 const name = ctor.constructor && ctor.constructor.name;
5849 function isSameType(a, b) {
5850 return getType(a) === getType(b);
5852 function getTypeIndex(type, expectedTypes) {
5853 if (isArray(expectedTypes)) {
5854 return expectedTypes.findIndex((t) => isSameType(t, type));
5855 } else if (isFunction(expectedTypes)) {
5856 return isSameType(expectedTypes, type) ? 0 : -1;
5860 function validateProps(rawProps, props, instance) {
5861 const resolvedValues = toRaw(props);
5862 const options = instance.propsOptions[0];
5863 for (const key in options) {
5864 let opt = options[key];
5869 resolvedValues[key],
5871 shallowReadonly(resolvedValues) ,
5872 !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
5876 function validateProp(name, value, prop, props, isAbsent) {
5877 const { type, required, validator, skipCheck } = prop;
5878 if (required && isAbsent) {
5879 warn$1('Missing required prop: "' + name + '"');
5882 if (value == null && !required) {
5885 if (type != null && type !== true && !skipCheck) {
5886 let isValid = false;
5887 const types = isArray(type) ? type : [type];
5888 const expectedTypes = [];
5889 for (let i = 0; i < types.length && !isValid; i++) {
5890 const { valid, expectedType } = assertType(value, types[i]);
5891 expectedTypes.push(expectedType || "");
5895 warn$1(getInvalidTypeMessage(name, value, expectedTypes));
5899 if (validator && !validator(value, props)) {
5900 warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
5903 const isSimpleType = /* @__PURE__ */ makeMap(
5904 "String,Number,Boolean,Function,Symbol,BigInt"
5906 function assertType(value, type) {
5908 const expectedType = getType(type);
5909 if (isSimpleType(expectedType)) {
5910 const t = typeof value;
5911 valid = t === expectedType.toLowerCase();
5912 if (!valid && t === "object") {
5913 valid = value instanceof type;
5915 } else if (expectedType === "Object") {
5916 valid = isObject(value);
5917 } else if (expectedType === "Array") {
5918 valid = isArray(value);
5919 } else if (expectedType === "null") {
5920 valid = value === null;
5922 valid = value instanceof type;
5929 function getInvalidTypeMessage(name, value, expectedTypes) {
5930 if (expectedTypes.length === 0) {
5931 return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
5933 let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
5934 const expectedType = expectedTypes[0];
5935 const receivedType = toRawType(value);
5936 const expectedValue = styleValue(value, expectedType);
5937 const receivedValue = styleValue(value, receivedType);
5938 if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
5939 message += ` with value ${expectedValue}`;
5941 message += `, got ${receivedType} `;
5942 if (isExplicable(receivedType)) {
5943 message += `with value ${receivedValue}.`;
5947 function styleValue(value, type) {
5948 if (type === "String") {
5949 return `"${value}"`;
5950 } else if (type === "Number") {
5951 return `${Number(value)}`;
5956 function isExplicable(type) {
5957 const explicitTypes = ["string", "number", "boolean"];
5958 return explicitTypes.some((elem) => type.toLowerCase() === elem);
5960 function isBoolean(...args) {
5961 return args.some((elem) => elem.toLowerCase() === "boolean");
5964 const isInternalKey = (key) => key[0] === "_" || key === "$stable";
5965 const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
5966 const normalizeSlot = (key, rawSlot, ctx) => {
5970 const normalized = withCtx((...args) => {
5971 if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
5973 `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.`
5976 return normalizeSlotValue(rawSlot(...args));
5978 normalized._c = false;
5981 const normalizeObjectSlots = (rawSlots, slots, instance) => {
5982 const ctx = rawSlots._ctx;
5983 for (const key in rawSlots) {
5984 if (isInternalKey(key))
5986 const value = rawSlots[key];
5987 if (isFunction(value)) {
5988 slots[key] = normalizeSlot(key, value, ctx);
5989 } else if (value != null) {
5992 `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
5995 const normalized = normalizeSlotValue(value);
5996 slots[key] = () => normalized;
6000 const normalizeVNodeSlots = (instance, children) => {
6001 if (!isKeepAlive(instance.vnode) && true) {
6003 `Non-function value encountered for default slot. Prefer function slots for better performance.`
6006 const normalized = normalizeSlotValue(children);
6007 instance.slots.default = () => normalized;
6009 const initSlots = (instance, children) => {
6010 const slots = instance.slots = createInternalObject();
6011 if (instance.vnode.shapeFlag & 32) {
6012 const type = children._;
6014 extend(slots, children);
6015 def(slots, "_", type, true);
6017 normalizeObjectSlots(children, slots);
6019 } else if (children) {
6020 normalizeVNodeSlots(instance, children);
6023 const updateSlots = (instance, children, optimized) => {
6024 const { vnode, slots } = instance;
6025 let needDeletionCheck = true;
6026 let deletionComparisonTarget = EMPTY_OBJ;
6027 if (vnode.shapeFlag & 32) {
6028 const type = children._;
6030 if (isHmrUpdating) {
6031 extend(slots, children);
6032 trigger(instance, "set", "$slots");
6033 } else if (optimized && type === 1) {
6034 needDeletionCheck = false;
6036 extend(slots, children);
6037 if (!optimized && type === 1) {
6042 needDeletionCheck = !children.$stable;
6043 normalizeObjectSlots(children, slots);
6045 deletionComparisonTarget = children;
6046 } else if (children) {
6047 normalizeVNodeSlots(instance, children);
6048 deletionComparisonTarget = { default: 1 };
6050 if (needDeletionCheck) {
6051 for (const key in slots) {
6052 if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
6059 function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6060 if (isArray(rawRef)) {
6064 oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
6072 if (isAsyncWrapper(vnode) && !isUnmount) {
6075 const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el;
6076 const value = isUnmount ? null : refValue;
6077 const { i: owner, r: ref } = rawRef;
6080 `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
6084 const oldRef = oldRawRef && oldRawRef.r;
6085 const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
6086 const setupState = owner.setupState;
6087 if (oldRef != null && oldRef !== ref) {
6088 if (isString(oldRef)) {
6089 refs[oldRef] = null;
6090 if (hasOwn(setupState, oldRef)) {
6091 setupState[oldRef] = null;
6093 } else if (isRef(oldRef)) {
6094 oldRef.value = null;
6097 if (isFunction(ref)) {
6098 callWithErrorHandling(ref, owner, 12, [value, refs]);
6100 const _isString = isString(ref);
6101 const _isRef = isRef(ref);
6102 if (_isString || _isRef) {
6103 const doSet = () => {
6105 const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
6107 isArray(existing) && remove(existing, refValue);
6109 if (!isArray(existing)) {
6111 refs[ref] = [refValue];
6112 if (hasOwn(setupState, ref)) {
6113 setupState[ref] = refs[ref];
6116 ref.value = [refValue];
6118 refs[rawRef.k] = ref.value;
6120 } else if (!existing.includes(refValue)) {
6121 existing.push(refValue);
6124 } else if (_isString) {
6126 if (hasOwn(setupState, ref)) {
6127 setupState[ref] = value;
6129 } else if (_isRef) {
6132 refs[rawRef.k] = value;
6134 warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
6139 queuePostRenderEffect(doSet, parentSuspense);
6144 warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
6149 let hasMismatch = false;
6150 const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
6151 const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
6152 const getContainerType = (container) => {
6153 if (isSVGContainer(container))
6155 if (isMathMLContainer(container))
6159 const isComment = (node) => node.nodeType === 8 /* COMMENT */;
6160 function createHydrationFunctions(rendererInternals) {
6173 } = rendererInternals;
6174 const hydrate = (vnode, container) => {
6175 if (!container.hasChildNodes()) {
6177 `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
6179 patch(null, vnode, container);
6180 flushPostFlushCbs();
6181 container._vnode = vnode;
6184 hasMismatch = false;
6185 hydrateNode(container.firstChild, vnode, null, null, null);
6186 flushPostFlushCbs();
6187 container._vnode = vnode;
6188 if (hasMismatch && true) {
6189 console.error(`Hydration completed but contains mismatches.`);
6192 const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
6193 optimized = optimized || !!vnode.dynamicChildren;
6194 const isFragmentStart = isComment(node) && node.data === "[";
6195 const onMismatch = () => handleMismatch(
6203 const { type, ref, shapeFlag, patchFlag } = vnode;
6204 let domType = node.nodeType;
6207 if (!("__vnode" in node)) {
6208 Object.defineProperty(node, "__vnode", {
6213 if (!("__vueParentComponent" in node)) {
6214 Object.defineProperty(node, "__vueParentComponent", {
6215 value: parentComponent,
6220 if (patchFlag === -2) {
6222 vnode.dynamicChildren = null;
6224 let nextNode = null;
6227 if (domType !== 3 /* TEXT */) {
6228 if (vnode.children === "") {
6229 insert(vnode.el = createText(""), parentNode(node), node);
6232 nextNode = onMismatch();
6235 if (node.data !== vnode.children) {
6238 `Hydration text mismatch in`,
6241 - rendered on server: ${JSON.stringify(
6244 - expected on client: ${JSON.stringify(vnode.children)}`
6246 node.data = vnode.children;
6248 nextNode = nextSibling(node);
6252 if (isTemplateNode(node)) {
6253 nextNode = nextSibling(node);
6255 vnode.el = node.content.firstChild,
6259 } else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
6260 nextNode = onMismatch();
6262 nextNode = nextSibling(node);
6266 if (isFragmentStart) {
6267 node = nextSibling(node);
6268 domType = node.nodeType;
6270 if (domType === 1 /* ELEMENT */ || domType === 3 /* TEXT */) {
6272 const needToAdoptContent = !vnode.children.length;
6273 for (let i = 0; i < vnode.staticCount; i++) {
6274 if (needToAdoptContent)
6275 vnode.children += nextNode.nodeType === 1 /* ELEMENT */ ? nextNode.outerHTML : nextNode.data;
6276 if (i === vnode.staticCount - 1) {
6277 vnode.anchor = nextNode;
6279 nextNode = nextSibling(nextNode);
6281 return isFragmentStart ? nextSibling(nextNode) : nextNode;
6287 if (!isFragmentStart) {
6288 nextNode = onMismatch();
6290 nextNode = hydrateFragment(
6301 if (shapeFlag & 1) {
6302 if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
6303 nextNode = onMismatch();
6305 nextNode = hydrateElement(
6314 } else if (shapeFlag & 6) {
6315 vnode.slotScopeIds = slotScopeIds;
6316 const container = parentNode(node);
6317 if (isFragmentStart) {
6318 nextNode = locateClosingAnchor(node);
6319 } else if (isComment(node) && node.data === "teleport start") {
6320 nextNode = locateClosingAnchor(node, node.data, "teleport end");
6322 nextNode = nextSibling(node);
6330 getContainerType(container),
6333 if (isAsyncWrapper(vnode)) {
6335 if (isFragmentStart) {
6336 subTree = createVNode(Fragment);
6337 subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
6339 subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
6342 vnode.component.subTree = subTree;
6344 } else if (shapeFlag & 64) {
6345 if (domType !== 8 /* COMMENT */) {
6346 nextNode = onMismatch();
6348 nextNode = vnode.type.hydrate(
6359 } else if (shapeFlag & 128) {
6360 nextNode = vnode.type.hydrate(
6365 getContainerType(parentNode(node)),
6372 warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
6376 setRef(ref, null, parentSuspense, vnode);
6380 const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
6381 optimized = optimized || !!vnode.dynamicChildren;
6382 const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
6383 const forcePatch = type === "input" || type === "option";
6386 invokeDirectiveHook(vnode, null, parentComponent, "created");
6388 let needCallTransitionHooks = false;
6389 if (isTemplateNode(el)) {
6390 needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
6391 const content = el.content.firstChild;
6392 if (needCallTransitionHooks) {
6393 transition.beforeEnter(content);
6395 replaceNode(content, el, parentComponent);
6396 vnode.el = el = content;
6398 if (shapeFlag & 16 && // skip if element has innerHTML / textContent
6399 !(props && (props.innerHTML || props.textContent))) {
6400 let next = hydrateChildren(
6409 let hasWarned = false;
6414 `Hydration children mismatch on`,
6417 Server rendered element contains more child nodes than client vdom.`
6422 next = next.nextSibling;
6425 } else if (shapeFlag & 8) {
6426 if (el.textContent !== vnode.children) {
6429 `Hydration text content mismatch on`,
6432 - rendered on server: ${el.textContent}
6433 - expected on client: ${vnode.children}`
6435 el.textContent = vnode.children;
6440 for (const key in props) {
6441 if (propHasMismatch(el, key, props[key], vnode, parentComponent)) {
6444 if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
6460 if (vnodeHooks = props && props.onVnodeBeforeMount) {
6461 invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6464 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6466 if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
6467 queueEffectWithSuspense(() => {
6468 vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6469 needCallTransitionHooks && transition.enter(el);
6470 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6474 return el.nextSibling;
6476 const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
6477 optimized = optimized || !!parentVNode.dynamicChildren;
6478 const children = parentVNode.children;
6479 const l = children.length;
6480 let hasWarned = false;
6481 for (let i = 0; i < l; i++) {
6482 const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
6492 } else if (vnode.type === Text && !vnode.children) {
6498 `Hydration children mismatch on`,
6501 Server rendered element contains fewer child nodes than client vdom.`
6512 getContainerType(container),
6519 const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
6520 const { slotScopeIds: fragmentSlotScopeIds } = vnode;
6521 if (fragmentSlotScopeIds) {
6522 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
6524 const container = parentNode(node);
6525 const next = hydrateChildren(
6534 if (next && isComment(next) && next.data === "]") {
6535 return nextSibling(vnode.anchor = next);
6538 insert(vnode.anchor = createComment(`]`), container, next);
6542 const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
6545 `Hydration node mismatch:
6546 - rendered on server:`,
6548 node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
6550 - expected on client:`,
6555 const end = locateClosingAnchor(node);
6557 const next2 = nextSibling(node);
6558 if (next2 && next2 !== end) {
6565 const next = nextSibling(node);
6566 const container = parentNode(node);
6575 getContainerType(container),
6580 const locateClosingAnchor = (node, open = "[", close = "]") => {
6583 node = nextSibling(node);
6584 if (node && isComment(node)) {
6585 if (node.data === open)
6587 if (node.data === close) {
6589 return nextSibling(node);
6598 const replaceNode = (newNode, oldNode, parentComponent) => {
6599 const parentNode2 = oldNode.parentNode;
6601 parentNode2.replaceChild(newNode, oldNode);
6603 let parent = parentComponent;
6605 if (parent.vnode.el === oldNode) {
6606 parent.vnode.el = parent.subTree.el = newNode;
6608 parent = parent.parent;
6611 const isTemplateNode = (node) => {
6612 return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
6614 return [hydrate, hydrateNode];
6616 function propHasMismatch(el, key, clientValue, vnode, instance) {
6622 if (key === "class") {
6623 actual = el.getAttribute("class");
6624 expected = normalizeClass(clientValue);
6625 if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
6626 mismatchType = mismatchKey = `class`;
6628 } else if (key === "style") {
6629 actual = el.getAttribute("style") || "";
6630 expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
6631 const actualMap = toStyleMap(actual);
6632 const expectedMap = toStyleMap(expected);
6634 for (const { dir, value } of vnode.dirs) {
6635 if (dir.name === "show" && !value) {
6636 expectedMap.set("display", "none");
6640 const root = instance == null ? void 0 : instance.subTree;
6641 if (vnode === root || (root == null ? void 0 : root.type) === Fragment && root.children.includes(vnode)) {
6642 const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
6643 for (const key2 in cssVars) {
6644 expectedMap.set(`--${key2}`, String(cssVars[key2]));
6647 if (!isMapEqual(actualMap, expectedMap)) {
6648 mismatchType = mismatchKey = "style";
6650 } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
6651 if (isBooleanAttr(key)) {
6652 actual = el.hasAttribute(key);
6653 expected = includeBooleanAttr(clientValue);
6654 } else if (clientValue == null) {
6655 actual = el.hasAttribute(key);
6658 if (el.hasAttribute(key)) {
6659 actual = el.getAttribute(key);
6660 } else if (key === "value" && el.tagName === "TEXTAREA") {
6665 expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
6667 if (actual !== expected) {
6668 mismatchType = `attribute`;
6673 const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
6674 const preSegment = `Hydration ${mismatchType} mismatch on`;
6675 const postSegment = `
6676 - rendered on server: ${format(actual)}
6677 - expected on client: ${format(expected)}
6678 Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
6679 You should fix the source of the mismatch.`;
6681 warn$1(preSegment, el, postSegment);
6687 function toClassSet(str) {
6688 return new Set(str.trim().split(/\s+/));
6690 function isSetEqual(a, b) {
6691 if (a.size !== b.size) {
6694 for (const s of a) {
6701 function toStyleMap(str) {
6702 const styleMap = /* @__PURE__ */ new Map();
6703 for (const item of str.split(";")) {
6704 let [key, value] = item.split(":");
6705 key = key == null ? void 0 : key.trim();
6706 value = value == null ? void 0 : value.trim();
6708 styleMap.set(key, value);
6713 function isMapEqual(a, b) {
6714 if (a.size !== b.size) {
6717 for (const [key, value] of a) {
6718 if (value !== b.get(key)) {
6727 function startMeasure(instance, type) {
6728 if (instance.appContext.config.performance && isSupported()) {
6729 perf.mark(`vue-${type}-${instance.uid}`);
6732 devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
6735 function endMeasure(instance, type) {
6736 if (instance.appContext.config.performance && isSupported()) {
6737 const startTag = `vue-${type}-${instance.uid}`;
6738 const endTag = startTag + `:end`;
6741 `<${formatComponentName(instance, instance.type)}> ${type}`,
6745 perf.clearMarks(startTag);
6746 perf.clearMarks(endTag);
6749 devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
6752 function isSupported() {
6753 if (supported !== void 0) {
6756 if (typeof window !== "undefined" && window.performance) {
6758 perf = window.performance;
6765 const queuePostRenderEffect = queueEffectWithSuspense ;
6766 function createRenderer(options) {
6767 return baseCreateRenderer(options);
6769 function createHydrationRenderer(options) {
6770 return baseCreateRenderer(options, createHydrationFunctions);
6772 function baseCreateRenderer(options, createHydrationFns) {
6773 const target = getGlobalThis();
6774 target.__VUE__ = true;
6776 setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
6781 patchProp: hostPatchProp,
6782 createElement: hostCreateElement,
6783 createText: hostCreateText,
6784 createComment: hostCreateComment,
6785 setText: hostSetText,
6786 setElementText: hostSetElementText,
6787 parentNode: hostParentNode,
6788 nextSibling: hostNextSibling,
6789 setScopeId: hostSetScopeId = NOOP,
6790 insertStaticContent: hostInsertStaticContent
6792 const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
6796 if (n1 && !isSameVNodeType(n1, n2)) {
6797 anchor = getNextHostNode(n1);
6798 unmount(n1, parentComponent, parentSuspense, true);
6801 if (n2.patchFlag === -2) {
6803 n2.dynamicChildren = null;
6805 const { type, ref, shapeFlag } = n2;
6808 processText(n1, n2, container, anchor);
6811 processCommentNode(n1, n2, container, anchor);
6815 mountStaticNode(n2, container, anchor, namespace);
6817 patchStaticNode(n1, n2, container, namespace);
6834 if (shapeFlag & 1) {
6846 } else if (shapeFlag & 6) {
6858 } else if (shapeFlag & 64) {
6871 } else if (shapeFlag & 128) {
6885 warn$1("Invalid VNode type:", type, `(${typeof type})`);
6888 if (ref != null && parentComponent) {
6889 setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
6892 const processText = (n1, n2, container, anchor) => {
6895 n2.el = hostCreateText(n2.children),
6900 const el = n2.el = n1.el;
6901 if (n2.children !== n1.children) {
6902 hostSetText(el, n2.children);
6906 const processCommentNode = (n1, n2, container, anchor) => {
6909 n2.el = hostCreateComment(n2.children || ""),
6917 const mountStaticNode = (n2, container, anchor, namespace) => {
6918 [n2.el, n2.anchor] = hostInsertStaticContent(
6927 const patchStaticNode = (n1, n2, container, namespace) => {
6928 if (n2.children !== n1.children) {
6929 const anchor = hostNextSibling(n1.anchor);
6930 removeStaticNode(n1);
6931 [n2.el, n2.anchor] = hostInsertStaticContent(
6939 n2.anchor = n1.anchor;
6942 const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
6944 while (el && el !== anchor) {
6945 next = hostNextSibling(el);
6946 hostInsert(el, container, nextSibling);
6949 hostInsert(anchor, container, nextSibling);
6951 const removeStaticNode = ({ el, anchor }) => {
6953 while (el && el !== anchor) {
6954 next = hostNextSibling(el);
6960 const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6961 if (n2.type === "svg") {
6963 } else if (n2.type === "math") {
6964 namespace = "mathml";
6989 const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6992 const { props, shapeFlag, transition, dirs } = vnode;
6993 el = vnode.el = hostCreateElement(
6999 if (shapeFlag & 8) {
7000 hostSetElementText(el, vnode.children);
7001 } else if (shapeFlag & 16) {
7008 resolveChildrenNamespace(vnode, namespace),
7014 invokeDirectiveHook(vnode, null, parentComponent, "created");
7016 setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
7018 for (const key in props) {
7019 if (key !== "value" && !isReservedProp(key)) {
7033 if ("value" in props) {
7034 hostPatchProp(el, "value", null, props.value, namespace);
7036 if (vnodeHook = props.onVnodeBeforeMount) {
7037 invokeVNodeHook(vnodeHook, parentComponent, vnode);
7041 Object.defineProperty(el, "__vnode", {
7045 Object.defineProperty(el, "__vueParentComponent", {
7046 value: parentComponent,
7051 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7053 const needCallTransitionHooks = needTransition(parentSuspense, transition);
7054 if (needCallTransitionHooks) {
7055 transition.beforeEnter(el);
7057 hostInsert(el, container, anchor);
7058 if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
7059 queuePostRenderEffect(() => {
7060 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7061 needCallTransitionHooks && transition.enter(el);
7062 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7066 const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
7068 hostSetScopeId(el, scopeId);
7071 for (let i = 0; i < slotScopeIds.length; i++) {
7072 hostSetScopeId(el, slotScopeIds[i]);
7075 if (parentComponent) {
7076 let subTree = parentComponent.subTree;
7077 if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
7078 subTree = filterSingleRoot(subTree.children) || subTree;
7080 if (vnode === subTree) {
7081 const parentVNode = parentComponent.vnode;
7085 parentVNode.scopeId,
7086 parentVNode.slotScopeIds,
7087 parentComponent.parent
7092 const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
7093 for (let i = start; i < children.length; i++) {
7094 const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
7108 const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7109 const el = n2.el = n1.el;
7110 let { patchFlag, dynamicChildren, dirs } = n2;
7111 patchFlag |= n1.patchFlag & 16;
7112 const oldProps = n1.props || EMPTY_OBJ;
7113 const newProps = n2.props || EMPTY_OBJ;
7115 parentComponent && toggleRecurse(parentComponent, false);
7116 if (vnodeHook = newProps.onVnodeBeforeUpdate) {
7117 invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
7120 invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
7122 parentComponent && toggleRecurse(parentComponent, true);
7123 if (isHmrUpdating) {
7126 dynamicChildren = null;
7128 if (dynamicChildren) {
7135 resolveChildrenNamespace(n2, namespace),
7139 traverseStaticChildren(n1, n2);
7141 } else if (!optimized) {
7149 resolveChildrenNamespace(n2, namespace),
7154 if (patchFlag > 0) {
7155 if (patchFlag & 16) {
7166 if (patchFlag & 2) {
7167 if (oldProps.class !== newProps.class) {
7168 hostPatchProp(el, "class", null, newProps.class, namespace);
7171 if (patchFlag & 4) {
7172 hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
7174 if (patchFlag & 8) {
7175 const propsToUpdate = n2.dynamicProps;
7176 for (let i = 0; i < propsToUpdate.length; i++) {
7177 const key = propsToUpdate[i];
7178 const prev = oldProps[key];
7179 const next = newProps[key];
7180 if (next !== prev || key === "value") {
7196 if (patchFlag & 1) {
7197 if (n1.children !== n2.children) {
7198 hostSetElementText(el, n2.children);
7201 } else if (!optimized && dynamicChildren == null) {
7212 if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
7213 queuePostRenderEffect(() => {
7214 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
7215 dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
7219 const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
7220 for (let i = 0; i < newChildren.length; i++) {
7221 const oldVNode = oldChildren[i];
7222 const newVNode = newChildren[i];
7224 // oldVNode may be an errored async setup() component inside Suspense
7225 // which will not have a mounted element
7226 oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
7227 // of the Fragment itself so it can move its children.
7228 (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
7229 // which also requires the correct parent container
7230 !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
7231 oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
7232 // In other cases, the parent container is not actually used so we
7233 // just pass the block element here to avoid a DOM parentNode call.
7250 const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
7251 if (oldProps !== newProps) {
7252 if (oldProps !== EMPTY_OBJ) {
7253 for (const key in oldProps) {
7254 if (!isReservedProp(key) && !(key in newProps)) {
7269 for (const key in newProps) {
7270 if (isReservedProp(key))
7272 const next = newProps[key];
7273 const prev = oldProps[key];
7274 if (next !== prev && key !== "value") {
7288 if ("value" in newProps) {
7289 hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
7293 const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7294 const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
7295 const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
7296 let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
7298 // #5523 dev root fragment may inherit directives
7299 isHmrUpdating || patchFlag & 2048
7303 dynamicChildren = null;
7305 if (fragmentSlotScopeIds) {
7306 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
7309 hostInsert(fragmentStartAnchor, container, anchor);
7310 hostInsert(fragmentEndAnchor, container, anchor);
7313 // such fragment like `<></>` will be compiled into
7314 // a fragment which doesn't have a children.
7315 // In this case fallback to an empty array
7326 if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
7327 // of renderSlot() with no valid children
7328 n1.dynamicChildren) {
7339 traverseStaticChildren(n1, n2);
7356 const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7357 n2.slotScopeIds = slotScopeIds;
7359 if (n2.shapeFlag & 512) {
7360 parentComponent.ctx.activate(
7379 updateComponent(n1, n2, optimized);
7382 const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
7383 const instance = (initialVNode.component = createComponentInstance(
7388 if (instance.type.__hmrId) {
7389 registerHMR(instance);
7392 pushWarningContext(initialVNode);
7393 startMeasure(instance, `mount`);
7395 if (isKeepAlive(initialVNode)) {
7396 instance.ctx.renderer = internals;
7400 startMeasure(instance, `init`);
7402 setupComponent(instance);
7404 endMeasure(instance, `init`);
7407 if (instance.asyncDep) {
7408 parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);
7409 if (!initialVNode.el) {
7410 const placeholder = instance.subTree = createVNode(Comment);
7411 processCommentNode(null, placeholder, container, anchor);
7425 popWarningContext();
7426 endMeasure(instance, `mount`);
7429 const updateComponent = (n1, n2, optimized) => {
7430 const instance = n2.component = n1.component;
7431 if (shouldUpdateComponent(n1, n2, optimized)) {
7432 if (instance.asyncDep && !instance.asyncResolved) {
7434 pushWarningContext(n2);
7436 updateComponentPreRender(instance, n2, optimized);
7438 popWarningContext();
7443 invalidateJob(instance.update);
7444 instance.effect.dirty = true;
7449 instance.vnode = n2;
7452 const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
7453 const componentUpdateFn = () => {
7454 if (!instance.isMounted) {
7456 const { el, props } = initialVNode;
7457 const { bm, m, parent } = instance;
7458 const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
7459 toggleRecurse(instance, false);
7463 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
7464 invokeVNodeHook(vnodeHook, parent, initialVNode);
7466 toggleRecurse(instance, true);
7467 if (el && hydrateNode) {
7468 const hydrateSubTree = () => {
7470 startMeasure(instance, `render`);
7472 instance.subTree = renderComponentRoot(instance);
7474 endMeasure(instance, `render`);
7477 startMeasure(instance, `hydrate`);
7487 endMeasure(instance, `hydrate`);
7490 if (isAsyncWrapperVNode) {
7491 initialVNode.type.__asyncLoader().then(
7492 // note: we are moving the render call into an async callback,
7493 // which means it won't track dependencies - but it's ok because
7494 // a server-rendered async wrapper is already in resolved state
7495 // and it will never need to change.
7496 () => !instance.isUnmounted && hydrateSubTree()
7503 startMeasure(instance, `render`);
7505 const subTree = instance.subTree = renderComponentRoot(instance);
7507 endMeasure(instance, `render`);
7510 startMeasure(instance, `patch`);
7522 endMeasure(instance, `patch`);
7524 initialVNode.el = subTree.el;
7527 queuePostRenderEffect(m, parentSuspense);
7529 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
7530 const scopedInitialVNode = initialVNode;
7531 queuePostRenderEffect(
7532 () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
7536 if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
7537 instance.a && queuePostRenderEffect(instance.a, parentSuspense);
7539 instance.isMounted = true;
7541 devtoolsComponentAdded(instance);
7543 initialVNode = container = anchor = null;
7545 let { next, bu, u, parent, vnode } = instance;
7547 const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
7548 if (nonHydratedAsyncRoot) {
7551 updateComponentPreRender(instance, next, optimized);
7553 nonHydratedAsyncRoot.asyncDep.then(() => {
7554 if (!instance.isUnmounted) {
7555 componentUpdateFn();
7561 let originNext = next;
7564 pushWarningContext(next || instance.vnode);
7566 toggleRecurse(instance, false);
7569 updateComponentPreRender(instance, next, optimized);
7576 if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
7577 invokeVNodeHook(vnodeHook, parent, next, vnode);
7579 toggleRecurse(instance, true);
7581 startMeasure(instance, `render`);
7583 const nextTree = renderComponentRoot(instance);
7585 endMeasure(instance, `render`);
7587 const prevTree = instance.subTree;
7588 instance.subTree = nextTree;
7590 startMeasure(instance, `patch`);
7595 // parent may have changed if it's in a teleport
7596 hostParentNode(prevTree.el),
7597 // anchor may have changed if it's in a fragment
7598 getNextHostNode(prevTree),
7604 endMeasure(instance, `patch`);
7606 next.el = nextTree.el;
7607 if (originNext === null) {
7608 updateHOCHostEl(instance, nextTree.el);
7611 queuePostRenderEffect(u, parentSuspense);
7613 if (vnodeHook = next.props && next.props.onVnodeUpdated) {
7614 queuePostRenderEffect(
7615 () => invokeVNodeHook(vnodeHook, parent, next, vnode),
7620 devtoolsComponentUpdated(instance);
7623 popWarningContext();
7627 const effect = instance.effect = new ReactiveEffect(
7630 () => queueJob(update),
7632 // track it in component's effect scope
7634 const update = instance.update = () => {
7639 update.id = instance.uid;
7640 toggleRecurse(instance, true);
7642 effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
7643 effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
7644 update.ownerInstance = instance;
7648 const updateComponentPreRender = (instance, nextVNode, optimized) => {
7649 nextVNode.component = instance;
7650 const prevProps = instance.vnode.props;
7651 instance.vnode = nextVNode;
7652 instance.next = null;
7653 updateProps(instance, nextVNode.props, prevProps, optimized);
7654 updateSlots(instance, nextVNode.children, optimized);
7656 flushPreFlushCbs(instance);
7659 const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
7660 const c1 = n1 && n1.children;
7661 const prevShapeFlag = n1 ? n1.shapeFlag : 0;
7662 const c2 = n2.children;
7663 const { patchFlag, shapeFlag } = n2;
7664 if (patchFlag > 0) {
7665 if (patchFlag & 128) {
7678 } else if (patchFlag & 256) {
7679 patchUnkeyedChildren(
7693 if (shapeFlag & 8) {
7694 if (prevShapeFlag & 16) {
7695 unmountChildren(c1, parentComponent, parentSuspense);
7698 hostSetElementText(container, c2);
7701 if (prevShapeFlag & 16) {
7702 if (shapeFlag & 16) {
7715 unmountChildren(c1, parentComponent, parentSuspense, true);
7718 if (prevShapeFlag & 8) {
7719 hostSetElementText(container, "");
7721 if (shapeFlag & 16) {
7736 const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7737 c1 = c1 || EMPTY_ARR;
7738 c2 = c2 || EMPTY_ARR;
7739 const oldLength = c1.length;
7740 const newLength = c2.length;
7741 const commonLength = Math.min(oldLength, newLength);
7743 for (i = 0; i < commonLength; i++) {
7744 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
7757 if (oldLength > newLength) {
7780 const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7782 const l2 = c2.length;
7783 let e1 = c1.length - 1;
7785 while (i <= e1 && i <= e2) {
7787 const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
7788 if (isSameVNodeType(n1, n2)) {
7805 while (i <= e1 && i <= e2) {
7807 const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
7808 if (isSameVNodeType(n1, n2)) {
7828 const nextPos = e2 + 1;
7829 const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
7833 c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
7845 } else if (i > e2) {
7847 unmount(c1[i], parentComponent, parentSuspense, true);
7853 const keyToNewIndexMap = /* @__PURE__ */ new Map();
7854 for (i = s2; i <= e2; i++) {
7855 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
7856 if (nextChild.key != null) {
7857 if (keyToNewIndexMap.has(nextChild.key)) {
7859 `Duplicate keys found during update:`,
7860 JSON.stringify(nextChild.key),
7861 `Make sure keys are unique.`
7864 keyToNewIndexMap.set(nextChild.key, i);
7869 const toBePatched = e2 - s2 + 1;
7871 let maxNewIndexSoFar = 0;
7872 const newIndexToOldIndexMap = new Array(toBePatched);
7873 for (i = 0; i < toBePatched; i++)
7874 newIndexToOldIndexMap[i] = 0;
7875 for (i = s1; i <= e1; i++) {
7876 const prevChild = c1[i];
7877 if (patched >= toBePatched) {
7878 unmount(prevChild, parentComponent, parentSuspense, true);
7882 if (prevChild.key != null) {
7883 newIndex = keyToNewIndexMap.get(prevChild.key);
7885 for (j = s2; j <= e2; j++) {
7886 if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
7892 if (newIndex === void 0) {
7893 unmount(prevChild, parentComponent, parentSuspense, true);
7895 newIndexToOldIndexMap[newIndex - s2] = i + 1;
7896 if (newIndex >= maxNewIndexSoFar) {
7897 maxNewIndexSoFar = newIndex;
7915 const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
7916 j = increasingNewIndexSequence.length - 1;
7917 for (i = toBePatched - 1; i >= 0; i--) {
7918 const nextIndex = s2 + i;
7919 const nextChild = c2[nextIndex];
7920 const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
7921 if (newIndexToOldIndexMap[i] === 0) {
7934 if (j < 0 || i !== increasingNewIndexSequence[j]) {
7935 move(nextChild, container, anchor, 2);
7943 const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
7944 const { el, type, transition, children, shapeFlag } = vnode;
7945 if (shapeFlag & 6) {
7946 move(vnode.component.subTree, container, anchor, moveType);
7949 if (shapeFlag & 128) {
7950 vnode.suspense.move(container, anchor, moveType);
7953 if (shapeFlag & 64) {
7954 type.move(vnode, container, anchor, internals);
7957 if (type === Fragment) {
7958 hostInsert(el, container, anchor);
7959 for (let i = 0; i < children.length; i++) {
7960 move(children[i], container, anchor, moveType);
7962 hostInsert(vnode.anchor, container, anchor);
7965 if (type === Static) {
7966 moveStaticNode(vnode, container, anchor);
7969 const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
7970 if (needTransition2) {
7971 if (moveType === 0) {
7972 transition.beforeEnter(el);
7973 hostInsert(el, container, anchor);
7974 queuePostRenderEffect(() => transition.enter(el), parentSuspense);
7976 const { leave, delayLeave, afterLeave } = transition;
7977 const remove2 = () => hostInsert(el, container, anchor);
7978 const performLeave = () => {
7981 afterLeave && afterLeave();
7985 delayLeave(el, remove2, performLeave);
7991 hostInsert(el, container, anchor);
7994 const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
8006 setRef(ref, null, parentSuspense, vnode, true);
8008 if (shapeFlag & 256) {
8009 parentComponent.ctx.deactivate(vnode);
8012 const shouldInvokeDirs = shapeFlag & 1 && dirs;
8013 const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
8015 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
8016 invokeVNodeHook(vnodeHook, parentComponent, vnode);
8018 if (shapeFlag & 6) {
8019 unmountComponent(vnode.component, parentSuspense, doRemove);
8021 if (shapeFlag & 128) {
8022 vnode.suspense.unmount(parentSuspense, doRemove);
8025 if (shouldInvokeDirs) {
8026 invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
8028 if (shapeFlag & 64) {
8037 } else if (dynamicChildren && // #1153: fast path should not be taken for non-stable (v-for) fragments
8038 (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
8046 } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
8047 unmountChildren(children, parentComponent, parentSuspense);
8053 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
8054 queuePostRenderEffect(() => {
8055 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
8056 shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
8060 const remove = (vnode) => {
8061 const { type, el, anchor, transition } = vnode;
8062 if (type === Fragment) {
8063 if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
8064 vnode.children.forEach((child) => {
8065 if (child.type === Comment) {
8066 hostRemove(child.el);
8072 removeFragment(el, anchor);
8076 if (type === Static) {
8077 removeStaticNode(vnode);
8080 const performRemove = () => {
8082 if (transition && !transition.persisted && transition.afterLeave) {
8083 transition.afterLeave();
8086 if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
8087 const { leave, delayLeave } = transition;
8088 const performLeave = () => leave(el, performRemove);
8090 delayLeave(vnode.el, performRemove, performLeave);
8098 const removeFragment = (cur, end) => {
8100 while (cur !== end) {
8101 next = hostNextSibling(cur);
8107 const unmountComponent = (instance, parentSuspense, doRemove) => {
8108 if (instance.type.__hmrId) {
8109 unregisterHMR(instance);
8111 const { bum, scope, update, subTree, um } = instance;
8113 invokeArrayFns(bum);
8117 update.active = false;
8118 unmount(subTree, instance, parentSuspense, doRemove);
8121 queuePostRenderEffect(um, parentSuspense);
8123 queuePostRenderEffect(() => {
8124 instance.isUnmounted = true;
8126 if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
8127 parentSuspense.deps--;
8128 if (parentSuspense.deps === 0) {
8129 parentSuspense.resolve();
8133 devtoolsComponentRemoved(instance);
8136 const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
8137 for (let i = start; i < children.length; i++) {
8138 unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
8141 const getNextHostNode = (vnode) => {
8142 if (vnode.shapeFlag & 6) {
8143 return getNextHostNode(vnode.component.subTree);
8145 if (vnode.shapeFlag & 128) {
8146 return vnode.suspense.next();
8148 return hostNextSibling(vnode.anchor || vnode.el);
8150 let isFlushing = false;
8151 const render = (vnode, container, namespace) => {
8152 if (vnode == null) {
8153 if (container._vnode) {
8154 unmount(container._vnode, null, null, true);
8158 container._vnode || null,
8170 flushPostFlushCbs();
8173 container._vnode = vnode;
8183 pbc: patchBlockChildren,
8189 if (createHydrationFns) {
8190 [hydrate, hydrateNode] = createHydrationFns(
8197 createApp: createAppAPI(render, hydrate)
8200 function resolveChildrenNamespace({ type, props }, currentNamespace) {
8201 return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
8203 function toggleRecurse({ effect, update }, allowed) {
8204 effect.allowRecurse = update.allowRecurse = allowed;
8206 function needTransition(parentSuspense, transition) {
8207 return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
8209 function traverseStaticChildren(n1, n2, shallow = false) {
8210 const ch1 = n1.children;
8211 const ch2 = n2.children;
8212 if (isArray(ch1) && isArray(ch2)) {
8213 for (let i = 0; i < ch1.length; i++) {
8216 if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
8217 if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
8218 c2 = ch2[i] = cloneIfMounted(ch2[i]);
8222 traverseStaticChildren(c1, c2);
8224 if (c2.type === Text) {
8227 if (c2.type === Comment && !c2.el) {
8233 function getSequence(arr) {
8234 const p = arr.slice();
8237 const len = arr.length;
8238 for (i = 0; i < len; i++) {
8239 const arrI = arr[i];
8241 j = result[result.length - 1];
8242 if (arr[j] < arrI) {
8248 v = result.length - 1;
8251 if (arr[result[c]] < arrI) {
8257 if (arrI < arr[result[u]]) {
8259 p[i] = result[u - 1];
8273 function locateNonHydratedAsyncRoot(instance) {
8274 const subComponent = instance.subTree.component;
8276 if (subComponent.asyncDep && !subComponent.asyncResolved) {
8277 return subComponent;
8279 return locateNonHydratedAsyncRoot(subComponent);
8284 const isTeleport = (type) => type.__isTeleport;
8285 const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
8286 const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
8287 const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
8288 const resolveTarget = (props, select) => {
8289 const targetSelector = props && props.to;
8290 if (isString(targetSelector)) {
8293 `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
8297 const target = select(targetSelector);
8300 `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.`
8306 if (!targetSelector && !isTeleportDisabled(props)) {
8307 warn$1(`Invalid Teleport target: ${targetSelector}`);
8309 return targetSelector;
8312 const TeleportImpl = {
8315 process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
8319 pbc: patchBlockChildren,
8320 o: { insert, querySelector, createText, createComment }
8322 const disabled = isTeleportDisabled(n2.props);
8323 let { shapeFlag, children, dynamicChildren } = n2;
8324 if (isHmrUpdating) {
8326 dynamicChildren = null;
8329 const placeholder = n2.el = createComment("teleport start") ;
8330 const mainAnchor = n2.anchor = createComment("teleport end") ;
8331 insert(placeholder, container, anchor);
8332 insert(mainAnchor, container, anchor);
8333 const target = n2.target = resolveTarget(n2.props, querySelector);
8334 const targetAnchor = n2.targetAnchor = createText("");
8336 insert(targetAnchor, target);
8337 if (namespace === "svg" || isTargetSVG(target)) {
8339 } else if (namespace === "mathml" || isTargetMathML(target)) {
8340 namespace = "mathml";
8342 } else if (!disabled) {
8343 warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
8345 const mount = (container2, anchor2) => {
8346 if (shapeFlag & 16) {
8360 mount(container, mainAnchor);
8361 } else if (target) {
8362 mount(target, targetAnchor);
8366 const mainAnchor = n2.anchor = n1.anchor;
8367 const target = n2.target = n1.target;
8368 const targetAnchor = n2.targetAnchor = n1.targetAnchor;
8369 const wasDisabled = isTeleportDisabled(n1.props);
8370 const currentContainer = wasDisabled ? container : target;
8371 const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
8372 if (namespace === "svg" || isTargetSVG(target)) {
8374 } else if (namespace === "mathml" || isTargetMathML(target)) {
8375 namespace = "mathml";
8377 if (dynamicChildren) {
8387 traverseStaticChildren(n1, n2, true);
8388 } else if (!optimized) {
8411 if (n2.props && n1.props && n2.props.to !== n1.props.to) {
8412 n2.props.to = n1.props.to;
8416 if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
8417 const nextTarget = n2.target = resolveTarget(
8431 "Invalid Teleport target on update:",
8433 `(${typeof target})`
8436 } else if (wasDisabled) {
8449 remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
8450 const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
8452 hostRemove(targetAnchor);
8454 doRemove && hostRemove(anchor);
8455 if (shapeFlag & 16) {
8456 const shouldRemove = doRemove || !isTeleportDisabled(props);
8457 for (let i = 0; i < children.length; i++) {
8458 const child = children[i];
8464 !!child.dynamicChildren
8470 hydrate: hydrateTeleport
8472 function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
8473 if (moveType === 0) {
8474 insert(vnode.targetAnchor, container, parentAnchor);
8476 const { el, anchor, shapeFlag, children, props } = vnode;
8477 const isReorder = moveType === 2;
8479 insert(el, container, parentAnchor);
8481 if (!isReorder || isTeleportDisabled(props)) {
8482 if (shapeFlag & 16) {
8483 for (let i = 0; i < children.length; i++) {
8494 insert(anchor, container, parentAnchor);
8497 function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
8498 o: { nextSibling, parentNode, querySelector }
8499 }, hydrateChildren) {
8500 const target = vnode.target = resolveTarget(
8505 const targetNode = target._lpa || target.firstChild;
8506 if (vnode.shapeFlag & 16) {
8507 if (isTeleportDisabled(vnode.props)) {
8508 vnode.anchor = hydrateChildren(
8517 vnode.targetAnchor = targetNode;
8519 vnode.anchor = nextSibling(node);
8520 let targetAnchor = targetNode;
8521 while (targetAnchor) {
8522 targetAnchor = nextSibling(targetAnchor);
8523 if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
8524 vnode.targetAnchor = targetAnchor;
8525 target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
8540 updateCssVars(vnode);
8542 return vnode.anchor && nextSibling(vnode.anchor);
8544 const Teleport = TeleportImpl;
8545 function updateCssVars(vnode) {
8546 const ctx = vnode.ctx;
8547 if (ctx && ctx.ut) {
8548 let node = vnode.children[0].el;
8549 while (node && node !== vnode.targetAnchor) {
8550 if (node.nodeType === 1)
8551 node.setAttribute("data-v-owner", ctx.uid);
8552 node = node.nextSibling;
8558 const Fragment = Symbol.for("v-fgt");
8559 const Text = Symbol.for("v-txt");
8560 const Comment = Symbol.for("v-cmt");
8561 const Static = Symbol.for("v-stc");
8562 const blockStack = [];
8563 let currentBlock = null;
8564 function openBlock(disableTracking = false) {
8565 blockStack.push(currentBlock = disableTracking ? null : []);
8567 function closeBlock() {
8569 currentBlock = blockStack[blockStack.length - 1] || null;
8571 let isBlockTreeEnabled = 1;
8572 function setBlockTracking(value) {
8573 isBlockTreeEnabled += value;
8575 function setupBlock(vnode) {
8576 vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
8578 if (isBlockTreeEnabled > 0 && currentBlock) {
8579 currentBlock.push(vnode);
8583 function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
8596 function createBlock(type, props, children, patchFlag, dynamicProps) {
8608 function isVNode(value) {
8609 return value ? value.__v_isVNode === true : false;
8611 function isSameVNodeType(n1, n2) {
8612 if (n2.shapeFlag & 6 && hmrDirtyComponents.has(n2.type)) {
8613 n1.shapeFlag &= ~256;
8614 n2.shapeFlag &= ~512;
8617 return n1.type === n2.type && n1.key === n2.key;
8619 let vnodeArgsTransformer;
8620 function transformVNodeArgs(transformer) {
8621 vnodeArgsTransformer = transformer;
8623 const createVNodeWithArgsTransform = (...args) => {
8624 return _createVNode(
8625 ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
8628 const normalizeKey = ({ key }) => key != null ? key : null;
8629 const normalizeRef = ({
8634 if (typeof ref === "number") {
8637 return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
8639 function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
8645 key: props && normalizeKey(props),
8646 ref: props && normalizeRef(props),
8647 scopeId: currentScopeId,
8664 dynamicChildren: null,
8666 ctx: currentRenderingInstance
8668 if (needFullChildrenNormalization) {
8669 normalizeChildren(vnode, children);
8670 if (shapeFlag & 128) {
8671 type.normalize(vnode);
8673 } else if (children) {
8674 vnode.shapeFlag |= isString(children) ? 8 : 16;
8676 if (vnode.key !== vnode.key) {
8677 warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
8679 if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
8680 !isBlockNode && // has current parent block
8681 currentBlock && // presence of a patch flag indicates this node needs patching on updates.
8682 // component nodes also should always be patched, because even if the
8683 // component doesn't need to update, it needs to persist the instance on to
8684 // the next vnode so that it can be properly unmounted later.
8685 (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
8686 // vnode should not be considered dynamic due to handler caching.
8687 vnode.patchFlag !== 32) {
8688 currentBlock.push(vnode);
8692 const createVNode = createVNodeWithArgsTransform ;
8693 function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
8694 if (!type || type === NULL_DYNAMIC_COMPONENT) {
8696 warn$1(`Invalid vnode type when creating vnode: ${type}.`);
8700 if (isVNode(type)) {
8701 const cloned = cloneVNode(
8705 /* mergeRef: true */
8708 normalizeChildren(cloned, children);
8710 if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
8711 if (cloned.shapeFlag & 6) {
8712 currentBlock[currentBlock.indexOf(type)] = cloned;
8714 currentBlock.push(cloned);
8717 cloned.patchFlag |= -2;
8720 if (isClassComponent(type)) {
8721 type = type.__vccOpts;
8724 props = guardReactiveProps(props);
8725 let { class: klass, style } = props;
8726 if (klass && !isString(klass)) {
8727 props.class = normalizeClass(klass);
8729 if (isObject(style)) {
8730 if (isProxy(style) && !isArray(style)) {
8731 style = extend({}, style);
8733 props.style = normalizeStyle(style);
8736 const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
8737 if (shapeFlag & 4 && isProxy(type)) {
8740 `Vue received a Component that 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\`.`,
8742 Component that was made reactive: `,
8746 return createBaseVNode(
8757 function guardReactiveProps(props) {
8760 return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
8762 function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
8763 const { props, ref, patchFlag, children, transition } = vnode;
8764 const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
8770 key: mergedProps && normalizeKey(mergedProps),
8771 ref: extraProps && extraProps.ref ? (
8772 // #2078 in the case of <component :is="vnode" ref="extra"/>
8773 // if the vnode itself already has a ref, cloneVNode will need to merge
8774 // the refs so the single vnode can be set on multiple refs
8775 mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
8777 scopeId: vnode.scopeId,
8778 slotScopeIds: vnode.slotScopeIds,
8779 children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
8780 target: vnode.target,
8781 targetAnchor: vnode.targetAnchor,
8782 staticCount: vnode.staticCount,
8783 shapeFlag: vnode.shapeFlag,
8784 // if the vnode is cloned with extra props, we can no longer assume its
8785 // existing patch flag to be reliable and need to add the FULL_PROPS flag.
8786 // note: preserve flag for fragments since they use the flag for children
8788 patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
8789 dynamicProps: vnode.dynamicProps,
8790 dynamicChildren: vnode.dynamicChildren,
8791 appContext: vnode.appContext,
8794 // These should technically only be non-null on mounted VNodes. However,
8795 // they *should* be copied for kept-alive vnodes. So we just always copy
8796 // them since them being non-null during a mount doesn't affect the logic as
8797 // they will simply be overwritten.
8798 component: vnode.component,
8799 suspense: vnode.suspense,
8800 ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
8801 ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
8803 anchor: vnode.anchor,
8807 if (transition && cloneTransition) {
8808 cloned.transition = transition.clone(cloned);
8812 function deepCloneVNode(vnode) {
8813 const cloned = cloneVNode(vnode);
8814 if (isArray(vnode.children)) {
8815 cloned.children = vnode.children.map(deepCloneVNode);
8819 function createTextVNode(text = " ", flag = 0) {
8820 return createVNode(Text, null, text, flag);
8822 function createStaticVNode(content, numberOfNodes) {
8823 const vnode = createVNode(Static, null, content);
8824 vnode.staticCount = numberOfNodes;
8827 function createCommentVNode(text = "", asBlock = false) {
8828 return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
8830 function normalizeVNode(child) {
8831 if (child == null || typeof child === "boolean") {
8832 return createVNode(Comment);
8833 } else if (isArray(child)) {
8837 // #3666, avoid reference pollution when reusing vnode
8840 } else if (typeof child === "object") {
8841 return cloneIfMounted(child);
8843 return createVNode(Text, null, String(child));
8846 function cloneIfMounted(child) {
8847 return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
8849 function normalizeChildren(vnode, children) {
8851 const { shapeFlag } = vnode;
8852 if (children == null) {
8854 } else if (isArray(children)) {
8856 } else if (typeof children === "object") {
8857 if (shapeFlag & (1 | 64)) {
8858 const slot = children.default;
8860 slot._c && (slot._d = false);
8861 normalizeChildren(vnode, slot());
8862 slot._c && (slot._d = true);
8867 const slotFlag = children._;
8868 if (!slotFlag && !isInternalObject(children)) {
8869 children._ctx = currentRenderingInstance;
8870 } else if (slotFlag === 3 && currentRenderingInstance) {
8871 if (currentRenderingInstance.slots._ === 1) {
8875 vnode.patchFlag |= 1024;
8879 } else if (isFunction(children)) {
8880 children = { default: children, _ctx: currentRenderingInstance };
8883 children = String(children);
8884 if (shapeFlag & 64) {
8886 children = [createTextVNode(children)];
8891 vnode.children = children;
8892 vnode.shapeFlag |= type;
8894 function mergeProps(...args) {
8896 for (let i = 0; i < args.length; i++) {
8897 const toMerge = args[i];
8898 for (const key in toMerge) {
8899 if (key === "class") {
8900 if (ret.class !== toMerge.class) {
8901 ret.class = normalizeClass([ret.class, toMerge.class]);
8903 } else if (key === "style") {
8904 ret.style = normalizeStyle([ret.style, toMerge.style]);
8905 } else if (isOn(key)) {
8906 const existing = ret[key];
8907 const incoming = toMerge[key];
8908 if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
8909 ret[key] = existing ? [].concat(existing, incoming) : incoming;
8911 } else if (key !== "") {
8912 ret[key] = toMerge[key];
8918 function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
8919 callWithAsyncErrorHandling(hook, instance, 7, [
8925 const emptyAppContext = createAppContext();
8927 function createComponentInstance(vnode, parent, suspense) {
8928 const type = vnode.type;
8929 const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
8937 // to be immediately set
8940 // will be set synchronously right after creation
8943 // will be set synchronously right after creation
8944 scope: new EffectScope(
8953 provides: parent ? parent.provides : Object.create(appContext.provides),
8956 // local resolved assets
8959 // resolved props and emits options
8960 propsOptions: normalizePropsOptions(type, appContext),
8961 emitsOptions: normalizeEmitsOptions(type, appContext),
8964 // to be set immediately
8966 // props default value
8967 propsDefaults: EMPTY_OBJ,
8969 inheritAttrs: type.inheritAttrs,
8977 setupState: EMPTY_OBJ,
8983 suspenseId: suspense ? suspense.pendingId : 0,
8985 asyncResolved: false,
8987 // not using enums here because it results in computed properties
8990 isDeactivated: false,
9007 instance.ctx = createDevRenderContext(instance);
9009 instance.root = parent ? parent.root : instance;
9010 instance.emit = emit.bind(null, instance);
9016 let currentInstance = null;
9017 const getCurrentInstance = () => currentInstance || currentRenderingInstance;
9018 let internalSetCurrentInstance;
9019 let setInSSRSetupState;
9021 internalSetCurrentInstance = (i) => {
9022 currentInstance = i;
9024 setInSSRSetupState = (v) => {
9025 isInSSRComponentSetup = v;
9028 const setCurrentInstance = (instance) => {
9029 const prev = currentInstance;
9030 internalSetCurrentInstance(instance);
9031 instance.scope.on();
9033 instance.scope.off();
9034 internalSetCurrentInstance(prev);
9037 const unsetCurrentInstance = () => {
9038 currentInstance && currentInstance.scope.off();
9039 internalSetCurrentInstance(null);
9041 const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
9042 function validateComponentName(name, { isNativeTag }) {
9043 if (isBuiltInTag(name) || isNativeTag(name)) {
9045 "Do not use built-in or reserved HTML elements as component id: " + name
9049 function isStatefulComponent(instance) {
9050 return instance.vnode.shapeFlag & 4;
9052 let isInSSRComponentSetup = false;
9053 function setupComponent(instance, isSSR = false) {
9054 isSSR && setInSSRSetupState(isSSR);
9055 const { props, children } = instance.vnode;
9056 const isStateful = isStatefulComponent(instance);
9057 initProps(instance, props, isStateful, isSSR);
9058 initSlots(instance, children);
9059 const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
9060 isSSR && setInSSRSetupState(false);
9063 function setupStatefulComponent(instance, isSSR) {
9065 const Component = instance.type;
9067 if (Component.name) {
9068 validateComponentName(Component.name, instance.appContext.config);
9070 if (Component.components) {
9071 const names = Object.keys(Component.components);
9072 for (let i = 0; i < names.length; i++) {
9073 validateComponentName(names[i], instance.appContext.config);
9076 if (Component.directives) {
9077 const names = Object.keys(Component.directives);
9078 for (let i = 0; i < names.length; i++) {
9079 validateDirectiveName(names[i]);
9082 if (Component.compilerOptions && isRuntimeOnly()) {
9084 `"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.`
9088 instance.accessCache = /* @__PURE__ */ Object.create(null);
9089 instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
9091 exposePropsOnRenderContext(instance);
9093 const { setup } = Component;
9095 const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
9096 const reset = setCurrentInstance(instance);
9098 const setupResult = callWithErrorHandling(
9103 shallowReadonly(instance.props) ,
9109 if (isPromise(setupResult)) {
9110 setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
9112 return setupResult.then((resolvedResult) => {
9113 handleSetupResult(instance, resolvedResult, isSSR);
9115 handleError(e, instance, 0);
9118 instance.asyncDep = setupResult;
9119 if (!instance.suspense) {
9120 const name = (_a = Component.name) != null ? _a : "Anonymous";
9122 `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.`
9127 handleSetupResult(instance, setupResult, isSSR);
9130 finishComponentSetup(instance, isSSR);
9133 function handleSetupResult(instance, setupResult, isSSR) {
9134 if (isFunction(setupResult)) {
9136 instance.render = setupResult;
9138 } else if (isObject(setupResult)) {
9139 if (isVNode(setupResult)) {
9141 `setup() should not return VNodes directly - return a render function instead.`
9145 instance.devtoolsRawSetupState = setupResult;
9147 instance.setupState = proxyRefs(setupResult);
9149 exposeSetupStateOnRenderContext(instance);
9151 } else if (setupResult !== void 0) {
9153 `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
9156 finishComponentSetup(instance, isSSR);
9159 let installWithProxy;
9160 function registerRuntimeCompiler(_compile) {
9161 compile$1 = _compile;
9162 installWithProxy = (i) => {
9164 i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
9168 const isRuntimeOnly = () => !compile$1;
9169 function finishComponentSetup(instance, isSSR, skipOptions) {
9170 const Component = instance.type;
9171 if (!instance.render) {
9172 if (!isSSR && compile$1 && !Component.render) {
9173 const template = Component.template || resolveMergedOptions(instance).template;
9176 startMeasure(instance, `compile`);
9178 const { isCustomElement, compilerOptions } = instance.appContext.config;
9179 const { delimiters, compilerOptions: componentCompilerOptions } = Component;
9180 const finalCompilerOptions = extend(
9188 componentCompilerOptions
9190 Component.render = compile$1(template, finalCompilerOptions);
9192 endMeasure(instance, `compile`);
9196 instance.render = Component.render || NOOP;
9197 if (installWithProxy) {
9198 installWithProxy(instance);
9202 const reset = setCurrentInstance(instance);
9205 applyOptions(instance);
9211 if (!Component.render && instance.render === NOOP && !isSSR) {
9212 if (!compile$1 && Component.template) {
9214 `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.global.js" instead.` )
9217 warn$1(`Component is missing template or render function.`);
9221 const attrsProxyHandlers = {
9223 markAttrsAccessed();
9224 track(target, "get", "");
9228 warn$1(`setupContext.attrs is readonly.`);
9232 warn$1(`setupContext.attrs is readonly.`);
9236 function getSlotsProxy(instance) {
9237 return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
9239 track(instance, "get", "$slots");
9244 function createSetupContext(instance) {
9245 const expose = (exposed) => {
9247 if (instance.exposed) {
9248 warn$1(`expose() should be called only once per setup().`);
9250 if (exposed != null) {
9251 let exposedType = typeof exposed;
9252 if (exposedType === "object") {
9253 if (isArray(exposed)) {
9254 exposedType = "array";
9255 } else if (isRef(exposed)) {
9256 exposedType = "ref";
9259 if (exposedType !== "object") {
9261 `expose() should be passed a plain object, received ${exposedType}.`
9266 instance.exposed = exposed || {};
9270 return Object.freeze({
9272 return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
9275 return getSlotsProxy(instance);
9278 return (event, ...args) => instance.emit(event, ...args);
9284 function getExposeProxy(instance) {
9285 if (instance.exposed) {
9286 return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
9288 if (key in target) {
9290 } else if (key in publicPropertiesMap) {
9291 return publicPropertiesMap[key](instance);
9295 return key in target || key in publicPropertiesMap;
9300 const classifyRE = /(?:^|[-_])(\w)/g;
9301 const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
9302 function getComponentName(Component, includeInferred = true) {
9303 return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
9305 function formatComponentName(instance, Component, isRoot = false) {
9306 let name = getComponentName(Component);
9307 if (!name && Component.__file) {
9308 const match = Component.__file.match(/([^/\\]+)\.\w+$/);
9313 if (!name && instance && instance.parent) {
9314 const inferFromRegistry = (registry) => {
9315 for (const key in registry) {
9316 if (registry[key] === Component) {
9321 name = inferFromRegistry(
9322 instance.components || instance.parent.type.components
9323 ) || inferFromRegistry(instance.appContext.components);
9325 return name ? classify(name) : isRoot ? `App` : `Anonymous`;
9327 function isClassComponent(value) {
9328 return isFunction(value) && "__vccOpts" in value;
9331 const computed = (getterOrOptions, debugOptions) => {
9332 const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
9334 const i = getCurrentInstance();
9335 if (i && i.appContext.config.warnRecursiveComputed) {
9336 c._warnRecursive = true;
9342 function useModel(props, name, options = EMPTY_OBJ) {
9343 const i = getCurrentInstance();
9345 warn$1(`useModel() called without active instance.`);
9348 if (!i.propsOptions[0][name]) {
9349 warn$1(`useModel() called with prop "${name}" which is not declared.`);
9352 const camelizedName = camelize(name);
9353 const hyphenatedName = hyphenate(name);
9354 const res = customRef((track, trigger) => {
9356 watchSyncEffect(() => {
9357 const propValue = props[name];
9358 if (hasChanged(localValue, propValue)) {
9359 localValue = propValue;
9366 return options.get ? options.get(localValue) : localValue;
9369 const rawProps = i.vnode.props;
9370 if (!(rawProps && // check if parent has passed v-model
9371 (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
9375 i.emit(`update:${name}`, options.set ? options.set(value) : value);
9379 const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
9380 res[Symbol.iterator] = () => {
9385 return { value: i2++ ? props[modifierKey] || {} : res, done: false };
9387 return { done: true };
9395 function h(type, propsOrChildren, children) {
9396 const l = arguments.length;
9398 if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
9399 if (isVNode(propsOrChildren)) {
9400 return createVNode(type, null, [propsOrChildren]);
9402 return createVNode(type, propsOrChildren);
9404 return createVNode(type, null, propsOrChildren);
9408 children = Array.prototype.slice.call(arguments, 2);
9409 } else if (l === 3 && isVNode(children)) {
9410 children = [children];
9412 return createVNode(type, propsOrChildren, children);
9416 function initCustomFormatter() {
9417 if (typeof window === "undefined") {
9420 const vueStyle = { style: "color:#3ba776" };
9421 const numberStyle = { style: "color:#1677ff" };
9422 const stringStyle = { style: "color:#f5222d" };
9423 const keywordStyle = { style: "color:#eb2f96" };
9426 if (!isObject(obj)) {
9430 return ["div", vueStyle, `VueInstance`];
9431 } else if (isRef(obj)) {
9435 ["span", vueStyle, genRefFlag(obj)],
9437 formatValue(obj.value),
9440 } else if (isReactive(obj)) {
9444 ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
9447 `>${isReadonly(obj) ? ` (readonly)` : ``}`
9449 } else if (isReadonly(obj)) {
9453 ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
9462 return obj && obj.__isVue;
9465 if (obj && obj.__isVue) {
9469 ...formatInstance(obj.$)
9474 function formatInstance(instance) {
9476 if (instance.type.props && instance.props) {
9477 blocks.push(createInstanceBlock("props", toRaw(instance.props)));
9479 if (instance.setupState !== EMPTY_OBJ) {
9480 blocks.push(createInstanceBlock("setup", instance.setupState));
9482 if (instance.data !== EMPTY_OBJ) {
9483 blocks.push(createInstanceBlock("data", toRaw(instance.data)));
9485 const computed = extractKeys(instance, "computed");
9487 blocks.push(createInstanceBlock("computed", computed));
9489 const injected = extractKeys(instance, "inject");
9491 blocks.push(createInstanceBlock("injected", injected));
9499 style: keywordStyle.style + ";opacity:0.66"
9503 ["object", { object: instance }]
9507 function createInstanceBlock(type, target) {
9508 target = extend({}, target);
9509 if (!Object.keys(target).length) {
9510 return ["span", {}];
9514 { style: "line-height:1.25em;margin-bottom:0.6em" },
9518 style: "color:#476582"
9525 style: "padding-left:1.25em"
9527 ...Object.keys(target).map((key) => {
9531 ["span", keywordStyle, key + ": "],
9532 formatValue(target[key], false)
9538 function formatValue(v, asRaw = true) {
9539 if (typeof v === "number") {
9540 return ["span", numberStyle, v];
9541 } else if (typeof v === "string") {
9542 return ["span", stringStyle, JSON.stringify(v)];
9543 } else if (typeof v === "boolean") {
9544 return ["span", keywordStyle, v];
9545 } else if (isObject(v)) {
9546 return ["object", { object: asRaw ? toRaw(v) : v }];
9548 return ["span", stringStyle, String(v)];
9551 function extractKeys(instance, type) {
9552 const Comp = instance.type;
9553 if (isFunction(Comp)) {
9556 const extracted = {};
9557 for (const key in instance.ctx) {
9558 if (isKeyOfType(Comp, key, type)) {
9559 extracted[key] = instance.ctx[key];
9564 function isKeyOfType(Comp, key, type) {
9565 const opts = Comp[type];
9566 if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
9569 if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
9572 if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
9576 function genRefFlag(v) {
9578 return `ShallowRef`;
9581 return `ComputedRef`;
9585 if (window.devtoolsFormatters) {
9586 window.devtoolsFormatters.push(formatter);
9588 window.devtoolsFormatters = [formatter];
9592 function withMemo(memo, render, cache, index) {
9593 const cached = cache[index];
9594 if (cached && isMemoSame(cached, memo)) {
9597 const ret = render();
9598 ret.memo = memo.slice();
9599 return cache[index] = ret;
9601 function isMemoSame(cached, memo) {
9602 const prev = cached.memo;
9603 if (prev.length != memo.length) {
9606 for (let i = 0; i < prev.length; i++) {
9607 if (hasChanged(prev[i], memo[i])) {
9611 if (isBlockTreeEnabled > 0 && currentBlock) {
9612 currentBlock.push(cached);
9617 const version = "3.4.27";
9618 const warn = warn$1 ;
9619 const ErrorTypeStrings = ErrorTypeStrings$1 ;
9620 const devtools = devtools$1 ;
9621 const setDevtoolsHook = setDevtoolsHook$1 ;
9622 const ssrUtils = null;
9623 const resolveFilter = null;
9624 const compatUtils = null;
9625 const DeprecationTypes = null;
9627 const svgNS = "http://www.w3.org/2000/svg";
9628 const mathmlNS = "http://www.w3.org/1998/Math/MathML";
9629 const doc = typeof document !== "undefined" ? document : null;
9630 const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
9632 insert: (child, parent, anchor) => {
9633 parent.insertBefore(child, anchor || null);
9635 remove: (child) => {
9636 const parent = child.parentNode;
9638 parent.removeChild(child);
9641 createElement: (tag, namespace, is, props) => {
9642 const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
9643 if (tag === "select" && props && props.multiple != null) {
9644 el.setAttribute("multiple", props.multiple);
9648 createText: (text) => doc.createTextNode(text),
9649 createComment: (text) => doc.createComment(text),
9650 setText: (node, text) => {
9651 node.nodeValue = text;
9653 setElementText: (el, text) => {
9654 el.textContent = text;
9656 parentNode: (node) => node.parentNode,
9657 nextSibling: (node) => node.nextSibling,
9658 querySelector: (selector) => doc.querySelector(selector),
9659 setScopeId(el, id) {
9660 el.setAttribute(id, "");
9663 // Reason: innerHTML.
9664 // Static content here can only come from compiled templates.
9665 // As long as the user only uses trusted templates, this is safe.
9666 insertStaticContent(content, parent, anchor, namespace, start, end) {
9667 const before = anchor ? anchor.previousSibling : parent.lastChild;
9668 if (start && (start === end || start.nextSibling)) {
9670 parent.insertBefore(start.cloneNode(true), anchor);
9671 if (start === end || !(start = start.nextSibling))
9675 templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
9676 const template = templateContainer.content;
9677 if (namespace === "svg" || namespace === "mathml") {
9678 const wrapper = template.firstChild;
9679 while (wrapper.firstChild) {
9680 template.appendChild(wrapper.firstChild);
9682 template.removeChild(wrapper);
9684 parent.insertBefore(template, anchor);
9688 before ? before.nextSibling : parent.firstChild,
9690 anchor ? anchor.previousSibling : parent.lastChild
9695 const TRANSITION$1 = "transition";
9696 const ANIMATION = "animation";
9697 const vtcKey = Symbol("_vtc");
9698 const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
9699 Transition.displayName = "Transition";
9700 const DOMTransitionPropsValidators = {
9707 duration: [String, Number, Object],
9708 enterFromClass: String,
9709 enterActiveClass: String,
9710 enterToClass: String,
9711 appearFromClass: String,
9712 appearActiveClass: String,
9713 appearToClass: String,
9714 leaveFromClass: String,
9715 leaveActiveClass: String,
9716 leaveToClass: String
9718 const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
9720 BaseTransitionPropsValidators,
9721 DOMTransitionPropsValidators
9723 const callHook = (hook, args = []) => {
9724 if (isArray(hook)) {
9725 hook.forEach((h2) => h2(...args));
9730 const hasExplicitCallback = (hook) => {
9731 return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
9733 function resolveTransitionProps(rawProps) {
9734 const baseProps = {};
9735 for (const key in rawProps) {
9736 if (!(key in DOMTransitionPropsValidators)) {
9737 baseProps[key] = rawProps[key];
9740 if (rawProps.css === false) {
9747 enterFromClass = `${name}-enter-from`,
9748 enterActiveClass = `${name}-enter-active`,
9749 enterToClass = `${name}-enter-to`,
9750 appearFromClass = enterFromClass,
9751 appearActiveClass = enterActiveClass,
9752 appearToClass = enterToClass,
9753 leaveFromClass = `${name}-leave-from`,
9754 leaveActiveClass = `${name}-leave-active`,
9755 leaveToClass = `${name}-leave-to`
9757 const durations = normalizeDuration(duration);
9758 const enterDuration = durations && durations[0];
9759 const leaveDuration = durations && durations[1];
9766 onBeforeAppear = onBeforeEnter,
9768 onAppearCancelled = onEnterCancelled
9770 const finishEnter = (el, isAppear, done) => {
9771 removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
9772 removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
9775 const finishLeave = (el, done) => {
9776 el._isLeaving = false;
9777 removeTransitionClass(el, leaveFromClass);
9778 removeTransitionClass(el, leaveToClass);
9779 removeTransitionClass(el, leaveActiveClass);
9782 const makeEnterHook = (isAppear) => {
9783 return (el, done) => {
9784 const hook = isAppear ? onAppear : onEnter;
9785 const resolve = () => finishEnter(el, isAppear, done);
9786 callHook(hook, [el, resolve]);
9788 removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
9789 addTransitionClass(el, isAppear ? appearToClass : enterToClass);
9790 if (!hasExplicitCallback(hook)) {
9791 whenTransitionEnds(el, type, enterDuration, resolve);
9796 return extend(baseProps, {
9798 callHook(onBeforeEnter, [el]);
9799 addTransitionClass(el, enterFromClass);
9800 addTransitionClass(el, enterActiveClass);
9802 onBeforeAppear(el) {
9803 callHook(onBeforeAppear, [el]);
9804 addTransitionClass(el, appearFromClass);
9805 addTransitionClass(el, appearActiveClass);
9807 onEnter: makeEnterHook(false),
9808 onAppear: makeEnterHook(true),
9810 el._isLeaving = true;
9811 const resolve = () => finishLeave(el, done);
9812 addTransitionClass(el, leaveFromClass);
9813 addTransitionClass(el, leaveActiveClass);
9816 if (!el._isLeaving) {
9819 removeTransitionClass(el, leaveFromClass);
9820 addTransitionClass(el, leaveToClass);
9821 if (!hasExplicitCallback(onLeave)) {
9822 whenTransitionEnds(el, type, leaveDuration, resolve);
9825 callHook(onLeave, [el, resolve]);
9827 onEnterCancelled(el) {
9828 finishEnter(el, false);
9829 callHook(onEnterCancelled, [el]);
9831 onAppearCancelled(el) {
9832 finishEnter(el, true);
9833 callHook(onAppearCancelled, [el]);
9835 onLeaveCancelled(el) {
9837 callHook(onLeaveCancelled, [el]);
9841 function normalizeDuration(duration) {
9842 if (duration == null) {
9844 } else if (isObject(duration)) {
9845 return [NumberOf(duration.enter), NumberOf(duration.leave)];
9847 const n = NumberOf(duration);
9851 function NumberOf(val) {
9852 const res = toNumber(val);
9854 assertNumber(res, "<transition> explicit duration");
9858 function addTransitionClass(el, cls) {
9859 cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
9860 (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
9862 function removeTransitionClass(el, cls) {
9863 cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
9864 const _vtc = el[vtcKey];
9868 el[vtcKey] = void 0;
9872 function nextFrame(cb) {
9873 requestAnimationFrame(() => {
9874 requestAnimationFrame(cb);
9878 function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
9879 const id = el._endId = ++endId;
9880 const resolveIfNotStale = () => {
9881 if (id === el._endId) {
9885 if (explicitTimeout) {
9886 return setTimeout(resolveIfNotStale, explicitTimeout);
9888 const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
9892 const endEvent = type + "end";
9895 el.removeEventListener(endEvent, onEnd);
9896 resolveIfNotStale();
9898 const onEnd = (e) => {
9899 if (e.target === el && ++ended >= propCount) {
9904 if (ended < propCount) {
9908 el.addEventListener(endEvent, onEnd);
9910 function getTransitionInfo(el, expectedType) {
9911 const styles = window.getComputedStyle(el);
9912 const getStyleProperties = (key) => (styles[key] || "").split(", ");
9913 const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
9914 const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
9915 const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
9916 const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
9917 const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
9918 const animationTimeout = getTimeout(animationDelays, animationDurations);
9922 if (expectedType === TRANSITION$1) {
9923 if (transitionTimeout > 0) {
9924 type = TRANSITION$1;
9925 timeout = transitionTimeout;
9926 propCount = transitionDurations.length;
9928 } else if (expectedType === ANIMATION) {
9929 if (animationTimeout > 0) {
9931 timeout = animationTimeout;
9932 propCount = animationDurations.length;
9935 timeout = Math.max(transitionTimeout, animationTimeout);
9936 type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION$1 : ANIMATION : null;
9937 propCount = type ? type === TRANSITION$1 ? transitionDurations.length : animationDurations.length : 0;
9939 const hasTransform = type === TRANSITION$1 && /\b(transform|all)(,|$)/.test(
9940 getStyleProperties(`${TRANSITION$1}Property`).toString()
9949 function getTimeout(delays, durations) {
9950 while (delays.length < durations.length) {
9951 delays = delays.concat(delays);
9953 return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
9958 return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
9960 function forceReflow() {
9961 return document.body.offsetHeight;
9964 function patchClass(el, value, isSVG) {
9965 const transitionClasses = el[vtcKey];
9966 if (transitionClasses) {
9967 value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
9969 if (value == null) {
9970 el.removeAttribute("class");
9972 el.setAttribute("class", value);
9974 el.className = value;
9978 const vShowOriginalDisplay = Symbol("_vod");
9979 const vShowHidden = Symbol("_vsh");
9981 beforeMount(el, { value }, { transition }) {
9982 el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
9983 if (transition && value) {
9984 transition.beforeEnter(el);
9986 setDisplay(el, value);
9989 mounted(el, { value }, { transition }) {
9990 if (transition && value) {
9991 transition.enter(el);
9994 updated(el, { value, oldValue }, { transition }) {
9995 if (!value === !oldValue)
9999 transition.beforeEnter(el);
10000 setDisplay(el, true);
10001 transition.enter(el);
10003 transition.leave(el, () => {
10004 setDisplay(el, false);
10008 setDisplay(el, value);
10011 beforeUnmount(el, { value }) {
10012 setDisplay(el, value);
10016 vShow.name = "show";
10018 function setDisplay(el, value) {
10019 el.style.display = value ? el[vShowOriginalDisplay] : "none";
10020 el[vShowHidden] = !value;
10023 const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
10024 function useCssVars(getter) {
10025 const instance = getCurrentInstance();
10027 warn(`useCssVars is called without current active component instance.`);
10030 const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
10032 document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
10033 ).forEach((node) => setVarsOnNode(node, vars));
10036 instance.getCssVars = () => getter(instance.proxy);
10038 const setVars = () => {
10039 const vars = getter(instance.proxy);
10040 setVarsOnVNode(instance.subTree, vars);
10041 updateTeleports(vars);
10044 watchPostEffect(setVars);
10045 const ob = new MutationObserver(setVars);
10046 ob.observe(instance.subTree.el.parentNode, { childList: true });
10047 onUnmounted(() => ob.disconnect());
10050 function setVarsOnVNode(vnode, vars) {
10051 if (vnode.shapeFlag & 128) {
10052 const suspense = vnode.suspense;
10053 vnode = suspense.activeBranch;
10054 if (suspense.pendingBranch && !suspense.isHydrating) {
10055 suspense.effects.push(() => {
10056 setVarsOnVNode(suspense.activeBranch, vars);
10060 while (vnode.component) {
10061 vnode = vnode.component.subTree;
10063 if (vnode.shapeFlag & 1 && vnode.el) {
10064 setVarsOnNode(vnode.el, vars);
10065 } else if (vnode.type === Fragment) {
10066 vnode.children.forEach((c) => setVarsOnVNode(c, vars));
10067 } else if (vnode.type === Static) {
10068 let { el, anchor } = vnode;
10070 setVarsOnNode(el, vars);
10073 el = el.nextSibling;
10077 function setVarsOnNode(el, vars) {
10078 if (el.nodeType === 1) {
10079 const style = el.style;
10081 for (const key in vars) {
10082 style.setProperty(`--${key}`, vars[key]);
10083 cssText += `--${key}: ${vars[key]};`;
10085 style[CSS_VAR_TEXT] = cssText;
10089 const displayRE = /(^|;)\s*display\s*:/;
10090 function patchStyle(el, prev, next) {
10091 const style = el.style;
10092 const isCssString = isString(next);
10093 let hasControlledDisplay = false;
10094 if (next && !isCssString) {
10096 if (!isString(prev)) {
10097 for (const key in prev) {
10098 if (next[key] == null) {
10099 setStyle(style, key, "");
10103 for (const prevStyle of prev.split(";")) {
10104 const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
10105 if (next[key] == null) {
10106 setStyle(style, key, "");
10111 for (const key in next) {
10112 if (key === "display") {
10113 hasControlledDisplay = true;
10115 setStyle(style, key, next[key]);
10119 if (prev !== next) {
10120 const cssVarText = style[CSS_VAR_TEXT];
10122 next += ";" + cssVarText;
10124 style.cssText = next;
10125 hasControlledDisplay = displayRE.test(next);
10128 el.removeAttribute("style");
10131 if (vShowOriginalDisplay in el) {
10132 el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
10133 if (el[vShowHidden]) {
10134 style.display = "none";
10138 const semicolonRE = /[^\\];\s*$/;
10139 const importantRE = /\s*!important$/;
10140 function setStyle(style, name, val) {
10141 if (isArray(val)) {
10142 val.forEach((v) => setStyle(style, name, v));
10147 if (semicolonRE.test(val)) {
10149 `Unexpected semicolon at the end of '${name}' style value: '${val}'`
10153 if (name.startsWith("--")) {
10154 style.setProperty(name, val);
10156 const prefixed = autoPrefix(style, name);
10157 if (importantRE.test(val)) {
10159 hyphenate(prefixed),
10160 val.replace(importantRE, ""),
10164 style[prefixed] = val;
10169 const prefixes = ["Webkit", "Moz", "ms"];
10170 const prefixCache = {};
10171 function autoPrefix(style, rawName) {
10172 const cached = prefixCache[rawName];
10176 let name = camelize(rawName);
10177 if (name !== "filter" && name in style) {
10178 return prefixCache[rawName] = name;
10180 name = capitalize(name);
10181 for (let i = 0; i < prefixes.length; i++) {
10182 const prefixed = prefixes[i] + name;
10183 if (prefixed in style) {
10184 return prefixCache[rawName] = prefixed;
10190 const xlinkNS = "http://www.w3.org/1999/xlink";
10191 function patchAttr(el, key, value, isSVG, instance) {
10192 if (isSVG && key.startsWith("xlink:")) {
10193 if (value == null) {
10194 el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
10196 el.setAttributeNS(xlinkNS, key, value);
10199 const isBoolean = isSpecialBooleanAttr(key);
10200 if (value == null || isBoolean && !includeBooleanAttr(value)) {
10201 el.removeAttribute(key);
10203 el.setAttribute(key, isBoolean ? "" : value);
10208 function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
10209 if (key === "innerHTML" || key === "textContent") {
10210 if (prevChildren) {
10211 unmountChildren(prevChildren, parentComponent, parentSuspense);
10213 el[key] = value == null ? "" : value;
10216 const tag = el.tagName;
10217 if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
10218 !tag.includes("-")) {
10219 const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
10220 const newValue = value == null ? "" : value;
10221 if (oldValue !== newValue || !("_value" in el)) {
10222 el.value = newValue;
10224 if (value == null) {
10225 el.removeAttribute(key);
10230 let needRemove = false;
10231 if (value === "" || value == null) {
10232 const type = typeof el[key];
10233 if (type === "boolean") {
10234 value = includeBooleanAttr(value);
10235 } else if (value == null && type === "string") {
10238 } else if (type === "number") {
10248 `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
10253 needRemove && el.removeAttribute(key);
10256 function addEventListener(el, event, handler, options) {
10257 el.addEventListener(event, handler, options);
10259 function removeEventListener(el, event, handler, options) {
10260 el.removeEventListener(event, handler, options);
10262 const veiKey = Symbol("_vei");
10263 function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
10264 const invokers = el[veiKey] || (el[veiKey] = {});
10265 const existingInvoker = invokers[rawName];
10266 if (nextValue && existingInvoker) {
10267 existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
10269 const [name, options] = parseName(rawName);
10271 const invoker = invokers[rawName] = createInvoker(
10272 sanitizeEventValue(nextValue, rawName) ,
10275 addEventListener(el, name, invoker, options);
10276 } else if (existingInvoker) {
10277 removeEventListener(el, name, existingInvoker, options);
10278 invokers[rawName] = void 0;
10282 const optionsModifierRE = /(?:Once|Passive|Capture)$/;
10283 function parseName(name) {
10285 if (optionsModifierRE.test(name)) {
10288 while (m = name.match(optionsModifierRE)) {
10289 name = name.slice(0, name.length - m[0].length);
10290 options[m[0].toLowerCase()] = true;
10293 const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
10294 return [event, options];
10297 const p = /* @__PURE__ */ Promise.resolve();
10298 const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
10299 function createInvoker(initialValue, instance) {
10300 const invoker = (e) => {
10302 e._vts = Date.now();
10303 } else if (e._vts <= invoker.attached) {
10306 callWithAsyncErrorHandling(
10307 patchStopImmediatePropagation(e, invoker.value),
10313 invoker.value = initialValue;
10314 invoker.attached = getNow();
10317 function sanitizeEventValue(value, propName) {
10318 if (isFunction(value) || isArray(value)) {
10322 `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
10323 Expected function or array of functions, received type ${typeof value}.`
10327 function patchStopImmediatePropagation(e, value) {
10328 if (isArray(value)) {
10329 const originalStop = e.stopImmediatePropagation;
10330 e.stopImmediatePropagation = () => {
10331 originalStop.call(e);
10335 (fn) => (e2) => !e2._stopped && fn && fn(e2)
10342 const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
10343 key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
10344 const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
10345 const isSVG = namespace === "svg";
10346 if (key === "class") {
10347 patchClass(el, nextValue, isSVG);
10348 } else if (key === "style") {
10349 patchStyle(el, prevValue, nextValue);
10350 } else if (isOn(key)) {
10351 if (!isModelListener(key)) {
10352 patchEvent(el, key, prevValue, nextValue, parentComponent);
10354 } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
10365 if (key === "true-value") {
10366 el._trueValue = nextValue;
10367 } else if (key === "false-value") {
10368 el._falseValue = nextValue;
10370 patchAttr(el, key, nextValue, isSVG);
10373 function shouldSetAsProp(el, key, value, isSVG) {
10375 if (key === "innerHTML" || key === "textContent") {
10378 if (key in el && isNativeOn(key) && isFunction(value)) {
10383 if (key === "spellcheck" || key === "draggable" || key === "translate") {
10386 if (key === "form") {
10389 if (key === "list" && el.tagName === "INPUT") {
10392 if (key === "type" && el.tagName === "TEXTAREA") {
10395 if (key === "width" || key === "height") {
10396 const tag = el.tagName;
10397 if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
10401 if (isNativeOn(key) && isString(value)) {
10407 /*! #__NO_SIDE_EFFECTS__ */
10408 // @__NO_SIDE_EFFECTS__
10409 function defineCustomElement(options, hydrate2) {
10410 const Comp = defineComponent(options);
10411 class VueCustomElement extends VueElement {
10412 constructor(initialProps) {
10413 super(Comp, initialProps, hydrate2);
10416 VueCustomElement.def = Comp;
10417 return VueCustomElement;
10419 /*! #__NO_SIDE_EFFECTS__ */
10420 const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => {
10421 return /* @__PURE__ */ defineCustomElement(options, hydrate);
10423 const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
10425 class VueElement extends BaseClass {
10426 constructor(_def, _props = {}, hydrate2) {
10429 this._props = _props;
10433 this._instance = null;
10434 this._connected = false;
10435 this._resolved = false;
10436 this._numberProps = null;
10438 if (this.shadowRoot && hydrate2) {
10439 hydrate2(this._createVNode(), this.shadowRoot);
10441 if (this.shadowRoot) {
10443 `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
10446 this.attachShadow({ mode: "open" });
10447 if (!this._def.__asyncLoader) {
10448 this._resolveProps(this._def);
10452 connectedCallback() {
10453 this._connected = true;
10454 if (!this._instance) {
10455 if (this._resolved) {
10458 this._resolveDef();
10462 disconnectedCallback() {
10463 this._connected = false;
10465 this._ob.disconnect();
10469 if (!this._connected) {
10470 render(null, this.shadowRoot);
10471 this._instance = null;
10476 * resolve inner component definition (handle possible async component)
10479 this._resolved = true;
10480 for (let i = 0; i < this.attributes.length; i++) {
10481 this._setAttr(this.attributes[i].name);
10483 this._ob = new MutationObserver((mutations) => {
10484 for (const m of mutations) {
10485 this._setAttr(m.attributeName);
10488 this._ob.observe(this, { attributes: true });
10489 const resolve = (def, isAsync = false) => {
10490 const { props, styles } = def;
10492 if (props && !isArray(props)) {
10493 for (const key in props) {
10494 const opt = props[key];
10495 if (opt === Number || opt && opt.type === Number) {
10496 if (key in this._props) {
10497 this._props[key] = toNumber(this._props[key]);
10499 (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
10503 this._numberProps = numberProps;
10505 this._resolveProps(def);
10507 this._applyStyles(styles);
10510 const asyncDef = this._def.__asyncLoader;
10512 asyncDef().then((def) => resolve(def, true));
10514 resolve(this._def);
10517 _resolveProps(def) {
10518 const { props } = def;
10519 const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
10520 for (const key of Object.keys(this)) {
10521 if (key[0] !== "_" && declaredPropKeys.includes(key)) {
10522 this._setProp(key, this[key], true, false);
10525 for (const key of declaredPropKeys.map(camelize)) {
10526 Object.defineProperty(this, key, {
10528 return this._getProp(key);
10531 this._setProp(key, val);
10537 let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
10538 const camelKey = camelize(key);
10539 if (this._numberProps && this._numberProps[camelKey]) {
10540 value = toNumber(value);
10542 this._setProp(camelKey, value, false);
10548 return this._props[key];
10553 _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
10554 if (val !== this._props[key]) {
10555 this._props[key] = val;
10556 if (shouldUpdate && this._instance) {
10559 if (shouldReflect) {
10560 if (val === true) {
10561 this.setAttribute(hyphenate(key), "");
10562 } else if (typeof val === "string" || typeof val === "number") {
10563 this.setAttribute(hyphenate(key), val + "");
10565 this.removeAttribute(hyphenate(key));
10571 render(this._createVNode(), this.shadowRoot);
10574 const vnode = createVNode(this._def, extend({}, this._props));
10575 if (!this._instance) {
10576 vnode.ce = (instance) => {
10577 this._instance = instance;
10578 instance.isCE = true;
10580 instance.ceReload = (newStyles) => {
10581 if (this._styles) {
10582 this._styles.forEach((s) => this.shadowRoot.removeChild(s));
10583 this._styles.length = 0;
10585 this._applyStyles(newStyles);
10586 this._instance = null;
10590 const dispatch = (event, args) => {
10591 this.dispatchEvent(
10592 new CustomEvent(event, {
10597 instance.emit = (event, ...args) => {
10598 dispatch(event, args);
10599 if (hyphenate(event) !== event) {
10600 dispatch(hyphenate(event), args);
10604 while (parent = parent && (parent.parentNode || parent.host)) {
10605 if (parent instanceof VueElement) {
10606 instance.parent = parent._instance;
10607 instance.provides = parent._instance.provides;
10615 _applyStyles(styles) {
10617 styles.forEach((css) => {
10618 const s = document.createElement("style");
10619 s.textContent = css;
10620 this.shadowRoot.appendChild(s);
10622 (this._styles || (this._styles = [])).push(s);
10629 function useCssModule(name = "$style") {
10632 warn(`useCssModule() is not supported in the global build.`);
10638 const positionMap = /* @__PURE__ */ new WeakMap();
10639 const newPositionMap = /* @__PURE__ */ new WeakMap();
10640 const moveCbKey = Symbol("_moveCb");
10641 const enterCbKey = Symbol("_enterCb");
10642 const TransitionGroupImpl = {
10643 name: "TransitionGroup",
10644 props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
10648 setup(props, { slots }) {
10649 const instance = getCurrentInstance();
10650 const state = useTransitionState();
10654 if (!prevChildren.length) {
10657 const moveClass = props.moveClass || `${props.name || "v"}-move`;
10658 if (!hasCSSTransform(
10659 prevChildren[0].el,
10665 prevChildren.forEach(callPendingCbs);
10666 prevChildren.forEach(recordPosition);
10667 const movedChildren = prevChildren.filter(applyTranslation);
10669 movedChildren.forEach((c) => {
10671 const style = el.style;
10672 addTransitionClass(el, moveClass);
10673 style.transform = style.webkitTransform = style.transitionDuration = "";
10674 const cb = el[moveCbKey] = (e) => {
10675 if (e && e.target !== el) {
10678 if (!e || /transform$/.test(e.propertyName)) {
10679 el.removeEventListener("transitionend", cb);
10680 el[moveCbKey] = null;
10681 removeTransitionClass(el, moveClass);
10684 el.addEventListener("transitionend", cb);
10688 const rawProps = toRaw(props);
10689 const cssTransitionProps = resolveTransitionProps(rawProps);
10690 let tag = rawProps.tag || Fragment;
10693 for (let i = 0; i < children.length; i++) {
10694 const child = children[i];
10695 if (child.el && child.el instanceof Element) {
10696 prevChildren.push(child);
10697 setTransitionHooks(
10699 resolveTransitionHooks(
10701 cssTransitionProps,
10708 child.el.getBoundingClientRect()
10713 children = slots.default ? getTransitionRawChildren(slots.default()) : [];
10714 for (let i = 0; i < children.length; i++) {
10715 const child = children[i];
10716 if (child.key != null) {
10717 setTransitionHooks(
10719 resolveTransitionHooks(child, cssTransitionProps, state, instance)
10722 warn(`<TransitionGroup> children must be keyed.`);
10725 return createVNode(tag, null, children);
10729 const removeMode = (props) => delete props.mode;
10730 /* @__PURE__ */ removeMode(TransitionGroupImpl.props);
10731 const TransitionGroup = TransitionGroupImpl;
10732 function callPendingCbs(c) {
10734 if (el[moveCbKey]) {
10737 if (el[enterCbKey]) {
10741 function recordPosition(c) {
10742 newPositionMap.set(c, c.el.getBoundingClientRect());
10744 function applyTranslation(c) {
10745 const oldPos = positionMap.get(c);
10746 const newPos = newPositionMap.get(c);
10747 const dx = oldPos.left - newPos.left;
10748 const dy = oldPos.top - newPos.top;
10750 const s = c.el.style;
10751 s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
10752 s.transitionDuration = "0s";
10756 function hasCSSTransform(el, root, moveClass) {
10757 const clone = el.cloneNode();
10758 const _vtc = el[vtcKey];
10760 _vtc.forEach((cls) => {
10761 cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
10764 moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
10765 clone.style.display = "none";
10766 const container = root.nodeType === 1 ? root : root.parentNode;
10767 container.appendChild(clone);
10768 const { hasTransform } = getTransitionInfo(clone);
10769 container.removeChild(clone);
10770 return hasTransform;
10773 const getModelAssigner = (vnode) => {
10774 const fn = vnode.props["onUpdate:modelValue"] || false;
10775 return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
10777 function onCompositionStart(e) {
10778 e.target.composing = true;
10780 function onCompositionEnd(e) {
10781 const target = e.target;
10782 if (target.composing) {
10783 target.composing = false;
10784 target.dispatchEvent(new Event("input"));
10787 const assignKey = Symbol("_assign");
10788 const vModelText = {
10789 created(el, { modifiers: { lazy, trim, number } }, vnode) {
10790 el[assignKey] = getModelAssigner(vnode);
10791 const castToNumber = number || vnode.props && vnode.props.type === "number";
10792 addEventListener(el, lazy ? "change" : "input", (e) => {
10793 if (e.target.composing)
10795 let domValue = el.value;
10797 domValue = domValue.trim();
10799 if (castToNumber) {
10800 domValue = looseToNumber(domValue);
10802 el[assignKey](domValue);
10805 addEventListener(el, "change", () => {
10806 el.value = el.value.trim();
10810 addEventListener(el, "compositionstart", onCompositionStart);
10811 addEventListener(el, "compositionend", onCompositionEnd);
10812 addEventListener(el, "change", onCompositionEnd);
10815 // set value on mounted so it's after min/max for type="range"
10816 mounted(el, { value }) {
10817 el.value = value == null ? "" : value;
10819 beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
10820 el[assignKey] = getModelAssigner(vnode);
10823 const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
10824 const newValue = value == null ? "" : value;
10825 if (elValue === newValue) {
10828 if (document.activeElement === el && el.type !== "range") {
10832 if (trim && el.value.trim() === newValue) {
10836 el.value = newValue;
10839 const vModelCheckbox = {
10840 // #4096 array checkboxes need to be deep traversed
10842 created(el, _, vnode) {
10843 el[assignKey] = getModelAssigner(vnode);
10844 addEventListener(el, "change", () => {
10845 const modelValue = el._modelValue;
10846 const elementValue = getValue(el);
10847 const checked = el.checked;
10848 const assign = el[assignKey];
10849 if (isArray(modelValue)) {
10850 const index = looseIndexOf(modelValue, elementValue);
10851 const found = index !== -1;
10852 if (checked && !found) {
10853 assign(modelValue.concat(elementValue));
10854 } else if (!checked && found) {
10855 const filtered = [...modelValue];
10856 filtered.splice(index, 1);
10859 } else if (isSet(modelValue)) {
10860 const cloned = new Set(modelValue);
10862 cloned.add(elementValue);
10864 cloned.delete(elementValue);
10868 assign(getCheckboxValue(el, checked));
10872 // set initial checked on mount to wait for true-value/false-value
10873 mounted: setChecked,
10874 beforeUpdate(el, binding, vnode) {
10875 el[assignKey] = getModelAssigner(vnode);
10876 setChecked(el, binding, vnode);
10879 function setChecked(el, { value, oldValue }, vnode) {
10880 el._modelValue = value;
10881 if (isArray(value)) {
10882 el.checked = looseIndexOf(value, vnode.props.value) > -1;
10883 } else if (isSet(value)) {
10884 el.checked = value.has(vnode.props.value);
10885 } else if (value !== oldValue) {
10886 el.checked = looseEqual(value, getCheckboxValue(el, true));
10889 const vModelRadio = {
10890 created(el, { value }, vnode) {
10891 el.checked = looseEqual(value, vnode.props.value);
10892 el[assignKey] = getModelAssigner(vnode);
10893 addEventListener(el, "change", () => {
10894 el[assignKey](getValue(el));
10897 beforeUpdate(el, { value, oldValue }, vnode) {
10898 el[assignKey] = getModelAssigner(vnode);
10899 if (value !== oldValue) {
10900 el.checked = looseEqual(value, vnode.props.value);
10904 const vModelSelect = {
10905 // <select multiple> value need to be deep traversed
10907 created(el, { value, modifiers: { number } }, vnode) {
10908 const isSetModel = isSet(value);
10909 addEventListener(el, "change", () => {
10910 const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
10911 (o) => number ? looseToNumber(getValue(o)) : getValue(o)
10914 el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
10916 el._assigning = true;
10918 el._assigning = false;
10921 el[assignKey] = getModelAssigner(vnode);
10923 // set value in mounted & updated because <select> relies on its children
10925 mounted(el, { value, modifiers: { number } }) {
10926 setSelected(el, value);
10928 beforeUpdate(el, _binding, vnode) {
10929 el[assignKey] = getModelAssigner(vnode);
10931 updated(el, { value, modifiers: { number } }) {
10932 if (!el._assigning) {
10933 setSelected(el, value);
10937 function setSelected(el, value, number) {
10938 const isMultiple = el.multiple;
10939 const isArrayValue = isArray(value);
10940 if (isMultiple && !isArrayValue && !isSet(value)) {
10942 `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
10946 for (let i = 0, l = el.options.length; i < l; i++) {
10947 const option = el.options[i];
10948 const optionValue = getValue(option);
10950 if (isArrayValue) {
10951 const optionType = typeof optionValue;
10952 if (optionType === "string" || optionType === "number") {
10953 option.selected = value.some((v) => String(v) === String(optionValue));
10955 option.selected = looseIndexOf(value, optionValue) > -1;
10958 option.selected = value.has(optionValue);
10960 } else if (looseEqual(getValue(option), value)) {
10961 if (el.selectedIndex !== i)
10962 el.selectedIndex = i;
10966 if (!isMultiple && el.selectedIndex !== -1) {
10967 el.selectedIndex = -1;
10970 function getValue(el) {
10971 return "_value" in el ? el._value : el.value;
10973 function getCheckboxValue(el, checked) {
10974 const key = checked ? "_trueValue" : "_falseValue";
10975 return key in el ? el[key] : checked;
10977 const vModelDynamic = {
10978 created(el, binding, vnode) {
10979 callModelHook(el, binding, vnode, null, "created");
10981 mounted(el, binding, vnode) {
10982 callModelHook(el, binding, vnode, null, "mounted");
10984 beforeUpdate(el, binding, vnode, prevVNode) {
10985 callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
10987 updated(el, binding, vnode, prevVNode) {
10988 callModelHook(el, binding, vnode, prevVNode, "updated");
10991 function resolveDynamicModel(tagName, type) {
10994 return vModelSelect;
11000 return vModelCheckbox;
11002 return vModelRadio;
11008 function callModelHook(el, binding, vnode, prevVNode, hook) {
11009 const modelToUse = resolveDynamicModel(
11011 vnode.props && vnode.props.type
11013 const fn = modelToUse[hook];
11014 fn && fn(el, binding, vnode, prevVNode);
11017 const systemModifiers = ["ctrl", "shift", "alt", "meta"];
11018 const modifierGuards = {
11019 stop: (e) => e.stopPropagation(),
11020 prevent: (e) => e.preventDefault(),
11021 self: (e) => e.target !== e.currentTarget,
11022 ctrl: (e) => !e.ctrlKey,
11023 shift: (e) => !e.shiftKey,
11024 alt: (e) => !e.altKey,
11025 meta: (e) => !e.metaKey,
11026 left: (e) => "button" in e && e.button !== 0,
11027 middle: (e) => "button" in e && e.button !== 1,
11028 right: (e) => "button" in e && e.button !== 2,
11029 exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
11031 const withModifiers = (fn, modifiers) => {
11032 const cache = fn._withMods || (fn._withMods = {});
11033 const cacheKey = modifiers.join(".");
11034 return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
11035 for (let i = 0; i < modifiers.length; i++) {
11036 const guard = modifierGuards[modifiers[i]];
11037 if (guard && guard(event, modifiers))
11040 return fn(event, ...args);
11047 left: "arrow-left",
11048 right: "arrow-right",
11049 down: "arrow-down",
11050 delete: "backspace"
11052 const withKeys = (fn, modifiers) => {
11053 const cache = fn._withKeys || (fn._withKeys = {});
11054 const cacheKey = modifiers.join(".");
11055 return cache[cacheKey] || (cache[cacheKey] = (event) => {
11056 if (!("key" in event)) {
11059 const eventKey = hyphenate(event.key);
11060 if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
11066 const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
11068 let enabledHydration = false;
11069 function ensureRenderer() {
11070 return renderer || (renderer = createRenderer(rendererOptions));
11072 function ensureHydrationRenderer() {
11073 renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
11074 enabledHydration = true;
11077 const render = (...args) => {
11078 ensureRenderer().render(...args);
11080 const hydrate = (...args) => {
11081 ensureHydrationRenderer().hydrate(...args);
11083 const createApp = (...args) => {
11084 const app = ensureRenderer().createApp(...args);
11086 injectNativeTagCheck(app);
11087 injectCompilerOptionsCheck(app);
11089 const { mount } = app;
11090 app.mount = (containerOrSelector) => {
11091 const container = normalizeContainer(containerOrSelector);
11094 const component = app._component;
11095 if (!isFunction(component) && !component.render && !component.template) {
11096 component.template = container.innerHTML;
11098 container.innerHTML = "";
11099 const proxy = mount(container, false, resolveRootNamespace(container));
11100 if (container instanceof Element) {
11101 container.removeAttribute("v-cloak");
11102 container.setAttribute("data-v-app", "");
11108 const createSSRApp = (...args) => {
11109 const app = ensureHydrationRenderer().createApp(...args);
11111 injectNativeTagCheck(app);
11112 injectCompilerOptionsCheck(app);
11114 const { mount } = app;
11115 app.mount = (containerOrSelector) => {
11116 const container = normalizeContainer(containerOrSelector);
11118 return mount(container, true, resolveRootNamespace(container));
11123 function resolveRootNamespace(container) {
11124 if (container instanceof SVGElement) {
11127 if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
11131 function injectNativeTagCheck(app) {
11132 Object.defineProperty(app.config, "isNativeTag", {
11133 value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
11137 function injectCompilerOptionsCheck(app) {
11138 if (isRuntimeOnly()) {
11139 const isCustomElement = app.config.isCustomElement;
11140 Object.defineProperty(app.config, "isCustomElement", {
11142 return isCustomElement;
11146 `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
11150 const compilerOptions = app.config.compilerOptions;
11151 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.
11152 - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
11153 - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
11154 - 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`;
11155 Object.defineProperty(app.config, "compilerOptions", {
11158 return compilerOptions;
11166 function normalizeContainer(container) {
11167 if (isString(container)) {
11168 const res = document.querySelector(container);
11171 `Failed to mount app: mount target selector "${container}" returned null.`
11176 if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
11178 `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
11183 const initDirectivesForSSR = NOOP;
11185 function initDev() {
11189 `You are running a development build of Vue.
11190 Make sure to use the production build (*.prod.js) when deploying for production.`
11193 initCustomFormatter();
11197 const FRAGMENT = Symbol(`Fragment` );
11198 const TELEPORT = Symbol(`Teleport` );
11199 const SUSPENSE = Symbol(`Suspense` );
11200 const KEEP_ALIVE = Symbol(`KeepAlive` );
11201 const BASE_TRANSITION = Symbol(`BaseTransition` );
11202 const OPEN_BLOCK = Symbol(`openBlock` );
11203 const CREATE_BLOCK = Symbol(`createBlock` );
11204 const CREATE_ELEMENT_BLOCK = Symbol(`createElementBlock` );
11205 const CREATE_VNODE = Symbol(`createVNode` );
11206 const CREATE_ELEMENT_VNODE = Symbol(`createElementVNode` );
11207 const CREATE_COMMENT = Symbol(`createCommentVNode` );
11208 const CREATE_TEXT = Symbol(`createTextVNode` );
11209 const CREATE_STATIC = Symbol(`createStaticVNode` );
11210 const RESOLVE_COMPONENT = Symbol(`resolveComponent` );
11211 const RESOLVE_DYNAMIC_COMPONENT = Symbol(
11212 `resolveDynamicComponent`
11214 const RESOLVE_DIRECTIVE = Symbol(`resolveDirective` );
11215 const RESOLVE_FILTER = Symbol(`resolveFilter` );
11216 const WITH_DIRECTIVES = Symbol(`withDirectives` );
11217 const RENDER_LIST = Symbol(`renderList` );
11218 const RENDER_SLOT = Symbol(`renderSlot` );
11219 const CREATE_SLOTS = Symbol(`createSlots` );
11220 const TO_DISPLAY_STRING = Symbol(`toDisplayString` );
11221 const MERGE_PROPS = Symbol(`mergeProps` );
11222 const NORMALIZE_CLASS = Symbol(`normalizeClass` );
11223 const NORMALIZE_STYLE = Symbol(`normalizeStyle` );
11224 const NORMALIZE_PROPS = Symbol(`normalizeProps` );
11225 const GUARD_REACTIVE_PROPS = Symbol(`guardReactiveProps` );
11226 const TO_HANDLERS = Symbol(`toHandlers` );
11227 const CAMELIZE = Symbol(`camelize` );
11228 const CAPITALIZE = Symbol(`capitalize` );
11229 const TO_HANDLER_KEY = Symbol(`toHandlerKey` );
11230 const SET_BLOCK_TRACKING = Symbol(`setBlockTracking` );
11231 const PUSH_SCOPE_ID = Symbol(`pushScopeId` );
11232 const POP_SCOPE_ID = Symbol(`popScopeId` );
11233 const WITH_CTX = Symbol(`withCtx` );
11234 const UNREF = Symbol(`unref` );
11235 const IS_REF = Symbol(`isRef` );
11236 const WITH_MEMO = Symbol(`withMemo` );
11237 const IS_MEMO_SAME = Symbol(`isMemoSame` );
11238 const helperNameMap = {
11239 [FRAGMENT]: `Fragment`,
11240 [TELEPORT]: `Teleport`,
11241 [SUSPENSE]: `Suspense`,
11242 [KEEP_ALIVE]: `KeepAlive`,
11243 [BASE_TRANSITION]: `BaseTransition`,
11244 [OPEN_BLOCK]: `openBlock`,
11245 [CREATE_BLOCK]: `createBlock`,
11246 [CREATE_ELEMENT_BLOCK]: `createElementBlock`,
11247 [CREATE_VNODE]: `createVNode`,
11248 [CREATE_ELEMENT_VNODE]: `createElementVNode`,
11249 [CREATE_COMMENT]: `createCommentVNode`,
11250 [CREATE_TEXT]: `createTextVNode`,
11251 [CREATE_STATIC]: `createStaticVNode`,
11252 [RESOLVE_COMPONENT]: `resolveComponent`,
11253 [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,
11254 [RESOLVE_DIRECTIVE]: `resolveDirective`,
11255 [RESOLVE_FILTER]: `resolveFilter`,
11256 [WITH_DIRECTIVES]: `withDirectives`,
11257 [RENDER_LIST]: `renderList`,
11258 [RENDER_SLOT]: `renderSlot`,
11259 [CREATE_SLOTS]: `createSlots`,
11260 [TO_DISPLAY_STRING]: `toDisplayString`,
11261 [MERGE_PROPS]: `mergeProps`,
11262 [NORMALIZE_CLASS]: `normalizeClass`,
11263 [NORMALIZE_STYLE]: `normalizeStyle`,
11264 [NORMALIZE_PROPS]: `normalizeProps`,
11265 [GUARD_REACTIVE_PROPS]: `guardReactiveProps`,
11266 [TO_HANDLERS]: `toHandlers`,
11267 [CAMELIZE]: `camelize`,
11268 [CAPITALIZE]: `capitalize`,
11269 [TO_HANDLER_KEY]: `toHandlerKey`,
11270 [SET_BLOCK_TRACKING]: `setBlockTracking`,
11271 [PUSH_SCOPE_ID]: `pushScopeId`,
11272 [POP_SCOPE_ID]: `popScopeId`,
11273 [WITH_CTX]: `withCtx`,
11276 [WITH_MEMO]: `withMemo`,
11277 [IS_MEMO_SAME]: `isMemoSame`
11279 function registerRuntimeHelpers(helpers) {
11280 Object.getOwnPropertySymbols(helpers).forEach((s) => {
11281 helperNameMap[s] = helpers[s];
11286 start: { line: 1, column: 1, offset: 0 },
11287 end: { line: 1, column: 1, offset: 0 },
11290 function createRoot(children, source = "") {
11295 helpers: /* @__PURE__ */ new Set(),
11302 codegenNode: void 0,
11306 function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) {
11309 context.helper(OPEN_BLOCK);
11310 context.helper(getVNodeBlockHelper(context.inSSR, isComponent));
11312 context.helper(getVNodeHelper(context.inSSR, isComponent));
11315 context.helper(WITH_DIRECTIVES);
11332 function createArrayExpression(elements, loc = locStub) {
11339 function createObjectExpression(properties, loc = locStub) {
11346 function createObjectProperty(key, value) {
11350 key: isString(key) ? createSimpleExpression(key, true) : key,
11354 function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
11360 constType: isStatic ? 3 : constType
11363 function createCompoundExpression(children, loc = locStub) {
11370 function createCallExpression(callee, args = [], loc = locStub) {
11378 function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
11388 function createConditionalExpression(test, consequent, alternate, newline = true) {
11398 function createCacheExpression(index, value, isVNode = false) {
11407 function createBlockStatement(body) {
11414 function getVNodeHelper(ssr, isComponent) {
11415 return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
11417 function getVNodeBlockHelper(ssr, isComponent) {
11418 return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
11420 function convertToBlock(node, { helper, removeHelper, inSSR }) {
11421 if (!node.isBlock) {
11422 node.isBlock = true;
11423 removeHelper(getVNodeHelper(inSSR, node.isComponent));
11424 helper(OPEN_BLOCK);
11425 helper(getVNodeBlockHelper(inSSR, node.isComponent));
11429 const defaultDelimitersOpen = new Uint8Array([123, 123]);
11430 const defaultDelimitersClose = new Uint8Array([125, 125]);
11431 function isTagStartChar(c) {
11432 return c >= 97 && c <= 122 || c >= 65 && c <= 90;
11434 function isWhitespace(c) {
11435 return c === 32 || c === 10 || c === 9 || c === 12 || c === 13;
11437 function isEndOfTagSection(c) {
11438 return c === 47 || c === 62 || isWhitespace(c);
11440 function toCharCodes(str) {
11441 const ret = new Uint8Array(str.length);
11442 for (let i = 0; i < str.length; i++) {
11443 ret[i] = str.charCodeAt(i);
11447 const Sequences = {
11448 Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
11450 CdataEnd: new Uint8Array([93, 93, 62]),
11452 CommentEnd: new Uint8Array([45, 45, 62]),
11454 ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
11456 StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
11458 TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]),
11460 TextareaEnd: new Uint8Array([
11475 constructor(stack, cbs) {
11476 this.stack = stack;
11478 /** The current state the tokenizer is in. */
11480 /** The read buffer. */
11482 /** The beginning of the section that is currently being read. */
11483 this.sectionStart = 0;
11484 /** The index within the buffer that we are currently looking at. */
11486 /** The start of the last entity. */
11487 this.entityStart = 0;
11488 /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
11489 this.baseState = 1;
11490 /** For special parsing behavior inside of script and style tags. */
11491 this.inRCDATA = false;
11492 /** For disabling RCDATA tags handling */
11493 this.inXML = false;
11494 /** For disabling interpolation parsing in v-pre */
11495 this.inVPre = false;
11496 /** Record newline positions for fast line / column calculation */
11497 this.newlines = [];
11499 this.delimiterOpen = defaultDelimitersOpen;
11500 this.delimiterClose = defaultDelimitersClose;
11501 this.delimiterIndex = -1;
11502 this.currentSequence = void 0;
11503 this.sequenceIndex = 0;
11506 return this.mode === 2 && this.stack.length === 0;
11512 this.sectionStart = 0;
11514 this.baseState = 1;
11515 this.inRCDATA = false;
11516 this.currentSequence = void 0;
11517 this.newlines.length = 0;
11518 this.delimiterOpen = defaultDelimitersOpen;
11519 this.delimiterClose = defaultDelimitersClose;
11522 * Generate Position object with line / column information using recorded
11523 * newline positions. We know the index is always going to be an already
11524 * processed index, so all the newlines up to this index should have been
11529 let column = index + 1;
11530 for (let i = this.newlines.length - 1; i >= 0; i--) {
11531 const newlineIndex = this.newlines[i];
11532 if (index > newlineIndex) {
11534 column = index - newlineIndex;
11545 return this.buffer.charCodeAt(this.index + 1);
11549 if (this.index > this.sectionStart) {
11550 this.cbs.ontext(this.sectionStart, this.index);
11553 this.sectionStart = this.index;
11554 } else if (!this.inVPre && c === this.delimiterOpen[0]) {
11556 this.delimiterIndex = 0;
11557 this.stateInterpolationOpen(c);
11560 stateInterpolationOpen(c) {
11561 if (c === this.delimiterOpen[this.delimiterIndex]) {
11562 if (this.delimiterIndex === this.delimiterOpen.length - 1) {
11563 const start = this.index + 1 - this.delimiterOpen.length;
11564 if (start > this.sectionStart) {
11565 this.cbs.ontext(this.sectionStart, start);
11568 this.sectionStart = start;
11570 this.delimiterIndex++;
11572 } else if (this.inRCDATA) {
11574 this.stateInRCDATA(c);
11580 stateInterpolation(c) {
11581 if (c === this.delimiterClose[0]) {
11583 this.delimiterIndex = 0;
11584 this.stateInterpolationClose(c);
11587 stateInterpolationClose(c) {
11588 if (c === this.delimiterClose[this.delimiterIndex]) {
11589 if (this.delimiterIndex === this.delimiterClose.length - 1) {
11590 this.cbs.oninterpolation(this.sectionStart, this.index + 1);
11591 if (this.inRCDATA) {
11596 this.sectionStart = this.index + 1;
11598 this.delimiterIndex++;
11602 this.stateInterpolation(c);
11605 stateSpecialStartSequence(c) {
11606 const isEnd = this.sequenceIndex === this.currentSequence.length;
11607 const isMatch = isEnd ? (
11608 // If we are at the end of the sequence, make sure the tag name has ended
11609 isEndOfTagSection(c)
11611 // Otherwise, do a case-insensitive comparison
11612 (c | 32) === this.currentSequence[this.sequenceIndex]
11615 this.inRCDATA = false;
11616 } else if (!isEnd) {
11617 this.sequenceIndex++;
11620 this.sequenceIndex = 0;
11622 this.stateInTagName(c);
11624 /** Look for an end tag. For <title> and <textarea>, also decode entities. */
11626 if (this.sequenceIndex === this.currentSequence.length) {
11627 if (c === 62 || isWhitespace(c)) {
11628 const endOfText = this.index - this.currentSequence.length;
11629 if (this.sectionStart < endOfText) {
11630 const actualIndex = this.index;
11631 this.index = endOfText;
11632 this.cbs.ontext(this.sectionStart, endOfText);
11633 this.index = actualIndex;
11635 this.sectionStart = endOfText + 2;
11636 this.stateInClosingTagName(c);
11637 this.inRCDATA = false;
11640 this.sequenceIndex = 0;
11642 if ((c | 32) === this.currentSequence[this.sequenceIndex]) {
11643 this.sequenceIndex += 1;
11644 } else if (this.sequenceIndex === 0) {
11645 if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {
11646 if (c === this.delimiterOpen[0]) {
11648 this.delimiterIndex = 0;
11649 this.stateInterpolationOpen(c);
11651 } else if (this.fastForwardTo(60)) {
11652 this.sequenceIndex = 1;
11655 this.sequenceIndex = Number(c === 60);
11658 stateCDATASequence(c) {
11659 if (c === Sequences.Cdata[this.sequenceIndex]) {
11660 if (++this.sequenceIndex === Sequences.Cdata.length) {
11662 this.currentSequence = Sequences.CdataEnd;
11663 this.sequenceIndex = 0;
11664 this.sectionStart = this.index + 1;
11667 this.sequenceIndex = 0;
11669 this.stateInDeclaration(c);
11673 * When we wait for one specific character, we can speed things up
11674 * by skipping through the buffer until we find it.
11676 * @returns Whether the character was found.
11679 while (++this.index < this.buffer.length) {
11680 const cc = this.buffer.charCodeAt(this.index);
11682 this.newlines.push(this.index);
11688 this.index = this.buffer.length - 1;
11692 * Comments and CDATA end with `-->` and `]]>`.
11694 * Their common qualities are:
11695 * - Their end sequences have a distinct character they start with.
11696 * - That character is then repeated, so we have to check multiple repeats.
11697 * - All characters but the start character of the sequence can be skipped.
11699 stateInCommentLike(c) {
11700 if (c === this.currentSequence[this.sequenceIndex]) {
11701 if (++this.sequenceIndex === this.currentSequence.length) {
11702 if (this.currentSequence === Sequences.CdataEnd) {
11703 this.cbs.oncdata(this.sectionStart, this.index - 2);
11705 this.cbs.oncomment(this.sectionStart, this.index - 2);
11707 this.sequenceIndex = 0;
11708 this.sectionStart = this.index + 1;
11711 } else if (this.sequenceIndex === 0) {
11712 if (this.fastForwardTo(this.currentSequence[0])) {
11713 this.sequenceIndex = 1;
11715 } else if (c !== this.currentSequence[this.sequenceIndex - 1]) {
11716 this.sequenceIndex = 0;
11719 startSpecial(sequence, offset) {
11720 this.enterRCDATA(sequence, offset);
11723 enterRCDATA(sequence, offset) {
11724 this.inRCDATA = true;
11725 this.currentSequence = sequence;
11726 this.sequenceIndex = offset;
11728 stateBeforeTagName(c) {
11731 this.sectionStart = this.index + 1;
11732 } else if (c === 63) {
11734 this.sectionStart = this.index + 1;
11735 } else if (isTagStartChar(c)) {
11736 this.sectionStart = this.index;
11737 if (this.mode === 0) {
11739 } else if (this.inSFCRoot) {
11741 } else if (!this.inXML) {
11745 this.state = c === 115 ? 29 : 6;
11750 } else if (c === 47) {
11757 stateInTagName(c) {
11758 if (isEndOfTagSection(c)) {
11759 this.handleTagName(c);
11762 stateInSFCRootTagName(c) {
11763 if (isEndOfTagSection(c)) {
11764 const tag = this.buffer.slice(this.sectionStart, this.index);
11765 if (tag !== "template") {
11766 this.enterRCDATA(toCharCodes(`</` + tag), 0);
11768 this.handleTagName(c);
11772 this.cbs.onopentagname(this.sectionStart, this.index);
11773 this.sectionStart = -1;
11775 this.stateBeforeAttrName(c);
11777 stateBeforeClosingTagName(c) {
11778 if (isWhitespace(c)) ; else if (c === 62) {
11780 this.cbs.onerr(14, this.index);
11783 this.sectionStart = this.index + 1;
11785 this.state = isTagStartChar(c) ? 9 : 27;
11786 this.sectionStart = this.index;
11789 stateInClosingTagName(c) {
11790 if (c === 62 || isWhitespace(c)) {
11791 this.cbs.onclosetag(this.sectionStart, this.index);
11792 this.sectionStart = -1;
11794 this.stateAfterClosingTagName(c);
11797 stateAfterClosingTagName(c) {
11800 this.sectionStart = this.index + 1;
11803 stateBeforeAttrName(c) {
11805 this.cbs.onopentagend(this.index);
11806 if (this.inRCDATA) {
11811 this.sectionStart = this.index + 1;
11812 } else if (c === 47) {
11814 if (this.peek() !== 62) {
11815 this.cbs.onerr(22, this.index);
11817 } else if (c === 60 && this.peek() === 47) {
11818 this.cbs.onopentagend(this.index);
11820 this.sectionStart = this.index;
11821 } else if (!isWhitespace(c)) {
11828 this.handleAttrStart(c);
11831 handleAttrStart(c) {
11832 if (c === 118 && this.peek() === 45) {
11834 this.sectionStart = this.index;
11835 } else if (c === 46 || c === 58 || c === 64 || c === 35) {
11836 this.cbs.ondirname(this.index, this.index + 1);
11838 this.sectionStart = this.index + 1;
11841 this.sectionStart = this.index;
11844 stateInSelfClosingTag(c) {
11846 this.cbs.onselfclosingtag(this.index);
11848 this.sectionStart = this.index + 1;
11849 this.inRCDATA = false;
11850 } else if (!isWhitespace(c)) {
11852 this.stateBeforeAttrName(c);
11855 stateInAttrName(c) {
11856 if (c === 61 || isEndOfTagSection(c)) {
11857 this.cbs.onattribname(this.sectionStart, this.index);
11858 this.handleAttrNameEnd(c);
11859 } else if (c === 34 || c === 39 || c === 60) {
11866 stateInDirName(c) {
11867 if (c === 61 || isEndOfTagSection(c)) {
11868 this.cbs.ondirname(this.sectionStart, this.index);
11869 this.handleAttrNameEnd(c);
11870 } else if (c === 58) {
11871 this.cbs.ondirname(this.sectionStart, this.index);
11873 this.sectionStart = this.index + 1;
11874 } else if (c === 46) {
11875 this.cbs.ondirname(this.sectionStart, this.index);
11877 this.sectionStart = this.index + 1;
11881 if (c === 61 || isEndOfTagSection(c)) {
11882 this.cbs.ondirarg(this.sectionStart, this.index);
11883 this.handleAttrNameEnd(c);
11884 } else if (c === 91) {
11886 } else if (c === 46) {
11887 this.cbs.ondirarg(this.sectionStart, this.index);
11889 this.sectionStart = this.index + 1;
11892 stateInDynamicDirArg(c) {
11895 } else if (c === 61 || isEndOfTagSection(c)) {
11896 this.cbs.ondirarg(this.sectionStart, this.index + 1);
11897 this.handleAttrNameEnd(c);
11906 stateInDirModifier(c) {
11907 if (c === 61 || isEndOfTagSection(c)) {
11908 this.cbs.ondirmodifier(this.sectionStart, this.index);
11909 this.handleAttrNameEnd(c);
11910 } else if (c === 46) {
11911 this.cbs.ondirmodifier(this.sectionStart, this.index);
11912 this.sectionStart = this.index + 1;
11915 handleAttrNameEnd(c) {
11916 this.sectionStart = this.index;
11918 this.cbs.onattribnameend(this.index);
11919 this.stateAfterAttrName(c);
11921 stateAfterAttrName(c) {
11924 } else if (c === 47 || c === 62) {
11925 this.cbs.onattribend(0, this.sectionStart);
11926 this.sectionStart = -1;
11928 this.stateBeforeAttrName(c);
11929 } else if (!isWhitespace(c)) {
11930 this.cbs.onattribend(0, this.sectionStart);
11931 this.handleAttrStart(c);
11934 stateBeforeAttrValue(c) {
11937 this.sectionStart = this.index + 1;
11938 } else if (c === 39) {
11940 this.sectionStart = this.index + 1;
11941 } else if (!isWhitespace(c)) {
11942 this.sectionStart = this.index;
11944 this.stateInAttrValueNoQuotes(c);
11947 handleInAttrValue(c, quote) {
11948 if (c === quote || this.fastForwardTo(quote)) {
11949 this.cbs.onattribdata(this.sectionStart, this.index);
11950 this.sectionStart = -1;
11951 this.cbs.onattribend(
11952 quote === 34 ? 3 : 2,
11958 stateInAttrValueDoubleQuotes(c) {
11959 this.handleInAttrValue(c, 34);
11961 stateInAttrValueSingleQuotes(c) {
11962 this.handleInAttrValue(c, 39);
11964 stateInAttrValueNoQuotes(c) {
11965 if (isWhitespace(c) || c === 62) {
11966 this.cbs.onattribdata(this.sectionStart, this.index);
11967 this.sectionStart = -1;
11968 this.cbs.onattribend(1, this.index);
11970 this.stateBeforeAttrName(c);
11971 } else if (c === 34 || c === 39 || c === 60 || c === 61 || c === 96) {
11978 stateBeforeDeclaration(c) {
11981 this.sequenceIndex = 0;
11983 this.state = c === 45 ? 25 : 23;
11986 stateInDeclaration(c) {
11987 if (c === 62 || this.fastForwardTo(62)) {
11989 this.sectionStart = this.index + 1;
11992 stateInProcessingInstruction(c) {
11993 if (c === 62 || this.fastForwardTo(62)) {
11994 this.cbs.onprocessinginstruction(this.sectionStart, this.index);
11996 this.sectionStart = this.index + 1;
11999 stateBeforeComment(c) {
12002 this.currentSequence = Sequences.CommentEnd;
12003 this.sequenceIndex = 2;
12004 this.sectionStart = this.index + 1;
12009 stateInSpecialComment(c) {
12010 if (c === 62 || this.fastForwardTo(62)) {
12011 this.cbs.oncomment(this.sectionStart, this.index);
12013 this.sectionStart = this.index + 1;
12016 stateBeforeSpecialS(c) {
12017 if (c === Sequences.ScriptEnd[3]) {
12018 this.startSpecial(Sequences.ScriptEnd, 4);
12019 } else if (c === Sequences.StyleEnd[3]) {
12020 this.startSpecial(Sequences.StyleEnd, 4);
12023 this.stateInTagName(c);
12026 stateBeforeSpecialT(c) {
12027 if (c === Sequences.TitleEnd[3]) {
12028 this.startSpecial(Sequences.TitleEnd, 4);
12029 } else if (c === Sequences.TextareaEnd[3]) {
12030 this.startSpecial(Sequences.TextareaEnd, 4);
12033 this.stateInTagName(c);
12041 * Iterates through the buffer, calling the function corresponding to the current state.
12043 * States that are more likely to be hit are higher up, as a performance improvement.
12046 this.buffer = input;
12047 while (this.index < this.buffer.length) {
12048 const c = this.buffer.charCodeAt(this.index);
12050 this.newlines.push(this.index);
12052 switch (this.state) {
12058 this.stateInterpolationOpen(c);
12062 this.stateInterpolation(c);
12066 this.stateInterpolationClose(c);
12070 this.stateSpecialStartSequence(c);
12074 this.stateInRCDATA(c);
12078 this.stateCDATASequence(c);
12082 this.stateInAttrValueDoubleQuotes(c);
12086 this.stateInAttrName(c);
12090 this.stateInDirName(c);
12094 this.stateInDirArg(c);
12098 this.stateInDynamicDirArg(c);
12102 this.stateInDirModifier(c);
12106 this.stateInCommentLike(c);
12110 this.stateInSpecialComment(c);
12114 this.stateBeforeAttrName(c);
12118 this.stateInTagName(c);
12122 this.stateInSFCRootTagName(c);
12126 this.stateInClosingTagName(c);
12130 this.stateBeforeTagName(c);
12134 this.stateAfterAttrName(c);
12138 this.stateInAttrValueSingleQuotes(c);
12142 this.stateBeforeAttrValue(c);
12146 this.stateBeforeClosingTagName(c);
12150 this.stateAfterClosingTagName(c);
12154 this.stateBeforeSpecialS(c);
12158 this.stateBeforeSpecialT(c);
12162 this.stateInAttrValueNoQuotes(c);
12166 this.stateInSelfClosingTag(c);
12170 this.stateInDeclaration(c);
12174 this.stateBeforeDeclaration(c);
12178 this.stateBeforeComment(c);
12182 this.stateInProcessingInstruction(c);
12186 this.stateInEntity();
12196 * Remove data that has already been consumed from the buffer.
12199 if (this.sectionStart !== this.index) {
12200 if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) {
12201 this.cbs.ontext(this.sectionStart, this.index);
12202 this.sectionStart = this.index;
12203 } else if (this.state === 19 || this.state === 20 || this.state === 21) {
12204 this.cbs.onattribdata(this.sectionStart, this.index);
12205 this.sectionStart = this.index;
12210 this.handleTrailingData();
12213 /** Handle any trailing data. */
12214 handleTrailingData() {
12215 const endIndex = this.buffer.length;
12216 if (this.sectionStart >= endIndex) {
12219 if (this.state === 28) {
12220 if (this.currentSequence === Sequences.CdataEnd) {
12221 this.cbs.oncdata(this.sectionStart, endIndex);
12223 this.cbs.oncomment(this.sectionStart, endIndex);
12225 } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else {
12226 this.cbs.ontext(this.sectionStart, endIndex);
12229 emitCodePoint(cp, consumed) {
12233 function defaultOnError(error) {
12236 function defaultOnWarn(msg) {
12237 console.warn(`[Vue warn] ${msg.message}`);
12239 function createCompilerError(code, loc, messages, additionalMessage) {
12240 const msg = (messages || errorMessages)[code] + (additionalMessage || ``) ;
12241 const error = new SyntaxError(String(msg));
12246 const errorMessages = {
12248 [0]: "Illegal comment.",
12249 [1]: "CDATA section is allowed only in XML context.",
12250 [2]: "Duplicate attribute.",
12251 [3]: "End tag cannot have attributes.",
12252 [4]: "Illegal '/' in tags.",
12253 [5]: "Unexpected EOF in tag.",
12254 [6]: "Unexpected EOF in CDATA section.",
12255 [7]: "Unexpected EOF in comment.",
12256 [8]: "Unexpected EOF in script.",
12257 [9]: "Unexpected EOF in tag.",
12258 [10]: "Incorrectly closed comment.",
12259 [11]: "Incorrectly opened comment.",
12260 [12]: "Illegal tag name. Use '<' to print '<'.",
12261 [13]: "Attribute value was expected.",
12262 [14]: "End tag name was expected.",
12263 [15]: "Whitespace was expected.",
12264 [16]: "Unexpected '<!--' in comment.",
12265 [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
12266 [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
12267 [19]: "Attribute name cannot start with '='.",
12268 [21]: "'<?' is allowed only in XML context.",
12269 [20]: `Unexpected null character.`,
12270 [22]: "Illegal '/' in tags.",
12271 // Vue-specific parse errors
12272 [23]: "Invalid end tag.",
12273 [24]: "Element is missing end tag.",
12274 [25]: "Interpolation end sign was not found.",
12275 [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
12276 [26]: "Legal directive name was expected.",
12277 // transform errors
12278 [28]: `v-if/v-else-if is missing expression.`,
12279 [29]: `v-if/else branches must use unique keys.`,
12280 [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
12281 [31]: `v-for is missing expression.`,
12282 [32]: `v-for has invalid expression.`,
12283 [33]: `<template v-for> key should be placed on the <template> tag.`,
12284 [34]: `v-bind is missing expression.`,
12285 [52]: `v-bind with same-name shorthand only allows static argument.`,
12286 [35]: `v-on is missing expression.`,
12287 [36]: `Unexpected custom directive on <slot> outlet.`,
12288 [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.`,
12289 [38]: `Duplicate slot names found. `,
12290 [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
12291 [40]: `v-slot can only be used on components or <template> tags.`,
12292 [41]: `v-model is missing expression.`,
12293 [42]: `v-model value must be a valid JavaScript member expression.`,
12294 [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
12295 [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
12296 Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
12297 [45]: `Error parsing JavaScript expression: `,
12298 [46]: `<KeepAlive> expects exactly one child component.`,
12299 [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
12301 [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
12302 [48]: `ES module mode is not supported in this build of compiler.`,
12303 [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
12304 [50]: `"scopeId" option is only supported in module mode.`,
12305 // just to fulfill types
12309 const isStaticExp = (p) => p.type === 4 && p.isStatic;
12310 function isCoreComponent(tag) {
12321 case "BaseTransition":
12322 case "base-transition":
12323 return BASE_TRANSITION;
12326 const nonIdentifierRE = /^\d|[^\$\w]/;
12327 const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
12328 const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
12329 const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
12330 const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
12331 const isMemberExpressionBrowser = (path) => {
12332 path = path.trim().replace(whitespaceRE, (s) => s.trim());
12333 let state = 0 /* inMemberExp */;
12334 let stateStack = [];
12335 let currentOpenBracketCount = 0;
12336 let currentOpenParensCount = 0;
12337 let currentStringType = null;
12338 for (let i = 0; i < path.length; i++) {
12339 const char = path.charAt(i);
12341 case 0 /* inMemberExp */:
12342 if (char === "[") {
12343 stateStack.push(state);
12344 state = 1 /* inBrackets */;
12345 currentOpenBracketCount++;
12346 } else if (char === "(") {
12347 stateStack.push(state);
12348 state = 2 /* inParens */;
12349 currentOpenParensCount++;
12350 } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {
12354 case 1 /* inBrackets */:
12355 if (char === `'` || char === `"` || char === "`") {
12356 stateStack.push(state);
12357 state = 3 /* inString */;
12358 currentStringType = char;
12359 } else if (char === `[`) {
12360 currentOpenBracketCount++;
12361 } else if (char === `]`) {
12362 if (!--currentOpenBracketCount) {
12363 state = stateStack.pop();
12367 case 2 /* inParens */:
12368 if (char === `'` || char === `"` || char === "`") {
12369 stateStack.push(state);
12370 state = 3 /* inString */;
12371 currentStringType = char;
12372 } else if (char === `(`) {
12373 currentOpenParensCount++;
12374 } else if (char === `)`) {
12375 if (i === path.length - 1) {
12378 if (!--currentOpenParensCount) {
12379 state = stateStack.pop();
12383 case 3 /* inString */:
12384 if (char === currentStringType) {
12385 state = stateStack.pop();
12386 currentStringType = null;
12391 return !currentOpenBracketCount && !currentOpenParensCount;
12393 const isMemberExpression = isMemberExpressionBrowser ;
12394 function assert(condition, msg) {
12396 throw new Error(msg || `unexpected compiler condition`);
12399 function findDir(node, name, allowEmpty = false) {
12400 for (let i = 0; i < node.props.length; i++) {
12401 const p = node.props[i];
12402 if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
12407 function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
12408 for (let i = 0; i < node.props.length; i++) {
12409 const p = node.props[i];
12410 if (p.type === 6) {
12413 if (p.name === name && (p.value || allowEmpty)) {
12416 } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) {
12421 function isStaticArgOf(arg, name) {
12422 return !!(arg && isStaticExp(arg) && arg.content === name);
12424 function hasDynamicKeyVBind(node) {
12425 return node.props.some(
12426 (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj"
12427 p.arg.type !== 4 || // v-bind:[_ctx.foo]
12432 function isText$1(node) {
12433 return node.type === 5 || node.type === 2;
12435 function isVSlot(p) {
12436 return p.type === 7 && p.name === "slot";
12438 function isTemplateNode(node) {
12439 return node.type === 1 && node.tagType === 3;
12441 function isSlotOutlet(node) {
12442 return node.type === 1 && node.tagType === 2;
12444 const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
12445 function getUnnormalizedProps(props, callPath = []) {
12446 if (props && !isString(props) && props.type === 14) {
12447 const callee = props.callee;
12448 if (!isString(callee) && propsHelperSet.has(callee)) {
12449 return getUnnormalizedProps(
12450 props.arguments[0],
12451 callPath.concat(props)
12455 return [props, callPath];
12457 function injectProp(node, prop, context) {
12458 let propsWithInjection;
12459 let props = node.type === 13 ? node.props : node.arguments[2];
12462 if (props && !isString(props) && props.type === 14) {
12463 const ret = getUnnormalizedProps(props);
12466 parentCall = callPath[callPath.length - 1];
12468 if (props == null || isString(props)) {
12469 propsWithInjection = createObjectExpression([prop]);
12470 } else if (props.type === 14) {
12471 const first = props.arguments[0];
12472 if (!isString(first) && first.type === 15) {
12473 if (!hasProp(prop, first)) {
12474 first.properties.unshift(prop);
12477 if (props.callee === TO_HANDLERS) {
12478 propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
12479 createObjectExpression([prop]),
12483 props.arguments.unshift(createObjectExpression([prop]));
12486 !propsWithInjection && (propsWithInjection = props);
12487 } else if (props.type === 15) {
12488 if (!hasProp(prop, props)) {
12489 props.properties.unshift(prop);
12491 propsWithInjection = props;
12493 propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
12494 createObjectExpression([prop]),
12497 if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) {
12498 parentCall = callPath[callPath.length - 2];
12501 if (node.type === 13) {
12503 parentCall.arguments[0] = propsWithInjection;
12505 node.props = propsWithInjection;
12509 parentCall.arguments[0] = propsWithInjection;
12511 node.arguments[2] = propsWithInjection;
12515 function hasProp(prop, props) {
12516 let result = false;
12517 if (prop.key.type === 4) {
12518 const propKeyName = prop.key.content;
12519 result = props.properties.some(
12520 (p) => p.key.type === 4 && p.key.content === propKeyName
12525 function toValidAssetId(name, type) {
12526 return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => {
12527 return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString();
12530 function getMemoedVNodeCall(node) {
12531 if (node.type === 14 && node.callee === WITH_MEMO) {
12532 return node.arguments[1].returns;
12537 const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
12539 const defaultParserOptions = {
12542 delimiters: [`{{`, `}}`],
12543 getNamespace: () => 0,
12546 isCustomElement: NO,
12547 onError: defaultOnError,
12548 onWarn: defaultOnWarn,
12550 prefixIdentifiers: false
12552 let currentOptions = defaultParserOptions;
12553 let currentRoot = null;
12554 let currentInput = "";
12555 let currentOpenTag = null;
12556 let currentProp = null;
12557 let currentAttrValue = "";
12558 let currentAttrStartIndex = -1;
12559 let currentAttrEndIndex = -1;
12561 let inVPre = false;
12562 let currentVPreBoundary = null;
12564 const tokenizer = new Tokenizer(stack, {
12566 ontext(start, end) {
12567 onText(getSlice(start, end), start, end);
12569 ontextentity(char, start, end) {
12570 onText(char, start, end);
12572 oninterpolation(start, end) {
12574 return onText(getSlice(start, end), start, end);
12576 let innerStart = start + tokenizer.delimiterOpen.length;
12577 let innerEnd = end - tokenizer.delimiterClose.length;
12578 while (isWhitespace(currentInput.charCodeAt(innerStart))) {
12581 while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) {
12584 let exp = getSlice(innerStart, innerEnd);
12585 if (exp.includes("&")) {
12587 exp = currentOptions.decodeEntities(exp, false);
12592 content: createExp(exp, false, getLoc(innerStart, innerEnd)),
12593 loc: getLoc(start, end)
12596 onopentagname(start, end) {
12597 const name = getSlice(start, end);
12601 ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns),
12603 // will be refined on tag close
12606 loc: getLoc(start - 1, end),
12607 codegenNode: void 0
12610 onopentagend(end) {
12613 onclosetag(start, end) {
12614 const name = getSlice(start, end);
12615 if (!currentOptions.isVoidTag(name)) {
12617 for (let i = 0; i < stack.length; i++) {
12618 const e = stack[i];
12619 if (e.tag.toLowerCase() === name.toLowerCase()) {
12622 emitError(24, stack[0].loc.start.offset);
12624 for (let j = 0; j <= i; j++) {
12625 const el = stack.shift();
12626 onCloseTag(el, end, j < i);
12632 emitError(23, backTrack(start, 60));
12636 onselfclosingtag(end) {
12637 const name = currentOpenTag.tag;
12638 currentOpenTag.isSelfClosing = true;
12640 if (stack[0] && stack[0].tag === name) {
12641 onCloseTag(stack.shift(), end);
12644 onattribname(start, end) {
12647 name: getSlice(start, end),
12648 nameLoc: getLoc(start, end),
12653 ondirname(start, end) {
12654 const raw = getSlice(start, end);
12655 const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2);
12656 if (!inVPre && name === "") {
12657 emitError(26, start);
12659 if (inVPre || name === "") {
12663 nameLoc: getLoc(start, end),
12674 modifiers: raw === "." ? ["prop"] : [],
12677 if (name === "pre") {
12678 inVPre = tokenizer.inVPre = true;
12679 currentVPreBoundary = currentOpenTag;
12680 const props = currentOpenTag.props;
12681 for (let i = 0; i < props.length; i++) {
12682 if (props[i].type === 7) {
12683 props[i] = dirToAttr(props[i]);
12689 ondirarg(start, end) {
12692 const arg = getSlice(start, end);
12694 currentProp.name += arg;
12695 setLocEnd(currentProp.nameLoc, end);
12697 const isStatic = arg[0] !== `[`;
12698 currentProp.arg = createExp(
12699 isStatic ? arg : arg.slice(1, -1),
12701 getLoc(start, end),
12706 ondirmodifier(start, end) {
12707 const mod = getSlice(start, end);
12709 currentProp.name += "." + mod;
12710 setLocEnd(currentProp.nameLoc, end);
12711 } else if (currentProp.name === "slot") {
12712 const arg = currentProp.arg;
12714 arg.content += "." + mod;
12715 setLocEnd(arg.loc, end);
12718 currentProp.modifiers.push(mod);
12721 onattribdata(start, end) {
12722 currentAttrValue += getSlice(start, end);
12723 if (currentAttrStartIndex < 0)
12724 currentAttrStartIndex = start;
12725 currentAttrEndIndex = end;
12727 onattribentity(char, start, end) {
12728 currentAttrValue += char;
12729 if (currentAttrStartIndex < 0)
12730 currentAttrStartIndex = start;
12731 currentAttrEndIndex = end;
12733 onattribnameend(end) {
12734 const start = currentProp.loc.start.offset;
12735 const name = getSlice(start, end);
12736 if (currentProp.type === 7) {
12737 currentProp.rawName = name;
12739 if (currentOpenTag.props.some(
12740 (p) => (p.type === 7 ? p.rawName : p.name) === name
12742 emitError(2, start);
12745 onattribend(quote, end) {
12746 if (currentOpenTag && currentProp) {
12747 setLocEnd(currentProp.loc, end);
12749 if (currentAttrValue.includes("&")) {
12750 currentAttrValue = currentOptions.decodeEntities(
12755 if (currentProp.type === 6) {
12756 if (currentProp.name === "class") {
12757 currentAttrValue = condense(currentAttrValue).trim();
12759 if (quote === 1 && !currentAttrValue) {
12760 emitError(13, end);
12762 currentProp.value = {
12764 content: currentAttrValue,
12765 loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1)
12767 if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") {
12768 tokenizer.enterRCDATA(toCharCodes(`</template`), 0);
12771 let expParseMode = 0 /* Normal */;
12772 currentProp.exp = createExp(
12775 getLoc(currentAttrStartIndex, currentAttrEndIndex),
12779 if (currentProp.name === "for") {
12780 currentProp.forParseResult = parseForExpression(currentProp.exp);
12784 if (currentProp.type !== 7 || currentProp.name !== "pre") {
12785 currentOpenTag.props.push(currentProp);
12788 currentAttrValue = "";
12789 currentAttrStartIndex = currentAttrEndIndex = -1;
12791 oncomment(start, end) {
12792 if (currentOptions.comments) {
12795 content: getSlice(start, end),
12796 loc: getLoc(start - 4, end + 3)
12801 const end = currentInput.length;
12802 if (tokenizer.state !== 1) {
12803 switch (tokenizer.state) {
12812 tokenizer.sectionStart
12816 if (tokenizer.currentSequence === Sequences.CdataEnd) {
12840 for (let index = 0; index < stack.length; index++) {
12841 onCloseTag(stack[index], end - 1);
12842 emitError(24, stack[index].loc.start.offset);
12845 oncdata(start, end) {
12846 if (stack[0].ns !== 0) {
12847 onText(getSlice(start, end), start, end);
12849 emitError(1, start - 9);
12852 onprocessinginstruction(start) {
12853 if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) {
12861 const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
12862 const stripParensRE = /^\(|\)$/g;
12863 function parseForExpression(input) {
12864 const loc = input.loc;
12865 const exp = input.content;
12866 const inMatch = exp.match(forAliasRE);
12869 const [, LHS, RHS] = inMatch;
12870 const createAliasExpression = (content, offset, asParam = false) => {
12871 const start = loc.start.offset + offset;
12872 const end = start + content.length;
12876 getLoc(start, end),
12878 asParam ? 1 /* Params */ : 0 /* Normal */
12882 source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)),
12888 let valueContent = LHS.trim().replace(stripParensRE, "").trim();
12889 const trimmedOffset = LHS.indexOf(valueContent);
12890 const iteratorMatch = valueContent.match(forIteratorRE);
12891 if (iteratorMatch) {
12892 valueContent = valueContent.replace(forIteratorRE, "").trim();
12893 const keyContent = iteratorMatch[1].trim();
12896 keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
12897 result.key = createAliasExpression(keyContent, keyOffset, true);
12899 if (iteratorMatch[2]) {
12900 const indexContent = iteratorMatch[2].trim();
12901 if (indexContent) {
12902 result.index = createAliasExpression(
12906 result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length
12913 if (valueContent) {
12914 result.value = createAliasExpression(valueContent, trimmedOffset, true);
12918 function getSlice(start, end) {
12919 return currentInput.slice(start, end);
12921 function endOpenTag(end) {
12922 if (tokenizer.inSFCRoot) {
12923 currentOpenTag.innerLoc = getLoc(end + 1, end + 1);
12925 addNode(currentOpenTag);
12926 const { tag, ns } = currentOpenTag;
12927 if (ns === 0 && currentOptions.isPreTag(tag)) {
12930 if (currentOptions.isVoidTag(tag)) {
12931 onCloseTag(currentOpenTag, end);
12933 stack.unshift(currentOpenTag);
12934 if (ns === 1 || ns === 2) {
12935 tokenizer.inXML = true;
12938 currentOpenTag = null;
12940 function onText(content, start, end) {
12942 const tag = stack[0] && stack[0].tag;
12943 if (tag !== "script" && tag !== "style" && content.includes("&")) {
12944 content = currentOptions.decodeEntities(content, false);
12947 const parent = stack[0] || currentRoot;
12948 const lastNode = parent.children[parent.children.length - 1];
12949 if (lastNode && lastNode.type === 2) {
12950 lastNode.content += content;
12951 setLocEnd(lastNode.loc, end);
12953 parent.children.push({
12956 loc: getLoc(start, end)
12960 function onCloseTag(el, end, isImplied = false) {
12962 setLocEnd(el.loc, backTrack(end, 60));
12964 setLocEnd(el.loc, lookAhead(end, 62) + 1);
12966 if (tokenizer.inSFCRoot) {
12967 if (el.children.length) {
12968 el.innerLoc.end = extend({}, el.children[el.children.length - 1].loc.end);
12970 el.innerLoc.end = extend({}, el.innerLoc.start);
12972 el.innerLoc.source = getSlice(
12973 el.innerLoc.start.offset,
12974 el.innerLoc.end.offset
12977 const { tag, ns } = el;
12979 if (tag === "slot") {
12981 } else if (isFragmentTemplate(el)) {
12983 } else if (isComponent(el)) {
12987 if (!tokenizer.inRCDATA) {
12988 el.children = condenseWhitespace(el.children, el.tag);
12990 if (ns === 0 && currentOptions.isPreTag(tag)) {
12993 if (currentVPreBoundary === el) {
12994 inVPre = tokenizer.inVPre = false;
12995 currentVPreBoundary = null;
12997 if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) {
12998 tokenizer.inXML = false;
13001 function lookAhead(index, c) {
13003 while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1)
13007 function backTrack(index, c) {
13009 while (currentInput.charCodeAt(i) !== c && i >= 0)
13013 const specialTemplateDir = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]);
13014 function isFragmentTemplate({ tag, props }) {
13015 if (tag === "template") {
13016 for (let i = 0; i < props.length; i++) {
13017 if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) {
13024 function isComponent({ tag, props }) {
13025 if (currentOptions.isCustomElement(tag)) {
13028 if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {
13031 for (let i = 0; i < props.length; i++) {
13032 const p = props[i];
13033 if (p.type === 6) {
13034 if (p.name === "is" && p.value) {
13035 if (p.value.content.startsWith("vue:")) {
13043 function isUpperCase(c) {
13044 return c > 64 && c < 91;
13046 const windowsNewlineRE = /\r\n/g;
13047 function condenseWhitespace(nodes, tag) {
13048 const shouldCondense = currentOptions.whitespace !== "preserve";
13049 let removedWhitespace = false;
13050 for (let i = 0; i < nodes.length; i++) {
13051 const node = nodes[i];
13052 if (node.type === 2) {
13054 if (isAllWhitespace(node.content)) {
13055 const prev = nodes[i - 1] && nodes[i - 1].type;
13056 const next = nodes[i + 1] && nodes[i + 1].type;
13057 if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
13058 removedWhitespace = true;
13061 node.content = " ";
13063 } else if (shouldCondense) {
13064 node.content = condense(node.content);
13067 node.content = node.content.replace(windowsNewlineRE, "\n");
13071 if (inPre && tag && currentOptions.isPreTag(tag)) {
13072 const first = nodes[0];
13073 if (first && first.type === 2) {
13074 first.content = first.content.replace(/^\r?\n/, "");
13077 return removedWhitespace ? nodes.filter(Boolean) : nodes;
13079 function isAllWhitespace(str) {
13080 for (let i = 0; i < str.length; i++) {
13081 if (!isWhitespace(str.charCodeAt(i))) {
13087 function hasNewlineChar(str) {
13088 for (let i = 0; i < str.length; i++) {
13089 const c = str.charCodeAt(i);
13090 if (c === 10 || c === 13) {
13096 function condense(str) {
13098 let prevCharIsWhitespace = false;
13099 for (let i = 0; i < str.length; i++) {
13100 if (isWhitespace(str.charCodeAt(i))) {
13101 if (!prevCharIsWhitespace) {
13103 prevCharIsWhitespace = true;
13107 prevCharIsWhitespace = false;
13112 function addNode(node) {
13113 (stack[0] || currentRoot).children.push(node);
13115 function getLoc(start, end) {
13117 start: tokenizer.getPos(start),
13118 // @ts-expect-error allow late attachment
13119 end: end == null ? end : tokenizer.getPos(end),
13120 // @ts-expect-error allow late attachment
13121 source: end == null ? end : getSlice(start, end)
13124 function setLocEnd(loc, end) {
13125 loc.end = tokenizer.getPos(end);
13126 loc.source = getSlice(loc.start.offset, end);
13128 function dirToAttr(dir) {
13133 dir.loc.start.offset,
13134 dir.loc.start.offset + dir.rawName.length
13140 const loc = dir.exp.loc;
13141 if (loc.end.offset < dir.loc.end.offset) {
13142 loc.start.offset--;
13143 loc.start.column--;
13149 content: dir.exp.content,
13155 function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) {
13156 const exp = createSimpleExpression(content, isStatic, loc, constType);
13159 function emitError(code, index, message) {
13160 currentOptions.onError(
13161 createCompilerError(code, getLoc(index, index), void 0, message)
13166 currentOpenTag = null;
13167 currentProp = null;
13168 currentAttrValue = "";
13169 currentAttrStartIndex = -1;
13170 currentAttrEndIndex = -1;
13173 function baseParse(input, options) {
13175 currentInput = input;
13176 currentOptions = extend({}, defaultParserOptions);
13179 for (key in options) {
13180 if (options[key] != null) {
13181 currentOptions[key] = options[key];
13186 if (!currentOptions.decodeEntities) {
13188 `[@vue/compiler-core] decodeEntities option is required in browser builds.`
13192 tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
13193 tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
13194 const delimiters = options && options.delimiters;
13196 tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
13197 tokenizer.delimiterClose = toCharCodes(delimiters[1]);
13199 const root = currentRoot = createRoot([], input);
13200 tokenizer.parse(currentInput);
13201 root.loc = getLoc(0, input.length);
13202 root.children = condenseWhitespace(root.children);
13203 currentRoot = null;
13207 function hoistStatic(root, context) {
13211 // Root node is unfortunately non-hoistable due to potential parent
13212 // fallthrough attributes.
13213 isSingleElementRoot(root, root.children[0])
13216 function isSingleElementRoot(root, child) {
13217 const { children } = root;
13218 return children.length === 1 && child.type === 1 && !isSlotOutlet(child);
13220 function walk(node, context, doNotHoistNode = false) {
13221 const { children } = node;
13222 const originalCount = children.length;
13223 let hoistedCount = 0;
13224 for (let i = 0; i < children.length; i++) {
13225 const child = children[i];
13226 if (child.type === 1 && child.tagType === 0) {
13227 const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
13228 if (constantType > 0) {
13229 if (constantType >= 2) {
13230 child.codegenNode.patchFlag = -1 + (` /* HOISTED */` );
13231 child.codegenNode = context.hoist(child.codegenNode);
13236 const codegenNode = child.codegenNode;
13237 if (codegenNode.type === 13) {
13238 const flag = getPatchFlag(codegenNode);
13239 if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
13240 const props = getNodeProps(child);
13242 codegenNode.props = context.hoist(props);
13245 if (codegenNode.dynamicProps) {
13246 codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps);
13251 if (child.type === 1) {
13252 const isComponent = child.tagType === 1;
13254 context.scopes.vSlot++;
13256 walk(child, context);
13258 context.scopes.vSlot--;
13260 } else if (child.type === 11) {
13261 walk(child, context, child.children.length === 1);
13262 } else if (child.type === 9) {
13263 for (let i2 = 0; i2 < child.branches.length; i2++) {
13265 child.branches[i2],
13267 child.branches[i2].children.length === 1
13272 if (hoistedCount && context.transformHoist) {
13273 context.transformHoist(children, context, node);
13275 if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
13276 const hoisted = context.hoist(
13277 createArrayExpression(node.codegenNode.children)
13280 hoisted.content = `[...${hoisted.content}]`;
13282 node.codegenNode.children = hoisted;
13285 function getConstantType(node, context) {
13286 const { constantCache } = context;
13287 switch (node.type) {
13289 if (node.tagType !== 0) {
13292 const cached = constantCache.get(node);
13293 if (cached !== void 0) {
13296 const codegenNode = node.codegenNode;
13297 if (codegenNode.type !== 13) {
13300 if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject") {
13303 const flag = getPatchFlag(codegenNode);
13305 let returnType2 = 3;
13306 const generatedPropsType = getGeneratedPropsConstantType(node, context);
13307 if (generatedPropsType === 0) {
13308 constantCache.set(node, 0);
13311 if (generatedPropsType < returnType2) {
13312 returnType2 = generatedPropsType;
13314 for (let i = 0; i < node.children.length; i++) {
13315 const childType = getConstantType(node.children[i], context);
13316 if (childType === 0) {
13317 constantCache.set(node, 0);
13320 if (childType < returnType2) {
13321 returnType2 = childType;
13324 if (returnType2 > 1) {
13325 for (let i = 0; i < node.props.length; i++) {
13326 const p = node.props[i];
13327 if (p.type === 7 && p.name === "bind" && p.exp) {
13328 const expType = getConstantType(p.exp, context);
13329 if (expType === 0) {
13330 constantCache.set(node, 0);
13333 if (expType < returnType2) {
13334 returnType2 = expType;
13339 if (codegenNode.isBlock) {
13340 for (let i = 0; i < node.props.length; i++) {
13341 const p = node.props[i];
13342 if (p.type === 7) {
13343 constantCache.set(node, 0);
13347 context.removeHelper(OPEN_BLOCK);
13348 context.removeHelper(
13349 getVNodeBlockHelper(context.inSSR, codegenNode.isComponent)
13351 codegenNode.isBlock = false;
13352 context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent));
13354 constantCache.set(node, returnType2);
13355 return returnType2;
13357 constantCache.set(node, 0);
13369 return getConstantType(node.content, context);
13371 return node.constType;
13373 let returnType = 3;
13374 for (let i = 0; i < node.children.length; i++) {
13375 const child = node.children[i];
13376 if (isString(child) || isSymbol(child)) {
13379 const childType = getConstantType(child, context);
13380 if (childType === 0) {
13382 } else if (childType < returnType) {
13383 returnType = childType;
13391 const allowHoistedHelperSet = /* @__PURE__ */ new Set([
13395 GUARD_REACTIVE_PROPS
13397 function getConstantTypeOfHelperCall(value, context) {
13398 if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
13399 const arg = value.arguments[0];
13400 if (arg.type === 4) {
13401 return getConstantType(arg, context);
13402 } else if (arg.type === 14) {
13403 return getConstantTypeOfHelperCall(arg, context);
13408 function getGeneratedPropsConstantType(node, context) {
13409 let returnType = 3;
13410 const props = getNodeProps(node);
13411 if (props && props.type === 15) {
13412 const { properties } = props;
13413 for (let i = 0; i < properties.length; i++) {
13414 const { key, value } = properties[i];
13415 const keyType = getConstantType(key, context);
13416 if (keyType === 0) {
13419 if (keyType < returnType) {
13420 returnType = keyType;
13423 if (value.type === 4) {
13424 valueType = getConstantType(value, context);
13425 } else if (value.type === 14) {
13426 valueType = getConstantTypeOfHelperCall(value, context);
13430 if (valueType === 0) {
13433 if (valueType < returnType) {
13434 returnType = valueType;
13440 function getNodeProps(node) {
13441 const codegenNode = node.codegenNode;
13442 if (codegenNode.type === 13) {
13443 return codegenNode.props;
13446 function getPatchFlag(node) {
13447 const flag = node.patchFlag;
13448 return flag ? parseInt(flag, 10) : void 0;
13451 function createTransformContext(root, {
13453 prefixIdentifiers = false,
13454 hoistStatic: hoistStatic2 = false,
13456 cacheHandlers = false,
13457 nodeTransforms = [],
13458 directiveTransforms = {},
13459 transformHoist = null,
13460 isBuiltInComponent = NOOP,
13461 isCustomElement = NOOP,
13462 expressionPlugins = [],
13468 bindingMetadata = EMPTY_OBJ,
13471 onError = defaultOnError,
13472 onWarn = defaultOnWarn,
13475 const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
13479 selfName: nameMatch && capitalize(camelize(nameMatch[1])),
13481 hoistStatic: hoistStatic2,
13485 directiveTransforms,
13487 isBuiltInComponent,
13503 helpers: /* @__PURE__ */ new Map(),
13504 components: /* @__PURE__ */ new Set(),
13505 directives: /* @__PURE__ */ new Set(),
13508 constantCache: /* @__PURE__ */ new WeakMap(),
13511 identifiers: /* @__PURE__ */ Object.create(null),
13525 const count = context.helpers.get(name) || 0;
13526 context.helpers.set(name, count + 1);
13529 removeHelper(name) {
13530 const count = context.helpers.get(name);
13532 const currentCount = count - 1;
13533 if (!currentCount) {
13534 context.helpers.delete(name);
13536 context.helpers.set(name, currentCount);
13540 helperString(name) {
13541 return `_${helperNameMap[context.helper(name)]}`;
13543 replaceNode(node) {
13545 if (!context.currentNode) {
13546 throw new Error(`Node being replaced is already removed.`);
13548 if (!context.parent) {
13549 throw new Error(`Cannot replace root node.`);
13552 context.parent.children[context.childIndex] = context.currentNode = node;
13555 if (!context.parent) {
13556 throw new Error(`Cannot remove root node.`);
13558 const list = context.parent.children;
13559 const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1;
13560 if (removalIndex < 0) {
13561 throw new Error(`node being removed is not a child of current parent`);
13563 if (!node || node === context.currentNode) {
13564 context.currentNode = null;
13565 context.onNodeRemoved();
13567 if (context.childIndex > removalIndex) {
13568 context.childIndex--;
13569 context.onNodeRemoved();
13572 context.parent.children.splice(removalIndex, 1);
13574 onNodeRemoved: NOOP,
13575 addIdentifiers(exp) {
13577 removeIdentifiers(exp) {
13581 exp = createSimpleExpression(exp);
13582 context.hoists.push(exp);
13583 const identifier = createSimpleExpression(
13584 `_hoisted_${context.hoists.length}`,
13589 identifier.hoisted = exp;
13592 cache(exp, isVNode = false) {
13593 return createCacheExpression(context.cached++, exp, isVNode);
13598 function transform(root, options) {
13599 const context = createTransformContext(root, options);
13600 traverseNode(root, context);
13601 if (options.hoistStatic) {
13602 hoistStatic(root, context);
13604 if (!options.ssr) {
13605 createRootCodegen(root, context);
13607 root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]);
13608 root.components = [...context.components];
13609 root.directives = [...context.directives];
13610 root.imports = context.imports;
13611 root.hoists = context.hoists;
13612 root.temps = context.temps;
13613 root.cached = context.cached;
13614 root.transformed = true;
13616 function createRootCodegen(root, context) {
13617 const { helper } = context;
13618 const { children } = root;
13619 if (children.length === 1) {
13620 const child = children[0];
13621 if (isSingleElementRoot(root, child) && child.codegenNode) {
13622 const codegenNode = child.codegenNode;
13623 if (codegenNode.type === 13) {
13624 convertToBlock(codegenNode, context);
13626 root.codegenNode = codegenNode;
13628 root.codegenNode = child;
13630 } else if (children.length > 1) {
13631 let patchFlag = 64;
13632 let patchFlagText = PatchFlagNames[64];
13633 if (children.filter((c) => c.type !== 3).length === 1) {
13635 patchFlagText += `, ${PatchFlagNames[2048]}`;
13637 root.codegenNode = createVNodeCall(
13642 patchFlag + (` /* ${patchFlagText} */` ),
13651 function traverseChildren(parent, context) {
13653 const nodeRemoved = () => {
13656 for (; i < parent.children.length; i++) {
13657 const child = parent.children[i];
13658 if (isString(child))
13660 context.grandParent = context.parent;
13661 context.parent = parent;
13662 context.childIndex = i;
13663 context.onNodeRemoved = nodeRemoved;
13664 traverseNode(child, context);
13667 function traverseNode(node, context) {
13668 context.currentNode = node;
13669 const { nodeTransforms } = context;
13670 const exitFns = [];
13671 for (let i2 = 0; i2 < nodeTransforms.length; i2++) {
13672 const onExit = nodeTransforms[i2](node, context);
13674 if (isArray(onExit)) {
13675 exitFns.push(...onExit);
13677 exitFns.push(onExit);
13680 if (!context.currentNode) {
13683 node = context.currentNode;
13686 switch (node.type) {
13688 if (!context.ssr) {
13689 context.helper(CREATE_COMMENT);
13693 if (!context.ssr) {
13694 context.helper(TO_DISPLAY_STRING);
13698 for (let i2 = 0; i2 < node.branches.length; i2++) {
13699 traverseNode(node.branches[i2], context);
13706 traverseChildren(node, context);
13709 context.currentNode = node;
13710 let i = exitFns.length;
13715 function createStructuralDirectiveTransform(name, fn) {
13716 const matches = isString(name) ? (n) => n === name : (n) => name.test(n);
13717 return (node, context) => {
13718 if (node.type === 1) {
13719 const { props } = node;
13720 if (node.tagType === 3 && props.some(isVSlot)) {
13723 const exitFns = [];
13724 for (let i = 0; i < props.length; i++) {
13725 const prop = props[i];
13726 if (prop.type === 7 && matches(prop.name)) {
13727 props.splice(i, 1);
13729 const onExit = fn(node, prop, context);
13731 exitFns.push(onExit);
13739 const PURE_ANNOTATION = `/*#__PURE__*/`;
13740 const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
13741 function createCodegenContext(ast, {
13743 prefixIdentifiers = mode === "module",
13745 filename = `template.vue.html`,
13747 optimizeImports = false,
13748 runtimeGlobalName = `Vue`,
13749 runtimeModuleName = `vue`,
13750 ssrRuntimeModuleName = "vue/server-renderer",
13764 ssrRuntimeModuleName,
13768 source: ast.source,
13777 return `_${helperNameMap[key]}`;
13779 push(code, newlineIndex = -2 /* None */, node) {
13780 context.code += code;
13783 newline(++context.indentLevel);
13785 deindent(withoutNewLine = false) {
13786 if (withoutNewLine) {
13787 --context.indentLevel;
13789 newline(--context.indentLevel);
13793 newline(context.indentLevel);
13796 function newline(n) {
13797 context.push("\n" + ` `.repeat(n), 0 /* Start */);
13801 function generate(ast, options = {}) {
13802 const context = createCodegenContext(ast, options);
13803 if (options.onContextCreated)
13804 options.onContextCreated(context);
13815 const helpers = Array.from(ast.helpers);
13816 const hasHelpers = helpers.length > 0;
13817 const useWithBlock = !prefixIdentifiers && mode !== "module";
13818 const preambleContext = context;
13820 genFunctionPreamble(ast, preambleContext);
13822 const functionName = ssr ? `ssrRender` : `render`;
13823 const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"];
13824 const signature = args.join(", ");
13826 push(`function ${functionName}(${signature}) {`);
13829 if (useWithBlock) {
13830 push(`with (_ctx) {`);
13834 `const { ${helpers.map(aliasHelper).join(", ")} } = _Vue
13841 if (ast.components.length) {
13842 genAssets(ast.components, "component", context);
13843 if (ast.directives.length || ast.temps > 0) {
13847 if (ast.directives.length) {
13848 genAssets(ast.directives, "directive", context);
13849 if (ast.temps > 0) {
13853 if (ast.temps > 0) {
13855 for (let i = 0; i < ast.temps; i++) {
13856 push(`${i > 0 ? `, ` : ``}_temp${i}`);
13859 if (ast.components.length || ast.directives.length || ast.temps) {
13867 if (ast.codegenNode) {
13868 genNode(ast.codegenNode, context);
13872 if (useWithBlock) {
13880 code: context.code,
13882 map: context.map ? context.map.toJSON() : void 0
13885 function genFunctionPreamble(ast, context) {
13893 ssrRuntimeModuleName
13895 const VueBinding = runtimeGlobalName;
13896 const helpers = Array.from(ast.helpers);
13897 if (helpers.length > 0) {
13899 push(`const _Vue = ${VueBinding}
13901 if (ast.hoists.length) {
13902 const staticHelpers = [
13904 CREATE_ELEMENT_VNODE,
13908 ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", ");
13909 push(`const { ${staticHelpers} } = _Vue
13914 genHoists(ast.hoists, context);
13918 function genAssets(assets, type, { helper, push, newline, isTS }) {
13919 const resolver = helper(
13920 type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE
13922 for (let i = 0; i < assets.length; i++) {
13923 let id = assets[i];
13924 const maybeSelfReference = id.endsWith("__self");
13925 if (maybeSelfReference) {
13926 id = id.slice(0, -6);
13929 `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}`
13931 if (i < assets.length - 1) {
13936 function genHoists(hoists, context) {
13937 if (!hoists.length) {
13940 context.pure = true;
13941 const { push, newline, helper, scopeId, mode } = context;
13943 for (let i = 0; i < hoists.length; i++) {
13944 const exp = hoists[i];
13947 `const _hoisted_${i + 1} = ${``}`
13949 genNode(exp, context);
13953 context.pure = false;
13955 function isText(n) {
13956 return isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8;
13958 function genNodeListAsArray(nodes, context) {
13959 const multilines = nodes.length > 3 || nodes.some((n) => isArray(n) || !isText(n));
13961 multilines && context.indent();
13962 genNodeList(nodes, context, multilines);
13963 multilines && context.deindent();
13966 function genNodeList(nodes, context, multilines = false, comma = true) {
13967 const { push, newline } = context;
13968 for (let i = 0; i < nodes.length; i++) {
13969 const node = nodes[i];
13970 if (isString(node)) {
13971 push(node, -3 /* Unknown */);
13972 } else if (isArray(node)) {
13973 genNodeListAsArray(node, context);
13975 genNode(node, context);
13977 if (i < nodes.length - 1) {
13979 comma && push(",");
13982 comma && push(", ");
13987 function genNode(node, context) {
13988 if (isString(node)) {
13989 context.push(node, -3 /* Unknown */);
13992 if (isSymbol(node)) {
13993 context.push(context.helper(node));
13996 switch (node.type) {
14001 node.codegenNode != null,
14002 `Codegen node is missing for element/if/for node. Apply appropriate transforms first.`
14004 genNode(node.codegenNode, context);
14007 genText(node, context);
14010 genExpression(node, context);
14013 genInterpolation(node, context);
14016 genNode(node.codegenNode, context);
14019 genCompoundExpression(node, context);
14022 genComment(node, context);
14025 genVNodeCall(node, context);
14028 genCallExpression(node, context);
14031 genObjectExpression(node, context);
14034 genArrayExpression(node, context);
14037 genFunctionExpression(node, context);
14040 genConditionalExpression(node, context);
14043 genCacheExpression(node, context);
14046 genNodeList(node.body, context, true, false);
14062 assert(false, `unhandled codegen node type: ${node.type}`);
14063 const exhaustiveCheck = node;
14064 return exhaustiveCheck;
14068 function genText(node, context) {
14069 context.push(JSON.stringify(node.content), -3 /* Unknown */, node);
14071 function genExpression(node, context) {
14072 const { content, isStatic } = node;
14074 isStatic ? JSON.stringify(content) : content,
14079 function genInterpolation(node, context) {
14080 const { push, helper, pure } = context;
14082 push(PURE_ANNOTATION);
14083 push(`${helper(TO_DISPLAY_STRING)}(`);
14084 genNode(node.content, context);
14087 function genCompoundExpression(node, context) {
14088 for (let i = 0; i < node.children.length; i++) {
14089 const child = node.children[i];
14090 if (isString(child)) {
14091 context.push(child, -3 /* Unknown */);
14093 genNode(child, context);
14097 function genExpressionAsPropertyKey(node, context) {
14098 const { push } = context;
14099 if (node.type === 8) {
14101 genCompoundExpression(node, context);
14103 } else if (node.isStatic) {
14104 const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content);
14105 push(text, -2 /* None */, node);
14107 push(`[${node.content}]`, -3 /* Unknown */, node);
14110 function genComment(node, context) {
14111 const { push, helper, pure } = context;
14113 push(PURE_ANNOTATION);
14116 `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`,
14121 function genVNodeCall(node, context) {
14122 const { push, helper, pure } = context;
14135 push(helper(WITH_DIRECTIVES) + `(`);
14138 push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);
14141 push(PURE_ANNOTATION);
14143 const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent);
14144 push(helper(callHelper) + `(`, -2 /* None */, node);
14146 genNullableArgs([tag, props, children, patchFlag, dynamicProps]),
14155 genNode(directives, context);
14159 function genNullableArgs(args) {
14160 let i = args.length;
14162 if (args[i] != null)
14165 return args.slice(0, i + 1).map((arg) => arg || `null`);
14167 function genCallExpression(node, context) {
14168 const { push, helper, pure } = context;
14169 const callee = isString(node.callee) ? node.callee : helper(node.callee);
14171 push(PURE_ANNOTATION);
14173 push(callee + `(`, -2 /* None */, node);
14174 genNodeList(node.arguments, context);
14177 function genObjectExpression(node, context) {
14178 const { push, indent, deindent, newline } = context;
14179 const { properties } = node;
14180 if (!properties.length) {
14181 push(`{}`, -2 /* None */, node);
14184 const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4);
14185 push(multilines ? `{` : `{ `);
14186 multilines && indent();
14187 for (let i = 0; i < properties.length; i++) {
14188 const { key, value } = properties[i];
14189 genExpressionAsPropertyKey(key, context);
14191 genNode(value, context);
14192 if (i < properties.length - 1) {
14197 multilines && deindent();
14198 push(multilines ? `}` : ` }`);
14200 function genArrayExpression(node, context) {
14201 genNodeListAsArray(node.elements, context);
14203 function genFunctionExpression(node, context) {
14204 const { push, indent, deindent } = context;
14205 const { params, returns, body, newline, isSlot } = node;
14207 push(`_${helperNameMap[WITH_CTX]}(`);
14209 push(`(`, -2 /* None */, node);
14210 if (isArray(params)) {
14211 genNodeList(params, context);
14212 } else if (params) {
14213 genNode(params, context);
14216 if (newline || body) {
14224 if (isArray(returns)) {
14225 genNodeListAsArray(returns, context);
14227 genNode(returns, context);
14230 genNode(body, context);
14232 if (newline || body) {
14240 function genConditionalExpression(node, context) {
14241 const { test, consequent, alternate, newline: needNewline } = node;
14242 const { push, indent, deindent, newline } = context;
14243 if (test.type === 4) {
14244 const needsParens = !isSimpleIdentifier(test.content);
14245 needsParens && push(`(`);
14246 genExpression(test, context);
14247 needsParens && push(`)`);
14250 genNode(test, context);
14253 needNewline && indent();
14254 context.indentLevel++;
14255 needNewline || push(` `);
14257 genNode(consequent, context);
14258 context.indentLevel--;
14259 needNewline && newline();
14260 needNewline || push(` `);
14262 const isNested = alternate.type === 19;
14264 context.indentLevel++;
14266 genNode(alternate, context);
14268 context.indentLevel--;
14270 needNewline && deindent(
14272 /* without newline */
14275 function genCacheExpression(node, context) {
14276 const { push, helper, indent, deindent, newline } = context;
14277 push(`_cache[${node.index}] || (`);
14278 if (node.isVNode) {
14280 push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
14283 push(`_cache[${node.index}] = `);
14284 genNode(node.value, context);
14285 if (node.isVNode) {
14288 push(`${helper(SET_BLOCK_TRACKING)}(1),`);
14290 push(`_cache[${node.index}]`);
14296 const prohibitedKeywordRE = new RegExp(
14297 "\\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"
14299 const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
14300 function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) {
14301 const exp = node.content;
14307 asRawStatements ? ` ${exp} ` : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}`
14310 let message = e.message;
14311 const keywordMatch = exp.replace(stripStringRE, "").match(prohibitedKeywordRE);
14312 if (keywordMatch) {
14313 message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
14316 createCompilerError(
14326 const transformExpression = (node, context) => {
14327 if (node.type === 5) {
14328 node.content = processExpression(
14332 } else if (node.type === 1) {
14333 for (let i = 0; i < node.props.length; i++) {
14334 const dir = node.props[i];
14335 if (dir.type === 7 && dir.name !== "for") {
14336 const exp = dir.exp;
14337 const arg = dir.arg;
14338 if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
14339 dir.exp = processExpression(
14342 // slot args must be processed as function params
14343 dir.name === "slot"
14346 if (arg && arg.type === 4 && !arg.isStatic) {
14347 dir.arg = processExpression(arg, context);
14353 function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) {
14356 validateBrowserExpression(node, context, asParams, asRawStatements);
14362 const transformIf = createStructuralDirectiveTransform(
14363 /^(if|else|else-if)$/,
14364 (node, dir, context) => {
14365 return processIf(node, dir, context, (ifNode, branch, isRoot) => {
14366 const siblings = context.parent.children;
14367 let i = siblings.indexOf(ifNode);
14370 const sibling = siblings[i];
14371 if (sibling && sibling.type === 9) {
14372 key += sibling.branches.length;
14377 ifNode.codegenNode = createCodegenNodeForBranch(
14383 const parentCondition = getParentCondition(ifNode.codegenNode);
14384 parentCondition.alternate = createCodegenNodeForBranch(
14386 key + ifNode.branches.length - 1,
14394 function processIf(node, dir, context, processCodegen) {
14395 if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
14396 const loc = dir.exp ? dir.exp.loc : node.loc;
14398 createCompilerError(28, dir.loc)
14400 dir.exp = createSimpleExpression(`true`, false, loc);
14403 validateBrowserExpression(dir.exp, context);
14405 if (dir.name === "if") {
14406 const branch = createIfBranch(node, dir);
14412 context.replaceNode(ifNode);
14413 if (processCodegen) {
14414 return processCodegen(ifNode, branch, true);
14417 const siblings = context.parent.children;
14418 const comments = [];
14419 let i = siblings.indexOf(node);
14420 while (i-- >= -1) {
14421 const sibling = siblings[i];
14422 if (sibling && sibling.type === 3) {
14423 context.removeNode(sibling);
14424 comments.unshift(sibling);
14427 if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
14428 context.removeNode(sibling);
14431 if (sibling && sibling.type === 9) {
14432 if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
14434 createCompilerError(30, node.loc)
14437 context.removeNode();
14438 const branch = createIfBranch(node, dir);
14439 if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition>
14440 !(context.parent && context.parent.type === 1 && (context.parent.tag === "transition" || context.parent.tag === "Transition"))) {
14441 branch.children = [...comments, ...branch.children];
14444 const key = branch.userKey;
14446 sibling.branches.forEach(({ userKey }) => {
14447 if (isSameKey(userKey, key)) {
14449 createCompilerError(
14458 sibling.branches.push(branch);
14459 const onExit = processCodegen && processCodegen(sibling, branch, false);
14460 traverseNode(branch, context);
14463 context.currentNode = null;
14466 createCompilerError(30, node.loc)
14473 function createIfBranch(node, dir) {
14474 const isTemplateIf = node.tagType === 3;
14478 condition: dir.name === "else" ? void 0 : dir.exp,
14479 children: isTemplateIf && !findDir(node, "for") ? node.children : [node],
14480 userKey: findProp(node, `key`),
14484 function createCodegenNodeForBranch(branch, keyIndex, context) {
14485 if (branch.condition) {
14486 return createConditionalExpression(
14488 createChildrenCodegenNode(branch, keyIndex, context),
14489 // make sure to pass in asBlock: true so that the comment node call
14490 // closes the current block.
14491 createCallExpression(context.helper(CREATE_COMMENT), [
14497 return createChildrenCodegenNode(branch, keyIndex, context);
14500 function createChildrenCodegenNode(branch, keyIndex, context) {
14501 const { helper } = context;
14502 const keyProperty = createObjectProperty(
14504 createSimpleExpression(
14511 const { children } = branch;
14512 const firstChild = children[0];
14513 const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1;
14514 if (needFragmentWrapper) {
14515 if (children.length === 1 && firstChild.type === 11) {
14516 const vnodeCall = firstChild.codegenNode;
14517 injectProp(vnodeCall, keyProperty, context);
14520 let patchFlag = 64;
14521 let patchFlagText = PatchFlagNames[64];
14522 if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) {
14524 patchFlagText += `, ${PatchFlagNames[2048]}`;
14526 return createVNodeCall(
14529 createObjectExpression([keyProperty]),
14531 patchFlag + (` /* ${patchFlagText} */` ),
14541 const ret = firstChild.codegenNode;
14542 const vnodeCall = getMemoedVNodeCall(ret);
14543 if (vnodeCall.type === 13) {
14544 convertToBlock(vnodeCall, context);
14546 injectProp(vnodeCall, keyProperty, context);
14550 function isSameKey(a, b) {
14551 if (!a || a.type !== b.type) {
14554 if (a.type === 6) {
14555 if (a.value.content !== b.value.content) {
14560 const branchExp = b.exp;
14561 if (exp.type !== branchExp.type) {
14564 if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
14570 function getParentCondition(node) {
14572 if (node.type === 19) {
14573 if (node.alternate.type === 19) {
14574 node = node.alternate;
14578 } else if (node.type === 20) {
14584 const transformFor = createStructuralDirectiveTransform(
14586 (node, dir, context) => {
14587 const { helper, removeHelper } = context;
14588 return processFor(node, dir, context, (forNode) => {
14589 const renderExp = createCallExpression(helper(RENDER_LIST), [
14592 const isTemplate = isTemplateNode(node);
14593 const memo = findDir(node, "memo");
14594 const keyProp = findProp(node, `key`);
14595 const keyExp = keyProp && (keyProp.type === 6 ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp);
14596 const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
14597 const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
14598 const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
14599 forNode.codegenNode = createVNodeCall(
14604 fragmentFlag + (` /* ${PatchFlagNames[fragmentFlag]} */` ),
14614 const { children } = forNode;
14616 node.children.some((c) => {
14617 if (c.type === 1) {
14618 const key = findProp(c, "key");
14621 createCompilerError(
14631 const needFragmentWrapper = children.length !== 1 || children[0].type !== 1;
14632 const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;
14634 childBlock = slotOutlet.codegenNode;
14635 if (isTemplate && keyProperty) {
14636 injectProp(childBlock, keyProperty, context);
14638 } else if (needFragmentWrapper) {
14639 childBlock = createVNodeCall(
14642 keyProperty ? createObjectExpression([keyProperty]) : void 0,
14644 64 + (` /* ${PatchFlagNames[64]} */` ),
14652 childBlock = children[0].codegenNode;
14653 if (isTemplate && keyProperty) {
14654 injectProp(childBlock, keyProperty, context);
14656 if (childBlock.isBlock !== !isStableFragment) {
14657 if (childBlock.isBlock) {
14658 removeHelper(OPEN_BLOCK);
14660 getVNodeBlockHelper(context.inSSR, childBlock.isComponent)
14664 getVNodeHelper(context.inSSR, childBlock.isComponent)
14668 childBlock.isBlock = !isStableFragment;
14669 if (childBlock.isBlock) {
14670 helper(OPEN_BLOCK);
14671 helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
14673 helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
14677 const loop = createFunctionExpression(
14678 createForLoopParams(forNode.parseResult, [
14679 createSimpleExpression(`_cached`)
14682 loop.body = createBlockStatement([
14683 createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
14684 createCompoundExpression([
14686 ...keyExp ? [` && _cached.key === `, keyExp] : [],
14687 ` && ${context.helperString(
14689 )}(_cached, _memo)) return _cached`
14691 createCompoundExpression([`const _item = `, childBlock]),
14692 createSimpleExpression(`_item.memo = _memo`),
14693 createSimpleExpression(`return _item`)
14695 renderExp.arguments.push(
14697 createSimpleExpression(`_cache`),
14698 createSimpleExpression(String(context.cached++))
14701 renderExp.arguments.push(
14702 createFunctionExpression(
14703 createForLoopParams(forNode.parseResult),
14713 function processFor(node, dir, context, processCodegen) {
14716 createCompilerError(31, dir.loc)
14720 const parseResult = dir.forParseResult;
14721 if (!parseResult) {
14723 createCompilerError(32, dir.loc)
14727 finalizeForParseResult(parseResult, context);
14728 const { addIdentifiers, removeIdentifiers, scopes } = context;
14729 const { source, value, key, index } = parseResult;
14736 objectIndexAlias: index,
14738 children: isTemplateNode(node) ? node.children : [node]
14740 context.replaceNode(forNode);
14742 const onExit = processCodegen && processCodegen(forNode);
14749 function finalizeForParseResult(result, context) {
14750 if (result.finalized)
14753 validateBrowserExpression(result.source, context);
14755 validateBrowserExpression(
14761 if (result.index) {
14762 validateBrowserExpression(
14768 if (result.value) {
14769 validateBrowserExpression(
14776 result.finalized = true;
14778 function createForLoopParams({ value, key, index }, memoArgs = []) {
14779 return createParamsList([value, key, index, ...memoArgs]);
14781 function createParamsList(args) {
14782 let i = args.length;
14787 return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false));
14790 const defaultFallback = createSimpleExpression(`undefined`, false);
14791 const trackSlotScopes = (node, context) => {
14792 if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) {
14793 const vSlot = findDir(node, "slot");
14796 context.scopes.vSlot++;
14798 context.scopes.vSlot--;
14803 const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression(
14808 children.length ? children[0].loc : loc
14810 function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
14811 context.helper(WITH_CTX);
14812 const { children, loc } = node;
14813 const slotsProperties = [];
14814 const dynamicSlots = [];
14815 let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;
14816 const onComponentSlot = findDir(node, "slot", true);
14817 if (onComponentSlot) {
14818 const { arg, exp } = onComponentSlot;
14819 if (arg && !isStaticExp(arg)) {
14820 hasDynamicSlots = true;
14822 slotsProperties.push(
14823 createObjectProperty(
14824 arg || createSimpleExpression("default", true),
14825 buildSlotFn(exp, void 0, children, loc)
14829 let hasTemplateSlots = false;
14830 let hasNamedDefaultSlot = false;
14831 const implicitDefaultChildren = [];
14832 const seenSlotNames = /* @__PURE__ */ new Set();
14833 let conditionalBranchIndex = 0;
14834 for (let i = 0; i < children.length; i++) {
14835 const slotElement = children[i];
14837 if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) {
14838 if (slotElement.type !== 3) {
14839 implicitDefaultChildren.push(slotElement);
14843 if (onComponentSlot) {
14845 createCompilerError(37, slotDir.loc)
14849 hasTemplateSlots = true;
14850 const { children: slotChildren, loc: slotLoc } = slotElement;
14852 arg: slotName = createSimpleExpression(`default`, true),
14856 let staticSlotName;
14857 if (isStaticExp(slotName)) {
14858 staticSlotName = slotName ? slotName.content : `default`;
14860 hasDynamicSlots = true;
14862 const vFor = findDir(slotElement, "for");
14863 const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc);
14866 if (vIf = findDir(slotElement, "if")) {
14867 hasDynamicSlots = true;
14869 createConditionalExpression(
14871 buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++),
14875 } else if (vElse = findDir(
14884 prev = children[j];
14885 if (prev.type !== 3) {
14889 if (prev && isTemplateNode(prev) && findDir(prev, "if")) {
14890 children.splice(i, 1);
14892 let conditional = dynamicSlots[dynamicSlots.length - 1];
14893 while (conditional.alternate.type === 19) {
14894 conditional = conditional.alternate;
14896 conditional.alternate = vElse.exp ? createConditionalExpression(
14901 conditionalBranchIndex++
14904 ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++);
14907 createCompilerError(30, vElse.loc)
14911 hasDynamicSlots = true;
14912 const parseResult = vFor.forParseResult;
14914 finalizeForParseResult(parseResult, context);
14916 createCallExpression(context.helper(RENDER_LIST), [
14917 parseResult.source,
14918 createFunctionExpression(
14919 createForLoopParams(parseResult),
14920 buildDynamicSlot(slotName, slotFunction),
14927 createCompilerError(
14934 if (staticSlotName) {
14935 if (seenSlotNames.has(staticSlotName)) {
14937 createCompilerError(
14944 seenSlotNames.add(staticSlotName);
14945 if (staticSlotName === "default") {
14946 hasNamedDefaultSlot = true;
14949 slotsProperties.push(createObjectProperty(slotName, slotFunction));
14952 if (!onComponentSlot) {
14953 const buildDefaultSlotProperty = (props, children2) => {
14954 const fn = buildSlotFn(props, void 0, children2, loc);
14955 return createObjectProperty(`default`, fn);
14957 if (!hasTemplateSlots) {
14958 slotsProperties.push(buildDefaultSlotProperty(void 0, children));
14959 } else if (implicitDefaultChildren.length && // #3766
14960 // with whitespace: 'preserve', whitespaces between slots will end up in
14961 // implicitDefaultChildren. Ignore if all implicit children are whitespaces.
14962 implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) {
14963 if (hasNamedDefaultSlot) {
14965 createCompilerError(
14967 implicitDefaultChildren[0].loc
14971 slotsProperties.push(
14972 buildDefaultSlotProperty(void 0, implicitDefaultChildren)
14977 const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1;
14978 let slots = createObjectExpression(
14979 slotsProperties.concat(
14980 createObjectProperty(
14982 // 2 = compiled but dynamic = can skip normalization, but must run diff
14983 // 1 = compiled and static = can skip normalization AND diff as optimized
14984 createSimpleExpression(
14985 slotFlag + (` /* ${slotFlagsText[slotFlag]} */` ),
14992 if (dynamicSlots.length) {
14993 slots = createCallExpression(context.helper(CREATE_SLOTS), [
14995 createArrayExpression(dynamicSlots)
15003 function buildDynamicSlot(name, fn, index) {
15005 createObjectProperty(`name`, name),
15006 createObjectProperty(`fn`, fn)
15008 if (index != null) {
15010 createObjectProperty(`key`, createSimpleExpression(String(index), true))
15013 return createObjectExpression(props);
15015 function hasForwardedSlots(children) {
15016 for (let i = 0; i < children.length; i++) {
15017 const child = children[i];
15018 switch (child.type) {
15020 if (child.tagType === 2 || hasForwardedSlots(child.children)) {
15025 if (hasForwardedSlots(child.branches))
15030 if (hasForwardedSlots(child.children))
15037 function isNonWhitespaceContent(node) {
15038 if (node.type !== 2 && node.type !== 12)
15040 return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
15043 const directiveImportMap = /* @__PURE__ */ new WeakMap();
15044 const transformElement = (node, context) => {
15045 return function postTransformElement() {
15046 node = context.currentNode;
15047 if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) {
15050 const { tag, props } = node;
15051 const isComponent = node.tagType === 1;
15052 let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`;
15053 const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
15056 let vnodePatchFlag;
15058 let vnodeDynamicProps;
15059 let dynamicPropNames;
15060 let vnodeDirectives;
15061 let shouldUseBlock = (
15062 // dynamic component may resolve to plain elements
15063 isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
15064 // updates inside get proper isSVG flag at runtime. (#639, #643)
15065 // This is technically web-specific, but splitting the logic out of core
15066 // leads to too much unnecessary complexity.
15067 (tag === "svg" || tag === "foreignObject")
15069 if (props.length > 0) {
15070 const propsBuildResult = buildProps(
15077 vnodeProps = propsBuildResult.props;
15078 patchFlag = propsBuildResult.patchFlag;
15079 dynamicPropNames = propsBuildResult.dynamicPropNames;
15080 const directives = propsBuildResult.directives;
15081 vnodeDirectives = directives && directives.length ? createArrayExpression(
15082 directives.map((dir) => buildDirectiveArgs(dir, context))
15084 if (propsBuildResult.shouldUseBlock) {
15085 shouldUseBlock = true;
15088 if (node.children.length > 0) {
15089 if (vnodeTag === KEEP_ALIVE) {
15090 shouldUseBlock = true;
15092 if (node.children.length > 1) {
15094 createCompilerError(46, {
15095 start: node.children[0].loc.start,
15096 end: node.children[node.children.length - 1].loc.end,
15102 const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling
15103 vnodeTag !== TELEPORT && // explained above.
15104 vnodeTag !== KEEP_ALIVE;
15105 if (shouldBuildAsSlots) {
15106 const { slots, hasDynamicSlots } = buildSlots(node, context);
15107 vnodeChildren = slots;
15108 if (hasDynamicSlots) {
15111 } else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
15112 const child = node.children[0];
15113 const type = child.type;
15114 const hasDynamicTextChild = type === 5 || type === 8;
15115 if (hasDynamicTextChild && getConstantType(child, context) === 0) {
15118 if (hasDynamicTextChild || type === 2) {
15119 vnodeChildren = child;
15121 vnodeChildren = node.children;
15124 vnodeChildren = node.children;
15127 if (patchFlag !== 0) {
15129 if (patchFlag < 0) {
15130 vnodePatchFlag = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
15132 const flagNames = Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `);
15133 vnodePatchFlag = patchFlag + ` /* ${flagNames} */`;
15136 if (dynamicPropNames && dynamicPropNames.length) {
15137 vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
15140 node.codegenNode = createVNodeCall(
15155 function resolveComponentType(node, context, ssr = false) {
15156 let { tag } = node;
15157 const isExplicitDynamic = isComponentTag(tag);
15158 const isProp = findProp(
15166 if (isExplicitDynamic || false) {
15168 if (isProp.type === 6) {
15169 exp = isProp.value && createSimpleExpression(isProp.value.content, true);
15173 exp = createSimpleExpression(`is`, false, isProp.loc);
15177 return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
15181 } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) {
15182 tag = isProp.value.content.slice(4);
15185 const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);
15188 context.helper(builtIn);
15191 context.helper(RESOLVE_COMPONENT);
15192 context.components.add(tag);
15193 return toValidAssetId(tag, `component`);
15195 function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
15196 const { tag, loc: elementLoc, children } = node;
15197 let properties = [];
15198 const mergeArgs = [];
15199 const runtimeDirectives = [];
15200 const hasChildren = children.length > 0;
15201 let shouldUseBlock = false;
15203 let hasRef = false;
15204 let hasClassBinding = false;
15205 let hasStyleBinding = false;
15206 let hasHydrationEventBinding = false;
15207 let hasDynamicKeys = false;
15208 let hasVnodeHook = false;
15209 const dynamicPropNames = [];
15210 const pushMergeArg = (arg) => {
15211 if (properties.length) {
15213 createObjectExpression(dedupeProperties(properties), elementLoc)
15218 mergeArgs.push(arg);
15220 const pushRefVForMarker = () => {
15221 if (context.scopes.vFor > 0) {
15223 createObjectProperty(
15224 createSimpleExpression("ref_for", true),
15225 createSimpleExpression("true")
15230 const analyzePatchFlag = ({ key, value }) => {
15231 if (isStaticExp(key)) {
15232 const name = key.content;
15233 const isEventHandler = isOn(name);
15234 if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click
15235 // dedicated fast path.
15236 name.toLowerCase() !== "onclick" && // omit v-model handlers
15237 name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks
15238 !isReservedProp(name)) {
15239 hasHydrationEventBinding = true;
15241 if (isEventHandler && isReservedProp(name)) {
15242 hasVnodeHook = true;
15244 if (isEventHandler && value.type === 14) {
15245 value = value.arguments[0];
15247 if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
15250 if (name === "ref") {
15252 } else if (name === "class") {
15253 hasClassBinding = true;
15254 } else if (name === "style") {
15255 hasStyleBinding = true;
15256 } else if (name !== "key" && !dynamicPropNames.includes(name)) {
15257 dynamicPropNames.push(name);
15259 if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
15260 dynamicPropNames.push(name);
15263 hasDynamicKeys = true;
15266 for (let i = 0; i < props.length; i++) {
15267 const prop = props[i];
15268 if (prop.type === 6) {
15269 const { loc, name, nameLoc, value } = prop;
15270 let isStatic = true;
15271 if (name === "ref") {
15273 pushRefVForMarker();
15275 if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || false)) {
15279 createObjectProperty(
15280 createSimpleExpression(name, true, nameLoc),
15281 createSimpleExpression(
15282 value ? value.content : "",
15284 value ? value.loc : loc
15289 const { name, arg, exp, loc, modifiers } = prop;
15290 const isVBind = name === "bind";
15291 const isVOn = name === "on";
15292 if (name === "slot") {
15293 if (!isComponent) {
15295 createCompilerError(40, loc)
15300 if (name === "once" || name === "memo") {
15303 if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || false)) {
15306 if (isVOn && ssr) {
15310 // #938: elements with dynamic keys should be forced into blocks
15311 isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked
15313 isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
15315 shouldUseBlock = true;
15317 if (isVBind && isStaticArgOf(arg, "ref")) {
15318 pushRefVForMarker();
15320 if (!arg && (isVBind || isVOn)) {
15321 hasDynamicKeys = true;
15324 pushRefVForMarker();
15326 mergeArgs.push(exp);
15331 callee: context.helper(TO_HANDLERS),
15332 arguments: isComponent ? [exp] : [exp, `true`]
15337 createCompilerError(
15345 if (isVBind && modifiers.includes("prop")) {
15348 const directiveTransform = context.directiveTransforms[name];
15349 if (directiveTransform) {
15350 const { props: props2, needRuntime } = directiveTransform(prop, node, context);
15351 !ssr && props2.forEach(analyzePatchFlag);
15352 if (isVOn && arg && !isStaticExp(arg)) {
15353 pushMergeArg(createObjectExpression(props2, elementLoc));
15355 properties.push(...props2);
15358 runtimeDirectives.push(prop);
15359 if (isSymbol(needRuntime)) {
15360 directiveImportMap.set(prop, needRuntime);
15363 } else if (!isBuiltInDirective(name)) {
15364 runtimeDirectives.push(prop);
15366 shouldUseBlock = true;
15371 let propsExpression = void 0;
15372 if (mergeArgs.length) {
15374 if (mergeArgs.length > 1) {
15375 propsExpression = createCallExpression(
15376 context.helper(MERGE_PROPS),
15381 propsExpression = mergeArgs[0];
15383 } else if (properties.length) {
15384 propsExpression = createObjectExpression(
15385 dedupeProperties(properties),
15389 if (hasDynamicKeys) {
15392 if (hasClassBinding && !isComponent) {
15395 if (hasStyleBinding && !isComponent) {
15398 if (dynamicPropNames.length) {
15401 if (hasHydrationEventBinding) {
15405 if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
15408 if (!context.inSSR && propsExpression) {
15409 switch (propsExpression.type) {
15411 let classKeyIndex = -1;
15412 let styleKeyIndex = -1;
15413 let hasDynamicKey = false;
15414 for (let i = 0; i < propsExpression.properties.length; i++) {
15415 const key = propsExpression.properties[i].key;
15416 if (isStaticExp(key)) {
15417 if (key.content === "class") {
15419 } else if (key.content === "style") {
15422 } else if (!key.isHandlerKey) {
15423 hasDynamicKey = true;
15426 const classProp = propsExpression.properties[classKeyIndex];
15427 const styleProp = propsExpression.properties[styleKeyIndex];
15428 if (!hasDynamicKey) {
15429 if (classProp && !isStaticExp(classProp.value)) {
15430 classProp.value = createCallExpression(
15431 context.helper(NORMALIZE_CLASS),
15435 if (styleProp && // the static style is compiled into an object,
15436 // so use `hasStyleBinding` to ensure that it is a dynamic style binding
15437 (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
15438 // v-bind:style with static literal object
15439 styleProp.value.type === 17)) {
15440 styleProp.value = createCallExpression(
15441 context.helper(NORMALIZE_STYLE),
15446 propsExpression = createCallExpression(
15447 context.helper(NORMALIZE_PROPS),
15455 propsExpression = createCallExpression(
15456 context.helper(NORMALIZE_PROPS),
15458 createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [
15467 props: propsExpression,
15468 directives: runtimeDirectives,
15474 function dedupeProperties(properties) {
15475 const knownProps = /* @__PURE__ */ new Map();
15476 const deduped = [];
15477 for (let i = 0; i < properties.length; i++) {
15478 const prop = properties[i];
15479 if (prop.key.type === 8 || !prop.key.isStatic) {
15480 deduped.push(prop);
15483 const name = prop.key.content;
15484 const existing = knownProps.get(name);
15486 if (name === "style" || name === "class" || isOn(name)) {
15487 mergeAsArray(existing, prop);
15490 knownProps.set(name, prop);
15491 deduped.push(prop);
15496 function mergeAsArray(existing, incoming) {
15497 if (existing.value.type === 17) {
15498 existing.value.elements.push(incoming.value);
15500 existing.value = createArrayExpression(
15501 [existing.value, incoming.value],
15506 function buildDirectiveArgs(dir, context) {
15507 const dirArgs = [];
15508 const runtime = directiveImportMap.get(dir);
15510 dirArgs.push(context.helperString(runtime));
15513 context.helper(RESOLVE_DIRECTIVE);
15514 context.directives.add(dir.name);
15515 dirArgs.push(toValidAssetId(dir.name, `directive`));
15518 const { loc } = dir;
15520 dirArgs.push(dir.exp);
15523 dirArgs.push(`void 0`);
15525 dirArgs.push(dir.arg);
15527 if (Object.keys(dir.modifiers).length) {
15530 dirArgs.push(`void 0`);
15532 dirArgs.push(`void 0`);
15534 const trueExpression = createSimpleExpression(`true`, false, loc);
15536 createObjectExpression(
15538 (modifier) => createObjectProperty(modifier, trueExpression)
15544 return createArrayExpression(dirArgs, dir.loc);
15546 function stringifyDynamicPropNames(props) {
15547 let propsNamesString = `[`;
15548 for (let i = 0, l = props.length; i < l; i++) {
15549 propsNamesString += JSON.stringify(props[i]);
15551 propsNamesString += ", ";
15553 return propsNamesString + `]`;
15555 function isComponentTag(tag) {
15556 return tag === "component" || tag === "Component";
15559 const transformSlotOutlet = (node, context) => {
15560 if (isSlotOutlet(node)) {
15561 const { children, loc } = node;
15562 const { slotName, slotProps } = processSlotOutlet(node, context);
15564 context.prefixIdentifiers ? `_ctx.$slots` : `$slots`,
15570 let expectedLen = 2;
15572 slotArgs[2] = slotProps;
15575 if (children.length) {
15576 slotArgs[3] = createFunctionExpression([], children, false, false, loc);
15579 if (context.scopeId && !context.slotted) {
15582 slotArgs.splice(expectedLen);
15583 node.codegenNode = createCallExpression(
15584 context.helper(RENDER_SLOT),
15590 function processSlotOutlet(node, context) {
15591 let slotName = `"default"`;
15592 let slotProps = void 0;
15593 const nonNameProps = [];
15594 for (let i = 0; i < node.props.length; i++) {
15595 const p = node.props[i];
15596 if (p.type === 6) {
15598 if (p.name === "name") {
15599 slotName = JSON.stringify(p.value.content);
15601 p.name = camelize(p.name);
15602 nonNameProps.push(p);
15606 if (p.name === "bind" && isStaticArgOf(p.arg, "name")) {
15609 } else if (p.arg && p.arg.type === 4) {
15610 const name = camelize(p.arg.content);
15611 slotName = p.exp = createSimpleExpression(name, false, p.arg.loc);
15614 if (p.name === "bind" && p.arg && isStaticExp(p.arg)) {
15615 p.arg.content = camelize(p.arg.content);
15617 nonNameProps.push(p);
15621 if (nonNameProps.length > 0) {
15622 const { props, directives } = buildProps(
15630 if (directives.length) {
15632 createCompilerError(
15645 const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
15646 const transformOn$1 = (dir, node, context, augmentor) => {
15647 const { loc, modifiers, arg } = dir;
15648 if (!dir.exp && !modifiers.length) {
15649 context.onError(createCompilerError(35, loc));
15652 if (arg.type === 4) {
15653 if (arg.isStatic) {
15654 let rawName = arg.content;
15655 if (rawName.startsWith("vnode")) {
15656 context.onError(createCompilerError(51, arg.loc));
15658 if (rawName.startsWith("vue:")) {
15659 rawName = `vnode-${rawName.slice(4)}`;
15661 const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
15662 // for non-element and vnode lifecycle event listeners, auto convert
15663 // it to camelCase. See issue #2249
15664 toHandlerKey(camelize(rawName))
15666 // preserve case for plain element listeners that have uppercase
15667 // letters, as these may be custom elements' custom events
15670 eventName = createSimpleExpression(eventString, true, arg.loc);
15672 eventName = createCompoundExpression([
15673 `${context.helperString(TO_HANDLER_KEY)}(`,
15680 eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);
15681 eventName.children.push(`)`);
15684 if (exp && !exp.content.trim()) {
15687 let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;
15689 const isMemberExp = isMemberExpression(exp.content);
15690 const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));
15691 const hasMultipleStatements = exp.content.includes(`;`);
15693 validateBrowserExpression(
15697 hasMultipleStatements
15700 if (isInlineStatement || shouldCache && isMemberExp) {
15701 exp = createCompoundExpression([
15702 `${isInlineStatement ? `$event` : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`,
15704 hasMultipleStatements ? `}` : `)`
15710 createObjectProperty(
15712 exp || createSimpleExpression(`() => {}`, false, loc)
15717 ret = augmentor(ret);
15720 ret.props[0].value = context.cache(ret.props[0].value);
15722 ret.props.forEach((p) => p.key.isHandlerKey = true);
15726 const transformBind = (dir, _node, context) => {
15727 const { modifiers, loc } = dir;
15728 const arg = dir.arg;
15730 if (exp && exp.type === 4 && !exp.content.trim()) {
15736 if (arg.type !== 4 || !arg.isStatic) {
15738 createCompilerError(
15745 createObjectProperty(arg, createSimpleExpression("", true, loc))
15749 const propName = camelize(arg.content);
15750 exp = dir.exp = createSimpleExpression(propName, false, arg.loc);
15752 if (arg.type !== 4) {
15753 arg.children.unshift(`(`);
15754 arg.children.push(`) || ""`);
15755 } else if (!arg.isStatic) {
15756 arg.content = `${arg.content} || ""`;
15758 if (modifiers.includes("camel")) {
15759 if (arg.type === 4) {
15760 if (arg.isStatic) {
15761 arg.content = camelize(arg.content);
15763 arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
15766 arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
15767 arg.children.push(`)`);
15770 if (!context.inSSR) {
15771 if (modifiers.includes("prop")) {
15772 injectPrefix(arg, ".");
15774 if (modifiers.includes("attr")) {
15775 injectPrefix(arg, "^");
15779 props: [createObjectProperty(arg, exp)]
15782 const injectPrefix = (arg, prefix) => {
15783 if (arg.type === 4) {
15784 if (arg.isStatic) {
15785 arg.content = prefix + arg.content;
15787 arg.content = `\`${prefix}\${${arg.content}}\``;
15790 arg.children.unshift(`'${prefix}' + (`);
15791 arg.children.push(`)`);
15795 const transformText = (node, context) => {
15796 if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
15798 const children = node.children;
15799 let currentContainer = void 0;
15800 let hasText = false;
15801 for (let i = 0; i < children.length; i++) {
15802 const child = children[i];
15803 if (isText$1(child)) {
15805 for (let j = i + 1; j < children.length; j++) {
15806 const next = children[j];
15807 if (isText$1(next)) {
15808 if (!currentContainer) {
15809 currentContainer = children[i] = createCompoundExpression(
15814 currentContainer.children.push(` + `, next);
15815 children.splice(j, 1);
15818 currentContainer = void 0;
15824 if (!hasText || // if this is a plain element with a single text child, leave it
15825 // as-is since the runtime has dedicated fast path for this by directly
15826 // setting textContent of the element.
15827 // for component root it's always normalized anyway.
15828 children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756
15829 // custom directives can potentially add DOM elements arbitrarily,
15830 // we need to avoid setting textContent of the element at runtime
15831 // to avoid accidentally overwriting the DOM elements added
15832 // by the user through custom directives.
15834 (p) => p.type === 7 && !context.directiveTransforms[p.name]
15835 ) && // in compat mode, <template> tags with no special directives
15836 // will be rendered as a fragment so its children must be
15837 // converted into vnodes.
15841 for (let i = 0; i < children.length; i++) {
15842 const child = children[i];
15843 if (isText$1(child) || child.type === 8) {
15844 const callArgs = [];
15845 if (child.type !== 2 || child.content !== " ") {
15846 callArgs.push(child);
15848 if (!context.ssr && getConstantType(child, context) === 0) {
15850 1 + (` /* ${PatchFlagNames[1]} */` )
15857 codegenNode: createCallExpression(
15858 context.helper(CREATE_TEXT),
15868 const seen$1 = /* @__PURE__ */ new WeakSet();
15869 const transformOnce = (node, context) => {
15870 if (node.type === 1 && findDir(node, "once", true)) {
15871 if (seen$1.has(node) || context.inVOnce || context.inSSR) {
15875 context.inVOnce = true;
15876 context.helper(SET_BLOCK_TRACKING);
15878 context.inVOnce = false;
15879 const cur = context.currentNode;
15880 if (cur.codegenNode) {
15881 cur.codegenNode = context.cache(
15891 const transformModel$1 = (dir, node, context) => {
15892 const { exp, arg } = dir;
15895 createCompilerError(41, dir.loc)
15897 return createTransformProps();
15899 const rawExp = exp.loc.source;
15900 const expString = exp.type === 4 ? exp.content : rawExp;
15901 const bindingType = context.bindingMetadata[rawExp];
15902 if (bindingType === "props" || bindingType === "props-aliased") {
15903 context.onError(createCompilerError(44, exp.loc));
15904 return createTransformProps();
15906 const maybeRef = false;
15907 if (!expString.trim() || !isMemberExpression(expString) && !maybeRef) {
15909 createCompilerError(42, exp.loc)
15911 return createTransformProps();
15913 const propName = arg ? arg : createSimpleExpression("modelValue", true);
15914 const eventName = arg ? isStaticExp(arg) ? `onUpdate:${camelize(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`;
15916 const eventArg = context.isTS ? `($event: any)` : `$event`;
15918 assignmentExp = createCompoundExpression([
15919 `${eventArg} => ((`,
15926 createObjectProperty(propName, dir.exp),
15927 // "onUpdate:modelValue": $event => (foo = $event)
15928 createObjectProperty(eventName, assignmentExp)
15930 if (dir.modifiers.length && node.tagType === 1) {
15931 const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
15932 const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
15934 createObjectProperty(
15936 createSimpleExpression(
15937 `{ ${modifiers} }`,
15945 return createTransformProps(props);
15947 function createTransformProps(props = []) {
15951 const seen = /* @__PURE__ */ new WeakSet();
15952 const transformMemo = (node, context) => {
15953 if (node.type === 1) {
15954 const dir = findDir(node, "memo");
15955 if (!dir || seen.has(node)) {
15960 const codegenNode = node.codegenNode || context.currentNode.codegenNode;
15961 if (codegenNode && codegenNode.type === 13) {
15962 if (node.tagType !== 1) {
15963 convertToBlock(codegenNode, context);
15965 node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
15967 createFunctionExpression(void 0, codegenNode),
15969 String(context.cached++)
15976 function getBaseTransformPreset(prefixIdentifiers) {
15984 ...[transformExpression] ,
15985 transformSlotOutlet,
15992 bind: transformBind,
15993 model: transformModel$1
15997 function baseCompile(source, options = {}) {
15998 const onError = options.onError || defaultOnError;
15999 const isModuleMode = options.mode === "module";
16001 if (options.prefixIdentifiers === true) {
16002 onError(createCompilerError(47));
16003 } else if (isModuleMode) {
16004 onError(createCompilerError(48));
16007 const prefixIdentifiers = false;
16008 if (options.cacheHandlers) {
16009 onError(createCompilerError(49));
16011 if (options.scopeId && !isModuleMode) {
16012 onError(createCompilerError(50));
16014 const resolvedOptions = extend({}, options, {
16017 const ast = isString(source) ? baseParse(source, resolvedOptions) : source;
16018 const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
16021 extend({}, resolvedOptions, {
16024 ...options.nodeTransforms || []
16027 directiveTransforms: extend(
16029 directiveTransforms,
16030 options.directiveTransforms || {}
16035 return generate(ast, resolvedOptions);
16038 const noopDirectiveTransform = () => ({ props: [] });
16040 const V_MODEL_RADIO = Symbol(`vModelRadio` );
16041 const V_MODEL_CHECKBOX = Symbol(`vModelCheckbox` );
16042 const V_MODEL_TEXT = Symbol(`vModelText` );
16043 const V_MODEL_SELECT = Symbol(`vModelSelect` );
16044 const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
16045 const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
16046 const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
16047 const V_SHOW = Symbol(`vShow` );
16048 const TRANSITION = Symbol(`Transition` );
16049 const TRANSITION_GROUP = Symbol(`TransitionGroup` );
16050 registerRuntimeHelpers({
16051 [V_MODEL_RADIO]: `vModelRadio`,
16052 [V_MODEL_CHECKBOX]: `vModelCheckbox`,
16053 [V_MODEL_TEXT]: `vModelText`,
16054 [V_MODEL_SELECT]: `vModelSelect`,
16055 [V_MODEL_DYNAMIC]: `vModelDynamic`,
16056 [V_ON_WITH_MODIFIERS]: `withModifiers`,
16057 [V_ON_WITH_KEYS]: `withKeys`,
16059 [TRANSITION]: `Transition`,
16060 [TRANSITION_GROUP]: `TransitionGroup`
16064 function decodeHtmlBrowser(raw, asAttr = false) {
16066 decoder = document.createElement("div");
16069 decoder.innerHTML = `<div foo="${raw.replace(/"/g, """)}">`;
16070 return decoder.children[0].getAttribute("foo");
16072 decoder.innerHTML = raw;
16073 return decoder.textContent;
16077 const parserOptions = {
16080 isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
16081 isPreTag: (tag) => tag === "pre",
16082 decodeEntities: decodeHtmlBrowser ,
16083 isBuiltInComponent: (tag) => {
16084 if (tag === "Transition" || tag === "transition") {
16086 } else if (tag === "TransitionGroup" || tag === "transition-group") {
16087 return TRANSITION_GROUP;
16090 // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
16091 getNamespace(tag, parent, rootNamespace) {
16092 let ns = parent ? parent.ns : rootNamespace;
16093 if (parent && ns === 2) {
16094 if (parent.tag === "annotation-xml") {
16095 if (tag === "svg") {
16098 if (parent.props.some(
16099 (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
16103 } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
16106 } else if (parent && ns === 1) {
16107 if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
16112 if (tag === "svg") {
16115 if (tag === "math") {
16123 const transformStyle = (node) => {
16124 if (node.type === 1) {
16125 node.props.forEach((p, i) => {
16126 if (p.type === 6 && p.name === "style" && p.value) {
16130 arg: createSimpleExpression(`style`, true, p.loc),
16131 exp: parseInlineCSS(p.value.content, p.loc),
16139 const parseInlineCSS = (cssText, loc) => {
16140 const normalized = parseStringStyle(cssText);
16141 return createSimpleExpression(
16142 JSON.stringify(normalized),
16149 function createDOMCompilerError(code, loc) {
16150 return createCompilerError(
16156 const DOMErrorMessages = {
16157 [53]: `v-html is missing expression.`,
16158 [54]: `v-html will override element children.`,
16159 [55]: `v-text is missing expression.`,
16160 [56]: `v-text will override element children.`,
16161 [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
16162 [58]: `v-model argument is not supported on plain elements.`,
16163 [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
16164 [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
16165 [61]: `v-show is missing expression.`,
16166 [62]: `<Transition> expects exactly one child element or component.`,
16167 [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
16170 const transformVHtml = (dir, node, context) => {
16171 const { exp, loc } = dir;
16174 createDOMCompilerError(53, loc)
16177 if (node.children.length) {
16179 createDOMCompilerError(54, loc)
16181 node.children.length = 0;
16185 createObjectProperty(
16186 createSimpleExpression(`innerHTML`, true, loc),
16187 exp || createSimpleExpression("", true)
16193 const transformVText = (dir, node, context) => {
16194 const { exp, loc } = dir;
16197 createDOMCompilerError(55, loc)
16200 if (node.children.length) {
16202 createDOMCompilerError(56, loc)
16204 node.children.length = 0;
16208 createObjectProperty(
16209 createSimpleExpression(`textContent`, true),
16210 exp ? getConstantType(exp, context) > 0 ? exp : createCallExpression(
16211 context.helperString(TO_DISPLAY_STRING),
16214 ) : createSimpleExpression("", true)
16220 const transformModel = (dir, node, context) => {
16221 const baseResult = transformModel$1(dir, node, context);
16222 if (!baseResult.props.length || node.tagType === 1) {
16227 createDOMCompilerError(
16233 function checkDuplicatedValue() {
16234 const value = findDir(node, "bind");
16235 if (value && isStaticArgOf(value.arg, "value")) {
16237 createDOMCompilerError(
16244 const { tag } = node;
16245 const isCustomElement = context.isCustomElement(tag);
16246 if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) {
16247 let directiveToUse = V_MODEL_TEXT;
16248 let isInvalidType = false;
16249 if (tag === "input" || isCustomElement) {
16250 const type = findProp(node, `type`);
16252 if (type.type === 7) {
16253 directiveToUse = V_MODEL_DYNAMIC;
16254 } else if (type.value) {
16255 switch (type.value.content) {
16257 directiveToUse = V_MODEL_RADIO;
16260 directiveToUse = V_MODEL_CHECKBOX;
16263 isInvalidType = true;
16265 createDOMCompilerError(
16272 checkDuplicatedValue();
16276 } else if (hasDynamicKeyVBind(node)) {
16277 directiveToUse = V_MODEL_DYNAMIC;
16279 checkDuplicatedValue();
16281 } else if (tag === "select") {
16282 directiveToUse = V_MODEL_SELECT;
16284 checkDuplicatedValue();
16286 if (!isInvalidType) {
16287 baseResult.needRuntime = context.helper(directiveToUse);
16291 createDOMCompilerError(
16297 baseResult.props = baseResult.props.filter(
16298 (p) => !(p.key.type === 4 && p.key.content === "modelValue")
16303 const isEventOptionModifier = /* @__PURE__ */ makeMap(`passive,once,capture`);
16304 const isNonKeyModifier = /* @__PURE__ */ makeMap(
16305 // event propagation management
16306 `stop,prevent,self,ctrl,shift,alt,meta,exact,middle`
16308 const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right");
16309 const isKeyboardEvent = /* @__PURE__ */ makeMap(
16310 `onkeyup,onkeydown,onkeypress`,
16313 const resolveModifiers = (key, modifiers, context, loc) => {
16314 const keyModifiers = [];
16315 const nonKeyModifiers = [];
16316 const eventOptionModifiers = [];
16317 for (let i = 0; i < modifiers.length; i++) {
16318 const modifier = modifiers[i];
16319 if (isEventOptionModifier(modifier)) {
16320 eventOptionModifiers.push(modifier);
16322 if (maybeKeyModifier(modifier)) {
16323 if (isStaticExp(key)) {
16324 if (isKeyboardEvent(key.content)) {
16325 keyModifiers.push(modifier);
16327 nonKeyModifiers.push(modifier);
16330 keyModifiers.push(modifier);
16331 nonKeyModifiers.push(modifier);
16334 if (isNonKeyModifier(modifier)) {
16335 nonKeyModifiers.push(modifier);
16337 keyModifiers.push(modifier);
16345 eventOptionModifiers
16348 const transformClick = (key, event) => {
16349 const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick";
16350 return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([
16353 `) === "onClick" ? "${event}" : (`,
16358 const transformOn = (dir, node, context) => {
16359 return transformOn$1(dir, node, context, (baseResult) => {
16360 const { modifiers } = dir;
16361 if (!modifiers.length)
16363 let { key, value: handlerExp } = baseResult.props[0];
16364 const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
16365 if (nonKeyModifiers.includes("right")) {
16366 key = transformClick(key, `onContextmenu`);
16368 if (nonKeyModifiers.includes("middle")) {
16369 key = transformClick(key, `onMouseup`);
16371 if (nonKeyModifiers.length) {
16372 handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [
16374 JSON.stringify(nonKeyModifiers)
16377 if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard
16378 (!isStaticExp(key) || isKeyboardEvent(key.content))) {
16379 handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [
16381 JSON.stringify(keyModifiers)
16384 if (eventOptionModifiers.length) {
16385 const modifierPostfix = eventOptionModifiers.map(capitalize).join("");
16386 key = isStaticExp(key) ? createSimpleExpression(`${key.content}${modifierPostfix}`, true) : createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]);
16389 props: [createObjectProperty(key, handlerExp)]
16394 const transformShow = (dir, node, context) => {
16395 const { exp, loc } = dir;
16398 createDOMCompilerError(61, loc)
16403 needRuntime: context.helper(V_SHOW)
16407 const transformTransition = (node, context) => {
16408 if (node.type === 1 && node.tagType === 1) {
16409 const component = context.isBuiltInComponent(node.tag);
16410 if (component === TRANSITION) {
16412 if (!node.children.length) {
16415 if (hasMultipleChildren(node)) {
16417 createDOMCompilerError(
16420 start: node.children[0].loc.start,
16421 end: node.children[node.children.length - 1].loc.end,
16427 const child = node.children[0];
16428 if (child.type === 1) {
16429 for (const p of child.props) {
16430 if (p.type === 7 && p.name === "show") {
16445 function hasMultipleChildren(node) {
16446 const children = node.children = node.children.filter(
16447 (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim())
16449 const child = children[0];
16450 return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren);
16453 const ignoreSideEffectTags = (node, context) => {
16454 if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
16456 createDOMCompilerError(
16461 context.removeNode();
16465 const DOMNodeTransforms = [
16467 ...[transformTransition]
16469 const DOMDirectiveTransforms = {
16470 cloak: noopDirectiveTransform,
16471 html: transformVHtml,
16472 text: transformVText,
16473 model: transformModel,
16474 // override compiler-core
16476 // override compiler-core
16477 show: transformShow
16479 function compile(src, options = {}) {
16480 return baseCompile(
16482 extend({}, parserOptions, options, {
16484 // ignore <script> and <tag>
16485 // this is not put inside DOMNodeTransforms because that list is used
16486 // by compiler-ssr to generate vnode fallback branches
16487 ignoreSideEffectTags,
16488 ...DOMNodeTransforms,
16489 ...options.nodeTransforms || []
16491 directiveTransforms: extend(
16493 DOMDirectiveTransforms,
16494 options.directiveTransforms || {}
16496 transformHoist: null
16504 const compileCache = /* @__PURE__ */ new WeakMap();
16505 function getCache(options) {
16506 let c = compileCache.get(options != null ? options : EMPTY_OBJ);
16508 c = /* @__PURE__ */ Object.create(null);
16509 compileCache.set(options != null ? options : EMPTY_OBJ, c);
16513 function compileToFunction(template, options) {
16514 if (!isString(template)) {
16515 if (template.nodeType) {
16516 template = template.innerHTML;
16518 warn(`invalid template option: `, template);
16522 const key = template;
16523 const cache = getCache(options);
16524 const cached = cache[key];
16528 if (template[0] === "#") {
16529 const el = document.querySelector(template);
16531 warn(`Template element not found or is empty: ${template}`);
16533 template = el ? el.innerHTML : ``;
16535 const opts = extend(
16539 onWarn: (e) => onError(e, true)
16543 if (!opts.isCustomElement && typeof customElements !== "undefined") {
16544 opts.isCustomElement = (tag) => !!customElements.get(tag);
16546 const { code } = compile(template, opts);
16547 function onError(err, asWarning = false) {
16548 const message = asWarning ? err.message : `Template compilation error: ${err.message}`;
16549 const codeFrame = err.loc && generateCodeFrame(
16551 err.loc.start.offset,
16554 warn(codeFrame ? `${message}
16555 ${codeFrame}` : message);
16557 const render = new Function(code)() ;
16559 return cache[key] = render;
16561 registerRuntimeCompiler(compileToFunction);
16563 exports.BaseTransition = BaseTransition;
16564 exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators;
16565 exports.Comment = Comment;
16566 exports.DeprecationTypes = DeprecationTypes;
16567 exports.EffectScope = EffectScope;
16568 exports.ErrorCodes = ErrorCodes;
16569 exports.ErrorTypeStrings = ErrorTypeStrings;
16570 exports.Fragment = Fragment;
16571 exports.KeepAlive = KeepAlive;
16572 exports.ReactiveEffect = ReactiveEffect;
16573 exports.Static = Static;
16574 exports.Suspense = Suspense;
16575 exports.Teleport = Teleport;
16576 exports.Text = Text;
16577 exports.TrackOpTypes = TrackOpTypes;
16578 exports.Transition = Transition;
16579 exports.TransitionGroup = TransitionGroup;
16580 exports.TriggerOpTypes = TriggerOpTypes;
16581 exports.VueElement = VueElement;
16582 exports.assertNumber = assertNumber;
16583 exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
16584 exports.callWithErrorHandling = callWithErrorHandling;
16585 exports.camelize = camelize;
16586 exports.capitalize = capitalize;
16587 exports.cloneVNode = cloneVNode;
16588 exports.compatUtils = compatUtils;
16589 exports.compile = compileToFunction;
16590 exports.computed = computed;
16591 exports.createApp = createApp;
16592 exports.createBlock = createBlock;
16593 exports.createCommentVNode = createCommentVNode;
16594 exports.createElementBlock = createElementBlock;
16595 exports.createElementVNode = createBaseVNode;
16596 exports.createHydrationRenderer = createHydrationRenderer;
16597 exports.createPropsRestProxy = createPropsRestProxy;
16598 exports.createRenderer = createRenderer;
16599 exports.createSSRApp = createSSRApp;
16600 exports.createSlots = createSlots;
16601 exports.createStaticVNode = createStaticVNode;
16602 exports.createTextVNode = createTextVNode;
16603 exports.createVNode = createVNode;
16604 exports.customRef = customRef;
16605 exports.defineAsyncComponent = defineAsyncComponent;
16606 exports.defineComponent = defineComponent;
16607 exports.defineCustomElement = defineCustomElement;
16608 exports.defineEmits = defineEmits;
16609 exports.defineExpose = defineExpose;
16610 exports.defineModel = defineModel;
16611 exports.defineOptions = defineOptions;
16612 exports.defineProps = defineProps;
16613 exports.defineSSRCustomElement = defineSSRCustomElement;
16614 exports.defineSlots = defineSlots;
16615 exports.devtools = devtools;
16616 exports.effect = effect;
16617 exports.effectScope = effectScope;
16618 exports.getCurrentInstance = getCurrentInstance;
16619 exports.getCurrentScope = getCurrentScope;
16620 exports.getTransitionRawChildren = getTransitionRawChildren;
16621 exports.guardReactiveProps = guardReactiveProps;
16623 exports.handleError = handleError;
16624 exports.hasInjectionContext = hasInjectionContext;
16625 exports.hydrate = hydrate;
16626 exports.initCustomFormatter = initCustomFormatter;
16627 exports.initDirectivesForSSR = initDirectivesForSSR;
16628 exports.inject = inject;
16629 exports.isMemoSame = isMemoSame;
16630 exports.isProxy = isProxy;
16631 exports.isReactive = isReactive;
16632 exports.isReadonly = isReadonly;
16633 exports.isRef = isRef;
16634 exports.isRuntimeOnly = isRuntimeOnly;
16635 exports.isShallow = isShallow;
16636 exports.isVNode = isVNode;
16637 exports.markRaw = markRaw;
16638 exports.mergeDefaults = mergeDefaults;
16639 exports.mergeModels = mergeModels;
16640 exports.mergeProps = mergeProps;
16641 exports.nextTick = nextTick;
16642 exports.normalizeClass = normalizeClass;
16643 exports.normalizeProps = normalizeProps;
16644 exports.normalizeStyle = normalizeStyle;
16645 exports.onActivated = onActivated;
16646 exports.onBeforeMount = onBeforeMount;
16647 exports.onBeforeUnmount = onBeforeUnmount;
16648 exports.onBeforeUpdate = onBeforeUpdate;
16649 exports.onDeactivated = onDeactivated;
16650 exports.onErrorCaptured = onErrorCaptured;
16651 exports.onMounted = onMounted;
16652 exports.onRenderTracked = onRenderTracked;
16653 exports.onRenderTriggered = onRenderTriggered;
16654 exports.onScopeDispose = onScopeDispose;
16655 exports.onServerPrefetch = onServerPrefetch;
16656 exports.onUnmounted = onUnmounted;
16657 exports.onUpdated = onUpdated;
16658 exports.openBlock = openBlock;
16659 exports.popScopeId = popScopeId;
16660 exports.provide = provide;
16661 exports.proxyRefs = proxyRefs;
16662 exports.pushScopeId = pushScopeId;
16663 exports.queuePostFlushCb = queuePostFlushCb;
16664 exports.reactive = reactive;
16665 exports.readonly = readonly;
16667 exports.registerRuntimeCompiler = registerRuntimeCompiler;
16668 exports.render = render;
16669 exports.renderList = renderList;
16670 exports.renderSlot = renderSlot;
16671 exports.resolveComponent = resolveComponent;
16672 exports.resolveDirective = resolveDirective;
16673 exports.resolveDynamicComponent = resolveDynamicComponent;
16674 exports.resolveFilter = resolveFilter;
16675 exports.resolveTransitionHooks = resolveTransitionHooks;
16676 exports.setBlockTracking = setBlockTracking;
16677 exports.setDevtoolsHook = setDevtoolsHook;
16678 exports.setTransitionHooks = setTransitionHooks;
16679 exports.shallowReactive = shallowReactive;
16680 exports.shallowReadonly = shallowReadonly;
16681 exports.shallowRef = shallowRef;
16682 exports.ssrContextKey = ssrContextKey;
16683 exports.ssrUtils = ssrUtils;
16684 exports.stop = stop;
16685 exports.toDisplayString = toDisplayString;
16686 exports.toHandlerKey = toHandlerKey;
16687 exports.toHandlers = toHandlers;
16688 exports.toRaw = toRaw;
16689 exports.toRef = toRef;
16690 exports.toRefs = toRefs;
16691 exports.toValue = toValue;
16692 exports.transformVNodeArgs = transformVNodeArgs;
16693 exports.triggerRef = triggerRef;
16694 exports.unref = unref;
16695 exports.useAttrs = useAttrs;
16696 exports.useCssModule = useCssModule;
16697 exports.useCssVars = useCssVars;
16698 exports.useModel = useModel;
16699 exports.useSSRContext = useSSRContext;
16700 exports.useSlots = useSlots;
16701 exports.useTransitionState = useTransitionState;
16702 exports.vModelCheckbox = vModelCheckbox;
16703 exports.vModelDynamic = vModelDynamic;
16704 exports.vModelRadio = vModelRadio;
16705 exports.vModelSelect = vModelSelect;
16706 exports.vModelText = vModelText;
16707 exports.vShow = vShow;
16708 exports.version = version;
16709 exports.warn = warn;
16710 exports.watch = watch;
16711 exports.watchEffect = watchEffect;
16712 exports.watchPostEffect = watchPostEffect;
16713 exports.watchSyncEffect = watchSyncEffect;
16714 exports.withAsyncContext = withAsyncContext;
16715 exports.withCtx = withCtx;
16716 exports.withDefaults = withDefaults;
16717 exports.withDirectives = withDirectives;
16718 exports.withKeys = withKeys;
16719 exports.withMemo = withMemo;
16720 exports.withModifiers = withModifiers;
16721 exports.withScopeId = withScopeId;