&& key[0] !== '_') {\r\n Object.defineProperty(ctx, key, {\r\n configurable: true,\r\n enumerable: true,\r\n get: () =\u003E data[key],\r\n set: NOOP\r\n });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n \u002F\u002F state initialization complete at this point - start caching access\r\n shouldCacheAccess = true;\r\n if (computedOptions) {\r\n for (const key in computedOptions) {\r\n const opt = computedOptions[key];\r\n const get = isFunction(opt)\r\n ? opt.bind(publicThis, publicThis)\r\n : isFunction(opt.get)\r\n ? opt.get.bind(publicThis, publicThis)\r\n : NOOP;\r\n if (get === NOOP) {\r\n warn$1(`Computed property \"${key}\" has no getter.`);\r\n }\r\n const set = !isFunction(opt) && isFunction(opt.set)\r\n ? opt.set.bind(publicThis)\r\n : () =\u003E {\r\n warn$1(`Write operation failed: computed property \"${key}\" is readonly.`);\r\n }\r\n ;\r\n const c = computed$1({\r\n get,\r\n set\r\n });\r\n Object.defineProperty(ctx, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: () =\u003E c.value,\r\n set: v =\u003E (c.value = v)\r\n });\r\n {\r\n checkDuplicateProperties(\"Computed\" \u002F* COMPUTED *\u002F, key);\r\n }\r\n }\r\n }\r\n if (watchOptions) {\r\n for (const key in watchOptions) {\r\n createWatcher(watchOptions[key], ctx, publicThis, key);\r\n }\r\n }\r\n if (provideOptions) {\r\n const provides = isFunction(provideOptions)\r\n ? provideOptions.call(publicThis)\r\n : provideOptions;\r\n Reflect.ownKeys(provides).forEach(key =\u003E {\r\n provide(key, provides[key]);\r\n });\r\n }\r\n if (created) {\r\n callHook(created, instance, \"c\" \u002F* CREATED *\u002F);\r\n }\r\n function registerLifecycleHook(register, hook) {\r\n if (isArray(hook)) {\r\n hook.forEach(_hook =\u003E register(_hook.bind(publicThis)));\r\n }\r\n else if (hook) {\r\n register(hook.bind(publicThis));\r\n }\r\n }\r\n registerLifecycleHook(onBeforeMount, beforeMount);\r\n registerLifecycleHook(onMounted, mounted);\r\n registerLifecycleHook(onBeforeUpdate, beforeUpdate);\r\n registerLifecycleHook(onUpdated, updated);\r\n registerLifecycleHook(onActivated, activated);\r\n registerLifecycleHook(onDeactivated, deactivated);\r\n registerLifecycleHook(onErrorCaptured, errorCaptured);\r\n registerLifecycleHook(onRenderTracked, renderTracked);\r\n registerLifecycleHook(onRenderTriggered, renderTriggered);\r\n registerLifecycleHook(onBeforeUnmount, beforeUnmount);\r\n registerLifecycleHook(onUnmounted, unmounted);\r\n registerLifecycleHook(onServerPrefetch, serverPrefetch);\r\n if (isArray(expose)) {\r\n if (expose.length) {\r\n const exposed = instance.exposed || (instance.exposed = {});\r\n expose.forEach(key =\u003E {\r\n Object.defineProperty(exposed, key, {\r\n get: () =\u003E publicThis[key],\r\n set: val =\u003E (publicThis[key] = val)\r\n });\r\n });\r\n }\r\n else if (!instance.exposed) {\r\n instance.exposed = {};\r\n }\r\n }\r\n \u002F\u002F options that are handled when creating the instance but also need to be\r\n \u002F\u002F applied from mixins\r\n if (render && instance.render === NOOP) {\r\n instance.render = render;\r\n }\r\n if (inheritAttrs != null) {\r\n instance.inheritAttrs = inheritAttrs;\r\n }\r\n \u002F\u002F asset options.\r\n if (components)\r\n instance.components = components;\r\n if (directives)\r\n instance.directives = directives;\r\n}\r\nfunction resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP, unwrapRef = false) {\r\n if (isArray(injectOptions)) {\r\n injectOptions = normalizeInject(injectOptions);\r\n }\r\n for (const key in injectOptions) {\r\n const opt = injectOptions[key];\r\n let injected;\r\n if (isObject(opt)) {\r\n if ('default' in opt) {\r\n injected = inject(opt.from || key, opt.default, true \u002F* treat default function as factory *\u002F);\r\n }\r\n else {\r\n injected = inject(opt.from || key);\r\n }\r\n }\r\n else {\r\n injected = inject(opt);\r\n }\r\n if (isRef(injected)) {\r\n \u002F\u002F TODO remove the check in 3.3\r\n if (unwrapRef) {\r\n Object.defineProperty(ctx, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: () =\u003E injected.value,\r\n set: v =\u003E (injected.value = v)\r\n });\r\n }\r\n else {\r\n {\r\n warn$1(`injected property \"${key}\" is a ref and will be auto-unwrapped ` +\r\n `and no longer needs \\`.value\\` in the next minor release. ` +\r\n `To opt-in to the new behavior now, ` +\r\n `set \\`app.config.unwrapInjectedRef = true\\` (this config is ` +\r\n `temporary and will not be needed in the future.)`);\r\n }\r\n ctx[key] = injected;\r\n }\r\n }\r\n else {\r\n ctx[key] = injected;\r\n }\r\n {\r\n checkDuplicateProperties(\"Inject\" \u002F* INJECT *\u002F, key);\r\n }\r\n }\r\n}\r\nfunction callHook(hook, instance, type) {\r\n callWithAsyncErrorHandling(isArray(hook)\r\n ? hook.map(h =\u003E h.bind(instance.proxy))\r\n : hook.bind(instance.proxy), instance, type);\r\n}\r\nfunction createWatcher(raw, ctx, publicThis, key) {\r\n const getter = key.includes('.')\r\n ? createPathGetter(publicThis, key)\r\n : () =\u003E publicThis[key];\r\n if (isString(raw)) {\r\n const handler = ctx[raw];\r\n if (isFunction(handler)) {\r\n watch(getter, handler);\r\n }\r\n else {\r\n warn$1(`Invalid watch handler specified by key \"${raw}\"`, handler);\r\n }\r\n }\r\n else if (isFunction(raw)) {\r\n watch(getter, raw.bind(publicThis));\r\n }\r\n else if (isObject(raw)) {\r\n if (isArray(raw)) {\r\n raw.forEach(r =\u003E createWatcher(r, ctx, publicThis, key));\r\n }\r\n else {\r\n const handler = isFunction(raw.handler)\r\n ? raw.handler.bind(publicThis)\r\n : ctx[raw.handler];\r\n if (isFunction(handler)) {\r\n watch(getter, handler, raw);\r\n }\r\n else {\r\n warn$1(`Invalid watch handler specified by key \"${raw.handler}\"`, handler);\r\n }\r\n }\r\n }\r\n else {\r\n warn$1(`Invalid watch option: \"${key}\"`, raw);\r\n }\r\n}\r\n\u002F**\r\n * Resolve merged options and cache it on the component.\r\n * This is done only once per-component since the merging does not involve\r\n * instances.\r\n *\u002F\r\nfunction resolveMergedOptions(instance) {\r\n const base = instance.type;\r\n const { mixins, extends: extendsOptions } = base;\r\n const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;\r\n const cached = cache.get(base);\r\n let resolved;\r\n if (cached) {\r\n resolved = cached;\r\n }\r\n else if (!globalMixins.length && !mixins && !extendsOptions) {\r\n {\r\n resolved = base;\r\n }\r\n }\r\n else {\r\n resolved = {};\r\n if (globalMixins.length) {\r\n globalMixins.forEach(m =\u003E mergeOptions(resolved, m, optionMergeStrategies, true));\r\n }\r\n mergeOptions(resolved, base, optionMergeStrategies);\r\n }\r\n cache.set(base, resolved);\r\n return resolved;\r\n}\r\nfunction mergeOptions(to, from, strats, asMixin = false) {\r\n const { mixins, extends: extendsOptions } = from;\r\n if (extendsOptions) {\r\n mergeOptions(to, extendsOptions, strats, true);\r\n }\r\n if (mixins) {\r\n mixins.forEach((m) =\u003E mergeOptions(to, m, strats, true));\r\n }\r\n for (const key in from) {\r\n if (asMixin && key === 'expose') {\r\n warn$1(`\"expose\" option is ignored when declared in mixins or extends. ` +\r\n `It should only be declared in the base component itself.`);\r\n }\r\n else {\r\n const strat = internalOptionMergeStrats[key] || (strats && strats[key]);\r\n to[key] = strat ? strat(to[key], from[key]) : from[key];\r\n }\r\n }\r\n return to;\r\n}\r\nconst internalOptionMergeStrats = {\r\n data: mergeDataFn,\r\n props: mergeObjectOptions,\r\n emits: mergeObjectOptions,\r\n \u002F\u002F objects\r\n methods: mergeObjectOptions,\r\n computed: mergeObjectOptions,\r\n \u002F\u002F lifecycle\r\n beforeCreate: mergeAsArray,\r\n created: mergeAsArray,\r\n beforeMount: mergeAsArray,\r\n mounted: mergeAsArray,\r\n beforeUpdate: mergeAsArray,\r\n updated: mergeAsArray,\r\n beforeDestroy: mergeAsArray,\r\n beforeUnmount: mergeAsArray,\r\n destroyed: mergeAsArray,\r\n unmounted: mergeAsArray,\r\n activated: mergeAsArray,\r\n deactivated: mergeAsArray,\r\n errorCaptured: mergeAsArray,\r\n serverPrefetch: mergeAsArray,\r\n \u002F\u002F assets\r\n components: mergeObjectOptions,\r\n directives: mergeObjectOptions,\r\n \u002F\u002F watch\r\n watch: mergeWatchOptions,\r\n \u002F\u002F provide \u002F inject\r\n provide: mergeDataFn,\r\n inject: mergeInject\r\n};\r\nfunction mergeDataFn(to, from) {\r\n if (!from) {\r\n return to;\r\n }\r\n if (!to) {\r\n return from;\r\n }\r\n return function mergedDataFn() {\r\n return (extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);\r\n };\r\n}\r\nfunction mergeInject(to, from) {\r\n return mergeObjectOptions(normalizeInject(to), normalizeInject(from));\r\n}\r\nfunction normalizeInject(raw) {\r\n if (isArray(raw)) {\r\n const res = {};\r\n for (let i = 0; i \u003C raw.length; i++) {\r\n res[raw[i]] = raw[i];\r\n }\r\n return res;\r\n }\r\n return raw;\r\n}\r\nfunction mergeAsArray(to, from) {\r\n return to ? [...new Set([].concat(to, from))] : from;\r\n}\r\nfunction mergeObjectOptions(to, from) {\r\n return to ? extend(extend(Object.create(null), to), from) : from;\r\n}\r\nfunction mergeWatchOptions(to, from) {\r\n if (!to)\r\n return from;\r\n if (!from)\r\n return to;\r\n const merged = extend(Object.create(null), to);\r\n for (const key in from) {\r\n merged[key] = mergeAsArray(to[key], from[key]);\r\n }\r\n return merged;\r\n}\r\n\r\nfunction initProps(instance, rawProps, isStateful, \u002F\u002F result of bitwise flag comparison\r\nisSSR = false) {\r\n const props = {};\r\n const attrs = {};\r\n def(attrs, InternalObjectKey, 1);\r\n instance.propsDefaults = Object.create(null);\r\n setFullProps(instance, rawProps, props, attrs);\r\n \u002F\u002F ensure all declared prop keys are present\r\n for (const key in instance.propsOptions[0]) {\r\n if (!(key in props)) {\r\n props[key] = undefined;\r\n }\r\n }\r\n \u002F\u002F validation\r\n {\r\n validateProps(rawProps || {}, props, instance);\r\n }\r\n if (isStateful) {\r\n \u002F\u002F stateful\r\n instance.props = isSSR ? props : shallowReactive(props);\r\n }\r\n else {\r\n if (!instance.type.props) {\r\n \u002F\u002F functional w\u002F optional props, props === attrs\r\n instance.props = attrs;\r\n }\r\n else {\r\n \u002F\u002F functional w\u002F declared props\r\n instance.props = props;\r\n }\r\n }\r\n instance.attrs = attrs;\r\n}\r\nfunction updateProps(instance, rawProps, rawPrevProps, optimized) {\r\n const { props, attrs, vnode: { patchFlag } } = instance;\r\n const rawCurrentProps = toRaw(props);\r\n const [options] = instance.propsOptions;\r\n let hasAttrsChanged = false;\r\n if (\r\n \u002F\u002F always force full diff in dev\r\n \u002F\u002F - #1942 if hmr is enabled with sfc component\r\n \u002F\u002F - vite#872 non-sfc component used by sfc component\r\n !((instance.type.__hmrId ||\r\n (instance.parent && instance.parent.type.__hmrId))) &&\r\n (optimized || patchFlag \u003E 0) &&\r\n !(patchFlag & 16 \u002F* FULL_PROPS *\u002F)) {\r\n if (patchFlag & 8 \u002F* PROPS *\u002F) {\r\n \u002F\u002F Compiler-generated props & no keys change, just set the updated\r\n \u002F\u002F the props.\r\n const propsToUpdate = instance.vnode.dynamicProps;\r\n for (let i = 0; i \u003C propsToUpdate.length; i++) {\r\n let key = propsToUpdate[i];\r\n \u002F\u002F PROPS flag guarantees rawProps to be non-null\r\n const value = rawProps[key];\r\n if (options) {\r\n \u002F\u002F attr \u002F props separation was done on init and will be consistent\r\n \u002F\u002F in this code path, so just check if attrs have it.\r\n if (hasOwn(attrs, key)) {\r\n if (value !== attrs[key]) {\r\n attrs[key] = value;\r\n hasAttrsChanged = true;\r\n }\r\n }\r\n else {\r\n const camelizedKey = camelize(key);\r\n props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance, false \u002F* isAbsent *\u002F);\r\n }\r\n }\r\n else {\r\n if (value !== attrs[key]) {\r\n attrs[key] = value;\r\n hasAttrsChanged = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n \u002F\u002F full props update.\r\n if (setFullProps(instance, rawProps, props, attrs)) {\r\n hasAttrsChanged = true;\r\n }\r\n \u002F\u002F in case of dynamic props, check if we need to delete keys from\r\n \u002F\u002F the props object\r\n let kebabKey;\r\n for (const key in rawCurrentProps) {\r\n if (!rawProps ||\r\n \u002F\u002F for camelCase\r\n (!hasOwn(rawProps, key) &&\r\n \u002F\u002F it's possible the original props was passed in as kebab-case\r\n \u002F\u002F and converted to camelCase (#955)\r\n ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))) {\r\n if (options) {\r\n if (rawPrevProps &&\r\n \u002F\u002F for camelCase\r\n (rawPrevProps[key] !== undefined ||\r\n \u002F\u002F for kebab-case\r\n rawPrevProps[kebabKey] !== undefined)) {\r\n props[key] = resolvePropValue(options, rawCurrentProps, key, undefined, instance, true \u002F* isAbsent *\u002F);\r\n }\r\n }\r\n else {\r\n delete props[key];\r\n }\r\n }\r\n }\r\n \u002F\u002F in the case of functional component w\u002Fo props declaration, props and\r\n \u002F\u002F attrs point to the same object so it should already have been updated.\r\n if (attrs !== rawCurrentProps) {\r\n for (const key in attrs) {\r\n if (!rawProps ||\r\n (!hasOwn(rawProps, key) &&\r\n (!false ))) {\r\n delete attrs[key];\r\n hasAttrsChanged = true;\r\n }\r\n }\r\n }\r\n }\r\n \u002F\u002F trigger updates for $attrs in case it's used in component slots\r\n if (hasAttrsChanged) {\r\n trigger(instance, \"set\" \u002F* SET *\u002F, '$attrs');\r\n }\r\n {\r\n validateProps(rawProps || {}, props, instance);\r\n }\r\n}\r\nfunction setFullProps(instance, rawProps, props, attrs) {\r\n const [options, needCastKeys] = instance.propsOptions;\r\n let hasAttrsChanged = false;\r\n let rawCastValues;\r\n if (rawProps) {\r\n for (let key in rawProps) {\r\n \u002F\u002F key, ref are reserved and never passed down\r\n if (isReservedProp(key)) {\r\n continue;\r\n }\r\n const value = rawProps[key];\r\n \u002F\u002F prop option names are camelized during normalization, so to support\r\n \u002F\u002F kebab -\u003E camel conversion here we need to camelize the key.\r\n let camelKey;\r\n if (options && hasOwn(options, (camelKey = camelize(key)))) {\r\n if (!needCastKeys || !needCastKeys.includes(camelKey)) {\r\n props[camelKey] = value;\r\n }\r\n else {\r\n (rawCastValues || (rawCastValues = {}))[camelKey] = value;\r\n }\r\n }\r\n else if (!isEmitListener(instance.emitsOptions, key)) {\r\n if (!(key in attrs) || value !== attrs[key]) {\r\n attrs[key] = value;\r\n hasAttrsChanged = true;\r\n }\r\n }\r\n }\r\n }\r\n if (needCastKeys) {\r\n const rawCurrentProps = toRaw(props);\r\n const castValues = rawCastValues || EMPTY_OBJ;\r\n for (let i = 0; i \u003C needCastKeys.length; i++) {\r\n const key = needCastKeys[i];\r\n props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn(castValues, key));\r\n }\r\n }\r\n return hasAttrsChanged;\r\n}\r\nfunction resolvePropValue(options, props, key, value, instance, isAbsent) {\r\n const opt = options[key];\r\n if (opt != null) {\r\n const hasDefault = hasOwn(opt, 'default');\r\n \u002F\u002F default values\r\n if (hasDefault && value === undefined) {\r\n const defaultValue = opt.default;\r\n if (opt.type !== Function && isFunction(defaultValue)) {\r\n const { propsDefaults } = instance;\r\n if (key in propsDefaults) {\r\n value = propsDefaults[key];\r\n }\r\n else {\r\n setCurrentInstance(instance);\r\n value = propsDefaults[key] = defaultValue.call(null, props);\r\n unsetCurrentInstance();\r\n }\r\n }\r\n else {\r\n value = defaultValue;\r\n }\r\n }\r\n \u002F\u002F boolean casting\r\n if (opt[0 \u002F* shouldCast *\u002F]) {\r\n if (isAbsent && !hasDefault) {\r\n value = false;\r\n }\r\n else if (opt[1 \u002F* shouldCastTrue *\u002F] &&\r\n (value === '' || value === hyphenate(key))) {\r\n value = true;\r\n }\r\n }\r\n }\r\n return value;\r\n}\r\nfunction normalizePropsOptions(comp, appContext, asMixin = false) {\r\n const cache = appContext.propsCache;\r\n const cached = cache.get(comp);\r\n if (cached) {\r\n return cached;\r\n }\r\n const raw = comp.props;\r\n const normalized = {};\r\n const needCastKeys = [];\r\n \u002F\u002F apply mixin\u002Fextends props\r\n let hasExtends = false;\r\n if (!isFunction(comp)) {\r\n const extendProps = (raw) =\u003E {\r\n hasExtends = true;\r\n const [props, keys] = normalizePropsOptions(raw, appContext, true);\r\n extend(normalized, props);\r\n if (keys)\r\n needCastKeys.push(...keys);\r\n };\r\n if (!asMixin && appContext.mixins.length) {\r\n appContext.mixins.forEach(extendProps);\r\n }\r\n if (comp.extends) {\r\n extendProps(comp.extends);\r\n }\r\n if (comp.mixins) {\r\n comp.mixins.forEach(extendProps);\r\n }\r\n }\r\n if (!raw && !hasExtends) {\r\n cache.set(comp, EMPTY_ARR);\r\n return EMPTY_ARR;\r\n }\r\n if (isArray(raw)) {\r\n for (let i = 0; i \u003C raw.length; i++) {\r\n if (!isString(raw[i])) {\r\n warn$1(`props must be strings when using array syntax.`, raw[i]);\r\n }\r\n const normalizedKey = camelize(raw[i]);\r\n if (validatePropName(normalizedKey)) {\r\n normalized[normalizedKey] = EMPTY_OBJ;\r\n }\r\n }\r\n }\r\n else if (raw) {\r\n if (!isObject(raw)) {\r\n warn$1(`invalid props options`, raw);\r\n }\r\n for (const key in raw) {\r\n const normalizedKey = camelize(key);\r\n if (validatePropName(normalizedKey)) {\r\n const opt = raw[key];\r\n const prop = (normalized[normalizedKey] =\r\n isArray(opt) || isFunction(opt) ? { type: opt } : opt);\r\n if (prop) {\r\n const booleanIndex = getTypeIndex(Boolean, prop.type);\r\n const stringIndex = getTypeIndex(String, prop.type);\r\n prop[0 \u002F* shouldCast *\u002F] = booleanIndex \u003E -1;\r\n prop[1 \u002F* shouldCastTrue *\u002F] =\r\n stringIndex \u003C 0 || booleanIndex \u003C stringIndex;\r\n \u002F\u002F if the prop needs boolean casting or default value\r\n if (booleanIndex \u003E -1 || hasOwn(prop, 'default')) {\r\n needCastKeys.push(normalizedKey);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n const res = [normalized, needCastKeys];\r\n cache.set(comp, res);\r\n return res;\r\n}\r\nfunction validatePropName(key) {\r\n if (key[0] !== '
) {\r\n return true;\r\n }\r\n else {\r\n warn$1(`Invalid prop name: \"${key}\" is a reserved property.`);\r\n }\r\n return false;\r\n}\r\n\u002F\u002F use function string name to check type constructors\r\n\u002F\u002F so that it works across vms \u002F iframes.\r\nfunction getType(ctor) {\r\n const match = ctor && ctor.toString().match(\u002F^\\s*function (\\w+)\u002F);\r\n return match ? match[1] : ctor === null ? 'null' : '';\r\n}\r\nfunction isSameType(a, b) {\r\n return getType(a) === getType(b);\r\n}\r\nfunction getTypeIndex(type, expectedTypes) {\r\n if (isArray(expectedTypes)) {\r\n return expectedTypes.findIndex(t =\u003E isSameType(t, type));\r\n }\r\n else if (isFunction(expectedTypes)) {\r\n return isSameType(expectedTypes, type) ? 0 : -1;\r\n }\r\n return -1;\r\n}\r\n\u002F**\r\n * dev only\r\n *\u002F\r\nfunction validateProps(rawProps, props, instance) {\r\n const resolvedValues = toRaw(props);\r\n const options = instance.propsOptions[0];\r\n for (const key in options) {\r\n let opt = options[key];\r\n if (opt == null)\r\n continue;\r\n validateProp(key, resolvedValues[key], opt, !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key)));\r\n }\r\n}\r\n\u002F**\r\n * dev only\r\n *\u002F\r\nfunction validateProp(name, value, prop, isAbsent) {\r\n const { type, required, validator } = prop;\r\n \u002F\u002F required!\r\n if (required && isAbsent) {\r\n warn$1('Missing required prop: \"' + name + '\"');\r\n return;\r\n }\r\n \u002F\u002F missing but optional\r\n if (value == null && !prop.required) {\r\n return;\r\n }\r\n \u002F\u002F type check\r\n if (type != null && type !== true) {\r\n let isValid = false;\r\n const types = isArray(type) ? type : [type];\r\n const expectedTypes = [];\r\n \u002F\u002F value is valid as long as one of the specified types match\r\n for (let i = 0; i \u003C types.length && !isValid; i++) {\r\n const { valid, expectedType } = assertType(value, types[i]);\r\n expectedTypes.push(expectedType || '');\r\n isValid = valid;\r\n }\r\n if (!isValid) {\r\n warn$1(getInvalidTypeMessage(name, value, expectedTypes));\r\n return;\r\n }\r\n }\r\n \u002F\u002F custom validator\r\n if (validator && !validator(value)) {\r\n warn$1('Invalid prop: custom validator check failed for prop \"' + name + '\".');\r\n }\r\n}\r\nconst isSimpleType = \u002F*#__PURE__*\u002F makeMap('String,Number,Boolean,Function,Symbol,BigInt');\r\n\u002F**\r\n * dev only\r\n *\u002F\r\nfunction assertType(value, type) {\r\n let valid;\r\n const expectedType = getType(type);\r\n if (isSimpleType(expectedType)) {\r\n const t = typeof value;\r\n valid = t === expectedType.toLowerCase();\r\n \u002F\u002F for primitive wrapper objects\r\n if (!valid && t === 'object') {\r\n valid = value instanceof type;\r\n }\r\n }\r\n else if (expectedType === 'Object') {\r\n valid = isObject(value);\r\n }\r\n else if (expectedType === 'Array') {\r\n valid = isArray(value);\r\n }\r\n else if (expectedType === 'null') {\r\n valid = value === null;\r\n }\r\n else {\r\n valid = value instanceof type;\r\n }\r\n return {\r\n valid,\r\n expectedType\r\n };\r\n}\r\n\u002F**\r\n * dev only\r\n *\u002F\r\nfunction getInvalidTypeMessage(name, value, expectedTypes) {\r\n let message = `Invalid prop: type check failed for prop \"${name}\".` +\r\n ` Expected ${expectedTypes.map(capitalize).join(' | ')}`;\r\n const expectedType = expectedTypes[0];\r\n const receivedType = toRawType(value);\r\n const expectedValue = styleValue(value, expectedType);\r\n const receivedValue = styleValue(value, receivedType);\r\n \u002F\u002F check if we need to specify expected value\r\n if (expectedTypes.length === 1 &&\r\n isExplicable(expectedType) &&\r\n !isBoolean(expectedType, receivedType)) {\r\n message += ` with value ${expectedValue}`;\r\n }\r\n message += `, got ${receivedType} `;\r\n \u002F\u002F check if we need to specify received value\r\n if (isExplicable(receivedType)) {\r\n message += `with value ${receivedValue}.`;\r\n }\r\n return message;\r\n}\r\n\u002F**\r\n * dev only\r\n *\u002F\r\nfunction styleValue(value, type) {\r\n if (type === 'String') {\r\n return `\"${value}\"`;\r\n }\r\n else if (type === 'Number') {\r\n return `${Number(value)}`;\r\n }\r\n else {\r\n return `${value}`;\r\n }\r\n}\r\n\u002F**\r\n * dev only\r\n *\u002F\r\nfunction isExplicable(type) {\r\n const explicitTypes = ['string', 'number', 'boolean'];\r\n return explicitTypes.some(elem =\u003E type.toLowerCase() === elem);\r\n}\r\n\u002F**\r\n * dev only\r\n *\u002F\r\nfunction isBoolean(...args) {\r\n return args.some(elem =\u003E elem.toLowerCase() === 'boolean');\r\n}\r\n\r\nconst isInternalKey = (key) =\u003E key[0] === '_' || key === '$stable';\r\nconst normalizeSlotValue = (value) =\u003E isArray(value)\r\n ? value.map(normalizeVNode)\r\n : [normalizeVNode(value)];\r\nconst normalizeSlot = (key, rawSlot, ctx) =\u003E {\r\n const normalized = withCtx((...args) =\u003E {\r\n if (currentInstance) {\r\n warn$1(`Slot \"${key}\" invoked outside of the render function: ` +\r\n `this will not track dependencies used in the slot. ` +\r\n `Invoke the slot function inside the render function instead.`);\r\n }\r\n return normalizeSlotValue(rawSlot(...args));\r\n }, ctx);\r\n normalized._c = false;\r\n return normalized;\r\n};\r\nconst normalizeObjectSlots = (rawSlots, slots, instance) =\u003E {\r\n const ctx = rawSlots._ctx;\r\n for (const key in rawSlots) {\r\n if (isInternalKey(key))\r\n continue;\r\n const value = rawSlots[key];\r\n if (isFunction(value)) {\r\n slots[key] = normalizeSlot(key, value, ctx);\r\n }\r\n else if (value != null) {\r\n {\r\n warn$1(`Non-function value encountered for slot \"${key}\". ` +\r\n `Prefer function slots for better performance.`);\r\n }\r\n const normalized = normalizeSlotValue(value);\r\n slots[key] = () =\u003E normalized;\r\n }\r\n }\r\n};\r\nconst normalizeVNodeSlots = (instance, children) =\u003E {\r\n if (!isKeepAlive(instance.vnode) &&\r\n !(false )) {\r\n warn$1(`Non-function value encountered for default slot. ` +\r\n `Prefer function slots for better performance.`);\r\n }\r\n const normalized = normalizeSlotValue(children);\r\n instance.slots.default = () =\u003E normalized;\r\n};\r\nconst initSlots = (instance, children) =\u003E {\r\n if (instance.vnode.shapeFlag & 32 \u002F* SLOTS_CHILDREN *\u002F) {\r\n const type = children._;\r\n if (type) {\r\n \u002F\u002F users can get the shallow readonly version of the slots object through `this.$slots`,\r\n \u002F\u002F we should avoid the proxy object polluting the slots of the internal instance\r\n instance.slots = toRaw(children);\r\n \u002F\u002F make compiler marker non-enumerable\r\n def(children, '_', type);\r\n }\r\n else {\r\n normalizeObjectSlots(children, (instance.slots = {}));\r\n }\r\n }\r\n else {\r\n instance.slots = {};\r\n if (children) {\r\n normalizeVNodeSlots(instance, children);\r\n }\r\n }\r\n def(instance.slots, InternalObjectKey, 1);\r\n};\r\nconst updateSlots = (instance, children, optimized) =\u003E {\r\n const { vnode, slots } = instance;\r\n let needDeletionCheck = true;\r\n let deletionComparisonTarget = EMPTY_OBJ;\r\n if (vnode.shapeFlag & 32 \u002F* SLOTS_CHILDREN *\u002F) {\r\n const type = children._;\r\n if (type) {\r\n \u002F\u002F compiled slots.\r\n if (isHmrUpdating) {\r\n \u002F\u002F Parent was HMR updated so slot content may have changed.\r\n \u002F\u002F force update slots and mark instance for hmr as well\r\n extend(slots, children);\r\n }\r\n else if (optimized && type === 1 \u002F* STABLE *\u002F) {\r\n \u002F\u002F compiled AND stable.\r\n \u002F\u002F no need to update, and skip stale slots removal.\r\n needDeletionCheck = false;\r\n }\r\n else {\r\n \u002F\u002F compiled but dynamic (v-if\u002Fv-for on slots) - update slots, but skip\r\n \u002F\u002F normalization.\r\n extend(slots, children);\r\n \u002F\u002F #2893\r\n \u002F\u002F when rendering the optimized slots by manually written render function,\r\n \u002F\u002F we need to delete the `slots._` flag if necessary to make subsequent updates reliable,\r\n \u002F\u002F i.e. let the `renderSlot` create the bailed Fragment\r\n if (!optimized && type === 1 \u002F* STABLE *\u002F) {\r\n delete slots._;\r\n }\r\n }\r\n }\r\n else {\r\n needDeletionCheck = !children.$stable;\r\n normalizeObjectSlots(children, slots);\r\n }\r\n deletionComparisonTarget = children;\r\n }\r\n else if (children) {\r\n \u002F\u002F non slot object children (direct value) passed to a component\r\n normalizeVNodeSlots(instance, children);\r\n deletionComparisonTarget = { default: 1 };\r\n }\r\n \u002F\u002F delete stale slots\r\n if (needDeletionCheck) {\r\n for (const key in slots) {\r\n if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {\r\n delete slots[key];\r\n }\r\n }\r\n }\r\n};\r\n\r\n\u002F**\r\nRuntime helper for applying directives to a vnode. Example usage:\r\n\r\nconst comp = resolveComponent('comp')\r\nconst foo = resolveDirective('foo')\r\nconst bar = resolveDirective('bar')\r\n\r\nreturn withDirectives(h(comp), [\r\n [foo, this.x],\r\n [bar, this.y]\r\n])\r\n*\u002F\r\nfunction validateDirectiveName(name) {\r\n if (isBuiltInDirective(name)) {\r\n warn$1('Do not use built-in directive ids as custom directive id: ' + name);\r\n }\r\n}\r\n\u002F**\r\n * Adds directives to a VNode.\r\n *\u002F\r\nfunction withDirectives(vnode, directives) {\r\n const internalInstance = currentRenderingInstance;\r\n if (internalInstance === null) {\r\n warn$1(`withDirectives can only be used inside render functions.`);\r\n return vnode;\r\n }\r\n const instance = internalInstance.proxy;\r\n const bindings = vnode.dirs || (vnode.dirs = []);\r\n for (let i = 0; i \u003C directives.length; i++) {\r\n let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];\r\n if (isFunction(dir)) {\r\n dir = {\r\n mounted: dir,\r\n updated: dir\r\n };\r\n }\r\n if (dir.deep) {\r\n traverse(value);\r\n }\r\n bindings.push({\r\n dir,\r\n instance,\r\n value,\r\n oldValue: void 0,\r\n arg,\r\n modifiers\r\n });\r\n }\r\n return vnode;\r\n}\r\nfunction invokeDirectiveHook(vnode, prevVNode, instance, name) {\r\n const bindings = vnode.dirs;\r\n const oldBindings = prevVNode && prevVNode.dirs;\r\n for (let i = 0; i \u003C bindings.length; i++) {\r\n const binding = bindings[i];\r\n if (oldBindings) {\r\n binding.oldValue = oldBindings[i].value;\r\n }\r\n let hook = binding.dir[name];\r\n if (hook) {\r\n \u002F\u002F disable tracking inside all lifecycle hooks\r\n \u002F\u002F since they can potentially be called inside effects.\r\n pauseTracking();\r\n callWithAsyncErrorHandling(hook, instance, 8 \u002F* DIRECTIVE_HOOK *\u002F, [\r\n vnode.el,\r\n binding,\r\n vnode,\r\n prevVNode\r\n ]);\r\n resetTracking();\r\n }\r\n }\r\n}\r\n\r\nfunction createAppContext() {\r\n return {\r\n app: null,\r\n config: {\r\n isNativeTag: NO,\r\n performance: false,\r\n globalProperties: {},\r\n optionMergeStrategies: {},\r\n errorHandler: undefined,\r\n warnHandler: undefined,\r\n compilerOptions: {}\r\n },\r\n mixins: [],\r\n components: {},\r\n directives: {},\r\n provides: Object.create(null),\r\n optionsCache: new WeakMap(),\r\n propsCache: new WeakMap(),\r\n emitsCache: new WeakMap()\r\n };\r\n}\r\nlet uid = 0;\r\nfunction createAppAPI(render, hydrate) {\r\n return function createApp(rootComponent, rootProps = null) {\r\n if (rootProps != null && !isObject(rootProps)) {\r\n warn$1(`root props passed to app.mount() must be an object.`);\r\n rootProps = null;\r\n }\r\n const context = createAppContext();\r\n const installedPlugins = new Set();\r\n let isMounted = false;\r\n const app = (context.app = {\r\n _uid: uid++,\r\n _component: rootComponent,\r\n _props: rootProps,\r\n _container: null,\r\n _context: context,\r\n _instance: null,\r\n version,\r\n get config() {\r\n return context.config;\r\n },\r\n set config(v) {\r\n {\r\n warn$1(`app.config cannot be replaced. Modify individual options instead.`);\r\n }\r\n },\r\n use(plugin, ...options) {\r\n if (installedPlugins.has(plugin)) {\r\n warn$1(`Plugin has already been applied to target app.`);\r\n }\r\n else if (plugin && isFunction(plugin.install)) {\r\n installedPlugins.add(plugin);\r\n plugin.install(app, ...options);\r\n }\r\n else if (isFunction(plugin)) {\r\n installedPlugins.add(plugin);\r\n plugin(app, ...options);\r\n }\r\n else {\r\n warn$1(`A plugin must either be a function or an object with an \"install\" ` +\r\n `function.`);\r\n }\r\n return app;\r\n },\r\n mixin(mixin) {\r\n {\r\n if (!context.mixins.includes(mixin)) {\r\n context.mixins.push(mixin);\r\n }\r\n else {\r\n warn$1('Mixin has already been applied to target app' +\r\n (mixin.name ? `: ${mixin.name}` : ''));\r\n }\r\n }\r\n return app;\r\n },\r\n component(name, component) {\r\n {\r\n validateComponentName(name, context.config);\r\n }\r\n if (!component) {\r\n return context.components[name];\r\n }\r\n if (context.components[name]) {\r\n warn$1(`Component \"${name}\" has already been registered in target app.`);\r\n }\r\n context.components[name] = component;\r\n return app;\r\n },\r\n directive(name, directive) {\r\n {\r\n validateDirectiveName(name);\r\n }\r\n if (!directive) {\r\n return context.directives[name];\r\n }\r\n if (context.directives[name]) {\r\n warn$1(`Directive \"${name}\" has already been registered in target app.`);\r\n }\r\n context.directives[name] = directive;\r\n return app;\r\n },\r\n mount(rootContainer, isHydrate, isSVG) {\r\n if (!isMounted) {\r\n const vnode = createVNode(rootComponent, rootProps);\r\n \u002F\u002F store app context on the root VNode.\r\n \u002F\u002F this will be set on the root instance on initial mount.\r\n vnode.appContext = context;\r\n \u002F\u002F HMR root reload\r\n {\r\n context.reload = () =\u003E {\r\n render(cloneVNode(vnode), rootContainer, isSVG);\r\n };\r\n }\r\n if (isHydrate && hydrate) {\r\n hydrate(vnode, rootContainer);\r\n }\r\n else {\r\n render(vnode, rootContainer, isSVG);\r\n }\r\n isMounted = true;\r\n app._container = rootContainer;\r\n rootContainer.__vue_app__ = app;\r\n {\r\n app._instance = vnode.component;\r\n devtoolsInitApp(app, version);\r\n }\r\n return getExposeProxy(vnode.component) || vnode.component.proxy;\r\n }\r\n else {\r\n warn$1(`App has already been mounted.\\n` +\r\n `If you want to remount the same app, move your app creation logic ` +\r\n `into a factory function and create fresh app instances for each ` +\r\n `mount - e.g. \\`const createMyApp = () =\u003E createApp(App)\\``);\r\n }\r\n },\r\n unmount() {\r\n if (isMounted) {\r\n render(null, app._container);\r\n {\r\n app._instance = null;\r\n devtoolsUnmountApp(app);\r\n }\r\n delete app._container.__vue_app__;\r\n }\r\n else {\r\n warn$1(`Cannot unmount an app that is not mounted.`);\r\n }\r\n },\r\n provide(key, value) {\r\n if (key in context.provides) {\r\n warn$1(`App already provides property with key \"${String(key)}\". ` +\r\n `It will be overwritten with the new value.`);\r\n }\r\n \u002F\u002F TypeScript doesn't allow symbols as index type\r\n \u002F\u002F https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FTypeScript\u002Fissues\u002F24587\r\n context.provides[key] = value;\r\n return app;\r\n }\r\n });\r\n return app;\r\n };\r\n}\r\n\r\n\u002F**\r\n * Function for handling a template ref\r\n *\u002F\r\nfunction setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {\r\n if (isArray(rawRef)) {\r\n rawRef.forEach((r, i) =\u003E setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));\r\n return;\r\n }\r\n if (isAsyncWrapper(vnode) && !isUnmount) {\r\n \u002F\u002F when mounting async components, nothing needs to be done,\r\n \u002F\u002F because the template ref is forwarded to inner component\r\n return;\r\n }\r\n const refValue = vnode.shapeFlag & 4 \u002F* STATEFUL_COMPONENT *\u002F\r\n ? getExposeProxy(vnode.component) || vnode.component.proxy\r\n : vnode.el;\r\n const value = isUnmount ? null : refValue;\r\n const { i: owner, r: ref } = rawRef;\r\n if (!owner) {\r\n warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +\r\n `A vnode with ref must be created inside the render function.`);\r\n return;\r\n }\r\n const oldRef = oldRawRef && oldRawRef.r;\r\n const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;\r\n const setupState = owner.setupState;\r\n \u002F\u002F dynamic ref changed. unset old ref\r\n if (oldRef != null && oldRef !== ref) {\r\n if (isString(oldRef)) {\r\n refs[oldRef] = null;\r\n if (hasOwn(setupState, oldRef)) {\r\n setupState[oldRef] = null;\r\n }\r\n }\r\n else if (isRef(oldRef)) {\r\n oldRef.value = null;\r\n }\r\n }\r\n if (isFunction(ref)) {\r\n callWithErrorHandling(ref, owner, 12 \u002F* FUNCTION_REF *\u002F, [value, refs]);\r\n }\r\n else {\r\n const _isString = isString(ref);\r\n const _isRef = isRef(ref);\r\n if (_isString || _isRef) {\r\n const doSet = () =\u003E {\r\n if (rawRef.f) {\r\n const existing = _isString ? refs[ref] : ref.value;\r\n if (isUnmount) {\r\n isArray(existing) && remove(existing, refValue);\r\n }\r\n else {\r\n if (!isArray(existing)) {\r\n if (_isString) {\r\n refs[ref] = [refValue];\r\n }\r\n else {\r\n ref.value = [refValue];\r\n if (rawRef.k)\r\n refs[rawRef.k] = ref.value;\r\n }\r\n }\r\n else if (!existing.includes(refValue)) {\r\n existing.push(refValue);\r\n }\r\n }\r\n }\r\n else if (_isString) {\r\n refs[ref] = value;\r\n if (hasOwn(setupState, ref)) {\r\n setupState[ref] = value;\r\n }\r\n }\r\n else if (isRef(ref)) {\r\n ref.value = value;\r\n if (rawRef.k)\r\n refs[rawRef.k] = value;\r\n }\r\n else {\r\n warn$1('Invalid template ref type:', ref, `(${typeof ref})`);\r\n }\r\n };\r\n if (value) {\r\n doSet.id = -1;\r\n queuePostRenderEffect(doSet, parentSuspense);\r\n }\r\n else {\r\n doSet();\r\n }\r\n }\r\n else {\r\n warn$1('Invalid template ref type:', ref, `(${typeof ref})`);\r\n }\r\n }\r\n}\r\n\r\nlet hasMismatch = false;\r\nconst isSVGContainer = (container) =\u003E \u002Fsvg\u002F.test(container.namespaceURI) && container.tagName !== 'foreignObject';\r\nconst isComment = (node) =\u003E node.nodeType === 8 \u002F* COMMENT *\u002F;\r\n\u002F\u002F Note: hydration is DOM-specific\r\n\u002F\u002F But we have to place it in core due to tight coupling with core - splitting\r\n\u002F\u002F it out creates a ton of unnecessary complexity.\r\n\u002F\u002F Hydration also depends on some renderer internal logic which needs to be\r\n\u002F\u002F passed in via arguments.\r\nfunction createHydrationFunctions(rendererInternals) {\r\n const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;\r\n const hydrate = (vnode, container) =\u003E {\r\n if (!container.hasChildNodes()) {\r\n warn$1(`Attempting to hydrate existing markup but container is empty. ` +\r\n `Performing full mount instead.`);\r\n patch(null, vnode, container);\r\n flushPostFlushCbs();\r\n return;\r\n }\r\n hasMismatch = false;\r\n hydrateNode(container.firstChild, vnode, null, null, null);\r\n flushPostFlushCbs();\r\n if (hasMismatch && !false) {\r\n \u002F\u002F this error should show up in production\r\n console.error(`Hydration completed but contains mismatches.`);\r\n }\r\n };\r\n const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) =\u003E {\r\n const isFragmentStart = isComment(node) && node.data === '[';\r\n const onMismatch = () =\u003E handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);\r\n const { type, ref, shapeFlag } = vnode;\r\n const domType = node.nodeType;\r\n vnode.el = node;\r\n let nextNode = null;\r\n switch (type) {\r\n case Text:\r\n if (domType !== 3 \u002F* TEXT *\u002F) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n if (node.data !== vnode.children) {\r\n hasMismatch = true;\r\n warn$1(`Hydration text mismatch:` +\r\n `\\n- Client: ${JSON.stringify(node.data)}` +\r\n `\\n- Server: ${JSON.stringify(vnode.children)}`);\r\n node.data = vnode.children;\r\n }\r\n nextNode = nextSibling(node);\r\n }\r\n break;\r\n case Comment:\r\n if (domType !== 8 \u002F* COMMENT *\u002F || isFragmentStart) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = nextSibling(node);\r\n }\r\n break;\r\n case Static:\r\n if (domType !== 1 \u002F* ELEMENT *\u002F) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n \u002F\u002F determine anchor, adopt content\r\n nextNode = node;\r\n \u002F\u002F if the static vnode has its content stripped during build,\r\n \u002F\u002F adopt it from the server-rendered HTML.\r\n const needToAdoptContent = !vnode.children.length;\r\n for (let i = 0; i \u003C vnode.staticCount; i++) {\r\n if (needToAdoptContent)\r\n vnode.children += nextNode.outerHTML;\r\n if (i === vnode.staticCount - 1) {\r\n vnode.anchor = nextNode;\r\n }\r\n nextNode = nextSibling(nextNode);\r\n }\r\n return nextNode;\r\n }\r\n break;\r\n case Fragment:\r\n if (!isFragmentStart) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n }\r\n break;\r\n default:\r\n if (shapeFlag & 1 \u002F* ELEMENT *\u002F) {\r\n if (domType !== 1 \u002F* ELEMENT *\u002F ||\r\n vnode.type.toLowerCase() !==\r\n node.tagName.toLowerCase()) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n }\r\n }\r\n else if (shapeFlag & 6 \u002F* COMPONENT *\u002F) {\r\n \u002F\u002F when setting up the render effect, if the initial vnode already\r\n \u002F\u002F has .el set, the component will perform hydration instead of mount\r\n \u002F\u002F on its sub-tree.\r\n vnode.slotScopeIds = slotScopeIds;\r\n const container = parentNode(node);\r\n mountComponent(vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container), optimized);\r\n \u002F\u002F component may be async, so in the case of fragments we cannot rely\r\n \u002F\u002F on component's rendered output to determine the end of the fragment\r\n \u002F\u002F instead, we do a lookahead to find the end anchor node.\r\n nextNode = isFragmentStart\r\n ? locateClosingAsyncAnchor(node)\r\n : nextSibling(node);\r\n \u002F\u002F #3787\r\n \u002F\u002F if component is async, it may get moved \u002F unmounted before its\r\n \u002F\u002F inner component is loaded, so we need to give it a placeholder\r\n \u002F\u002F vnode that matches its adopted DOM.\r\n if (isAsyncWrapper(vnode)) {\r\n let subTree;\r\n if (isFragmentStart) {\r\n subTree = createVNode(Fragment);\r\n subTree.anchor = nextNode\r\n ? nextNode.previousSibling\r\n : container.lastChild;\r\n }\r\n else {\r\n subTree =\r\n node.nodeType === 3 ? createTextVNode('') : createVNode('div');\r\n }\r\n subTree.el = node;\r\n vnode.component.subTree = subTree;\r\n }\r\n }\r\n else if (shapeFlag & 64 \u002F* TELEPORT *\u002F) {\r\n if (domType !== 8 \u002F* COMMENT *\u002F) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);\r\n }\r\n }\r\n else if (shapeFlag & 128 \u002F* SUSPENSE *\u002F) {\r\n nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);\r\n }\r\n else {\r\n warn$1('Invalid HostVNode type:', type, `(${typeof type})`);\r\n }\r\n }\r\n if (ref != null) {\r\n setRef(ref, null, parentSuspense, vnode);\r\n }\r\n return nextNode;\r\n };\r\n const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) =\u003E {\r\n optimized = optimized || !!vnode.dynamicChildren;\r\n const { type, props, patchFlag, shapeFlag, dirs } = vnode;\r\n \u002F\u002F #4006 for form elements with non-string v-model value bindings\r\n \u002F\u002F e.g. \u003Coption :value=\"obj\"\u003E, \u003Cinput type=\"checkbox\" :true-value=\"1\"\u003E\r\n const forcePatchValue = (type === 'input' && dirs) || type === 'option';\r\n \u002F\u002F skip props & children if this is hoisted static nodes\r\n \u002F\u002F #5405 in dev, always hydrate children for HMR\r\n {\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'created');\r\n }\r\n \u002F\u002F props\r\n if (props) {\r\n if (forcePatchValue ||\r\n !optimized ||\r\n patchFlag & (16 \u002F* FULL_PROPS *\u002F | 32 \u002F* HYDRATE_EVENTS *\u002F)) {\r\n for (const key in props) {\r\n if ((forcePatchValue && key.endsWith('value')) ||\r\n (isOn(key) && !isReservedProp(key))) {\r\n patchProp(el, key, null, props[key], false, undefined, parentComponent);\r\n }\r\n }\r\n }\r\n else if (props.onClick) {\r\n \u002F\u002F Fast path for click listeners (which is most often) to avoid\r\n \u002F\u002F iterating through props.\r\n patchProp(el, 'onClick', null, props.onClick, false, undefined, parentComponent);\r\n }\r\n }\r\n \u002F\u002F vnode \u002F directive hooks\r\n let vnodeHooks;\r\n if ((vnodeHooks = props && props.onVnodeBeforeMount)) {\r\n invokeVNodeHook(vnodeHooks, parentComponent, vnode);\r\n }\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount');\r\n }\r\n if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {\r\n queueEffectWithSuspense(() =\u003E {\r\n vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);\r\n dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted');\r\n }, parentSuspense);\r\n }\r\n \u002F\u002F children\r\n if (shapeFlag & 16 \u002F* ARRAY_CHILDREN *\u002F &&\r\n \u002F\u002F skip if element has innerHTML \u002F textContent\r\n !(props && (props.innerHTML || props.textContent))) {\r\n let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n let hasWarned = false;\r\n while (next) {\r\n hasMismatch = true;\r\n if (!hasWarned) {\r\n warn$1(`Hydration children mismatch in \u003C${vnode.type}\u003E: ` +\r\n `server rendered element contains more child nodes than client vdom.`);\r\n hasWarned = true;\r\n }\r\n \u002F\u002F The SSRed DOM contains more nodes than it should. Remove them.\r\n const cur = next;\r\n next = next.nextSibling;\r\n remove(cur);\r\n }\r\n }\r\n else if (shapeFlag & 8 \u002F* TEXT_CHILDREN *\u002F) {\r\n if (el.textContent !== vnode.children) {\r\n hasMismatch = true;\r\n warn$1(`Hydration text content mismatch in \u003C${vnode.type}\u003E:\\n` +\r\n `- Client: ${el.textContent}\\n` +\r\n `- Server: ${vnode.children}`);\r\n el.textContent = vnode.children;\r\n }\r\n }\r\n }\r\n return el.nextSibling;\r\n };\r\n const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) =\u003E {\r\n optimized = optimized || !!parentVNode.dynamicChildren;\r\n const children = parentVNode.children;\r\n const l = children.length;\r\n let hasWarned = false;\r\n for (let i = 0; i \u003C l; i++) {\r\n const vnode = optimized\r\n ? children[i]\r\n : (children[i] = normalizeVNode(children[i]));\r\n if (node) {\r\n node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n }\r\n else if (vnode.type === Text && !vnode.children) {\r\n continue;\r\n }\r\n else {\r\n hasMismatch = true;\r\n if (!hasWarned) {\r\n warn$1(`Hydration children mismatch in \u003C${container.tagName.toLowerCase()}\u003E: ` +\r\n `server rendered element contains fewer child nodes than client vdom.`);\r\n hasWarned = true;\r\n }\r\n \u002F\u002F the SSRed DOM didn't contain enough nodes. Mount the missing ones.\r\n patch(null, vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container), slotScopeIds);\r\n }\r\n }\r\n return node;\r\n };\r\n const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) =\u003E {\r\n const { slotScopeIds: fragmentSlotScopeIds } = vnode;\r\n if (fragmentSlotScopeIds) {\r\n slotScopeIds = slotScopeIds\r\n ? slotScopeIds.concat(fragmentSlotScopeIds)\r\n : fragmentSlotScopeIds;\r\n }\r\n const container = parentNode(node);\r\n const next = hydrateChildren(nextSibling(node), vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n if (next && isComment(next) && next.data === ']') {\r\n return nextSibling((vnode.anchor = next));\r\n }\r\n else {\r\n \u002F\u002F fragment didn't hydrate successfully, since we didn't get a end anchor\r\n \u002F\u002F back. This should have led to node\u002Fchildren mismatch warnings.\r\n hasMismatch = true;\r\n \u002F\u002F since the anchor is missing, we need to create one and insert it\r\n insert((vnode.anchor = createComment(`]`)), container, next);\r\n return next;\r\n }\r\n };\r\n const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) =\u003E {\r\n hasMismatch = true;\r\n warn$1(`Hydration node mismatch:\\n- Client vnode:`, vnode.type, `\\n- Server rendered DOM:`, node, node.nodeType === 3 \u002F* TEXT *\u002F\r\n ? `(text)`\r\n : isComment(node) && node.data === '['\r\n ? `(start of fragment)`\r\n : ``);\r\n vnode.el = null;\r\n if (isFragment) {\r\n \u002F\u002F remove excessive fragment nodes\r\n const end = locateClosingAsyncAnchor(node);\r\n while (true) {\r\n const next = nextSibling(node);\r\n if (next && next !== end) {\r\n remove(next);\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n }\r\n const next = nextSibling(node);\r\n const container = parentNode(node);\r\n remove(node);\r\n patch(null, vnode, container, next, parentComponent, parentSuspense, isSVGContainer(container), slotScopeIds);\r\n return next;\r\n };\r\n const locateClosingAsyncAnchor = (node) =\u003E {\r\n let match = 0;\r\n while (node) {\r\n node = nextSibling(node);\r\n if (node && isComment(node)) {\r\n if (node.data === '[')\r\n match++;\r\n if (node.data === ']') {\r\n if (match === 0) {\r\n return nextSibling(node);\r\n }\r\n else {\r\n match--;\r\n }\r\n }\r\n }\r\n }\r\n return node;\r\n };\r\n return [hydrate, hydrateNode];\r\n}\r\n\r\n\u002F* eslint-disable no-restricted-globals *\u002F\r\nlet supported;\r\nlet perf;\r\nfunction startMeasure(instance, type) {\r\n if (instance.appContext.config.performance && isSupported()) {\r\n perf.mark(`vue-${type}-${instance.uid}`);\r\n }\r\n {\r\n devtoolsPerfStart(instance, type, supported ? perf.now() : Date.now());\r\n }\r\n}\r\nfunction endMeasure(instance, type) {\r\n if (instance.appContext.config.performance && isSupported()) {\r\n const startTag = `vue-${type}-${instance.uid}`;\r\n const endTag = startTag + `:end`;\r\n perf.mark(endTag);\r\n perf.measure(`\u003C${formatComponentName(instance, instance.type)}\u003E ${type}`, startTag, endTag);\r\n perf.clearMarks(startTag);\r\n perf.clearMarks(endTag);\r\n }\r\n {\r\n devtoolsPerfEnd(instance, type, supported ? perf.now() : Date.now());\r\n }\r\n}\r\nfunction isSupported() {\r\n if (supported !== undefined) {\r\n return supported;\r\n }\r\n if (typeof window !== 'undefined' && window.performance) {\r\n supported = true;\r\n perf = window.performance;\r\n }\r\n else {\r\n supported = false;\r\n }\r\n return supported;\r\n}\r\n\r\nconst queuePostRenderEffect = queueEffectWithSuspense\r\n ;\r\n\u002F**\r\n * The createRenderer function accepts two generic arguments:\r\n * HostNode and HostElement, corresponding to Node and Element types in the\r\n * host environment. For example, for runtime-dom, HostNode would be the DOM\r\n * `Node` interface and HostElement would be the DOM `Element` interface.\r\n *\r\n * Custom renderers can pass in the platform specific types like this:\r\n *\r\n * ``` js\r\n * const { render, createApp } = createRenderer\u003CNode, Element\u003E({\r\n * patchProp,\r\n * ...nodeOps\r\n * })\r\n * ```\r\n *\u002F\r\nfunction createRenderer(options) {\r\n return baseCreateRenderer(options);\r\n}\r\n\u002F\u002F Separate API for creating hydration-enabled renderer.\r\n\u002F\u002F Hydration logic is only used when calling this function, making it\r\n\u002F\u002F tree-shakable.\r\nfunction createHydrationRenderer(options) {\r\n return baseCreateRenderer(options, createHydrationFunctions);\r\n}\r\n\u002F\u002F implementation\r\nfunction baseCreateRenderer(options, createHydrationFns) {\r\n const target = getGlobalThis();\r\n target.__VUE__ = true;\r\n {\r\n setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);\r\n }\r\n const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;\r\n \u002F\u002F Note: functions inside this closure should use `const xxx = () =\u003E {}`\r\n \u002F\u002F style in order to prevent being inlined by minifiers.\r\n const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) =\u003E {\r\n if (n1 === n2) {\r\n return;\r\n }\r\n \u002F\u002F patching & not same type, unmount old tree\r\n if (n1 && !isSameVNodeType(n1, n2)) {\r\n anchor = getNextHostNode(n1);\r\n unmount(n1, parentComponent, parentSuspense, true);\r\n n1 = null;\r\n }\r\n if (n2.patchFlag === -2 \u002F* BAIL *\u002F) {\r\n optimized = false;\r\n n2.dynamicChildren = null;\r\n }\r\n const { type, ref, shapeFlag } = n2;\r\n switch (type) {\r\n case Text:\r\n processText(n1, n2, container, anchor);\r\n break;\r\n case Comment:\r\n processCommentNode(n1, n2, container, anchor);\r\n break;\r\n case Static:\r\n if (n1 == null) {\r\n mountStaticNode(n2, container, anchor, isSVG);\r\n }\r\n else {\r\n patchStaticNode(n1, n2, container, isSVG);\r\n }\r\n break;\r\n case Fragment:\r\n processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n break;\r\n default:\r\n if (shapeFlag & 1 \u002F* ELEMENT *\u002F) {\r\n processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else if (shapeFlag & 6 \u002F* COMPONENT *\u002F) {\r\n processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else if (shapeFlag & 64 \u002F* TELEPORT *\u002F) {\r\n type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);\r\n }\r\n else if (shapeFlag & 128 \u002F* SUSPENSE *\u002F) {\r\n type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);\r\n }\r\n else {\r\n warn$1('Invalid VNode type:', type, `(${typeof type})`);\r\n }\r\n }\r\n \u002F\u002F set ref\r\n if (ref != null && parentComponent) {\r\n setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);\r\n }\r\n };\r\n const processText = (n1, n2, container, anchor) =\u003E {\r\n if (n1 == null) {\r\n hostInsert((n2.el = hostCreateText(n2.children)), container, anchor);\r\n }\r\n else {\r\n const el = (n2.el = n1.el);\r\n if (n2.children !== n1.children) {\r\n hostSetText(el, n2.children);\r\n }\r\n }\r\n };\r\n const processCommentNode = (n1, n2, container, anchor) =\u003E {\r\n if (n1 == null) {\r\n hostInsert((n2.el = hostCreateComment(n2.children || '')), container, anchor);\r\n }\r\n else {\r\n \u002F\u002F there's no support for dynamic comments\r\n n2.el = n1.el;\r\n }\r\n };\r\n const mountStaticNode = (n2, container, anchor, isSVG) =\u003E {\r\n [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG, n2.el, n2.anchor);\r\n };\r\n \u002F**\r\n * Dev \u002F HMR only\r\n *\u002F\r\n const patchStaticNode = (n1, n2, container, isSVG) =\u003E {\r\n \u002F\u002F static nodes are only patched during dev for HMR\r\n if (n2.children !== n1.children) {\r\n const anchor = hostNextSibling(n1.anchor);\r\n \u002F\u002F remove existing\r\n removeStaticNode(n1);\r\n [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);\r\n }\r\n else {\r\n n2.el = n1.el;\r\n n2.anchor = n1.anchor;\r\n }\r\n };\r\n const moveStaticNode = ({ el, anchor }, container, nextSibling) =\u003E {\r\n let next;\r\n while (el && el !== anchor) {\r\n next = hostNextSibling(el);\r\n hostInsert(el, container, nextSibling);\r\n el = next;\r\n }\r\n hostInsert(anchor, container, nextSibling);\r\n };\r\n const removeStaticNode = ({ el, anchor }) =\u003E {\r\n let next;\r\n while (el && el !== anchor) {\r\n next = hostNextSibling(el);\r\n hostRemove(el);\r\n el = next;\r\n }\r\n hostRemove(anchor);\r\n };\r\n const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) =\u003E {\r\n isSVG = isSVG || n2.type === 'svg';\r\n if (n1 == null) {\r\n mountElement(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n patchElement(n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n };\r\n const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) =\u003E {\r\n let el;\r\n let vnodeHook;\r\n const { type, props, shapeFlag, transition, patchFlag, dirs } = vnode;\r\n {\r\n el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);\r\n \u002F\u002F mount children first, since some props may rely on child content\r\n \u002F\u002F being already rendered, e.g. `\u003Cselect value\u003E`\r\n if (shapeFlag & 8 \u002F* TEXT_CHILDREN *\u002F) {\r\n hostSetElementText(el, vnode.children);\r\n }\r\n else if (shapeFlag & 16 \u002F* ARRAY_CHILDREN *\u002F) {\r\n mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized);\r\n }\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'created');\r\n }\r\n \u002F\u002F props\r\n if (props) {\r\n for (const key in props) {\r\n if (key !== 'value' && !isReservedProp(key)) {\r\n hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n }\r\n \u002F**\r\n * Special case for setting value on DOM elements:\r\n * - it can be order-sensitive (e.g. should be set *after* min\u002Fmax, #2325, #4024)\r\n * - it needs to be forced (#1471)\r\n * #2353 proposes adding another renderer option to configure this, but\r\n * the properties affects are so finite it is worth special casing it\r\n * here to reduce the complexity. (Special casing it also should not\r\n * affect non-DOM renderers)\r\n *\u002F\r\n if ('value' in props) {\r\n hostPatchProp(el, 'value', null, props.value);\r\n }\r\n if ((vnodeHook = props.onVnodeBeforeMount)) {\r\n invokeVNodeHook(vnodeHook, parentComponent, vnode);\r\n }\r\n }\r\n \u002F\u002F scopeId\r\n setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);\r\n }\r\n {\r\n Object.defineProperty(el, '__vnode', {\r\n value: vnode,\r\n enumerable: false\r\n });\r\n Object.defineProperty(el, '__vueParentComponent', {\r\n value: parentComponent,\r\n enumerable: false\r\n });\r\n }\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount');\r\n }\r\n \u002F\u002F #1583 For inside suspense + suspense not resolved case, enter hook should call when suspense resolved\r\n \u002F\u002F #1689 For inside suspense + suspense resolved case, just call it\r\n const needCallTransitionHooks = (!parentSuspense || (parentSuspense && !parentSuspense.pendingBranch)) &&\r\n transition &&\r\n !transition.persisted;\r\n if (needCallTransitionHooks) {\r\n transition.beforeEnter(el);\r\n }\r\n hostInsert(el, container, anchor);\r\n if ((vnodeHook = props && props.onVnodeMounted) ||\r\n needCallTransitionHooks ||\r\n dirs) {\r\n queuePostRenderEffect(() =\u003E {\r\n vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);\r\n needCallTransitionHooks && transition.enter(el);\r\n dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted');\r\n }, parentSuspense);\r\n }\r\n };\r\n const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) =\u003E {\r\n if (scopeId) {\r\n hostSetScopeId(el, scopeId);\r\n }\r\n if (slotScopeIds) {\r\n for (let i = 0; i \u003C slotScopeIds.length; i++) {\r\n hostSetScopeId(el, slotScopeIds[i]);\r\n }\r\n }\r\n if (parentComponent) {\r\n let subTree = parentComponent.subTree;\r\n if (subTree.patchFlag \u003E 0 &&\r\n subTree.patchFlag & 2048 \u002F* DEV_ROOT_FRAGMENT *\u002F) {\r\n subTree =\r\n filterSingleRoot(subTree.children) || subTree;\r\n }\r\n if (vnode === subTree) {\r\n const parentVNode = parentComponent.vnode;\r\n setScopeId(el, parentVNode, parentVNode.scopeId, parentVNode.slotScopeIds, parentComponent.parent);\r\n }\r\n }\r\n };\r\n const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) =\u003E {\r\n for (let i = start; i \u003C children.length; i++) {\r\n const child = (children[i] = optimized\r\n ? cloneIfMounted(children[i])\r\n : normalizeVNode(children[i]));\r\n patch(null, child, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n };\r\n const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) =\u003E {\r\n const el = (n2.el = n1.el);\r\n let { patchFlag, dynamicChildren, dirs } = n2;\r\n \u002F\u002F #1426 take the old vnode's patch flag into account since user may clone a\r\n \u002F\u002F compiler-generated vnode, which de-opts to FULL_PROPS\r\n patchFlag |= n1.patchFlag & 16 \u002F* FULL_PROPS *\u002F;\r\n const oldProps = n1.props || EMPTY_OBJ;\r\n const newProps = n2.props || EMPTY_OBJ;\r\n let vnodeHook;\r\n \u002F\u002F disable recurse in beforeUpdate hooks\r\n parentComponent && toggleRecurse(parentComponent, false);\r\n if ((vnodeHook = newProps.onVnodeBeforeUpdate)) {\r\n invokeVNodeHook(vnodeHook, parentComponent, n2, n1);\r\n }\r\n if (dirs) {\r\n invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate');\r\n }\r\n parentComponent && toggleRecurse(parentComponent, true);\r\n if (isHmrUpdating) {\r\n \u002F\u002F HMR updated, force full diff\r\n patchFlag = 0;\r\n optimized = false;\r\n dynamicChildren = null;\r\n }\r\n const areChildrenSVG = isSVG && n2.type !== 'foreignObject';\r\n if (dynamicChildren) {\r\n patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds);\r\n if (parentComponent && parentComponent.type.__hmrId) {\r\n traverseStaticChildren(n1, n2);\r\n }\r\n }\r\n else if (!optimized) {\r\n \u002F\u002F full diff\r\n patchChildren(n1, n2, el, null, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds, false);\r\n }\r\n if (patchFlag \u003E 0) {\r\n \u002F\u002F the presence of a patchFlag means this element's render code was\r\n \u002F\u002F generated by the compiler and can take the fast path.\r\n \u002F\u002F in this path old node and new node are guaranteed to have the same shape\r\n \u002F\u002F (i.e. at the exact same position in the source template)\r\n if (patchFlag & 16 \u002F* FULL_PROPS *\u002F) {\r\n \u002F\u002F element props contain dynamic keys, full diff needed\r\n patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);\r\n }\r\n else {\r\n \u002F\u002F class\r\n \u002F\u002F this flag is matched when the element has dynamic class bindings.\r\n if (patchFlag & 2 \u002F* CLASS *\u002F) {\r\n if (oldProps.class !== newProps.class) {\r\n hostPatchProp(el, 'class', null, newProps.class, isSVG);\r\n }\r\n }\r\n \u002F\u002F style\r\n \u002F\u002F this flag is matched when the element has dynamic style bindings\r\n if (patchFlag & 4 \u002F* STYLE *\u002F) {\r\n hostPatchProp(el, 'style', oldProps.style, newProps.style, isSVG);\r\n }\r\n \u002F\u002F props\r\n \u002F\u002F This flag is matched when the element has dynamic prop\u002Fattr bindings\r\n \u002F\u002F other than class and style. The keys of dynamic prop\u002Fattrs are saved for\r\n \u002F\u002F faster iteration.\r\n \u002F\u002F Note dynamic keys like :[foo]=\"bar\" will cause this optimization to\r\n \u002F\u002F bail out and go through a full diff because we need to unset the old key\r\n if (patchFlag & 8 \u002F* PROPS *\u002F) {\r\n \u002F\u002F if the flag is present then dynamicProps must be non-null\r\n const propsToUpdate = n2.dynamicProps;\r\n for (let i = 0; i \u003C propsToUpdate.length; i++) {\r\n const key = propsToUpdate[i];\r\n const prev = oldProps[key];\r\n const next = newProps[key];\r\n \u002F\u002F #1471 force patch value\r\n if (next !== prev || key === 'value') {\r\n hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n }\r\n }\r\n }\r\n \u002F\u002F text\r\n \u002F\u002F This flag is matched when the element has only dynamic text children.\r\n if (patchFlag & 1 \u002F* TEXT *\u002F) {\r\n if (n1.children !== n2.children) {\r\n hostSetElementText(el, n2.children);\r\n }\r\n }\r\n }\r\n else if (!optimized && dynamicChildren == null) {\r\n \u002F\u002F unoptimized, full diff\r\n patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);\r\n }\r\n if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {\r\n queuePostRenderEffect(() =\u003E {\r\n vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);\r\n dirs && invokeDirectiveHook(n2, n1, parentComponent, 'updated');\r\n }, parentSuspense);\r\n }\r\n };\r\n \u002F\u002F The fast path for blocks.\r\n const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) =\u003E {\r\n for (let i = 0; i \u003C newChildren.length; i++) {\r\n const oldVNode = oldChildren[i];\r\n const newVNode = newChildren[i];\r\n \u002F\u002F Determine the container (parent element) for the patch.\r\n const container = \r\n \u002F\u002F oldVNode may be an errored async setup() component inside Suspense\r\n \u002F\u002F which will not have a mounted element\r\n oldVNode.el &&\r\n \u002F\u002F - In the case of a Fragment, we need to provide the actual parent\r\n \u002F\u002F of the Fragment itself so it can move its children.\r\n (oldVNode.type === Fragment ||\r\n \u002F\u002F - In the case of different nodes, there is going to be a replacement\r\n \u002F\u002F which also requires the correct parent container\r\n !isSameVNodeType(oldVNode, newVNode) ||\r\n \u002F\u002F - In the case of a component, it could contain anything.\r\n oldVNode.shapeFlag & (6 \u002F* COMPONENT *\u002F | 64 \u002F* TELEPORT *\u002F))\r\n ? hostParentNode(oldVNode.el)\r\n : \u002F\u002F In other cases, the parent container is not actually used so we\r\n \u002F\u002F just pass the block element here to avoid a DOM parentNode call.\r\n fallbackContainer;\r\n patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, true);\r\n }\r\n };\r\n const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) =\u003E {\r\n if (oldProps !== newProps) {\r\n for (const key in newProps) {\r\n \u002F\u002F empty string is not valid prop\r\n if (isReservedProp(key))\r\n continue;\r\n const next = newProps[key];\r\n const prev = oldProps[key];\r\n \u002F\u002F defer patching value\r\n if (next !== prev && key !== 'value') {\r\n hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n }\r\n if (oldProps !== EMPTY_OBJ) {\r\n for (const key in oldProps) {\r\n if (!isReservedProp(key) && !(key in newProps)) {\r\n hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n }\r\n }\r\n if ('value' in newProps) {\r\n hostPatchProp(el, 'value', oldProps.value, newProps.value);\r\n }\r\n }\r\n };\r\n const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) =\u003E {\r\n const fragmentStartAnchor = (n2.el = n1 ? n1.el : hostCreateText(''));\r\n const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));\r\n let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;\r\n if (isHmrUpdating) {\r\n \u002F\u002F HMR updated, force full diff\r\n patchFlag = 0;\r\n optimized = false;\r\n dynamicChildren = null;\r\n }\r\n \u002F\u002F check if this is a slot fragment with :slotted scope ids\r\n if (fragmentSlotScopeIds) {\r\n slotScopeIds = slotScopeIds\r\n ? slotScopeIds.concat(fragmentSlotScopeIds)\r\n : fragmentSlotScopeIds;\r\n }\r\n if (n1 == null) {\r\n hostInsert(fragmentStartAnchor, container, anchor);\r\n hostInsert(fragmentEndAnchor, container, anchor);\r\n \u002F\u002F a fragment can only have array children\r\n \u002F\u002F since they are either generated by the compiler, or implicitly created\r\n \u002F\u002F from arrays.\r\n mountChildren(n2.children, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n if (patchFlag \u003E 0 &&\r\n patchFlag & 64 \u002F* STABLE_FRAGMENT *\u002F &&\r\n dynamicChildren &&\r\n \u002F\u002F #2715 the previous fragment could've been a BAILed one as a result\r\n \u002F\u002F of renderSlot() with no valid children\r\n n1.dynamicChildren) {\r\n \u002F\u002F a stable fragment (template root or \u003Ctemplate v-for\u003E) doesn't need to\r\n \u002F\u002F patch children order, but it may contain dynamicChildren.\r\n patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, isSVG, slotScopeIds);\r\n if (parentComponent && parentComponent.type.__hmrId) {\r\n traverseStaticChildren(n1, n2);\r\n }\r\n else if (\r\n \u002F\u002F #2080 if the stable fragment has a key, it's a \u003Ctemplate v-for\u003E that may\r\n \u002F\u002F get moved around. Make sure all root level vnodes inherit el.\r\n \u002F\u002F #2134 or if it's a component root, it may also get moved around\r\n \u002F\u002F as the component is being moved.\r\n n2.key != null ||\r\n (parentComponent && n2 === parentComponent.subTree)) {\r\n traverseStaticChildren(n1, n2, true \u002F* shallow *\u002F);\r\n }\r\n }\r\n else {\r\n \u002F\u002F keyed \u002F unkeyed, or manual fragments.\r\n \u002F\u002F for keyed & unkeyed, since they are compiler generated from v-for,\r\n \u002F\u002F each child is guaranteed to be a block so the fragment will never\r\n \u002F\u002F have dynamicChildren.\r\n patchChildren(n1, n2, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n }\r\n };\r\n const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) =\u003E {\r\n n2.slotScopeIds = slotScopeIds;\r\n if (n1 == null) {\r\n if (n2.shapeFlag & 512 \u002F* COMPONENT_KEPT_ALIVE *\u002F) {\r\n parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);\r\n }\r\n else {\r\n mountComponent(n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);\r\n }\r\n }\r\n else {\r\n updateComponent(n1, n2, optimized);\r\n }\r\n };\r\n const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) =\u003E {\r\n const instance = (initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense));\r\n if (instance.type.__hmrId) {\r\n registerHMR(instance);\r\n }\r\n {\r\n pushWarningContext(initialVNode);\r\n startMeasure(instance, `mount`);\r\n }\r\n \u002F\u002F inject renderer internals for keepAlive\r\n if (isKeepAlive(initialVNode)) {\r\n instance.ctx.renderer = internals;\r\n }\r\n \u002F\u002F resolve props and slots for setup context\r\n {\r\n {\r\n startMeasure(instance, `init`);\r\n }\r\n setupComponent(instance);\r\n {\r\n endMeasure(instance, `init`);\r\n }\r\n }\r\n \u002F\u002F setup() is async. This component relies on async logic to be resolved\r\n \u002F\u002F before proceeding\r\n if (instance.asyncDep) {\r\n parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);\r\n \u002F\u002F Give it a placeholder if this is not hydration\r\n \u002F\u002F TODO handle self-defined fallback\r\n if (!initialVNode.el) {\r\n const placeholder = (instance.subTree = createVNode(Comment));\r\n processCommentNode(null, placeholder, container, anchor);\r\n }\r\n return;\r\n }\r\n setupRenderEffect(instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized);\r\n {\r\n popWarningContext();\r\n endMeasure(instance, `mount`);\r\n }\r\n };\r\n const updateComponent = (n1, n2, optimized) =\u003E {\r\n const instance = (n2.component = n1.component);\r\n if (shouldUpdateComponent(n1, n2, optimized)) {\r\n if (instance.asyncDep &&\r\n !instance.asyncResolved) {\r\n \u002F\u002F async & still pending - just update props and slots\r\n \u002F\u002F since the component's reactive effect for render isn't set-up yet\r\n {\r\n pushWarningContext(n2);\r\n }\r\n updateComponentPreRender(instance, n2, optimized);\r\n {\r\n popWarningContext();\r\n }\r\n return;\r\n }\r\n else {\r\n \u002F\u002F normal update\r\n instance.next = n2;\r\n \u002F\u002F in case the child component is also queued, remove it to avoid\r\n \u002F\u002F double updating the same child component in the same flush.\r\n invalidateJob(instance.update);\r\n \u002F\u002F instance.update is the reactive effect.\r\n instance.update();\r\n }\r\n }\r\n else {\r\n \u002F\u002F no update needed. just copy over properties\r\n n2.component = n1.component;\r\n n2.el = n1.el;\r\n instance.vnode = n2;\r\n }\r\n };\r\n const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) =\u003E {\r\n const componentUpdateFn = () =\u003E {\r\n if (!instance.isMounted) {\r\n let vnodeHook;\r\n const { el, props } = initialVNode;\r\n const { bm, m, parent } = instance;\r\n const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);\r\n toggleRecurse(instance, false);\r\n \u002F\u002F beforeMount hook\r\n if (bm) {\r\n invokeArrayFns(bm);\r\n }\r\n \u002F\u002F onVnodeBeforeMount\r\n if (!isAsyncWrapperVNode &&\r\n (vnodeHook = props && props.onVnodeBeforeMount)) {\r\n invokeVNodeHook(vnodeHook, parent, initialVNode);\r\n }\r\n toggleRecurse(instance, true);\r\n if (el && hydrateNode) {\r\n \u002F\u002F vnode has adopted host node - perform hydration instead of mount.\r\n const hydrateSubTree = () =\u003E {\r\n {\r\n startMeasure(instance, `render`);\r\n }\r\n instance.subTree = renderComponentRoot(instance);\r\n {\r\n endMeasure(instance, `render`);\r\n }\r\n {\r\n startMeasure(instance, `hydrate`);\r\n }\r\n hydrateNode(el, instance.subTree, instance, parentSuspense, null);\r\n {\r\n endMeasure(instance, `hydrate`);\r\n }\r\n };\r\n if (isAsyncWrapperVNode) {\r\n initialVNode.type.__asyncLoader().then(\r\n \u002F\u002F note: we are moving the render call into an async callback,\r\n \u002F\u002F which means it won't track dependencies - but it's ok because\r\n \u002F\u002F a server-rendered async wrapper is already in resolved state\r\n \u002F\u002F and it will never need to change.\r\n () =\u003E !instance.isUnmounted && hydrateSubTree());\r\n }\r\n else {\r\n hydrateSubTree();\r\n }\r\n }\r\n else {\r\n {\r\n startMeasure(instance, `render`);\r\n }\r\n const subTree = (instance.subTree = renderComponentRoot(instance));\r\n {\r\n endMeasure(instance, `render`);\r\n }\r\n {\r\n startMeasure(instance, `patch`);\r\n }\r\n patch(null, subTree, container, anchor, instance, parentSuspense, isSVG);\r\n {\r\n endMeasure(instance, `patch`);\r\n }\r\n initialVNode.el = subTree.el;\r\n }\r\n \u002F\u002F mounted hook\r\n if (m) {\r\n queuePostRenderEffect(m, parentSuspense);\r\n }\r\n \u002F\u002F onVnodeMounted\r\n if (!isAsyncWrapperVNode &&\r\n (vnodeHook = props && props.onVnodeMounted)) {\r\n const scopedInitialVNode = initialVNode;\r\n queuePostRenderEffect(() =\u003E invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);\r\n }\r\n \u002F\u002F activated hook for keep-alive roots.\r\n \u002F\u002F #1742 activated hook must be accessed after first render\r\n \u002F\u002F since the hook may be injected by a child keep-alive\r\n if (initialVNode.shapeFlag & 256 \u002F* COMPONENT_SHOULD_KEEP_ALIVE *\u002F) {\r\n instance.a && queuePostRenderEffect(instance.a, parentSuspense);\r\n }\r\n instance.isMounted = true;\r\n {\r\n devtoolsComponentAdded(instance);\r\n }\r\n \u002F\u002F #2458: deference mount-only object parameters to prevent memleaks\r\n initialVNode = container = anchor = null;\r\n }\r\n else {\r\n \u002F\u002F updateComponent\r\n \u002F\u002F This is triggered by mutation of component's own state (next: null)\r\n \u002F\u002F OR parent calling processComponent (next: VNode)\r\n let { next, bu, u, parent, vnode } = instance;\r\n let originNext = next;\r\n let vnodeHook;\r\n {\r\n pushWarningContext(next || instance.vnode);\r\n }\r\n \u002F\u002F Disallow component effect recursion during pre-lifecycle hooks.\r\n toggleRecurse(instance, false);\r\n if (next) {\r\n next.el = vnode.el;\r\n updateComponentPreRender(instance, next, optimized);\r\n }\r\n else {\r\n next = vnode;\r\n }\r\n \u002F\u002F beforeUpdate hook\r\n if (bu) {\r\n invokeArrayFns(bu);\r\n }\r\n \u002F\u002F onVnodeBeforeUpdate\r\n if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {\r\n invokeVNodeHook(vnodeHook, parent, next, vnode);\r\n }\r\n toggleRecurse(instance, true);\r\n \u002F\u002F render\r\n {\r\n startMeasure(instance, `render`);\r\n }\r\n const nextTree = renderComponentRoot(instance);\r\n {\r\n endMeasure(instance, `render`);\r\n }\r\n const prevTree = instance.subTree;\r\n instance.subTree = nextTree;\r\n {\r\n startMeasure(instance, `patch`);\r\n }\r\n patch(prevTree, nextTree, \r\n \u002F\u002F parent may have changed if it's in a teleport\r\n hostParentNode(prevTree.el), \r\n \u002F\u002F anchor may have changed if it's in a fragment\r\n getNextHostNode(prevTree), instance, parentSuspense, isSVG);\r\n {\r\n endMeasure(instance, `patch`);\r\n }\r\n next.el = nextTree.el;\r\n if (originNext === null) {\r\n \u002F\u002F self-triggered update. In case of HOC, update parent component\r\n \u002F\u002F vnode el. HOC is indicated by parent instance's subTree pointing\r\n \u002F\u002F to child component's vnode\r\n updateHOCHostEl(instance, nextTree.el);\r\n }\r\n \u002F\u002F updated hook\r\n if (u) {\r\n queuePostRenderEffect(u, parentSuspense);\r\n }\r\n \u002F\u002F onVnodeUpdated\r\n if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {\r\n queuePostRenderEffect(() =\u003E invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);\r\n }\r\n {\r\n devtoolsComponentUpdated(instance);\r\n }\r\n {\r\n popWarningContext();\r\n }\r\n }\r\n };\r\n \u002F\u002F create reactive effect for rendering\r\n const effect = (instance.effect = new ReactiveEffect(componentUpdateFn, () =\u003E queueJob(instance.update), instance.scope \u002F\u002F track it in component's effect scope\r\n ));\r\n const update = (instance.update = effect.run.bind(effect));\r\n update.id = instance.uid;\r\n \u002F\u002F allowRecurse\r\n \u002F\u002F #1801, #2043 component render effects should allow recursive updates\r\n toggleRecurse(instance, true);\r\n {\r\n effect.onTrack = instance.rtc\r\n ? e =\u003E invokeArrayFns(instance.rtc, e)\r\n : void 0;\r\n effect.onTrigger = instance.rtg\r\n ? e =\u003E invokeArrayFns(instance.rtg, e)\r\n : void 0;\r\n \u002F\u002F @ts-ignore (for scheduler)\r\n update.ownerInstance = instance;\r\n }\r\n update();\r\n };\r\n const updateComponentPreRender = (instance, nextVNode, optimized) =\u003E {\r\n nextVNode.component = instance;\r\n const prevProps = instance.vnode.props;\r\n instance.vnode = nextVNode;\r\n instance.next = null;\r\n updateProps(instance, nextVNode.props, prevProps, optimized);\r\n updateSlots(instance, nextVNode.children, optimized);\r\n pauseTracking();\r\n \u002F\u002F props update may have triggered pre-flush watchers.\r\n \u002F\u002F flush them before the render update.\r\n flushPreFlushCbs(undefined, instance.update);\r\n resetTracking();\r\n };\r\n const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) =\u003E {\r\n const c1 = n1 && n1.children;\r\n const prevShapeFlag = n1 ? n1.shapeFlag : 0;\r\n const c2 = n2.children;\r\n const { patchFlag, shapeFlag } = n2;\r\n \u002F\u002F fast path\r\n if (patchFlag \u003E 0) {\r\n if (patchFlag & 128 \u002F* KEYED_FRAGMENT *\u002F) {\r\n \u002F\u002F this could be either fully-keyed or mixed (some keyed some not)\r\n \u002F\u002F presence of patchFlag means children are guaranteed to be arrays\r\n patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n return;\r\n }\r\n else if (patchFlag & 256 \u002F* UNKEYED_FRAGMENT *\u002F) {\r\n \u002F\u002F unkeyed\r\n patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n return;\r\n }\r\n }\r\n \u002F\u002F children has 3 possibilities: text, array or no children.\r\n if (shapeFlag & 8 \u002F* TEXT_CHILDREN *\u002F) {\r\n \u002F\u002F text children fast path\r\n if (prevShapeFlag & 16 \u002F* ARRAY_CHILDREN *\u002F) {\r\n unmountChildren(c1, parentComponent, parentSuspense);\r\n }\r\n if (c2 !== c1) {\r\n hostSetElementText(container, c2);\r\n }\r\n }\r\n else {\r\n if (prevShapeFlag & 16 \u002F* ARRAY_CHILDREN *\u002F) {\r\n \u002F\u002F prev children was array\r\n if (shapeFlag & 16 \u002F* ARRAY_CHILDREN *\u002F) {\r\n \u002F\u002F two arrays, cannot assume anything, do full diff\r\n patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n \u002F\u002F no new children, just unmount old\r\n unmountChildren(c1, parentComponent, parentSuspense, true);\r\n }\r\n }\r\n else {\r\n \u002F\u002F prev children was text OR null\r\n \u002F\u002F new children is array OR null\r\n if (prevShapeFlag & 8 \u002F* TEXT_CHILDREN *\u002F) {\r\n hostSetElementText(container, '');\r\n }\r\n \u002F\u002F mount new if array\r\n if (shapeFlag & 16 \u002F* ARRAY_CHILDREN *\u002F) {\r\n mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n }\r\n }\r\n };\r\n const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) =\u003E {\r\n c1 = c1 || EMPTY_ARR;\r\n c2 = c2 || EMPTY_ARR;\r\n const oldLength = c1.length;\r\n const newLength = c2.length;\r\n const commonLength = Math.min(oldLength, newLength);\r\n let i;\r\n for (i = 0; i \u003C commonLength; i++) {\r\n const nextChild = (c2[i] = optimized\r\n ? cloneIfMounted(c2[i])\r\n : normalizeVNode(c2[i]));\r\n patch(c1[i], nextChild, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n if (oldLength \u003E newLength) {\r\n \u002F\u002F remove old\r\n unmountChildren(c1, parentComponent, parentSuspense, true, false, commonLength);\r\n }\r\n else {\r\n \u002F\u002F mount new\r\n mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, commonLength);\r\n }\r\n };\r\n \u002F\u002F can be all-keyed or mixed\r\n const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) =\u003E {\r\n let i = 0;\r\n const l2 = c2.length;\r\n let e1 = c1.length - 1; \u002F\u002F prev ending index\r\n let e2 = l2 - 1; \u002F\u002F next ending index\r\n \u002F\u002F 1. sync from start\r\n \u002F\u002F (a b) c\r\n \u002F\u002F (a b) d e\r\n while (i \u003C= e1 && i \u003C= e2) {\r\n const n1 = c1[i];\r\n const n2 = (c2[i] = optimized\r\n ? cloneIfMounted(c2[i])\r\n : normalizeVNode(c2[i]));\r\n if (isSameVNodeType(n1, n2)) {\r\n patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n break;\r\n }\r\n i++;\r\n }\r\n \u002F\u002F 2. sync from end\r\n \u002F\u002F a (b c)\r\n \u002F\u002F d e (b c)\r\n while (i \u003C= e1 && i \u003C= e2) {\r\n const n1 = c1[e1];\r\n const n2 = (c2[e2] = optimized\r\n ? cloneIfMounted(c2[e2])\r\n : normalizeVNode(c2[e2]));\r\n if (isSameVNodeType(n1, n2)) {\r\n patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n break;\r\n }\r\n e1--;\r\n e2--;\r\n }\r\n \u002F\u002F 3. common sequence + mount\r\n \u002F\u002F (a b)\r\n \u002F\u002F (a b) c\r\n \u002F\u002F i = 2, e1 = 1, e2 = 2\r\n \u002F\u002F (a b)\r\n \u002F\u002F c (a b)\r\n \u002F\u002F i = 0, e1 = -1, e2 = 0\r\n if (i \u003E e1) {\r\n if (i \u003C= e2) {\r\n const nextPos = e2 + 1;\r\n const anchor = nextPos \u003C l2 ? c2[nextPos].el : parentAnchor;\r\n while (i \u003C= e2) {\r\n patch(null, (c2[i] = optimized\r\n ? cloneIfMounted(c2[i])\r\n : normalizeVNode(c2[i])), container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n i++;\r\n }\r\n }\r\n }\r\n \u002F\u002F 4. common sequence + unmount\r\n \u002F\u002F (a b) c\r\n \u002F\u002F (a b)\r\n \u002F\u002F i = 2, e1 = 2, e2 = 1\r\n \u002F\u002F a (b c)\r\n \u002F\u002F (b c)\r\n \u002F\u002F i = 0, e1 = 0, e2 = -1\r\n else if (i \u003E e2) {\r\n while (i \u003C= e1) {\r\n unmount(c1[i], parentComponent, parentSuspense, true);\r\n i++;\r\n }\r\n }\r\n \u002F\u002F 5. unknown sequence\r\n \u002F\u002F [i ... e1 + 1]: a b [c d e] f g\r\n \u002F\u002F [i ... e2 + 1]: a b [e d c h] f g\r\n \u002F\u002F i = 2, e1 = 4, e2 = 5\r\n else {\r\n const s1 = i; \u002F\u002F prev starting index\r\n const s2 = i; \u002F\u002F next starting index\r\n \u002F\u002F 5.1 build key:index map for newChildren\r\n const keyToNewIndexMap = new Map();\r\n for (i = s2; i \u003C= e2; i++) {\r\n const nextChild = (c2[i] = optimized\r\n ? cloneIfMounted(c2[i])\r\n : normalizeVNode(c2[i]));\r\n if (nextChild.key != null) {\r\n if (keyToNewIndexMap.has(nextChild.key)) {\r\n warn$1(`Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.`);\r\n }\r\n keyToNewIndexMap.set(nextChild.key, i);\r\n }\r\n }\r\n \u002F\u002F 5.2 loop through old children left to be patched and try to patch\r\n \u002F\u002F matching nodes & remove nodes that are no longer present\r\n let j;\r\n let patched = 0;\r\n const toBePatched = e2 - s2 + 1;\r\n let moved = false;\r\n \u002F\u002F used to track whether any node has moved\r\n let maxNewIndexSoFar = 0;\r\n \u002F\u002F works as Map\u003CnewIndex, oldIndex\u003E\r\n \u002F\u002F Note that oldIndex is offset by +1\r\n \u002F\u002F and oldIndex = 0 is a special value indicating the new node has\r\n \u002F\u002F no corresponding old node.\r\n \u002F\u002F used for determining longest stable subsequence\r\n const newIndexToOldIndexMap = new Array(toBePatched);\r\n for (i = 0; i \u003C toBePatched; i++)\r\n newIndexToOldIndexMap[i] = 0;\r\n for (i = s1; i \u003C= e1; i++) {\r\n const prevChild = c1[i];\r\n if (patched \u003E= toBePatched) {\r\n \u002F\u002F all new children have been patched so this can only be a removal\r\n unmount(prevChild, parentComponent, parentSuspense, true);\r\n continue;\r\n }\r\n let newIndex;\r\n if (prevChild.key != null) {\r\n newIndex = keyToNewIndexMap.get(prevChild.key);\r\n }\r\n else {\r\n \u002F\u002F key-less node, try to locate a key-less node of the same type\r\n for (j = s2; j \u003C= e2; j++) {\r\n if (newIndexToOldIndexMap[j - s2] === 0 &&\r\n isSameVNodeType(prevChild, c2[j])) {\r\n newIndex = j;\r\n break;\r\n }\r\n }\r\n }\r\n if (newIndex === undefined) {\r\n unmount(prevChild, parentComponent, parentSuspense, true);\r\n }\r\n else {\r\n newIndexToOldIndexMap[newIndex - s2] = i + 1;\r\n if (newIndex \u003E= maxNewIndexSoFar) {\r\n maxNewIndexSoFar = newIndex;\r\n }\r\n else {\r\n moved = true;\r\n }\r\n patch(prevChild, c2[newIndex], container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n patched++;\r\n }\r\n }\r\n \u002F\u002F 5.3 move and mount\r\n \u002F\u002F generate longest stable subsequence only when nodes have moved\r\n const increasingNewIndexSequence = moved\r\n ? getSequence(newIndexToOldIndexMap)\r\n : EMPTY_ARR;\r\n j = increasingNewIndexSequence.length - 1;\r\n \u002F\u002F looping backwards so that we can use last patched node as anchor\r\n for (i = toBePatched - 1; i \u003E= 0; i--) {\r\n const nextIndex = s2 + i;\r\n const nextChild = c2[nextIndex];\r\n const anchor = nextIndex + 1 \u003C l2 ? c2[nextIndex + 1].el : parentAnchor;\r\n if (newIndexToOldIndexMap[i] === 0) {\r\n \u002F\u002F mount new\r\n patch(null, nextChild, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else if (moved) {\r\n \u002F\u002F move if:\r\n \u002F\u002F There is no stable subsequence (e.g. a reverse)\r\n \u002F\u002F OR current node is not among the stable sequence\r\n if (j \u003C 0 || i !== increasingNewIndexSequence[j]) {\r\n move(nextChild, container, anchor, 2 \u002F* REORDER *\u002F);\r\n }\r\n else {\r\n j--;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n const move = (vnode, container, anchor, moveType, parentSuspense = null) =\u003E {\r\n const { el, type, transition, children, shapeFlag } = vnode;\r\n if (shapeFlag & 6 \u002F* COMPONENT *\u002F) {\r\n move(vnode.component.subTree, container, anchor, moveType);\r\n return;\r\n }\r\n if (shapeFlag & 128 \u002F* SUSPENSE *\u002F) {\r\n vnode.suspense.move(container, anchor, moveType);\r\n return;\r\n }\r\n if (shapeFlag & 64 \u002F* TELEPORT *\u002F) {\r\n type.move(vnode, container, anchor, internals);\r\n return;\r\n }\r\n if (type === Fragment) {\r\n hostInsert(el, container, anchor);\r\n for (let i = 0; i \u003C children.length; i++) {\r\n move(children[i], container, anchor, moveType);\r\n }\r\n hostInsert(vnode.anchor, container, anchor);\r\n return;\r\n }\r\n if (type === Static) {\r\n moveStaticNode(vnode, container, anchor);\r\n return;\r\n }\r\n \u002F\u002F single nodes\r\n const needTransition = moveType !== 2 \u002F* REORDER *\u002F &&\r\n shapeFlag & 1 \u002F* ELEMENT *\u002F &&\r\n transition;\r\n if (needTransition) {\r\n if (moveType === 0 \u002F* ENTER *\u002F) {\r\n transition.beforeEnter(el);\r\n hostInsert(el, container, anchor);\r\n queuePostRenderEffect(() =\u003E transition.enter(el), parentSuspense);\r\n }\r\n else {\r\n const { leave, delayLeave, afterLeave } = transition;\r\n const remove = () =\u003E hostInsert(el, container, anchor);\r\n const performLeave = () =\u003E {\r\n leave(el, () =\u003E {\r\n remove();\r\n afterLeave && afterLeave();\r\n });\r\n };\r\n if (delayLeave) {\r\n delayLeave(el, remove, performLeave);\r\n }\r\n else {\r\n performLeave();\r\n }\r\n }\r\n }\r\n else {\r\n hostInsert(el, container, anchor);\r\n }\r\n };\r\n const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) =\u003E {\r\n const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs } = vnode;\r\n \u002F\u002F unset ref\r\n if (ref != null) {\r\n setRef(ref, null, parentSuspense, vnode, true);\r\n }\r\n if (shapeFlag & 256 \u002F* COMPONENT_SHOULD_KEEP_ALIVE *\u002F) {\r\n parentComponent.ctx.deactivate(vnode);\r\n return;\r\n }\r\n const shouldInvokeDirs = shapeFlag & 1 \u002F* ELEMENT *\u002F && dirs;\r\n const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);\r\n let vnodeHook;\r\n if (shouldInvokeVnodeHook &&\r\n (vnodeHook = props && props.onVnodeBeforeUnmount)) {\r\n invokeVNodeHook(vnodeHook, parentComponent, vnode);\r\n }\r\n if (shapeFlag & 6 \u002F* COMPONENT *\u002F) {\r\n unmountComponent(vnode.component, parentSuspense, doRemove);\r\n }\r\n else {\r\n if (shapeFlag & 128 \u002F* SUSPENSE *\u002F) {\r\n vnode.suspense.unmount(parentSuspense, doRemove);\r\n return;\r\n }\r\n if (shouldInvokeDirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount');\r\n }\r\n if (shapeFlag & 64 \u002F* TELEPORT *\u002F) {\r\n vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove);\r\n }\r\n else if (dynamicChildren &&\r\n \u002F\u002F #1153: fast path should not be taken for non-stable (v-for) fragments\r\n (type !== Fragment ||\r\n (patchFlag \u003E 0 && patchFlag & 64 \u002F* STABLE_FRAGMENT *\u002F))) {\r\n \u002F\u002F fast path for block nodes: only need to unmount dynamic children.\r\n unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);\r\n }\r\n else if ((type === Fragment &&\r\n patchFlag &\r\n (128 \u002F* KEYED_FRAGMENT *\u002F | 256 \u002F* UNKEYED_FRAGMENT *\u002F)) ||\r\n (!optimized && shapeFlag & 16 \u002F* ARRAY_CHILDREN *\u002F)) {\r\n unmountChildren(children, parentComponent, parentSuspense);\r\n }\r\n if (doRemove) {\r\n remove(vnode);\r\n }\r\n }\r\n if ((shouldInvokeVnodeHook &&\r\n (vnodeHook = props && props.onVnodeUnmounted)) ||\r\n shouldInvokeDirs) {\r\n queuePostRenderEffect(() =\u003E {\r\n vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);\r\n shouldInvokeDirs &&\r\n invokeDirectiveHook(vnode, null, parentComponent, 'unmounted');\r\n }, parentSuspense);\r\n }\r\n };\r\n const remove = vnode =\u003E {\r\n const { type, el, anchor, transition } = vnode;\r\n if (type === Fragment) {\r\n removeFragment(el, anchor);\r\n return;\r\n }\r\n if (type === Static) {\r\n removeStaticNode(vnode);\r\n return;\r\n }\r\n const performRemove = () =\u003E {\r\n hostRemove(el);\r\n if (transition && !transition.persisted && transition.afterLeave) {\r\n transition.afterLeave();\r\n }\r\n };\r\n if (vnode.shapeFlag & 1 \u002F* ELEMENT *\u002F &&\r\n transition &&\r\n !transition.persisted) {\r\n const { leave, delayLeave } = transition;\r\n const performLeave = () =\u003E leave(el, performRemove);\r\n if (delayLeave) {\r\n delayLeave(vnode.el, performRemove, performLeave);\r\n }\r\n else {\r\n performLeave();\r\n }\r\n }\r\n else {\r\n performRemove();\r\n }\r\n };\r\n const removeFragment = (cur, end) =\u003E {\r\n \u002F\u002F For fragments, directly remove all contained DOM nodes.\r\n \u002F\u002F (fragment child nodes cannot have transition)\r\n let next;\r\n while (cur !== end) {\r\n next = hostNextSibling(cur);\r\n hostRemove(cur);\r\n cur = next;\r\n }\r\n hostRemove(end);\r\n };\r\n const unmountComponent = (instance, parentSuspense, doRemove) =\u003E {\r\n if (instance.type.__hmrId) {\r\n unregisterHMR(instance);\r\n }\r\n const { bum, scope, update, subTree, um } = instance;\r\n \u002F\u002F beforeUnmount hook\r\n if (bum) {\r\n invokeArrayFns(bum);\r\n }\r\n \u002F\u002F stop effects in component scope\r\n scope.stop();\r\n \u002F\u002F update may be null if a component is unmounted before its async\r\n \u002F\u002F setup has resolved.\r\n if (update) {\r\n \u002F\u002F so that scheduler will no longer invoke it\r\n update.active = false;\r\n unmount(subTree, instance, parentSuspense, doRemove);\r\n }\r\n \u002F\u002F unmounted hook\r\n if (um) {\r\n queuePostRenderEffect(um, parentSuspense);\r\n }\r\n queuePostRenderEffect(() =\u003E {\r\n instance.isUnmounted = true;\r\n }, parentSuspense);\r\n \u002F\u002F A component with async dep inside a pending suspense is unmounted before\r\n \u002F\u002F its async dep resolves. This should remove the dep from the suspense, and\r\n \u002F\u002F cause the suspense to resolve immediately if that was the last dep.\r\n if (parentSuspense &&\r\n parentSuspense.pendingBranch &&\r\n !parentSuspense.isUnmounted &&\r\n instance.asyncDep &&\r\n !instance.asyncResolved &&\r\n instance.suspenseId === parentSuspense.pendingId) {\r\n parentSuspense.deps--;\r\n if (parentSuspense.deps === 0) {\r\n parentSuspense.resolve();\r\n }\r\n }\r\n {\r\n devtoolsComponentRemoved(instance);\r\n }\r\n };\r\n const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) =\u003E {\r\n for (let i = start; i \u003C children.length; i++) {\r\n unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);\r\n }\r\n };\r\n const getNextHostNode = vnode =\u003E {\r\n if (vnode.shapeFlag & 6 \u002F* COMPONENT *\u002F) {\r\n return getNextHostNode(vnode.component.subTree);\r\n }\r\n if (vnode.shapeFlag & 128 \u002F* SUSPENSE *\u002F) {\r\n return vnode.suspense.next();\r\n }\r\n return hostNextSibling((vnode.anchor || vnode.el));\r\n };\r\n const render = (vnode, container, isSVG) =\u003E {\r\n if (vnode == null) {\r\n if (container._vnode) {\r\n unmount(container._vnode, null, null, true);\r\n }\r\n }\r\n else {\r\n patch(container._vnode || null, vnode, container, null, null, null, isSVG);\r\n }\r\n flushPostFlushCbs();\r\n container._vnode = vnode;\r\n };\r\n const internals = {\r\n p: patch,\r\n um: unmount,\r\n m: move,\r\n r: remove,\r\n mt: mountComponent,\r\n mc: mountChildren,\r\n pc: patchChildren,\r\n pbc: patchBlockChildren,\r\n n: getNextHostNode,\r\n o: options\r\n };\r\n let hydrate;\r\n let hydrateNode;\r\n if (createHydrationFns) {\r\n [hydrate, hydrateNode] = createHydrationFns(internals);\r\n }\r\n return {\r\n render,\r\n hydrate,\r\n createApp: createAppAPI(render, hydrate)\r\n };\r\n}\r\nfunction toggleRecurse({ effect, update }, allowed) {\r\n effect.allowRecurse = update.allowRecurse = allowed;\r\n}\r\n\u002F**\r\n * #1156\r\n * When a component is HMR-enabled, we need to make sure that all static nodes\r\n * inside a block also inherit the DOM element from the previous tree so that\r\n * HMR updates (which are full updates) can retrieve the element for patching.\r\n *\r\n * #2080\r\n * Inside keyed `template` fragment static children, if a fragment is moved,\r\n * the children will always be moved. Therefore, in order to ensure correct move\r\n * position, el should be inherited from previous nodes.\r\n *\u002F\r\nfunction traverseStaticChildren(n1, n2, shallow = false) {\r\n const ch1 = n1.children;\r\n const ch2 = n2.children;\r\n if (isArray(ch1) && isArray(ch2)) {\r\n for (let i = 0; i \u003C ch1.length; i++) {\r\n \u002F\u002F this is only called in the optimized path so array children are\r\n \u002F\u002F guaranteed to be vnodes\r\n const c1 = ch1[i];\r\n let c2 = ch2[i];\r\n if (c2.shapeFlag & 1 \u002F* ELEMENT *\u002F && !c2.dynamicChildren) {\r\n if (c2.patchFlag \u003C= 0 || c2.patchFlag === 32 \u002F* HYDRATE_EVENTS *\u002F) {\r\n c2 = ch2[i] = cloneIfMounted(ch2[i]);\r\n c2.el = c1.el;\r\n }\r\n if (!shallow)\r\n traverseStaticChildren(c1, c2);\r\n }\r\n \u002F\u002F also inherit for comment nodes, but not placeholders (e.g. v-if which\r\n \u002F\u002F would have received .el during block patch)\r\n if (c2.type === Comment && !c2.el) {\r\n c2.el = c1.el;\r\n }\r\n }\r\n }\r\n}\r\n\u002F\u002F https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FLongest_increasing_subsequence\r\nfunction getSequence(arr) {\r\n const p = arr.slice();\r\n const result = [0];\r\n let i, j, u, v, c;\r\n const len = arr.length;\r\n for (i = 0; i \u003C len; i++) {\r\n const arrI = arr[i];\r\n if (arrI !== 0) {\r\n j = result[result.length - 1];\r\n if (arr[j] \u003C arrI) {\r\n p[i] = j;\r\n result.push(i);\r\n continue;\r\n }\r\n u = 0;\r\n v = result.length - 1;\r\n while (u \u003C v) {\r\n c = (u + v) \u003E\u003E 1;\r\n if (arr[result[c]] \u003C arrI) {\r\n u = c + 1;\r\n }\r\n else {\r\n v = c;\r\n }\r\n }\r\n if (arrI \u003C arr[result[u]]) {\r\n if (u \u003E 0) {\r\n p[i] = result[u - 1];\r\n }\r\n result[u] = i;\r\n }\r\n }\r\n }\r\n u = result.length;\r\n v = result[u - 1];\r\n while (u-- \u003E 0) {\r\n result[u] = v;\r\n v = p[v];\r\n }\r\n return result;\r\n}\r\n\r\nconst isTeleport = (type) =\u003E type.__isTeleport;\r\nconst isTeleportDisabled = (props) =\u003E props && (props.disabled || props.disabled === '');\r\nconst isTargetSVG = (target) =\u003E typeof SVGElement !== 'undefined' && target instanceof SVGElement;\r\nconst resolveTarget = (props, select) =\u003E {\r\n const targetSelector = props && props.to;\r\n if (isString(targetSelector)) {\r\n if (!select) {\r\n warn$1(`Current renderer does not support string target for Teleports. ` +\r\n `(missing querySelector renderer option)`);\r\n return null;\r\n }\r\n else {\r\n const target = select(targetSelector);\r\n if (!target) {\r\n warn$1(`Failed to locate Teleport target with selector \"${targetSelector}\". ` +\r\n `Note the target element must exist before the component is mounted - ` +\r\n `i.e. the target cannot be rendered by the component itself, and ` +\r\n `ideally should be outside of the entire Vue component tree.`);\r\n }\r\n return target;\r\n }\r\n }\r\n else {\r\n if (!targetSelector && !isTeleportDisabled(props)) {\r\n warn$1(`Invalid Teleport target: ${targetSelector}`);\r\n }\r\n return targetSelector;\r\n }\r\n};\r\nconst TeleportImpl = {\r\n __isTeleport: true,\r\n process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {\r\n const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;\r\n const disabled = isTeleportDisabled(n2.props);\r\n let { shapeFlag, children, dynamicChildren } = n2;\r\n \u002F\u002F #3302\r\n \u002F\u002F HMR updated, force full diff\r\n if (isHmrUpdating) {\r\n optimized = false;\r\n dynamicChildren = null;\r\n }\r\n if (n1 == null) {\r\n \u002F\u002F insert anchors in the main view\r\n const placeholder = (n2.el = createComment('teleport start')\r\n );\r\n const mainAnchor = (n2.anchor = createComment('teleport end')\r\n );\r\n insert(placeholder, container, anchor);\r\n insert(mainAnchor, container, anchor);\r\n const target = (n2.target = resolveTarget(n2.props, querySelector));\r\n const targetAnchor = (n2.targetAnchor = createText(''));\r\n if (target) {\r\n insert(targetAnchor, target);\r\n \u002F\u002F #2652 we could be teleporting from a non-SVG tree into an SVG tree\r\n isSVG = isSVG || isTargetSVG(target);\r\n }\r\n else if (!disabled) {\r\n warn$1('Invalid Teleport target on mount:', target, `(${typeof target})`);\r\n }\r\n const mount = (container, anchor) =\u003E {\r\n \u002F\u002F Teleport *always* has Array children. This is enforced in both the\r\n \u002F\u002F compiler and vnode children normalization.\r\n if (shapeFlag & 16 \u002F* ARRAY_CHILDREN *\u002F) {\r\n mountChildren(children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n };\r\n if (disabled) {\r\n mount(container, mainAnchor);\r\n }\r\n else if (target) {\r\n mount(target, targetAnchor);\r\n }\r\n }\r\n else {\r\n \u002F\u002F update content\r\n n2.el = n1.el;\r\n const mainAnchor = (n2.anchor = n1.anchor);\r\n const target = (n2.target = n1.target);\r\n const targetAnchor = (n2.targetAnchor = n1.targetAnchor);\r\n const wasDisabled = isTeleportDisabled(n1.props);\r\n const currentContainer = wasDisabled ? container : target;\r\n const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;\r\n isSVG = isSVG || isTargetSVG(target);\r\n if (dynamicChildren) {\r\n \u002F\u002F fast path when the teleport happens to be a block root\r\n patchBlockChildren(n1.dynamicChildren, dynamicChildren, currentContainer, parentComponent, parentSuspense, isSVG, slotScopeIds);\r\n \u002F\u002F even in block tree mode we need to make sure all root-level nodes\r\n \u002F\u002F in the teleport inherit previous DOM references so that they can\r\n \u002F\u002F be moved in future patches.\r\n traverseStaticChildren(n1, n2, true);\r\n }\r\n else if (!optimized) {\r\n patchChildren(n1, n2, currentContainer, currentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, false);\r\n }\r\n if (disabled) {\r\n if (!wasDisabled) {\r\n \u002F\u002F enabled -\u003E disabled\r\n \u002F\u002F move into main container\r\n moveTeleport(n2, container, mainAnchor, internals, 1 \u002F* TOGGLE *\u002F);\r\n }\r\n }\r\n else {\r\n \u002F\u002F target changed\r\n if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {\r\n const nextTarget = (n2.target = resolveTarget(n2.props, querySelector));\r\n if (nextTarget) {\r\n moveTeleport(n2, nextTarget, null, internals, 0 \u002F* TARGET_CHANGE *\u002F);\r\n }\r\n else {\r\n warn$1('Invalid Teleport target on update:', target, `(${typeof target})`);\r\n }\r\n }\r\n else if (wasDisabled) {\r\n \u002F\u002F disabled -\u003E enabled\r\n \u002F\u002F move into teleport target\r\n moveTeleport(n2, target, targetAnchor, internals, 1 \u002F* TOGGLE *\u002F);\r\n }\r\n }\r\n }\r\n },\r\n remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {\r\n const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;\r\n if (target) {\r\n hostRemove(targetAnchor);\r\n }\r\n \u002F\u002F an unmounted teleport should always remove its children if not disabled\r\n if (doRemove || !isTeleportDisabled(props)) {\r\n hostRemove(anchor);\r\n if (shapeFlag & 16 \u002F* ARRAY_CHILDREN *\u002F) {\r\n for (let i = 0; i \u003C children.length; i++) {\r\n const child = children[i];\r\n unmount(child, parentComponent, parentSuspense, true, !!child.dynamicChildren);\r\n }\r\n }\r\n }\r\n },\r\n move: moveTeleport,\r\n hydrate: hydrateTeleport\r\n};\r\nfunction moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 \u002F* REORDER *\u002F) {\r\n \u002F\u002F move target anchor if this is a target change.\r\n if (moveType === 0 \u002F* TARGET_CHANGE *\u002F) {\r\n insert(vnode.targetAnchor, container, parentAnchor);\r\n }\r\n const { el, anchor, shapeFlag, children, props } = vnode;\r\n const isReorder = moveType === 2 \u002F* REORDER *\u002F;\r\n \u002F\u002F move main view anchor if this is a re-order.\r\n if (isReorder) {\r\n insert(el, container, parentAnchor);\r\n }\r\n \u002F\u002F if this is a re-order and teleport is enabled (content is in target)\r\n \u002F\u002F do not move children. So the opposite is: only move children if this\r\n \u002F\u002F is not a reorder, or the teleport is disabled\r\n if (!isReorder || isTeleportDisabled(props)) {\r\n \u002F\u002F Teleport has either Array children or no children.\r\n if (shapeFlag & 16 \u002F* ARRAY_CHILDREN *\u002F) {\r\n for (let i = 0; i \u003C children.length; i++) {\r\n move(children[i], container, parentAnchor, 2 \u002F* REORDER *\u002F);\r\n }\r\n }\r\n }\r\n \u002F\u002F move main view anchor if this is a re-order.\r\n if (isReorder) {\r\n insert(anchor, container, parentAnchor);\r\n }\r\n}\r\nfunction hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { o: { nextSibling, parentNode, querySelector } }, hydrateChildren) {\r\n const target = (vnode.target = resolveTarget(vnode.props, querySelector));\r\n if (target) {\r\n \u002F\u002F if multiple teleports rendered to the same target element, we need to\r\n \u002F\u002F pick up from where the last teleport finished instead of the first node\r\n const targetNode = target._lpa || target.firstChild;\r\n if (vnode.shapeFlag & 16 \u002F* ARRAY_CHILDREN *\u002F) {\r\n if (isTeleportDisabled(vnode.props)) {\r\n vnode.anchor = hydrateChildren(nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized);\r\n vnode.targetAnchor = targetNode;\r\n }\r\n else {\r\n vnode.anchor = nextSibling(node);\r\n vnode.targetAnchor = hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n }\r\n target._lpa =\r\n vnode.targetAnchor && nextSibling(vnode.targetAnchor);\r\n }\r\n }\r\n return vnode.anchor && nextSibling(vnode.anchor);\r\n}\r\n\u002F\u002F Force-casted public typing for h and TSX props inference\r\nconst Teleport = TeleportImpl;\r\n\r\nconst COMPONENTS = 'components';\r\nconst DIRECTIVES = 'directives';\r\n\u002F**\r\n * @private\r\n *\u002F\r\nfunction resolveComponent(name, maybeSelfReference) {\r\n return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;\r\n}\r\nconst NULL_DYNAMIC_COMPONENT = Symbol();\r\n\u002F**\r\n * @private\r\n *\u002F\r\nfunction resolveDynamicComponent(component) {\r\n if (isString(component)) {\r\n return resolveAsset(COMPONENTS, component, false) || component;\r\n }\r\n else {\r\n \u002F\u002F invalid types will fallthrough to createVNode and raise warning\r\n return (component || NULL_DYNAMIC_COMPONENT);\r\n }\r\n}\r\n\u002F**\r\n * @private\r\n *\u002F\r\nfunction resolveDirective(name) {\r\n return resolveAsset(DIRECTIVES, name);\r\n}\r\n\u002F\u002F implementation\r\nfunction resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {\r\n const instance = currentRenderingInstance || currentInstance;\r\n if (instance) {\r\n const Component = instance.type;\r\n \u002F\u002F explicit self name has highest priority\r\n if (type === COMPONENTS) {\r\n const selfName = getComponentName(Component);\r\n if (selfName &&\r\n (selfName === name ||\r\n selfName === camelize(name) ||\r\n selfName === capitalize(camelize(name)))) {\r\n return Component;\r\n }\r\n }\r\n const res = \r\n \u002F\u002F local registration\r\n \u002F\u002F check instance[type] first which is resolved for options API\r\n resolve(instance[type] || Component[type], name) ||\r\n \u002F\u002F global registration\r\n resolve(instance.appContext[type], name);\r\n if (!res && maybeSelfReference) {\r\n \u002F\u002F fallback to implicit self-reference\r\n return Component;\r\n }\r\n if (warnMissing && !res) {\r\n const extra = type === COMPONENTS\r\n ? `\\nIf this is a native custom element, make sure to exclude it from ` +\r\n `component resolution via compilerOptions.isCustomElement.`\r\n : ``;\r\n warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);\r\n }\r\n return res;\r\n }\r\n else {\r\n warn$1(`resolve${capitalize(type.slice(0, -1))} ` +\r\n `can only be used in render() or setup().`);\r\n }\r\n}\r\nfunction resolve(registry, name) {\r\n return (registry &&\r\n (registry[name] ||\r\n registry[camelize(name)] ||\r\n registry[capitalize(camelize(name))]));\r\n}\r\n\r\nconst Fragment = Symbol('Fragment' );\r\nconst Text = Symbol('Text' );\r\nconst Comment = Symbol('Comment' );\r\nconst Static = Symbol('Static' );\r\n\u002F\u002F Since v-if and v-for are the two possible ways node structure can dynamically\r\n\u002F\u002F change, once we consider v-if branches and each v-for fragment a block, we\r\n\u002F\u002F can divide a template into nested blocks, and within each block the node\r\n\u002F\u002F structure would be stable. This allows us to skip most children diffing\r\n\u002F\u002F and only worry about the dynamic nodes (indicated by patch flags).\r\nconst blockStack = [];\r\nlet currentBlock = null;\r\n\u002F**\r\n * Open a block.\r\n * This must be called before `createBlock`. It cannot be part of `createBlock`\r\n * because the children of the block are evaluated before `createBlock` itself\r\n * is called. The generated code typically looks like this:\r\n *\r\n * ```js\r\n * function render() {\r\n * return (openBlock(),createBlock('div', null, [...]))\r\n * }\r\n * ```\r\n * disableTracking is true when creating a v-for fragment block, since a v-for\r\n * fragment always diffs its children.\r\n *\r\n * @private\r\n *\u002F\r\nfunction openBlock(disableTracking = false) {\r\n blockStack.push((currentBlock = disableTracking ? null : []));\r\n}\r\nfunction closeBlock() {\r\n blockStack.pop();\r\n currentBlock = blockStack[blockStack.length - 1] || null;\r\n}\r\n\u002F\u002F Whether we should be tracking dynamic child nodes inside a block.\r\n\u002F\u002F Only tracks when this value is \u003E 0\r\n\u002F\u002F We are not using a simple boolean because this value may need to be\r\n\u002F\u002F incremented\u002Fdecremented by nested usage of v-once (see below)\r\nlet isBlockTreeEnabled = 1;\r\n\u002F**\r\n * Block tracking sometimes needs to be disabled, for example during the\r\n * creation of a tree that needs to be cached by v-once. The compiler generates\r\n * code like this:\r\n *\r\n * ``` js\r\n * _cache[1] || (\r\n * setBlockTracking(-1),\r\n * _cache[1] = createVNode(...),\r\n * setBlockTracking(1),\r\n * _cache[1]\r\n * )\r\n * ```\r\n *\r\n * @private\r\n *\u002F\r\nfunction setBlockTracking(value) {\r\n isBlockTreeEnabled += value;\r\n}\r\nfunction setupBlock(vnode) {\r\n \u002F\u002F save current block children on the block vnode\r\n vnode.dynamicChildren =\r\n isBlockTreeEnabled \u003E 0 ? currentBlock || EMPTY_ARR : null;\r\n \u002F\u002F close block\r\n closeBlock();\r\n \u002F\u002F a block is always going to be patched, so track it as a child of its\r\n \u002F\u002F parent block\r\n if (isBlockTreeEnabled \u003E 0 && currentBlock) {\r\n currentBlock.push(vnode);\r\n }\r\n return vnode;\r\n}\r\n\u002F**\r\n * @private\r\n *\u002F\r\nfunction createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {\r\n return setupBlock(createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, true \u002F* isBlock *\u002F));\r\n}\r\n\u002F**\r\n * Create a block root vnode. Takes the same exact arguments as `createVNode`.\r\n * A block root keeps track of dynamic nodes within the block in the\r\n * `dynamicChildren` array.\r\n *\r\n * @private\r\n *\u002F\r\nfunction createBlock(type, props, children, patchFlag, dynamicProps) {\r\n return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true \u002F* isBlock: prevent a block from tracking itself *\u002F));\r\n}\r\nfunction isVNode(value) {\r\n return value ? value.__v_isVNode === true : false;\r\n}\r\nfunction isSameVNodeType(n1, n2) {\r\n if (n2.shapeFlag & 6 \u002F* COMPONENT *\u002F &&\r\n hmrDirtyComponents.has(n2.type)) {\r\n \u002F\u002F HMR only: if the component has been hot-updated, force a reload.\r\n return false;\r\n }\r\n return n1.type === n2.type && n1.key === n2.key;\r\n}\r\nlet vnodeArgsTransformer;\r\n\u002F**\r\n * Internal API for registering an arguments transform for createVNode\r\n * used for creating stubs in the test-utils\r\n * It is *internal* but needs to be exposed for test-utils to pick up proper\r\n * typings\r\n *\u002F\r\nfunction transformVNodeArgs(transformer) {\r\n vnodeArgsTransformer = transformer;\r\n}\r\nconst createVNodeWithArgsTransform = (...args) =\u003E {\r\n return _createVNode(...(vnodeArgsTransformer\r\n ? vnodeArgsTransformer(args, currentRenderingInstance)\r\n : args));\r\n};\r\nconst InternalObjectKey = `__vInternal`;\r\nconst normalizeKey = ({ key }) =\u003E key != null ? key : null;\r\nconst normalizeRef = ({ ref, ref_key, ref_for }) =\u003E {\r\n return (ref != null\r\n ? isString(ref) || isRef(ref) || isFunction(ref)\r\n ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for }\r\n : ref\r\n : null);\r\n};\r\nfunction createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 \u002F* ELEMENT *\u002F, isBlockNode = false, needFullChildrenNormalization = false) {\r\n const vnode = {\r\n __v_isVNode: true,\r\n __v_skip: true,\r\n type,\r\n props,\r\n key: props && normalizeKey(props),\r\n ref: props && normalizeRef(props),\r\n scopeId: currentScopeId,\r\n slotScopeIds: null,\r\n children,\r\n component: null,\r\n suspense: null,\r\n ssContent: null,\r\n ssFallback: null,\r\n dirs: null,\r\n transition: null,\r\n el: null,\r\n anchor: null,\r\n target: null,\r\n targetAnchor: null,\r\n staticCount: 0,\r\n shapeFlag,\r\n patchFlag,\r\n dynamicProps,\r\n dynamicChildren: null,\r\n appContext: null\r\n };\r\n if (needFullChildrenNormalization) {\r\n normalizeChildren(vnode, children);\r\n \u002F\u002F normalize suspense children\r\n if (shapeFlag & 128 \u002F* SUSPENSE *\u002F) {\r\n type.normalize(vnode);\r\n }\r\n }\r\n else if (children) {\r\n \u002F\u002F compiled element vnode - if children is passed, only possible types are\r\n \u002F\u002F string or Array.\r\n vnode.shapeFlag |= isString(children)\r\n ? 8 \u002F* TEXT_CHILDREN *\u002F\r\n : 16 \u002F* ARRAY_CHILDREN *\u002F;\r\n }\r\n \u002F\u002F validate key\r\n if (vnode.key !== vnode.key) {\r\n warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);\r\n }\r\n \u002F\u002F track vnode for block tree\r\n if (isBlockTreeEnabled \u003E 0 &&\r\n \u002F\u002F avoid a block node from tracking itself\r\n !isBlockNode &&\r\n \u002F\u002F has current parent block\r\n currentBlock &&\r\n \u002F\u002F presence of a patch flag indicates this node needs patching on updates.\r\n \u002F\u002F component nodes also should always be patched, because even if the\r\n \u002F\u002F component doesn't need to update, it needs to persist the instance on to\r\n \u002F\u002F the next vnode so that it can be properly unmounted later.\r\n (vnode.patchFlag \u003E 0 || shapeFlag & 6 \u002F* COMPONENT *\u002F) &&\r\n \u002F\u002F the EVENTS flag is only for hydration and if it is the only flag, the\r\n \u002F\u002F vnode should not be considered dynamic due to handler caching.\r\n vnode.patchFlag !== 32 \u002F* HYDRATE_EVENTS *\u002F) {\r\n currentBlock.push(vnode);\r\n }\r\n return vnode;\r\n}\r\nconst createVNode = (createVNodeWithArgsTransform );\r\nfunction _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {\r\n if (!type || type === NULL_DYNAMIC_COMPONENT) {\r\n if (!type) {\r\n warn$1(`Invalid vnode type when creating vnode: ${type}.`);\r\n }\r\n type = Comment;\r\n }\r\n if (isVNode(type)) {\r\n \u002F\u002F createVNode receiving an existing vnode. This happens in cases like\r\n \u002F\u002F \u003Ccomponent :is=\"vnode\"\u002F\u003E\r\n \u002F\u002F #2078 make sure to merge refs during the clone instead of overwriting it\r\n const cloned = cloneVNode(type, props, true \u002F* mergeRef: true *\u002F);\r\n if (children) {\r\n normalizeChildren(cloned, children);\r\n }\r\n return cloned;\r\n }\r\n \u002F\u002F class component normalization.\r\n if (isClassComponent(type)) {\r\n type = type.__vccOpts;\r\n }\r\n \u002F\u002F class & style normalization.\r\n if (props) {\r\n \u002F\u002F for reactive or proxy objects, we need to clone it to enable mutation.\r\n props = guardReactiveProps(props);\r\n let { class: klass, style } = props;\r\n if (klass && !isString(klass)) {\r\n props.class = normalizeClass(klass);\r\n }\r\n if (isObject(style)) {\r\n \u002F\u002F reactive state objects need to be cloned since they are likely to be\r\n \u002F\u002F mutated\r\n if (isProxy(style) && !isArray(style)) {\r\n style = extend({}, style);\r\n }\r\n props.style = normalizeStyle(style);\r\n }\r\n }\r\n \u002F\u002F encode the vnode type information into a bitmap\r\n const shapeFlag = isString(type)\r\n ? 1 \u002F* ELEMENT *\u002F\r\n : isSuspense(type)\r\n ? 128 \u002F* SUSPENSE *\u002F\r\n : isTeleport(type)\r\n ? 64 \u002F* TELEPORT *\u002F\r\n : isObject(type)\r\n ? 4 \u002F* STATEFUL_COMPONENT *\u002F\r\n : isFunction(type)\r\n ? 2 \u002F* FUNCTIONAL_COMPONENT *\u002F\r\n : 0;\r\n if (shapeFlag & 4 \u002F* STATEFUL_COMPONENT *\u002F && isProxy(type)) {\r\n type = toRaw(type);\r\n warn$1(`Vue received a Component which was made a reactive object. This can ` +\r\n `lead to unnecessary performance overhead, and should be avoided by ` +\r\n `marking the component with \\`markRaw\\` or using \\`shallowRef\\` ` +\r\n `instead of \\`ref\\`.`, `\\nComponent that was made reactive: `, type);\r\n }\r\n return createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true);\r\n}\r\nfunction guardReactiveProps(props) {\r\n if (!props)\r\n return null;\r\n return isProxy(props) || InternalObjectKey in props\r\n ? extend({}, props)\r\n : props;\r\n}\r\nfunction cloneVNode(vnode, extraProps, mergeRef = false) {\r\n \u002F\u002F This is intentionally NOT using spread or extend to avoid the runtime\r\n \u002F\u002F key enumeration cost.\r\n const { props, ref, patchFlag, children } = vnode;\r\n const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;\r\n const cloned = {\r\n __v_isVNode: true,\r\n __v_skip: true,\r\n type: vnode.type,\r\n props: mergedProps,\r\n key: mergedProps && normalizeKey(mergedProps),\r\n ref: extraProps && extraProps.ref\r\n ? \u002F\u002F #2078 in the case of \u003Ccomponent :is=\"vnode\" ref=\"extra\"\u002F\u003E\r\n \u002F\u002F if the vnode itself already has a ref, cloneVNode will need to merge\r\n \u002F\u002F the refs so the single vnode can be set on multiple refs\r\n mergeRef && ref\r\n ? isArray(ref)\r\n ? ref.concat(normalizeRef(extraProps))\r\n : [ref, normalizeRef(extraProps)]\r\n : normalizeRef(extraProps)\r\n : ref,\r\n scopeId: vnode.scopeId,\r\n slotScopeIds: vnode.slotScopeIds,\r\n children: patchFlag === -1 \u002F* HOISTED *\u002F && isArray(children)\r\n ? children.map(deepCloneVNode)\r\n : children,\r\n target: vnode.target,\r\n targetAnchor: vnode.targetAnchor,\r\n staticCount: vnode.staticCount,\r\n shapeFlag: vnode.shapeFlag,\r\n \u002F\u002F if the vnode is cloned with extra props, we can no longer assume its\r\n \u002F\u002F existing patch flag to be reliable and need to add the FULL_PROPS flag.\r\n \u002F\u002F note: preserve flag for fragments since they use the flag for children\r\n \u002F\u002F fast paths only.\r\n patchFlag: extraProps && vnode.type !== Fragment\r\n ? patchFlag === -1 \u002F\u002F hoisted node\r\n ? 16 \u002F* FULL_PROPS *\u002F\r\n : patchFlag | 16 \u002F* FULL_PROPS *\u002F\r\n : patchFlag,\r\n dynamicProps: vnode.dynamicProps,\r\n dynamicChildren: vnode.dynamicChildren,\r\n appContext: vnode.appContext,\r\n dirs: vnode.dirs,\r\n transition: vnode.transition,\r\n \u002F\u002F These should technically only be non-null on mounted VNodes. However,\r\n \u002F\u002F they *should* be copied for kept-alive vnodes. So we just always copy\r\n \u002F\u002F them since them being non-null during a mount doesn't affect the logic as\r\n \u002F\u002F they will simply be overwritten.\r\n component: vnode.component,\r\n suspense: vnode.suspense,\r\n ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),\r\n ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),\r\n el: vnode.el,\r\n anchor: vnode.anchor\r\n };\r\n return cloned;\r\n}\r\n\u002F**\r\n * Dev only, for HMR of hoisted vnodes reused in v-for\r\n * https:\u002F\u002Fgithub.com\u002Fvitejs\u002Fvite\u002Fissues\u002F2022\r\n *\u002F\r\nfunction deepCloneVNode(vnode) {\r\n const cloned = cloneVNode(vnode);\r\n if (isArray(vnode.children)) {\r\n cloned.children = vnode.children.map(deepCloneVNode);\r\n }\r\n return cloned;\r\n}\r\n\u002F**\r\n * @private\r\n *\u002F\r\nfunction createTextVNode(text = ' ', flag = 0) {\r\n return createVNode(Text, null, text, flag);\r\n}\r\n\u002F**\r\n * @private\r\n *\u002F\r\nfunction createStaticVNode(content, numberOfNodes) {\r\n \u002F\u002F A static vnode can contain multiple stringified elements, and the number\r\n \u002F\u002F of elements is necessary for hydration.\r\n const vnode = createVNode(Static, null, content);\r\n vnode.staticCount = numberOfNodes;\r\n return vnode;\r\n}\r\n\u002F**\r\n * @private\r\n *\u002F\r\nfunction createCommentVNode(text = '', \r\n\u002F\u002F when used as the v-else branch, the comment node must be created as a\r\n\u002F\u002F block to ensure correct updates.\r\nasBlock = false) {\r\n return asBlock\r\n ? (openBlock(), createBlock(Comment, null, text))\r\n : createVNode(Comment, null, text);\r\n}\r\nfunction normalizeVNode(child) {\r\n if (child == null || typeof child === 'boolean') {\r\n \u002F\u002F empty placeholder\r\n return createVNode(Comment);\r\n }\r\n else if (isArray(child)) {\r\n \u002F\u002F fragment\r\n return createVNode(Fragment, null, \r\n \u002F\u002F #3666, avoid reference pollution when reusing vnode\r\n child.slice());\r\n }\r\n else if (typeof child === 'object') {\r\n \u002F\u002F already vnode, this should be the most common since compiled templates\r\n \u002F\u002F always produce all-vnode children arrays\r\n return cloneIfMounted(child);\r\n }\r\n else {\r\n \u002F\u002F strings and numbers\r\n return createVNode(Text, null, String(child));\r\n }\r\n}\r\n\u002F\u002F optimized normalization for template-compiled render fns\r\nfunction cloneIfMounted(child) {\r\n return child.el === null || child.memo ? child : cloneVNode(child);\r\n}\r\nfunction normalizeChildren(vnode, children) {\r\n let type = 0;\r\n const { shapeFlag } = vnode;\r\n if (children == null) {\r\n children = null;\r\n }\r\n else if (isArray(children)) {\r\n type = 16 \u002F* ARRAY_CHILDREN *\u002F;\r\n }\r\n else if (typeof children === 'object') {\r\n if (shapeFlag & (1 \u002F* ELEMENT *\u002F | 64 \u002F* TELEPORT *\u002F)) {\r\n \u002F\u002F Normalize slot to plain children for plain element and Teleport\r\n const slot = children.default;\r\n if (slot) {\r\n \u002F\u002F _c marker is added by withCtx() indicating this is a compiled slot\r\n slot._c && (slot._d = false);\r\n normalizeChildren(vnode, slot());\r\n slot._c && (slot._d = true);\r\n }\r\n return;\r\n }\r\n else {\r\n type = 32 \u002F* SLOTS_CHILDREN *\u002F;\r\n const slotFlag = children._;\r\n if (!slotFlag && !(InternalObjectKey in children)) {\r\n children._ctx = currentRenderingInstance;\r\n }\r\n else if (slotFlag === 3 \u002F* FORWARDED *\u002F && currentRenderingInstance) {\r\n \u002F\u002F a child component receives forwarded slots from the parent.\r\n \u002F\u002F its slot type is determined by its parent's slot type.\r\n if (currentRenderingInstance.slots._ === 1 \u002F* STABLE *\u002F) {\r\n children._ = 1 \u002F* STABLE *\u002F;\r\n }\r\n else {\r\n children._ = 2 \u002F* DYNAMIC *\u002F;\r\n vnode.patchFlag |= 1024 \u002F* DYNAMIC_SLOTS *\u002F;\r\n }\r\n }\r\n }\r\n }\r\n else if (isFunction(children)) {\r\n children = { default: children, _ctx: currentRenderingInstance };\r\n type = 32 \u002F* SLOTS_CHILDREN *\u002F;\r\n }\r\n else {\r\n children = String(children);\r\n \u002F\u002F force teleport children to array so it can be moved around\r\n if (shapeFlag & 64 \u002F* TELEPORT *\u002F) {\r\n type = 16 \u002F* ARRAY_CHILDREN *\u002F;\r\n children = [createTextVNode(children)];\r\n }\r\n else {\r\n type = 8 \u002F* TEXT_CHILDREN *\u002F;\r\n }\r\n }\r\n vnode.children = children;\r\n vnode.shapeFlag |= type;\r\n}\r\nfunction mergeProps(...args) {\r\n const ret = {};\r\n for (let i = 0; i \u003C args.length; i++) {\r\n const toMerge = args[i];\r\n for (const key in toMerge) {\r\n if (key === 'class') {\r\n if (ret.class !== toMerge.class) {\r\n ret.class = normalizeClass([ret.class, toMerge.class]);\r\n }\r\n }\r\n else if (key === 'style') {\r\n ret.style = normalizeStyle([ret.style, toMerge.style]);\r\n }\r\n else if (isOn(key)) {\r\n const existing = ret[key];\r\n const incoming = toMerge[key];\r\n if (incoming &&\r\n existing !== incoming &&\r\n !(isArray(existing) && existing.includes(incoming))) {\r\n ret[key] = existing\r\n ? [].concat(existing, incoming)\r\n : incoming;\r\n }\r\n }\r\n else if (key !== '') {\r\n ret[key] = toMerge[key];\r\n }\r\n }\r\n }\r\n return ret;\r\n}\r\nfunction invokeVNodeHook(hook, instance, vnode, prevVNode = null) {\r\n callWithAsyncErrorHandling(hook, instance, 7 \u002F* VNODE_HOOK *\u002F, [\r\n vnode,\r\n prevVNode\r\n ]);\r\n}\r\n\r\n\u002F**\r\n * Actual implementation\r\n *\u002F\r\nfunction renderList(source, renderItem, cache, index) {\r\n let ret;\r\n const cached = (cache && cache[index]);\r\n if (isArray(source) || isString(source)) {\r\n ret = new Array(source.length);\r\n for (let i = 0, l = source.length; i \u003C l; i++) {\r\n ret[i] = renderItem(source[i], i, undefined, cached && cached[i]);\r\n }\r\n }\r\n else if (typeof source === 'number') {\r\n if (!Number.isInteger(source)) {\r\n warn$1(`The v-for range expect an integer value but got ${source}.`);\r\n return [];\r\n }\r\n ret = new Array(source);\r\n for (let i = 0; i \u003C source; i++) {\r\n ret[i] = renderItem(i + 1, i, undefined, cached && cached[i]);\r\n }\r\n }\r\n else if (isObject(source)) {\r\n if (source[Symbol.iterator]) {\r\n ret = Array.from(source, (item, i) =\u003E renderItem(item, i, undefined, cached && cached[i]));\r\n }\r\n else {\r\n const keys = Object.keys(source);\r\n ret = new Array(keys.length);\r\n for (let i = 0, l = keys.length; i \u003C l; i++) {\r\n const key = keys[i];\r\n ret[i] = renderItem(source[key], key, i, cached && cached[i]);\r\n }\r\n }\r\n }\r\n else {\r\n ret = [];\r\n }\r\n if (cache) {\r\n cache[index] = ret;\r\n }\r\n return ret;\r\n}\r\n\r\n\u002F**\r\n * Compiler runtime helper for creating dynamic slots object\r\n * @private\r\n *\u002F\r\nfunction createSlots(slots, dynamicSlots) {\r\n for (let i = 0; i \u003C dynamicSlots.length; i++) {\r\n const slot = dynamicSlots[i];\r\n \u002F\u002F array of dynamic slot generated by \u003Ctemplate v-for=\"...\" #[...]\u003E\r\n if (isArray(slot)) {\r\n for (let j = 0; j \u003C slot.length; j++) {\r\n slots[slot[j].name] = slot[j].fn;\r\n }\r\n }\r\n else if (slot) {\r\n \u002F\u002F conditional single slot generated by \u003Ctemplate v-if=\"...\" #foo\u003E\r\n slots[slot.name] = slot.fn;\r\n }\r\n }\r\n return slots;\r\n}\r\n\r\n\u002F**\r\n * Compiler runtime helper for rendering `\u003Cslot\u002F\u003E`\r\n * @private\r\n *\u002F\r\nfunction renderSlot(slots, name, props = {}, \r\n\u002F\u002F this is not a user-facing function, so the fallback is always generated by\r\n\u002F\u002F the compiler and guaranteed to be a function returning an array\r\nfallback, noSlotted) {\r\n if (currentRenderingInstance.isCE) {\r\n return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback());\r\n }\r\n let slot = slots[name];\r\n if (slot && slot.length \u003E 1) {\r\n warn$1(`SSR-optimized slot function detected in a non-SSR-optimized render ` +\r\n `function. You need to mark this component with $dynamic-slots in the ` +\r\n `parent template.`);\r\n slot = () =\u003E [];\r\n }\r\n \u002F\u002F a compiled slot disables block tracking by default to avoid manual\r\n \u002F\u002F invocation interfering with template-based block tracking, but in\r\n \u002F\u002F `renderSlot` we can be sure that it's template-based so we can force\r\n \u002F\u002F enable it.\r\n if (slot && slot._c) {\r\n slot._d = false;\r\n }\r\n openBlock();\r\n const validSlotContent = slot && ensureValidVNode(slot(props));\r\n const rendered = createBlock(Fragment, { key: props.key || `_${name}` }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 \u002F* STABLE *\u002F\r\n ? 64 \u002F* STABLE_FRAGMENT *\u002F\r\n : -2 \u002F* BAIL *\u002F);\r\n if (!noSlotted && rendered.scopeId) {\r\n rendered.slotScopeIds = [rendered.scopeId + '-s'];\r\n }\r\n if (slot && slot._c) {\r\n slot._d = true;\r\n }\r\n return rendered;\r\n}\r\nfunction ensureValidVNode(vnodes) {\r\n return vnodes.some(child =\u003E {\r\n if (!isVNode(child))\r\n return true;\r\n if (child.type === Comment)\r\n return false;\r\n if (child.type === Fragment &&\r\n !ensureValidVNode(child.children))\r\n return false;\r\n return true;\r\n })\r\n ? vnodes\r\n : null;\r\n}\r\n\r\n\u002F**\r\n * For prefixing keys in v-on=\"obj\" with \"on\"\r\n * @private\r\n *\u002F\r\nfunction toHandlers(obj) {\r\n const ret = {};\r\n if (!isObject(obj)) {\r\n warn$1(`v-on with no argument expects an object value.`);\r\n return ret;\r\n }\r\n for (const key in obj) {\r\n ret[toHandlerKey(key)] = obj[key];\r\n }\r\n return ret;\r\n}\r\n\r\n\u002F**\r\n * #2437 In Vue 3, functional components do not have a public instance proxy but\r\n * they exist in the internal parent chain. For code that relies on traversing\r\n * public $parent chains, skip functional ones and go to the parent instead.\r\n *\u002F\r\nconst getPublicInstance = (i) =\u003E {\r\n if (!i)\r\n return null;\r\n if (isStatefulComponent(i))\r\n return getExposeProxy(i) || i.proxy;\r\n return getPublicInstance(i.parent);\r\n};\r\nconst publicPropertiesMap = extend(Object.create(null), {\r\n $: i =\u003E i,\r\n $el: i =\u003E i.vnode.el,\r\n $data: i =\u003E i.data,\r\n $props: i =\u003E (shallowReadonly(i.props) ),\r\n $attrs: i =\u003E (shallowReadonly(i.attrs) ),\r\n $slots: i =\u003E (shallowReadonly(i.slots) ),\r\n $refs: i =\u003E (shallowReadonly(i.refs) ),\r\n $parent: i =\u003E getPublicInstance(i.parent),\r\n $root: i =\u003E getPublicInstance(i.root),\r\n $emit: i =\u003E i.emit,\r\n $options: i =\u003E (resolveMergedOptions(i) ),\r\n $forceUpdate: i =\u003E () =\u003E queueJob(i.update),\r\n $nextTick: i =\u003E nextTick.bind(i.proxy),\r\n $watch: i =\u003E (instanceWatch.bind(i) )\r\n});\r\nconst PublicInstanceProxyHandlers = {\r\n get({ _: instance }, key) {\r\n const { ctx, setupState, data, props, accessCache, type, appContext } = instance;\r\n \u002F\u002F for internal formatters to know that this is a Vue instance\r\n if (key === '__isVue') {\r\n return true;\r\n }\r\n \u002F\u002F prioritize \u003Cscript setup\u003E bindings during dev.\r\n \u002F\u002F this allows even properties that start with _ or $ to be used - so that\r\n \u002F\u002F it aligns with the production behavior where the render fn is inlined and\r\n \u002F\u002F indeed has access to all declared variables.\r\n if (setupState !== EMPTY_OBJ &&\r\n setupState.__isScriptSetup &&\r\n hasOwn(setupState, key)) {\r\n return setupState[key];\r\n }\r\n \u002F\u002F data \u002F props \u002F ctx\r\n \u002F\u002F This getter gets called for every property access on the render context\r\n \u002F\u002F during render and is a major hotspot. The most expensive part of this\r\n \u002F\u002F is the multiple hasOwn() calls. It's much faster to do a simple property\r\n \u002F\u002F access on a plain object, so we use an accessCache object (with null\r\n \u002F\u002F prototype) to memoize what access type a key corresponds to.\r\n let normalizedProps;\r\n if (key[0] !== '
) {\r\n const n = accessCache[key];\r\n if (n !== undefined) {\r\n switch (n) {\r\n case 1 \u002F* SETUP *\u002F:\r\n return setupState[key];\r\n case 2 \u002F* DATA *\u002F:\r\n return data[key];\r\n case 4 \u002F* CONTEXT *\u002F:\r\n return ctx[key];\r\n case 3 \u002F* PROPS *\u002F:\r\n return props[key];\r\n \u002F\u002F default: just fallthrough\r\n }\r\n }\r\n else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {\r\n accessCache[key] = 1 \u002F* SETUP *\u002F;\r\n return setupState[key];\r\n }\r\n else if (data !== EMPTY_OBJ && hasOwn(data, key)) {\r\n accessCache[key] = 2 \u002F* DATA *\u002F;\r\n return data[key];\r\n }\r\n else if (\r\n \u002F\u002F only cache other properties when instance has declared (thus stable)\r\n \u002F\u002F props\r\n (normalizedProps = instance.propsOptions[0]) &&\r\n hasOwn(normalizedProps, key)) {\r\n accessCache[key] = 3 \u002F* PROPS *\u002F;\r\n return props[key];\r\n }\r\n else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\r\n accessCache[key] = 4 \u002F* CONTEXT *\u002F;\r\n return ctx[key];\r\n }\r\n else if (shouldCacheAccess) {\r\n accessCache[key] = 0 \u002F* OTHER *\u002F;\r\n }\r\n }\r\n const publicGetter = publicPropertiesMap[key];\r\n let cssModule, globalProperties;\r\n \u002F\u002F public $xxx properties\r\n if (publicGetter) {\r\n if (key === '$attrs') {\r\n track(instance, \"get\" \u002F* GET *\u002F, key);\r\n markAttrsAccessed();\r\n }\r\n return publicGetter(instance);\r\n }\r\n else if (\r\n \u002F\u002F css module (injected by vue-loader)\r\n (cssModule = type.__cssModules) &&\r\n (cssModule = cssModule[key])) {\r\n return cssModule;\r\n }\r\n else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\r\n \u002F\u002F user may set custom properties to `this` that start with `hello-vue-module - CodeSandbox\r\n accessCache[key] = 4 \u002F* CONTEXT *\u002F;\r\n return ctx[key];\r\n }\r\n else if (\r\n \u002F\u002F global properties\r\n ((globalProperties = appContext.config.globalProperties),\r\n hasOwn(globalProperties, key))) {\r\n {\r\n return globalProperties[key];\r\n }\r\n }\r\n else if (currentRenderingInstance &&\r\n (!isString(key) ||\r\n \u002F\u002F #1091 avoid internal isRef\u002FisVNode checks on component instance leading\r\n \u002F\u002F to infinite warning loop\r\n key.indexOf('__v') !== 0)) {\r\n if (data !== EMPTY_OBJ &&\r\n (key[0] === '
|| key[0] === '_') &&\r\n hasOwn(data, key)) {\r\n warn$1(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +\r\n `character (\"$\" or \"_\") and is not proxied on the render context.`);\r\n }\r\n else if (instance === currentRenderingInstance) {\r\n warn$1(`Property ${JSON.stringify(key)} was accessed during render ` +\r\n `but is not defined on instance.`);\r\n }\r\n }\r\n },\r\n set({ _: instance }, key, value) {\r\n const { data, setupState, ctx } = instance;\r\n if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {\r\n setupState[key] = value;\r\n return true;\r\n }\r\n else if (data !== EMPTY_OBJ && hasOwn(data, key)) {\r\n data[key] = value;\r\n return true;\r\n }\r\n else if (hasOwn(instance.props, key)) {\r\n warn$1(`Attempting to mutate prop \"${key}\". Props are readonly.`, instance);\r\n return false;\r\n }\r\n if (key[0] === '
&& key.slice(1) in instance) {\r\n warn$1(`Attempting to mutate public property \"${key}\". ` +\r\n `Properties starting with $ are reserved and readonly.`, instance);\r\n return false;\r\n }\r\n else {\r\n if (key in instance.appContext.config.globalProperties) {\r\n Object.defineProperty(ctx, key, {\r\n enumerable: true,\r\n configurable: true,\r\n value\r\n });\r\n }\r\n else {\r\n ctx[key] = value;\r\n }\r\n }\r\n return true;\r\n },\r\n has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {\r\n let normalizedProps;\r\n return (!!accessCache[key] ||\r\n (data !== EMPTY_OBJ && hasOwn(data, key)) ||\r\n (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||\r\n ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||\r\n hasOwn(ctx, key) ||\r\n hasOwn(publicPropertiesMap, key) ||\r\n hasOwn(appContext.config.globalProperties, key));\r\n },\r\n defineProperty(target, key, descriptor) {\r\n if (descriptor.get != null) {\r\n this.set(target, key, descriptor.get(), null);\r\n }\r\n else if (descriptor.value != null) {\r\n this.set(target, key, descriptor.value, null);\r\n }\r\n return Reflect.defineProperty(target, key, descriptor);\r\n }\r\n};\r\n{\r\n PublicInstanceProxyHandlers.ownKeys = (target) =\u003E {\r\n warn$1(`Avoid app logic that relies on enumerating keys on a component instance. ` +\r\n `The keys will be empty in production mode to avoid performance overhead.`);\r\n return Reflect.ownKeys(target);\r\n };\r\n}\r\nconst RuntimeCompiledPublicInstanceProxyHandlers = \u002F*#__PURE__*\u002F extend({}, PublicInstanceProxyHandlers, {\r\n get(target, key) {\r\n \u002F\u002F fast path for unscopables when using `with` block\r\n if (key === Symbol.unscopables) {\r\n return;\r\n }\r\n return PublicInstanceProxyHandlers.get(target, key, target);\r\n },\r\n has(_, key) {\r\n const has = key[0] !== '_' && !isGloballyWhitelisted(key);\r\n if (!has && PublicInstanceProxyHandlers.has(_, key)) {\r\n warn$1(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);\r\n }\r\n return has;\r\n }\r\n});\r\n\u002F\u002F dev only\r\n\u002F\u002F In dev mode, the proxy target exposes the same properties as seen on `this`\r\n\u002F\u002F for easier console inspection. In prod mode it will be an empty object so\r\n\u002F\u002F these properties definitions can be skipped.\r\nfunction createDevRenderContext(instance) {\r\n const target = {};\r\n \u002F\u002F expose internal instance for proxy handlers\r\n Object.defineProperty(target, `_`, {\r\n configurable: true,\r\n enumerable: false,\r\n get: () =\u003E instance\r\n });\r\n \u002F\u002F expose public properties\r\n Object.keys(publicPropertiesMap).forEach(key =\u003E {\r\n Object.defineProperty(target, key, {\r\n configurable: true,\r\n enumerable: false,\r\n get: () =\u003E publicPropertiesMap[key](instance),\r\n \u002F\u002F intercepted by the proxy so no need for implementation,\r\n \u002F\u002F but needed to prevent set errors\r\n set: NOOP\r\n });\r\n });\r\n return target;\r\n}\r\n\u002F\u002F dev only\r\nfunction exposePropsOnRenderContext(instance) {\r\n const { ctx, propsOptions: [propsOptions] } = instance;\r\n if (propsOptions) {\r\n Object.keys(propsOptions).forEach(key =\u003E {\r\n Object.defineProperty(ctx, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: () =\u003E instance.props[key],\r\n set: NOOP\r\n });\r\n });\r\n }\r\n}\r\n\u002F\u002F dev only\r\nfunction exposeSetupStateOnRenderContext(instance) {\r\n const { ctx, setupState } = instance;\r\n Object.keys(toRaw(setupState)).forEach(key =\u003E {\r\n if (!setupState.__isScriptSetup) {\r\n if (key[0] === '
|| key[0] === '_') {\r\n warn$1(`setup() return property ${JSON.stringify(key)} should not start with \"$\" or \"_\" ` +\r\n `which are reserved prefixes for Vue internals.`);\r\n return;\r\n }\r\n Object.defineProperty(ctx, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: () =\u003E setupState[key],\r\n set: NOOP\r\n });\r\n }\r\n });\r\n}\r\n\r\nconst emptyAppContext = createAppContext();\r\nlet uid$1 = 0;\r\nfunction createComponentInstance(vnode, parent, suspense) {\r\n const type = vnode.type;\r\n \u002F\u002F inherit parent app context - or - if root, adopt from root vnode\r\n const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;\r\n const instance = {\r\n uid: uid$1++,\r\n vnode,\r\n type,\r\n parent,\r\n appContext,\r\n root: null,\r\n next: null,\r\n subTree: null,\r\n effect: null,\r\n update: null,\r\n scope: new EffectScope(true \u002F* detached *\u002F),\r\n render: null,\r\n proxy: null,\r\n exposed: null,\r\n exposeProxy: null,\r\n withProxy: null,\r\n provides: parent ? parent.provides : Object.create(appContext.provides),\r\n accessCache: null,\r\n renderCache: [],\r\n \u002F\u002F local resovled assets\r\n components: null,\r\n directives: null,\r\n \u002F\u002F resolved props and emits options\r\n propsOptions: normalizePropsOptions(type, appContext),\r\n emitsOptions: normalizeEmitsOptions(type, appContext),\r\n \u002F\u002F emit\r\n emit: null,\r\n emitted: null,\r\n \u002F\u002F props default value\r\n propsDefaults: EMPTY_OBJ,\r\n \u002F\u002F inheritAttrs\r\n inheritAttrs: type.inheritAttrs,\r\n \u002F\u002F state\r\n ctx: EMPTY_OBJ,\r\n data: EMPTY_OBJ,\r\n props: EMPTY_OBJ,\r\n attrs: EMPTY_OBJ,\r\n slots: EMPTY_OBJ,\r\n refs: EMPTY_OBJ,\r\n setupState: EMPTY_OBJ,\r\n setupContext: null,\r\n \u002F\u002F suspense related\r\n suspense,\r\n suspenseId: suspense ? suspense.pendingId : 0,\r\n asyncDep: null,\r\n asyncResolved: false,\r\n \u002F\u002F lifecycle hooks\r\n \u002F\u002F not using enums here because it results in computed properties\r\n isMounted: false,\r\n isUnmounted: false,\r\n isDeactivated: false,\r\n bc: null,\r\n c: null,\r\n bm: null,\r\n m: null,\r\n bu: null,\r\n u: null,\r\n um: null,\r\n bum: null,\r\n da: null,\r\n a: null,\r\n rtg: null,\r\n rtc: null,\r\n ec: null,\r\n sp: null\r\n };\r\n {\r\n instance.ctx = createDevRenderContext(instance);\r\n }\r\n instance.root = parent ? parent.root : instance;\r\n instance.emit = emit$1.bind(null, instance);\r\n \u002F\u002F apply custom element special handling\r\n if (vnode.ce) {\r\n vnode.ce(instance);\r\n }\r\n return instance;\r\n}\r\nlet currentInstance = null;\r\nconst getCurrentInstance = () =\u003E currentInstance || currentRenderingInstance;\r\nconst setCurrentInstance = (instance) =\u003E {\r\n currentInstance = instance;\r\n instance.scope.on();\r\n};\r\nconst unsetCurrentInstance = () =\u003E {\r\n currentInstance && currentInstance.scope.off();\r\n currentInstance = null;\r\n};\r\nconst isBuiltInTag = \u002F*#__PURE__*\u002F makeMap('slot,component');\r\nfunction validateComponentName(name, config) {\r\n const appIsNativeTag = config.isNativeTag || NO;\r\n if (isBuiltInTag(name) || appIsNativeTag(name)) {\r\n warn$1('Do not use built-in or reserved HTML elements as component id: ' + name);\r\n }\r\n}\r\nfunction isStatefulComponent(instance) {\r\n return instance.vnode.shapeFlag & 4 \u002F* STATEFUL_COMPONENT *\u002F;\r\n}\r\nlet isInSSRComponentSetup = false;\r\nfunction setupComponent(instance, isSSR = false) {\r\n isInSSRComponentSetup = isSSR;\r\n const { props, children } = instance.vnode;\r\n const isStateful = isStatefulComponent(instance);\r\n initProps(instance, props, isStateful, isSSR);\r\n initSlots(instance, children);\r\n const setupResult = isStateful\r\n ? setupStatefulComponent(instance, isSSR)\r\n : undefined;\r\n isInSSRComponentSetup = false;\r\n return setupResult;\r\n}\r\nfunction setupStatefulComponent(instance, isSSR) {\r\n const Component = instance.type;\r\n {\r\n if (Component.name) {\r\n validateComponentName(Component.name, instance.appContext.config);\r\n }\r\n if (Component.components) {\r\n const names = Object.keys(Component.components);\r\n for (let i = 0; i \u003C names.length; i++) {\r\n validateComponentName(names[i], instance.appContext.config);\r\n }\r\n }\r\n if (Component.directives) {\r\n const names = Object.keys(Component.directives);\r\n for (let i = 0; i \u003C names.length; i++) {\r\n validateDirectiveName(names[i]);\r\n }\r\n }\r\n if (Component.compilerOptions && isRuntimeOnly()) {\r\n warn$1(`\"compilerOptions\" is only supported when using a build of Vue that ` +\r\n `includes the runtime compiler. Since you are using a runtime-only ` +\r\n `build, the options should be passed via your build tool config instead.`);\r\n }\r\n }\r\n \u002F\u002F 0. create render proxy property access cache\r\n instance.accessCache = Object.create(null);\r\n \u002F\u002F 1. create public instance \u002F render proxy\r\n \u002F\u002F also mark it raw so it's never observed\r\n instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));\r\n {\r\n exposePropsOnRenderContext(instance);\r\n }\r\n \u002F\u002F 2. call setup()\r\n const { setup } = Component;\r\n if (setup) {\r\n const setupContext = (instance.setupContext =\r\n setup.length \u003E 1 ? createSetupContext(instance) : null);\r\n setCurrentInstance(instance);\r\n pauseTracking();\r\n const setupResult = callWithErrorHandling(setup, instance, 0 \u002F* SETUP_FUNCTION *\u002F, [shallowReadonly(instance.props) , setupContext]);\r\n resetTracking();\r\n unsetCurrentInstance();\r\n if (isPromise(setupResult)) {\r\n setupResult.then(unsetCurrentInstance, unsetCurrentInstance);\r\n if (isSSR) {\r\n \u002F\u002F return the promise so server-renderer can wait on it\r\n return setupResult\r\n .then((resolvedResult) =\u003E {\r\n handleSetupResult(instance, resolvedResult, isSSR);\r\n })\r\n .catch(e =\u003E {\r\n handleError(e, instance, 0 \u002F* SETUP_FUNCTION *\u002F);\r\n });\r\n }\r\n else {\r\n \u002F\u002F async setup returned Promise.\r\n \u002F\u002F bail here and wait for re-entry.\r\n instance.asyncDep = setupResult;\r\n }\r\n }\r\n else {\r\n handleSetupResult(instance, setupResult, isSSR);\r\n }\r\n }\r\n else {\r\n finishComponentSetup(instance, isSSR);\r\n }\r\n}\r\nfunction handleSetupResult(instance, setupResult, isSSR) {\r\n if (isFunction(setupResult)) {\r\n \u002F\u002F setup returned an inline render function\r\n {\r\n instance.render = setupResult;\r\n }\r\n }\r\n else if (isObject(setupResult)) {\r\n if (isVNode(setupResult)) {\r\n warn$1(`setup() should not return VNodes directly - ` +\r\n `return a render function instead.`);\r\n }\r\n \u002F\u002F setup returned bindings.\r\n \u002F\u002F assuming a render function compiled from template is present.\r\n {\r\n instance.devtoolsRawSetupState = setupResult;\r\n }\r\n instance.setupState = proxyRefs(setupResult);\r\n {\r\n exposeSetupStateOnRenderContext(instance);\r\n }\r\n }\r\n else if (setupResult !== undefined) {\r\n warn$1(`setup() should return an object. Received: ${setupResult === null ? 'null' : typeof setupResult}`);\r\n }\r\n finishComponentSetup(instance, isSSR);\r\n}\r\nlet compile;\r\nlet installWithProxy;\r\n\u002F**\r\n * For runtime-dom to register the compiler.\r\n * Note the exported method uses any to avoid d.ts relying on the compiler types.\r\n *\u002F\r\nfunction registerRuntimeCompiler(_compile) {\r\n compile = _compile;\r\n installWithProxy = i =\u003E {\r\n if (i.render._rc) {\r\n i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);\r\n }\r\n };\r\n}\r\n\u002F\u002F dev only\r\nconst isRuntimeOnly = () =\u003E !compile;\r\nfunction finishComponentSetup(instance, isSSR, skipOptions) {\r\n const Component = instance.type;\r\n \u002F\u002F template \u002F render function normalization\r\n \u002F\u002F could be already set when returned from setup()\r\n if (!instance.render) {\r\n \u002F\u002F only do on-the-fly compile if not in SSR - SSR on-the-fly compilation\r\n \u002F\u002F is done by server-renderer\r\n if (!isSSR && compile && !Component.render) {\r\n const template = Component.template;\r\n if (template) {\r\n {\r\n startMeasure(instance, `compile`);\r\n }\r\n const { isCustomElement, compilerOptions } = instance.appContext.config;\r\n const { delimiters, compilerOptions: componentCompilerOptions } = Component;\r\n const finalCompilerOptions = extend(extend({\r\n isCustomElement,\r\n delimiters\r\n }, compilerOptions), componentCompilerOptions);\r\n Component.render = compile(template, finalCompilerOptions);\r\n {\r\n endMeasure(instance, `compile`);\r\n }\r\n }\r\n }\r\n instance.render = (Component.render || NOOP);\r\n \u002F\u002F for runtime-compiled render functions using `with` blocks, the render\r\n \u002F\u002F proxy used needs a different `has` handler which is more performant and\r\n \u002F\u002F also only allows a whitelist of globals to fallthrough.\r\n if (installWithProxy) {\r\n installWithProxy(instance);\r\n }\r\n }\r\n \u002F\u002F support for 2.x options\r\n {\r\n setCurrentInstance(instance);\r\n pauseTracking();\r\n applyOptions(instance);\r\n resetTracking();\r\n unsetCurrentInstance();\r\n }\r\n \u002F\u002F warn missing template\u002Frender\r\n \u002F\u002F the runtime compilation of template in SSR is done by server-render\r\n if (!Component.render && instance.render === NOOP && !isSSR) {\r\n \u002F* istanbul ignore if *\u002F\r\n if (!compile && Component.template) {\r\n warn$1(`Component provided template option but ` +\r\n `runtime compilation is not supported in this build of Vue.` +\r\n (` Use \"vue.esm-browser.js\" instead.`\r\n ) \u002F* should not happen *\u002F);\r\n }\r\n else {\r\n warn$1(`Component is missing template or render function.`);\r\n }\r\n }\r\n}\r\nfunction createAttrsProxy(instance) {\r\n return new Proxy(instance.attrs, {\r\n get(target, key) {\r\n markAttrsAccessed();\r\n track(instance, \"get\" \u002F* GET *\u002F, '$attrs');\r\n return target[key];\r\n },\r\n set() {\r\n warn$1(`setupContext.attrs is readonly.`);\r\n return false;\r\n },\r\n deleteProperty() {\r\n warn$1(`setupContext.attrs is readonly.`);\r\n return false;\r\n }\r\n }\r\n );\r\n}\r\nfunction createSetupContext(instance) {\r\n const expose = exposed =\u003E {\r\n if (instance.exposed) {\r\n warn$1(`expose() should be called only once per setup().`);\r\n }\r\n instance.exposed = exposed || {};\r\n };\r\n let attrs;\r\n {\r\n \u002F\u002F We use getters in dev in case libs like test-utils overwrite instance\r\n \u002F\u002F properties (overwrites should not be done in prod)\r\n return Object.freeze({\r\n get attrs() {\r\n return attrs || (attrs = createAttrsProxy(instance));\r\n },\r\n get slots() {\r\n return shallowReadonly(instance.slots);\r\n },\r\n get emit() {\r\n return (event, ...args) =\u003E instance.emit(event, ...args);\r\n },\r\n expose\r\n });\r\n }\r\n}\r\nfunction getExposeProxy(instance) {\r\n if (instance.exposed) {\r\n return (instance.exposeProxy ||\r\n (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {\r\n get(target, key) {\r\n if (key in target) {\r\n return target[key];\r\n }\r\n else if (key in publicPropertiesMap) {\r\n return publicPropertiesMap[key](instance);\r\n }\r\n }\r\n })));\r\n }\r\n}\r\nconst classifyRE = \u002F(?:^|[-_])(\\w)\u002Fg;\r\nconst classify = (str) =\u003E str.replace(classifyRE, c =\u003E c.toUpperCase()).replace(\u002F[-_]\u002Fg, '');\r\nfunction getComponentName(Component) {\r\n return isFunction(Component)\r\n ? Component.displayName || Component.name\r\n : Component.name;\r\n}\r\n\u002F* istanbul ignore next *\u002F\r\nfunction formatComponentName(instance, Component, isRoot = false) {\r\n let name = getComponentName(Component);\r\n if (!name && Component.__file) {\r\n const match = Component.__file.match(\u002F([^\u002F\\\\]+)\\.\\w+$\u002F);\r\n if (match) {\r\n name = match[1];\r\n }\r\n }\r\n if (!name && instance && instance.parent) {\r\n \u002F\u002F try to infer the name based on reverse resolution\r\n const inferFromRegistry = (registry) =\u003E {\r\n for (const key in registry) {\r\n if (registry[key] === Component) {\r\n return key;\r\n }\r\n }\r\n };\r\n name =\r\n inferFromRegistry(instance.components ||\r\n instance.parent.type.components) || inferFromRegistry(instance.appContext.components);\r\n }\r\n return name ? classify(name) : isRoot ? `App` : `Anonymous`;\r\n}\r\nfunction isClassComponent(value) {\r\n return isFunction(value) && '__vccOpts' in value;\r\n}\r\n\r\nconst computed$1 = ((getterOrOptions, debugOptions) =\u003E {\r\n \u002F\u002F @ts-ignore\r\n return computed(getterOrOptions, debugOptions, isInSSRComponentSetup);\r\n});\r\n\r\n\u002F\u002F dev only\r\nconst warnRuntimeUsage = (method) =\u003E warn$1(`${method}() is a compiler-hint helper that is only usable inside ` +\r\n `\u003Cscript setup\u003E of a single file component. Its arguments should be ` +\r\n `compiled away and passing it at runtime has no effect.`);\r\n\u002F\u002F implementation\r\nfunction defineProps() {\r\n {\r\n warnRuntimeUsage(`defineProps`);\r\n }\r\n return null;\r\n}\r\n\u002F\u002F implementation\r\nfunction defineEmits() {\r\n {\r\n warnRuntimeUsage(`defineEmits`);\r\n }\r\n return null;\r\n}\r\n\u002F**\r\n * Vue `\u003Cscript setup\u003E` compiler macro for declaring a component's exposed\r\n * instance properties when it is accessed by a parent component via template\r\n * refs.\r\n *\r\n * `\u003Cscript setup\u003E` components are closed by default - i.e. variables inside\r\n * the `\u003Cscript setup\u003E` scope is not exposed to parent unless explicitly exposed\r\n * via `defineExpose`.\r\n *\r\n * This is only usable inside `\u003Cscript setup\u003E`, is compiled away in the\r\n * output and should **not** be actually called at runtime.\r\n *\u002F\r\nfunction defineExpose(exposed) {\r\n {\r\n warnRuntimeUsage(`defineExpose`);\r\n }\r\n}\r\n\u002F**\r\n * Vue `\u003Cscript setup\u003E` compiler macro for providing props default values when\r\n * using type-based `defineProps` declaration.\r\n *\r\n * Example usage:\r\n * ```ts\r\n * withDefaults(defineProps\u003C{\r\n * size?: number\r\n * labels?: string[]\r\n * }\u003E(), {\r\n * size: 3,\r\n * labels: () =\u003E ['default label']\r\n * })\r\n * ```\r\n *\r\n * This is only usable inside `\u003Cscript setup\u003E`, is compiled away in the output\r\n * and should **not** be actually called at runtime.\r\n *\u002F\r\nfunction withDefaults(props, defaults) {\r\n {\r\n warnRuntimeUsage(`withDefaults`);\r\n }\r\n return null;\r\n}\r\nfunction useSlots() {\r\n return getContext().slots;\r\n}\r\nfunction useAttrs() {\r\n return getContext().attrs;\r\n}\r\nfunction getContext() {\r\n const i = getCurrentInstance();\r\n if (!i) {\r\n warn$1(`useContext() called without active instance.`);\r\n }\r\n return i.setupContext || (i.setupContext = createSetupContext(i));\r\n}\r\n\u002F**\r\n * Runtime helper for merging default declarations. Imported by compiled code\r\n * only.\r\n * @internal\r\n *\u002F\r\nfunction mergeDefaults(raw, defaults) {\r\n const props = isArray(raw)\r\n ? raw.reduce((normalized, p) =\u003E ((normalized[p] = {}), normalized), {})\r\n : raw;\r\n for (const key in defaults) {\r\n const opt = props[key];\r\n if (opt) {\r\n if (isArray(opt) || isFunction(opt)) {\r\n props[key] = { type: opt, default: defaults[key] };\r\n }\r\n else {\r\n opt.default = defaults[key];\r\n }\r\n }\r\n else if (opt === null) {\r\n props[key] = { default: defaults[key] };\r\n }\r\n else {\r\n warn$1(`props default key \"${key}\" has no corresponding declaration.`);\r\n }\r\n }\r\n return props;\r\n}\r\n\u002F**\r\n * Used to create a proxy for the rest element when destructuring props with\r\n * defineProps().\r\n * @internal\r\n *\u002F\r\nfunction createPropsRestProxy(props, excludedKeys) {\r\n const ret = {};\r\n for (const key in props) {\r\n if (!excludedKeys.includes(key)) {\r\n Object.defineProperty(ret, key, {\r\n enumerable: true,\r\n get: () =\u003E props[key]\r\n });\r\n }\r\n }\r\n return ret;\r\n}\r\n\u002F**\r\n * `\u003Cscript setup\u003E` helper for persisting the current instance context over\r\n * async\u002Fawait flows.\r\n *\r\n * `@vue\u002Fcompiler-sfc` converts the following:\r\n *\r\n * ```ts\r\n * const x = await foo()\r\n * ```\r\n *\r\n * into:\r\n *\r\n * ```ts\r\n * let __temp, __restore\r\n * const x = (([__temp, __restore] = withAsyncContext(() =\u003E foo())),__temp=await __temp,__restore(),__temp)\r\n * ```\r\n * @internal\r\n *\u002F\r\nfunction withAsyncContext(getAwaitable) {\r\n const ctx = getCurrentInstance();\r\n if (!ctx) {\r\n warn$1(`withAsyncContext called without active current instance. ` +\r\n `This is likely a bug.`);\r\n }\r\n let awaitable = getAwaitable();\r\n unsetCurrentInstance();\r\n if (isPromise(awaitable)) {\r\n awaitable = awaitable.catch(e =\u003E {\r\n setCurrentInstance(ctx);\r\n throw e;\r\n });\r\n }\r\n return [awaitable, () =\u003E setCurrentInstance(ctx)];\r\n}\r\n\r\n\u002F\u002F Actual implementation\r\nfunction h(type, propsOrChildren, children) {\r\n const l = arguments.length;\r\n if (l === 2) {\r\n if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {\r\n \u002F\u002F single vnode without props\r\n if (isVNode(propsOrChildren)) {\r\n return createVNode(type, null, [propsOrChildren]);\r\n }\r\n \u002F\u002F props without children\r\n return createVNode(type, propsOrChildren);\r\n }\r\n else {\r\n \u002F\u002F omit props\r\n return createVNode(type, null, propsOrChildren);\r\n }\r\n }\r\n else {\r\n if (l \u003E 3) {\r\n children = Array.prototype.slice.call(arguments, 2);\r\n }\r\n else if (l === 3 && isVNode(children)) {\r\n children = [children];\r\n }\r\n return createVNode(type, propsOrChildren, children);\r\n }\r\n}\r\n\r\nconst ssrContextKey = Symbol(`ssrContext` );\r\nconst useSSRContext = () =\u003E {\r\n {\r\n const ctx = inject(ssrContextKey);\r\n if (!ctx) {\r\n warn$1(`Server rendering context not provided. Make sure to only call ` +\r\n `useSSRContext() conditionally in the server build.`);\r\n }\r\n return ctx;\r\n }\r\n};\r\n\r\nfunction initCustomFormatter() {\r\n \u002F* eslint-disable no-restricted-globals *\u002F\r\n if (typeof window === 'undefined') {\r\n return;\r\n }\r\n const vueStyle = { style: 'color:#3ba776' };\r\n const numberStyle = { style: 'color:#0b1bc9' };\r\n const stringStyle = { style: 'color:#b62e24' };\r\n const keywordStyle = { style: 'color:#9d288c' };\r\n \u002F\u002F custom formatter for Chrome\r\n \u002F\u002F https:\u002F\u002Fwww.mattzeunert.com\u002F2016\u002F02\u002F19\u002Fcustom-chrome-devtools-object-formatters.html\r\n const formatter = {\r\n header(obj) {\r\n \u002F\u002F TODO also format ComponentPublicInstance & ctx.slots\u002Fattrs in setup\r\n if (!isObject(obj)) {\r\n return null;\r\n }\r\n if (obj.__isVue) {\r\n return ['div', vueStyle, `VueInstance`];\r\n }\r\n else if (isRef(obj)) {\r\n return [\r\n 'div',\r\n {},\r\n ['span', vueStyle, genRefFlag(obj)],\r\n '\u003C',\r\n formatValue(obj.value),\r\n `\u003E`\r\n ];\r\n }\r\n else if (isReactive(obj)) {\r\n return [\r\n 'div',\r\n {},\r\n ['span', vueStyle, isShallow(obj) ? 'ShallowReactive' : 'Reactive'],\r\n '\u003C',\r\n formatValue(obj),\r\n `\u003E${isReadonly(obj) ? ` (readonly)` : ``}`\r\n ];\r\n }\r\n else if (isReadonly(obj)) {\r\n return [\r\n 'div',\r\n {},\r\n ['span', vueStyle, isShallow(obj) ? 'ShallowReadonly' : 'Readonly'],\r\n '\u003C',\r\n formatValue(obj),\r\n '\u003E'\r\n ];\r\n }\r\n return null;\r\n },\r\n hasBody(obj) {\r\n return obj && obj.__isVue;\r\n },\r\n body(obj) {\r\n if (obj && obj.__isVue) {\r\n return [\r\n 'div',\r\n {},\r\n ...formatInstance(obj.$)\r\n ];\r\n }\r\n }\r\n };\r\n function formatInstance(instance) {\r\n const blocks = [];\r\n if (instance.type.props && instance.props) {\r\n blocks.push(createInstanceBlock('props', toRaw(instance.props)));\r\n }\r\n if (instance.setupState !== EMPTY_OBJ) {\r\n blocks.push(createInstanceBlock('setup', instance.setupState));\r\n }\r\n if (instance.data !== EMPTY_OBJ) {\r\n blocks.push(createInstanceBlock('data', toRaw(instance.data)));\r\n }\r\n const computed = extractKeys(instance, 'computed');\r\n if (computed) {\r\n blocks.push(createInstanceBlock('computed', computed));\r\n }\r\n const injected = extractKeys(instance, 'inject');\r\n if (injected) {\r\n blocks.push(createInstanceBlock('injected', injected));\r\n }\r\n blocks.push([\r\n 'div',\r\n {},\r\n [\r\n 'span',\r\n {\r\n style: keywordStyle.style + ';opacity:0.66'\r\n },\r\n '$ (internal): '\r\n ],\r\n ['object', { object: instance }]\r\n ]);\r\n return blocks;\r\n }\r\n function createInstanceBlock(type, target) {\r\n target = extend({}, target);\r\n if (!Object.keys(target).length) {\r\n return ['span', {}];\r\n }\r\n return [\r\n 'div',\r\n { style: 'line-height:1.25em;margin-bottom:0.6em' },\r\n [\r\n 'div',\r\n {\r\n style: 'color:#476582'\r\n },\r\n type\r\n ],\r\n [\r\n 'div',\r\n {\r\n style: 'padding-left:1.25em'\r\n },\r\n ...Object.keys(target).map(key =\u003E {\r\n return [\r\n 'div',\r\n {},\r\n ['span', keywordStyle, key + ': '],\r\n formatValue(target[key], false)\r\n ];\r\n })\r\n ]\r\n ];\r\n }\r\n function formatValue(v, asRaw = true) {\r\n if (typeof v === 'number') {\r\n return ['span', numberStyle, v];\r\n }\r\n else if (typeof v === 'string') {\r\n return ['span', stringStyle, JSON.stringify(v)];\r\n }\r\n else if (typeof v === 'boolean') {\r\n return ['span', keywordStyle, v];\r\n }\r\n else if (isObject(v)) {\r\n return ['object', { object: asRaw ? toRaw(v) : v }];\r\n }\r\n else {\r\n return ['span', stringStyle, String(v)];\r\n }\r\n }\r\n function extractKeys(instance, type) {\r\n const Comp = instance.type;\r\n if (isFunction(Comp)) {\r\n return;\r\n }\r\n const extracted = {};\r\n for (const key in instance.ctx) {\r\n if (isKeyOfType(Comp, key, type)) {\r\n extracted[key] = instance.ctx[key];\r\n }\r\n }\r\n return extracted;\r\n }\r\n function isKeyOfType(Comp, key, type) {\r\n const opts = Comp[type];\r\n if ((isArray(opts) && opts.includes(key)) ||\r\n (isObject(opts) && key in opts)) {\r\n return true;\r\n }\r\n if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {\r\n return true;\r\n }\r\n if (Comp.mixins && Comp.mixins.some(m =\u003E isKeyOfType(m, key, type))) {\r\n return true;\r\n }\r\n }\r\n function genRefFlag(v) {\r\n if (isShallow(v)) {\r\n return `ShallowRef`;\r\n }\r\n if (v.effect) {\r\n return `ComputedRef`;\r\n }\r\n return `Ref`;\r\n }\r\n if (window.devtoolsFormatters) {\r\n window.devtoolsFormatters.push(formatter);\r\n }\r\n else {\r\n window.devtoolsFormatters = [formatter];\r\n }\r\n}\r\n\r\nfunction withMemo(memo, render, cache, index) {\r\n const cached = cache[index];\r\n if (cached && isMemoSame(cached, memo)) {\r\n return cached;\r\n }\r\n const ret = render();\r\n \u002F\u002F shallow clone\r\n ret.memo = memo.slice();\r\n return (cache[index] = ret);\r\n}\r\nfunction isMemoSame(cached, memo) {\r\n const prev = cached.memo;\r\n if (prev.length != memo.length) {\r\n return false;\r\n }\r\n for (let i = 0; i \u003C prev.length; i++) {\r\n if (prev[i] !== memo[i]) {\r\n return false;\r\n }\r\n }\r\n \u002F\u002F make sure to let parent block track it when returning cached\r\n if (isBlockTreeEnabled \u003E 0 && currentBlock) {\r\n currentBlock.push(cached);\r\n }\r\n return true;\r\n}\r\n\r\n\u002F\u002F Core API ------------------------------------------------------------------\r\nconst version = \"3.2.31\";\r\n\u002F**\r\n * SSR utils for \\@vue\u002Fserver-renderer. Only exposed in cjs builds.\r\n * @internal\r\n *\u002F\r\nconst ssrUtils = (null);\r\n\u002F**\r\n * @internal only exposed in compat builds\r\n *\u002F\r\nconst resolveFilter = null;\r\n\u002F**\r\n * @internal only exposed in compat builds.\r\n *\u002F\r\nconst compatUtils = (null);\r\n\r\nconst svgNS = 'http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg';\r\nconst doc = (typeof document !== 'undefined' ? document : null);\r\nconst templateContainer = doc && doc.createElement('template');\r\nconst nodeOps = {\r\n insert: (child, parent, anchor) =\u003E {\r\n parent.insertBefore(child, anchor || null);\r\n },\r\n remove: child =\u003E {\r\n const parent = child.parentNode;\r\n if (parent) {\r\n parent.removeChild(child);\r\n }\r\n },\r\n createElement: (tag, isSVG, is, props) =\u003E {\r\n const el = isSVG\r\n ? doc.createElementNS(svgNS, tag)\r\n : doc.createElement(tag, is ? { is } : undefined);\r\n if (tag === 'select' && props && props.multiple != null) {\r\n el.setAttribute('multiple', props.multiple);\r\n }\r\n return el;\r\n },\r\n createText: text =\u003E doc.createTextNode(text),\r\n createComment: text =\u003E doc.createComment(text),\r\n setText: (node, text) =\u003E {\r\n node.nodeValue = text;\r\n },\r\n setElementText: (el, text) =\u003E {\r\n el.textContent = text;\r\n },\r\n parentNode: node =\u003E node.parentNode,\r\n nextSibling: node =\u003E node.nextSibling,\r\n querySelector: selector =\u003E doc.querySelector(selector),\r\n setScopeId(el, id) {\r\n el.setAttribute(id, '');\r\n },\r\n cloneNode(el) {\r\n const cloned = el.cloneNode(true);\r\n \u002F\u002F #3072\r\n \u002F\u002F - in `patchDOMProp`, we store the actual value in the `el._value` property.\r\n \u002F\u002F - normally, elements using `:value` bindings will not be hoisted, but if\r\n \u002F\u002F the bound value is a constant, e.g. `:value=\"true\"` - they do get\r\n \u002F\u002F hoisted.\r\n \u002F\u002F - in production, hoisted nodes are cloned when subsequent inserts, but\r\n \u002F\u002F cloneNode() does not copy the custom property we attached.\r\n \u002F\u002F - This may need to account for other custom DOM properties we attach to\r\n \u002F\u002F elements in addition to `_value` in the future.\r\n if (`_value` in el) {\r\n cloned._value = el._value;\r\n }\r\n return cloned;\r\n },\r\n \u002F\u002F __UNSAFE__\r\n \u002F\u002F Reason: innerHTML.\r\n \u002F\u002F Static content here can only come from compiled templates.\r\n \u002F\u002F As long as the user only uses trusted templates, this is safe.\r\n insertStaticContent(content, parent, anchor, isSVG, start, end) {\r\n \u002F\u002F \u003Cparent\u003E before | first ... last | anchor \u003C\u002Fparent\u003E\r\n const before = anchor ? anchor.previousSibling : parent.lastChild;\r\n \u002F\u002F #5308 can only take cached path if:\r\n \u002F\u002F - has a single root node\r\n \u002F\u002F - nextSibling info is still available\r\n if (start && (start === end || start.nextSibling)) {\r\n \u002F\u002F cached\r\n while (true) {\r\n parent.insertBefore(start.cloneNode(true), anchor);\r\n if (start === end || !(start = start.nextSibling))\r\n break;\r\n }\r\n }\r\n else {\r\n \u002F\u002F fresh insert\r\n templateContainer.innerHTML = isSVG ? `\u003Csvg\u003E${content}\u003C\u002Fsvg\u003E` : content;\r\n const template = templateContainer.content;\r\n if (isSVG) {\r\n \u002F\u002F remove outer svg wrapper\r\n const wrapper = template.firstChild;\r\n while (wrapper.firstChild) {\r\n template.appendChild(wrapper.firstChild);\r\n }\r\n template.removeChild(wrapper);\r\n }\r\n parent.insertBefore(template, anchor);\r\n }\r\n return [\r\n \u002F\u002F first\r\n before ? before.nextSibling : parent.firstChild,\r\n \u002F\u002F last\r\n anchor ? anchor.previousSibling : parent.lastChild\r\n ];\r\n }\r\n};\r\n\r\n\u002F\u002F compiler should normalize class + :class bindings on the same element\r\n\u002F\u002F into a single binding ['staticClass', dynamic]\r\nfunction patchClass(el, value, isSVG) {\r\n \u002F\u002F directly setting className should be faster than setAttribute in theory\r\n \u002F\u002F if this is an element during a transition, take the temporary transition\r\n \u002F\u002F classes into account.\r\n const transitionClasses = el._vtc;\r\n if (transitionClasses) {\r\n value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(' ');\r\n }\r\n if (value == null) {\r\n el.removeAttribute('class');\r\n }\r\n else if (isSVG) {\r\n el.setAttribute('class', value);\r\n }\r\n else {\r\n el.className = value;\r\n }\r\n}\r\n\r\nfunction patchStyle(el, prev, next) {\r\n const style = el.style;\r\n const isCssString = isString(next);\r\n if (next && !isCssString) {\r\n for (const key in next) {\r\n setStyle(style, key, next[key]);\r\n }\r\n if (prev && !isString(prev)) {\r\n for (const key in prev) {\r\n if (next[key] == null) {\r\n setStyle(style, key, '');\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n const currentDisplay = style.display;\r\n if (isCssString) {\r\n if (prev !== next) {\r\n style.cssText = next;\r\n }\r\n }\r\n else if (prev) {\r\n el.removeAttribute('style');\r\n }\r\n \u002F\u002F indicates that the `display` of the element is controlled by `v-show`,\r\n \u002F\u002F so we always keep the current `display` value regardless of the `style`\r\n \u002F\u002F value, thus handing over control to `v-show`.\r\n if ('_vod' in el) {\r\n style.display = currentDisplay;\r\n }\r\n }\r\n}\r\nconst importantRE = \u002F\\s*!important$\u002F;\r\nfunction setStyle(style, name, val) {\r\n if (isArray(val)) {\r\n val.forEach(v =\u003E setStyle(style, name, v));\r\n }\r\n else {\r\n if (name.startsWith('--')) {\r\n \u002F\u002F custom property definition\r\n style.setProperty(name, val);\r\n }\r\n else {\r\n const prefixed = autoPrefix(style, name);\r\n if (importantRE.test(val)) {\r\n \u002F\u002F !important\r\n style.setProperty(hyphenate(prefixed), val.replace(importantRE, ''), 'important');\r\n }\r\n else {\r\n style[prefixed] = val;\r\n }\r\n }\r\n }\r\n}\r\nconst prefixes = ['Webkit', 'Moz', 'ms'];\r\nconst prefixCache = {};\r\nfunction autoPrefix(style, rawName) {\r\n const cached = prefixCache[rawName];\r\n if (cached) {\r\n return cached;\r\n }\r\n let name = camelize(rawName);\r\n if (name !== 'filter' && name in style) {\r\n return (prefixCache[rawName] = name);\r\n }\r\n name = capitalize(name);\r\n for (let i = 0; i \u003C prefixes.length; i++) {\r\n const prefixed = prefixes[i] + name;\r\n if (prefixed in style) {\r\n return (prefixCache[rawName] = prefixed);\r\n }\r\n }\r\n return rawName;\r\n}\r\n\r\nconst xlinkNS = 'http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxlink';\r\nfunction patchAttr(el, key, value, isSVG, instance) {\r\n if (isSVG && key.startsWith('xlink:')) {\r\n if (value == null) {\r\n el.removeAttributeNS(xlinkNS, key.slice(6, key.length));\r\n }\r\n else {\r\n el.setAttributeNS(xlinkNS, key, value);\r\n }\r\n }\r\n else {\r\n \u002F\u002F note we are only checking boolean attributes that don't have a\r\n \u002F\u002F corresponding dom prop of the same name here.\r\n const isBoolean = isSpecialBooleanAttr(key);\r\n if (value == null || (isBoolean && !includeBooleanAttr(value))) {\r\n el.removeAttribute(key);\r\n }\r\n else {\r\n el.setAttribute(key, isBoolean ? '' : value);\r\n }\r\n }\r\n}\r\n\r\n\u002F\u002F __UNSAFE__\r\n\u002F\u002F functions. The user is responsible for using them with only trusted content.\r\nfunction patchDOMProp(el, key, value, \r\n\u002F\u002F the following args are passed only due to potential innerHTML\u002FtextContent\r\n\u002F\u002F overriding existing VNodes, in which case the old tree must be properly\r\n\u002F\u002F unmounted.\r\nprevChildren, parentComponent, parentSuspense, unmountChildren) {\r\n if (key === 'innerHTML' || key === 'textContent') {\r\n if (prevChildren) {\r\n unmountChildren(prevChildren, parentComponent, parentSuspense);\r\n }\r\n el[key] = value == null ? '' : value;\r\n return;\r\n }\r\n if (key === 'value' &&\r\n el.tagName !== 'PROGRESS' &&\r\n \u002F\u002F custom elements may use _value internally\r\n !el.tagName.includes('-')) {\r\n \u002F\u002F store value as _value as well since\r\n \u002F\u002F non-string values will be stringified.\r\n el._value = value;\r\n const newValue = value == null ? '' : value;\r\n if (el.value !== newValue ||\r\n \u002F\u002F #4956: always set for OPTION elements because its value falls back to\r\n \u002F\u002F textContent if no value attribute is present. And setting .value for\r\n \u002F\u002F OPTION has no side effect\r\n el.tagName === 'OPTION') {\r\n el.value = newValue;\r\n }\r\n if (value == null) {\r\n el.removeAttribute(key);\r\n }\r\n return;\r\n }\r\n if (value === '' || value == null) {\r\n const type = typeof el[key];\r\n if (type === 'boolean') {\r\n \u002F\u002F e.g. \u003Cselect multiple\u003E compiles to { multiple: '' }\r\n el[key] = includeBooleanAttr(value);\r\n return;\r\n }\r\n else if (value == null && type === 'string') {\r\n \u002F\u002F e.g. \u003Cdiv :id=\"null\"\u003E\r\n el[key] = '';\r\n el.removeAttribute(key);\r\n return;\r\n }\r\n else if (type === 'number') {\r\n \u002F\u002F e.g. \u003Cimg :width=\"null\"\u003E\r\n \u002F\u002F the value of some IDL attr must be greater than 0, e.g. input.size = 0 -\u003E error\r\n try {\r\n el[key] = 0;\r\n }\r\n catch (_a) { }\r\n el.removeAttribute(key);\r\n return;\r\n }\r\n }\r\n \u002F\u002F some properties perform value validation and throw\r\n try {\r\n el[key] = value;\r\n }\r\n catch (e) {\r\n {\r\n warn$1(`Failed setting prop \"${key}\" on \u003C${el.tagName.toLowerCase()}\u003E: ` +\r\n `value ${value} is invalid.`, e);\r\n }\r\n }\r\n}\r\n\r\n\u002F\u002F Async edge case fix requires storing an event listener's attach timestamp.\r\nlet _getNow = Date.now;\r\nlet skipTimestampCheck = false;\r\nif (typeof window !== 'undefined') {\r\n \u002F\u002F Determine what event timestamp the browser is using. Annoyingly, the\r\n \u002F\u002F timestamp can either be hi-res (relative to page load) or low-res\r\n \u002F\u002F (relative to UNIX epoch), so in order to compare time we have to use the\r\n \u002F\u002F same timestamp type when saving the flush timestamp.\r\n if (_getNow() \u003E document.createEvent('Event').timeStamp) {\r\n \u002F\u002F if the low-res timestamp which is bigger than the event timestamp\r\n \u002F\u002F (which is evaluated AFTER) it means the event is using a hi-res timestamp,\r\n \u002F\u002F and we need to use the hi-res version for event listeners as well.\r\n _getNow = () =\u003E performance.now();\r\n }\r\n \u002F\u002F #3485: Firefox \u003C= 53 has incorrect Event.timeStamp implementation\r\n \u002F\u002F and does not fire microtasks in between event propagation, so safe to exclude.\r\n const ffMatch = navigator.userAgent.match(\u002Ffirefox\\\u002F(\\d+)\u002Fi);\r\n skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) \u003C= 53);\r\n}\r\n\u002F\u002F To avoid the overhead of repeatedly calling performance.now(), we cache\r\n\u002F\u002F and use the same timestamp for all event listeners attached in the same tick.\r\nlet cachedNow = 0;\r\nconst p = Promise.resolve();\r\nconst reset = () =\u003E {\r\n cachedNow = 0;\r\n};\r\nconst getNow = () =\u003E cachedNow || (p.then(reset), (cachedNow = _getNow()));\r\nfunction addEventListener(el, event, handler, options) {\r\n el.addEventListener(event, handler, options);\r\n}\r\nfunction removeEventListener(el, event, handler, options) {\r\n el.removeEventListener(event, handler, options);\r\n}\r\nfunction patchEvent(el, rawName, prevValue, nextValue, instance = null) {\r\n \u002F\u002F vei = vue event invokers\r\n const invokers = el._vei || (el._vei = {});\r\n const existingInvoker = invokers[rawName];\r\n if (nextValue && existingInvoker) {\r\n \u002F\u002F patch\r\n existingInvoker.value = nextValue;\r\n }\r\n else {\r\n const [name, options] = parseName(rawName);\r\n if (nextValue) {\r\n \u002F\u002F add\r\n const invoker = (invokers[rawName] = createInvoker(nextValue, instance));\r\n addEventListener(el, name, invoker, options);\r\n }\r\n else if (existingInvoker) {\r\n \u002F\u002F remove\r\n removeEventListener(el, name, existingInvoker, options);\r\n invokers[rawName] = undefined;\r\n }\r\n }\r\n}\r\nconst optionsModifierRE = \u002F(?:Once|Passive|Capture)$\u002F;\r\nfunction parseName(name) {\r\n let options;\r\n if (optionsModifierRE.test(name)) {\r\n options = {};\r\n let m;\r\n while ((m = name.match(optionsModifierRE))) {\r\n name = name.slice(0, name.length - m[0].length);\r\n options[m[0].toLowerCase()] = true;\r\n }\r\n }\r\n return [hyphenate(name.slice(2)), options];\r\n}\r\nfunction createInvoker(initialValue, instance) {\r\n const invoker = (e) =\u003E {\r\n \u002F\u002F async edge case #6566: inner click event triggers patch, event handler\r\n \u002F\u002F attached to outer element during patch, and triggered again. This\r\n \u002F\u002F happens because browsers fire microtask ticks between event propagation.\r\n \u002F\u002F the solution is simple: we save the timestamp when a handler is attached,\r\n \u002F\u002F and the handler would only fire if the event passed to it was fired\r\n \u002F\u002F AFTER it was attached.\r\n const timeStamp = e.timeStamp || _getNow();\r\n if (skipTimestampCheck || timeStamp \u003E= invoker.attached - 1) {\r\n callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 \u002F* NATIVE_EVENT_HANDLER *\u002F, [e]);\r\n }\r\n };\r\n invoker.value = initialValue;\r\n invoker.attached = getNow();\r\n return invoker;\r\n}\r\nfunction patchStopImmediatePropagation(e, value) {\r\n if (isArray(value)) {\r\n const originalStop = e.stopImmediatePropagation;\r\n e.stopImmediatePropagation = () =\u003E {\r\n originalStop.call(e);\r\n e._stopped = true;\r\n };\r\n return value.map(fn =\u003E (e) =\u003E !e._stopped && fn && fn(e));\r\n }\r\n else {\r\n return value;\r\n }\r\n}\r\n\r\nconst nativeOnRE = \u002F^on[a-z]\u002F;\r\nconst patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) =\u003E {\r\n if (key === 'class') {\r\n patchClass(el, nextValue, isSVG);\r\n }\r\n else if (key === 'style') {\r\n patchStyle(el, prevValue, nextValue);\r\n }\r\n else if (isOn(key)) {\r\n \u002F\u002F ignore v-model listeners\r\n if (!isModelListener(key)) {\r\n patchEvent(el, key, prevValue, nextValue, parentComponent);\r\n }\r\n }\r\n else if (key[0] === '.'\r\n ? ((key = key.slice(1)), true)\r\n : key[0] === '^'\r\n ? ((key = key.slice(1)), false)\r\n : shouldSetAsProp(el, key, nextValue, isSVG)) {\r\n patchDOMProp(el, key, nextValue, prevChildren, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n else {\r\n \u002F\u002F special case for \u003Cinput v-model type=\"checkbox\"\u003E with\r\n \u002F\u002F :true-value & :false-value\r\n \u002F\u002F store value as dom properties since non-string values will be\r\n \u002F\u002F stringified.\r\n if (key === 'true-value') {\r\n el._trueValue = nextValue;\r\n }\r\n else if (key === 'false-value') {\r\n el._falseValue = nextValue;\r\n }\r\n patchAttr(el, key, nextValue, isSVG);\r\n }\r\n};\r\nfunction shouldSetAsProp(el, key, value, isSVG) {\r\n if (isSVG) {\r\n \u002F\u002F most keys must be set as attribute on svg elements to work\r\n \u002F\u002F ...except innerHTML & textContent\r\n if (key === 'innerHTML' || key === 'textContent') {\r\n return true;\r\n }\r\n \u002F\u002F or native onclick with function values\r\n if (key in el && nativeOnRE.test(key) && isFunction(value)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n \u002F\u002F spellcheck and draggable are numerated attrs, however their\r\n \u002F\u002F corresponding DOM properties are actually booleans - this leads to\r\n \u002F\u002F setting it with a string \"false\" value leading it to be coerced to\r\n \u002F\u002F `true`, so we need to always treat them as attributes.\r\n \u002F\u002F Note that `contentEditable` doesn't have this problem: its DOM\r\n \u002F\u002F property is also enumerated string values.\r\n if (key === 'spellcheck' || key === 'draggable') {\r\n return false;\r\n }\r\n \u002F\u002F #1787, #2840 form property on form elements is readonly and must be set as\r\n \u002F\u002F attribute.\r\n if (key === 'form') {\r\n return false;\r\n }\r\n \u002F\u002F #1526 \u003Cinput list\u003E must be set as attribute\r\n if (key === 'list' && el.tagName === 'INPUT') {\r\n return false;\r\n }\r\n \u002F\u002F #2766 \u003Ctextarea type\u003E must be set as attribute\r\n if (key === 'type' && el.tagName === 'TEXTAREA') {\r\n return false;\r\n }\r\n \u002F\u002F native onclick with string value, must be set as attribute\r\n if (nativeOnRE.test(key) && isString(value)) {\r\n return false;\r\n }\r\n return key in el;\r\n}\r\n\r\nfunction defineCustomElement(options, hydate) {\r\n const Comp = defineComponent(options);\r\n class VueCustomElement extends VueElement {\r\n constructor(initialProps) {\r\n super(Comp, initialProps, hydate);\r\n }\r\n }\r\n VueCustomElement.def = Comp;\r\n return VueCustomElement;\r\n}\r\nconst defineSSRCustomElement = ((options) =\u003E {\r\n \u002F\u002F @ts-ignore\r\n return defineCustomElement(options, hydrate);\r\n});\r\nconst BaseClass = (typeof HTMLElement !== 'undefined' ? HTMLElement : class {\r\n});\r\nclass VueElement extends BaseClass {\r\n constructor(_def, _props = {}, hydrate) {\r\n super();\r\n this._def = _def;\r\n this._props = _props;\r\n \u002F**\r\n * @internal\r\n *\u002F\r\n this._instance = null;\r\n this._connected = false;\r\n this._resolved = false;\r\n this._numberProps = null;\r\n if (this.shadowRoot && hydrate) {\r\n hydrate(this._createVNode(), this.shadowRoot);\r\n }\r\n else {\r\n if (this.shadowRoot) {\r\n warn$1(`Custom element has pre-rendered declarative shadow root but is not ` +\r\n `defined as hydratable. Use \\`defineSSRCustomElement\\`.`);\r\n }\r\n this.attachShadow({ mode: 'open' });\r\n }\r\n }\r\n connectedCallback() {\r\n this._connected = true;\r\n if (!this._instance) {\r\n this._resolveDef();\r\n }\r\n }\r\n disconnectedCallback() {\r\n this._connected = false;\r\n nextTick(() =\u003E {\r\n if (!this._connected) {\r\n render(null, this.shadowRoot);\r\n this._instance = null;\r\n }\r\n });\r\n }\r\n \u002F**\r\n * resolve inner component definition (handle possible async component)\r\n *\u002F\r\n _resolveDef() {\r\n if (this._resolved) {\r\n return;\r\n }\r\n this._resolved = true;\r\n \u002F\u002F set initial attrs\r\n for (let i = 0; i \u003C this.attributes.length; i++) {\r\n this._setAttr(this.attributes[i].name);\r\n }\r\n \u002F\u002F watch future attr changes\r\n new MutationObserver(mutations =\u003E {\r\n for (const m of mutations) {\r\n this._setAttr(m.attributeName);\r\n }\r\n }).observe(this, { attributes: true });\r\n const resolve = (def) =\u003E {\r\n const { props, styles } = def;\r\n const hasOptions = !isArray(props);\r\n const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];\r\n \u002F\u002F cast Number-type props set before resolve\r\n let numberProps;\r\n if (hasOptions) {\r\n for (const key in this._props) {\r\n const opt = props[key];\r\n if (opt === Number || (opt && opt.type === Number)) {\r\n this._props[key] = toNumber(this._props[key]);\r\n (numberProps || (numberProps = Object.create(null)))[key] = true;\r\n }\r\n }\r\n }\r\n this._numberProps = numberProps;\r\n \u002F\u002F check if there are props set pre-upgrade or connect\r\n for (const key of Object.keys(this)) {\r\n if (key[0] !== '_') {\r\n this._setProp(key, this[key], true, false);\r\n }\r\n }\r\n \u002F\u002F defining getter\u002Fsetters on prototype\r\n for (const key of rawKeys.map(camelize)) {\r\n Object.defineProperty(this, key, {\r\n get() {\r\n return this._getProp(key);\r\n },\r\n set(val) {\r\n this._setProp(key, val);\r\n }\r\n });\r\n }\r\n \u002F\u002F apply CSS\r\n this._applyStyles(styles);\r\n \u002F\u002F initial render\r\n this._update();\r\n };\r\n const asyncDef = this._def.__asyncLoader;\r\n if (asyncDef) {\r\n asyncDef().then(resolve);\r\n }\r\n else {\r\n resolve(this._def);\r\n }\r\n }\r\n _setAttr(key) {\r\n let value = this.getAttribute(key);\r\n if (this._numberProps && this._numberProps[key]) {\r\n value = toNumber(value);\r\n }\r\n this._setProp(camelize(key), value, false);\r\n }\r\n \u002F**\r\n * @internal\r\n *\u002F\r\n _getProp(key) {\r\n return this._props[key];\r\n }\r\n \u002F**\r\n * @internal\r\n *\u002F\r\n _setProp(key, val, shouldReflect = true, shouldUpdate = true) {\r\n if (val !== this._props[key]) {\r\n this._props[key] = val;\r\n if (shouldUpdate && this._instance) {\r\n this._update();\r\n }\r\n \u002F\u002F reflect\r\n if (shouldReflect) {\r\n if (val === true) {\r\n this.setAttribute(hyphenate(key), '');\r\n }\r\n else if (typeof val === 'string' || typeof val === 'number') {\r\n this.setAttribute(hyphenate(key), val + '');\r\n }\r\n else if (!val) {\r\n this.removeAttribute(hyphenate(key));\r\n }\r\n }\r\n }\r\n }\r\n _update() {\r\n render(this._createVNode(), this.shadowRoot);\r\n }\r\n _createVNode() {\r\n const vnode = createVNode(this._def, extend({}, this._props));\r\n if (!this._instance) {\r\n vnode.ce = instance =\u003E {\r\n this._instance = instance;\r\n instance.isCE = true;\r\n \u002F\u002F HMR\r\n {\r\n instance.ceReload = newStyles =\u003E {\r\n \u002F\u002F always reset styles\r\n if (this._styles) {\r\n this._styles.forEach(s =\u003E this.shadowRoot.removeChild(s));\r\n this._styles.length = 0;\r\n }\r\n this._applyStyles(newStyles);\r\n \u002F\u002F if this is an async component, ceReload is called from the inner\r\n \u002F\u002F component so no need to reload the async wrapper\r\n if (!this._def.__asyncLoader) {\r\n \u002F\u002F reload\r\n this._instance = null;\r\n this._update();\r\n }\r\n };\r\n }\r\n \u002F\u002F intercept emit\r\n instance.emit = (event, ...args) =\u003E {\r\n this.dispatchEvent(new CustomEvent(event, {\r\n detail: args\r\n }));\r\n };\r\n \u002F\u002F locate nearest Vue custom element parent for provide\u002Finject\r\n let parent = this;\r\n while ((parent =\r\n parent && (parent.parentNode || parent.host))) {\r\n if (parent instanceof VueElement) {\r\n instance.parent = parent._instance;\r\n break;\r\n }\r\n }\r\n };\r\n }\r\n return vnode;\r\n }\r\n _applyStyles(styles) {\r\n if (styles) {\r\n styles.forEach(css =\u003E {\r\n const s = document.createElement('style');\r\n s.textContent = css;\r\n this.shadowRoot.appendChild(s);\r\n \u002F\u002F record for HMR\r\n {\r\n (this._styles || (this._styles = [])).push(s);\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\nfunction useCssModule(name = '$style') {\r\n \u002F* istanbul ignore else *\u002F\r\n {\r\n const instance = getCurrentInstance();\r\n if (!instance) {\r\n warn$1(`useCssModule must be called inside setup()`);\r\n return EMPTY_OBJ;\r\n }\r\n const modules = instance.type.__cssModules;\r\n if (!modules) {\r\n warn$1(`Current instance does not have CSS modules injected.`);\r\n return EMPTY_OBJ;\r\n }\r\n const mod = modules[name];\r\n if (!mod) {\r\n warn$1(`Current instance does not have CSS module named \"${name}\".`);\r\n return EMPTY_OBJ;\r\n }\r\n return mod;\r\n }\r\n}\r\n\r\n\u002F**\r\n * Runtime helper for SFC's CSS variable injection feature.\r\n * @private\r\n *\u002F\r\nfunction useCssVars(getter) {\r\n const instance = getCurrentInstance();\r\n \u002F* istanbul ignore next *\u002F\r\n if (!instance) {\r\n warn$1(`useCssVars is called without current active component instance.`);\r\n return;\r\n }\r\n const setVars = () =\u003E setVarsOnVNode(instance.subTree, getter(instance.proxy));\r\n watchPostEffect(setVars);\r\n onMounted(() =\u003E {\r\n const ob = new MutationObserver(setVars);\r\n ob.observe(instance.subTree.el.parentNode, { childList: true });\r\n onUnmounted(() =\u003E ob.disconnect());\r\n });\r\n}\r\nfunction setVarsOnVNode(vnode, vars) {\r\n if (vnode.shapeFlag & 128 \u002F* SUSPENSE *\u002F) {\r\n const suspense = vnode.suspense;\r\n vnode = suspense.activeBranch;\r\n if (suspense.pendingBranch && !suspense.isHydrating) {\r\n suspense.effects.push(() =\u003E {\r\n setVarsOnVNode(suspense.activeBranch, vars);\r\n });\r\n }\r\n }\r\n \u002F\u002F drill down HOCs until it's a non-component vnode\r\n while (vnode.component) {\r\n vnode = vnode.component.subTree;\r\n }\r\n if (vnode.shapeFlag & 1 \u002F* ELEMENT *\u002F && vnode.el) {\r\n setVarsOnNode(vnode.el, vars);\r\n }\r\n else if (vnode.type === Fragment) {\r\n vnode.children.forEach(c =\u003E setVarsOnVNode(c, vars));\r\n }\r\n else if (vnode.type === Static) {\r\n let { el, anchor } = vnode;\r\n while (el) {\r\n setVarsOnNode(el, vars);\r\n if (el === anchor)\r\n break;\r\n el = el.nextSibling;\r\n }\r\n }\r\n}\r\nfunction setVarsOnNode(el, vars) {\r\n if (el.nodeType === 1) {\r\n const style = el.style;\r\n for (const key in vars) {\r\n style.setProperty(`--${key}`, vars[key]);\r\n }\r\n }\r\n}\r\n\r\nconst TRANSITION = 'transition';\r\nconst ANIMATION = 'animation';\r\n\u002F\u002F DOM Transition is a higher-order-component based on the platform-agnostic\r\n\u002F\u002F base Transition component, with DOM-specific logic.\r\nconst Transition = (props, { slots }) =\u003E h(BaseTransition, resolveTransitionProps(props), slots);\r\nTransition.displayName = 'Transition';\r\nconst DOMTransitionPropsValidators = {\r\n name: String,\r\n type: String,\r\n css: {\r\n type: Boolean,\r\n default: true\r\n },\r\n duration: [String, Number, Object],\r\n enterFromClass: String,\r\n enterActiveClass: String,\r\n enterToClass: String,\r\n appearFromClass: String,\r\n appearActiveClass: String,\r\n appearToClass: String,\r\n leaveFromClass: String,\r\n leaveActiveClass: String,\r\n leaveToClass: String\r\n};\r\nconst TransitionPropsValidators = (Transition.props =\r\n \u002F*#__PURE__*\u002F extend({}, BaseTransition.props, DOMTransitionPropsValidators));\r\n\u002F**\r\n * #3227 Incoming hooks may be merged into arrays when wrapping Transition\r\n * with custom HOCs.\r\n *\u002F\r\nconst callHook$1 = (hook, args = []) =\u003E {\r\n if (isArray(hook)) {\r\n hook.forEach(h =\u003E h(...args));\r\n }\r\n else if (hook) {\r\n hook(...args);\r\n }\r\n};\r\n\u002F**\r\n * Check if a hook expects a callback (2nd arg), which means the user\r\n * intends to explicitly control the end of the transition.\r\n *\u002F\r\nconst hasExplicitCallback = (hook) =\u003E {\r\n return hook\r\n ? isArray(hook)\r\n ? hook.some(h =\u003E h.length \u003E 1)\r\n : hook.length \u003E 1\r\n : false;\r\n};\r\nfunction resolveTransitionProps(rawProps) {\r\n const baseProps = {};\r\n for (const key in rawProps) {\r\n if (!(key in DOMTransitionPropsValidators)) {\r\n baseProps[key] = rawProps[key];\r\n }\r\n }\r\n if (rawProps.css === false) {\r\n return baseProps;\r\n }\r\n const { name = 'v', type, duration, enterFromClass = `${name}-enter-from`, enterActiveClass = `${name}-enter-active`, enterToClass = `${name}-enter-to`, appearFromClass = enterFromClass, appearActiveClass = enterActiveClass, appearToClass = enterToClass, leaveFromClass = `${name}-leave-from`, leaveActiveClass = `${name}-leave-active`, leaveToClass = `${name}-leave-to` } = rawProps;\r\n const durations = normalizeDuration(duration);\r\n const enterDuration = durations && durations[0];\r\n const leaveDuration = durations && durations[1];\r\n const { onBeforeEnter, onEnter, onEnterCancelled, onLeave, onLeaveCancelled, onBeforeAppear = onBeforeEnter, onAppear = onEnter, onAppearCancelled = onEnterCancelled } = baseProps;\r\n const finishEnter = (el, isAppear, done) =\u003E {\r\n removeTransitionClass(el, isAppear ? appearToClass : enterToClass);\r\n removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);\r\n done && done();\r\n };\r\n const finishLeave = (el, done) =\u003E {\r\n removeTransitionClass(el, leaveToClass);\r\n removeTransitionClass(el, leaveActiveClass);\r\n done && done();\r\n };\r\n const makeEnterHook = (isAppear) =\u003E {\r\n return (el, done) =\u003E {\r\n const hook = isAppear ? onAppear : onEnter;\r\n const resolve = () =\u003E finishEnter(el, isAppear, done);\r\n callHook$1(hook, [el, resolve]);\r\n nextFrame(() =\u003E {\r\n removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);\r\n addTransitionClass(el, isAppear ? appearToClass : enterToClass);\r\n if (!hasExplicitCallback(hook)) {\r\n whenTransitionEnds(el, type, enterDuration, resolve);\r\n }\r\n });\r\n };\r\n };\r\n return extend(baseProps, {\r\n onBeforeEnter(el) {\r\n callHook$1(onBeforeEnter, [el]);\r\n addTransitionClass(el, enterFromClass);\r\n addTransitionClass(el, enterActiveClass);\r\n },\r\n onBeforeAppear(el) {\r\n callHook$1(onBeforeAppear, [el]);\r\n addTransitionClass(el, appearFromClass);\r\n addTransitionClass(el, appearActiveClass);\r\n },\r\n onEnter: makeEnterHook(false),\r\n onAppear: makeEnterHook(true),\r\n onLeave(el, done) {\r\n const resolve = () =\u003E finishLeave(el, done);\r\n addTransitionClass(el, leaveFromClass);\r\n \u002F\u002F force reflow so *-leave-from classes immediately take effect (#2593)\r\n forceReflow();\r\n addTransitionClass(el, leaveActiveClass);\r\n nextFrame(() =\u003E {\r\n removeTransitionClass(el, leaveFromClass);\r\n addTransitionClass(el, leaveToClass);\r\n if (!hasExplicitCallback(onLeave)) {\r\n whenTransitionEnds(el, type, leaveDuration, resolve);\r\n }\r\n });\r\n callHook$1(onLeave, [el, resolve]);\r\n },\r\n onEnterCancelled(el) {\r\n finishEnter(el, false);\r\n callHook$1(onEnterCancelled, [el]);\r\n },\r\n onAppearCancelled(el) {\r\n finishEnter(el, true);\r\n callHook$1(onAppearCancelled, [el]);\r\n },\r\n onLeaveCancelled(el) {\r\n finishLeave(el);\r\n callHook$1(onLeaveCancelled, [el]);\r\n }\r\n });\r\n}\r\nfunction normalizeDuration(duration) {\r\n if (duration == null) {\r\n return null;\r\n }\r\n else if (isObject(duration)) {\r\n return [NumberOf(duration.enter), NumberOf(duration.leave)];\r\n }\r\n else {\r\n const n = NumberOf(duration);\r\n return [n, n];\r\n }\r\n}\r\nfunction NumberOf(val) {\r\n const res = toNumber(val);\r\n validateDuration(res);\r\n return res;\r\n}\r\nfunction validateDuration(val) {\r\n if (typeof val !== 'number') {\r\n warn$1(`\u003Ctransition\u003E explicit duration is not a valid number - ` +\r\n `got ${JSON.stringify(val)}.`);\r\n }\r\n else if (isNaN(val)) {\r\n warn$1(`\u003Ctransition\u003E explicit duration is NaN - ` +\r\n 'the duration expression might be incorrect.');\r\n }\r\n}\r\nfunction addTransitionClass(el, cls) {\r\n cls.split(\u002F\\s+\u002F).forEach(c =\u003E c && el.classList.add(c));\r\n (el._vtc ||\r\n (el._vtc = new Set())).add(cls);\r\n}\r\nfunction removeTransitionClass(el, cls) {\r\n cls.split(\u002F\\s+\u002F).forEach(c =\u003E c && el.classList.remove(c));\r\n const { _vtc } = el;\r\n if (_vtc) {\r\n _vtc.delete(cls);\r\n if (!_vtc.size) {\r\n el._vtc = undefined;\r\n }\r\n }\r\n}\r\nfunction nextFrame(cb) {\r\n requestAnimationFrame(() =\u003E {\r\n requestAnimationFrame(cb);\r\n });\r\n}\r\nlet endId = 0;\r\nfunction whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {\r\n const id = (el._endId = ++endId);\r\n const resolveIfNotStale = () =\u003E {\r\n if (id === el._endId) {\r\n resolve();\r\n }\r\n };\r\n if (explicitTimeout) {\r\n return setTimeout(resolveIfNotStale, explicitTimeout);\r\n }\r\n const { type, timeout, propCount } = getTransitionInfo(el, expectedType);\r\n if (!type) {\r\n return resolve();\r\n }\r\n const endEvent = type + 'end';\r\n let ended = 0;\r\n const end = () =\u003E {\r\n el.removeEventListener(endEvent, onEnd);\r\n resolveIfNotStale();\r\n };\r\n const onEnd = (e) =\u003E {\r\n if (e.target === el && ++ended \u003E= propCount) {\r\n end();\r\n }\r\n };\r\n setTimeout(() =\u003E {\r\n if (ended \u003C propCount) {\r\n end();\r\n }\r\n }, timeout + 1);\r\n el.addEventListener(endEvent, onEnd);\r\n}\r\nfunction getTransitionInfo(el, expectedType) {\r\n const styles = window.getComputedStyle(el);\r\n \u002F\u002F JSDOM may return undefined for transition properties\r\n const getStyleProperties = (key) =\u003E (styles[key] || '').split(', ');\r\n const transitionDelays = getStyleProperties(TRANSITION + 'Delay');\r\n const transitionDurations = getStyleProperties(TRANSITION + 'Duration');\r\n const transitionTimeout = getTimeout(transitionDelays, transitionDurations);\r\n const animationDelays = getStyleProperties(ANIMATION + 'Delay');\r\n const animationDurations = getStyleProperties(ANIMATION + 'Duration');\r\n const animationTimeout = getTimeout(animationDelays, animationDurations);\r\n let type = null;\r\n let timeout = 0;\r\n let propCount = 0;\r\n \u002F* istanbul ignore if *\u002F\r\n if (expectedType === TRANSITION) {\r\n if (transitionTimeout \u003E 0) {\r\n type = TRANSITION;\r\n timeout = transitionTimeout;\r\n propCount = transitionDurations.length;\r\n }\r\n }\r\n else if (expectedType === ANIMATION) {\r\n if (animationTimeout \u003E 0) {\r\n type = ANIMATION;\r\n timeout = animationTimeout;\r\n propCount = animationDurations.length;\r\n }\r\n }\r\n else {\r\n timeout = Math.max(transitionTimeout, animationTimeout);\r\n type =\r\n timeout \u003E 0\r\n ? transitionTimeout \u003E animationTimeout\r\n ? TRANSITION\r\n : ANIMATION\r\n : null;\r\n propCount = type\r\n ? type === TRANSITION\r\n ? transitionDurations.length\r\n : animationDurations.length\r\n : 0;\r\n }\r\n const hasTransform = type === TRANSITION &&\r\n \u002F\\b(transform|all)(,|$)\u002F.test(styles[TRANSITION + 'Property']);\r\n return {\r\n type,\r\n timeout,\r\n propCount,\r\n hasTransform\r\n };\r\n}\r\nfunction getTimeout(delays, durations) {\r\n while (delays.length \u003C durations.length) {\r\n delays = delays.concat(delays);\r\n }\r\n return Math.max(...durations.map((d, i) =\u003E toMs(d) + toMs(delays[i])));\r\n}\r\n\u002F\u002F Old versions of Chromium (below 61.0.3163.100) formats floating pointer\r\n\u002F\u002F numbers in a locale-dependent way, using a comma instead of a dot.\r\n\u002F\u002F If comma is not replaced with a dot, the input will be rounded down\r\n\u002F\u002F (i.e. acting as a floor function) causing unexpected behaviors\r\nfunction toMs(s) {\r\n return Number(s.slice(0, -1).replace(',', '.')) * 1000;\r\n}\r\n\u002F\u002F synchronously force layout to put elements into a certain state\r\nfunction forceReflow() {\r\n return document.body.offsetHeight;\r\n}\r\n\r\nconst positionMap = new WeakMap();\r\nconst newPositionMap = new WeakMap();\r\nconst TransitionGroupImpl = {\r\n name: 'TransitionGroup',\r\n props: \u002F*#__PURE__*\u002F extend({}, TransitionPropsValidators, {\r\n tag: String,\r\n moveClass: String\r\n }),\r\n setup(props, { slots }) {\r\n const instance = getCurrentInstance();\r\n const state = useTransitionState();\r\n let prevChildren;\r\n let children;\r\n onUpdated(() =\u003E {\r\n \u002F\u002F children is guaranteed to exist after initial render\r\n if (!prevChildren.length) {\r\n return;\r\n }\r\n const moveClass = props.moveClass || `${props.name || 'v'}-move`;\r\n if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {\r\n return;\r\n }\r\n \u002F\u002F we divide the work into three loops to avoid mixing DOM reads and writes\r\n \u002F\u002F in each iteration - which helps prevent layout thrashing.\r\n prevChildren.forEach(callPendingCbs);\r\n prevChildren.forEach(recordPosition);\r\n const movedChildren = prevChildren.filter(applyTranslation);\r\n \u002F\u002F force reflow to put everything in position\r\n forceReflow();\r\n movedChildren.forEach(c =\u003E {\r\n const el = c.el;\r\n const style = el.style;\r\n addTransitionClass(el, moveClass);\r\n style.transform = style.webkitTransform = style.transitionDuration = '';\r\n const cb = (el._moveCb = (e) =\u003E {\r\n if (e && e.target !== el) {\r\n return;\r\n }\r\n if (!e || \u002Ftransform$\u002F.test(e.propertyName)) {\r\n el.removeEventListener('transitionend', cb);\r\n el._moveCb = null;\r\n removeTransitionClass(el, moveClass);\r\n }\r\n });\r\n el.addEventListener('transitionend', cb);\r\n });\r\n });\r\n return () =\u003E {\r\n const rawProps = toRaw(props);\r\n const cssTransitionProps = resolveTransitionProps(rawProps);\r\n let tag = rawProps.tag || Fragment;\r\n prevChildren = children;\r\n children = slots.default ? getTransitionRawChildren(slots.default()) : [];\r\n for (let i = 0; i \u003C children.length; i++) {\r\n const child = children[i];\r\n if (child.key != null) {\r\n setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));\r\n }\r\n else {\r\n warn$1(`\u003CTransitionGroup\u003E children must be keyed.`);\r\n }\r\n }\r\n if (prevChildren) {\r\n for (let i = 0; i \u003C prevChildren.length; i++) {\r\n const child = prevChildren[i];\r\n setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));\r\n positionMap.set(child, child.el.getBoundingClientRect());\r\n }\r\n }\r\n return createVNode(tag, null, children);\r\n };\r\n }\r\n};\r\nconst TransitionGroup = TransitionGroupImpl;\r\nfunction callPendingCbs(c) {\r\n const el = c.el;\r\n if (el._moveCb) {\r\n el._moveCb();\r\n }\r\n if (el._enterCb) {\r\n el._enterCb();\r\n }\r\n}\r\nfunction recordPosition(c) {\r\n newPositionMap.set(c, c.el.getBoundingClientRect());\r\n}\r\nfunction applyTranslation(c) {\r\n const oldPos = positionMap.get(c);\r\n const newPos = newPositionMap.get(c);\r\n const dx = oldPos.left - newPos.left;\r\n const dy = oldPos.top - newPos.top;\r\n if (dx || dy) {\r\n const s = c.el.style;\r\n s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;\r\n s.transitionDuration = '0s';\r\n return c;\r\n }\r\n}\r\nfunction hasCSSTransform(el, root, moveClass) {\r\n \u002F\u002F Detect whether an element with the move class applied has\r\n \u002F\u002F CSS transitions. Since the element may be inside an entering\r\n \u002F\u002F transition at this very moment, we make a clone of it and remove\r\n \u002F\u002F all other transition classes applied to ensure only the move class\r\n \u002F\u002F is applied.\r\n const clone = el.cloneNode();\r\n if (el._vtc) {\r\n el._vtc.forEach(cls =\u003E {\r\n cls.split(\u002F\\s+\u002F).forEach(c =\u003E c && clone.classList.remove(c));\r\n });\r\n }\r\n moveClass.split(\u002F\\s+\u002F).forEach(c =\u003E c && clone.classList.add(c));\r\n clone.style.display = 'none';\r\n const container = (root.nodeType === 1 ? root : root.parentNode);\r\n container.appendChild(clone);\r\n const { hasTransform } = getTransitionInfo(clone);\r\n container.removeChild(clone);\r\n return hasTransform;\r\n}\r\n\r\nconst getModelAssigner = (vnode) =\u003E {\r\n const fn = vnode.props['onUpdate:modelValue'];\r\n return isArray(fn) ? value =\u003E invokeArrayFns(fn, value) : fn;\r\n};\r\nfunction onCompositionStart(e) {\r\n e.target.composing = true;\r\n}\r\nfunction onCompositionEnd(e) {\r\n const target = e.target;\r\n if (target.composing) {\r\n target.composing = false;\r\n trigger$1(target, 'input');\r\n }\r\n}\r\nfunction trigger$1(el, type) {\r\n const e = document.createEvent('HTMLEvents');\r\n e.initEvent(type, true, true);\r\n el.dispatchEvent(e);\r\n}\r\n\u002F\u002F We are exporting the v-model runtime directly as vnode hooks so that it can\r\n\u002F\u002F be tree-shaken in case v-model is never used.\r\nconst vModelText = {\r\n created(el, { modifiers: { lazy, trim, number } }, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n const castToNumber = number || (vnode.props && vnode.props.type === 'number');\r\n addEventListener(el, lazy ? 'change' : 'input', e =\u003E {\r\n if (e.target.composing)\r\n return;\r\n let domValue = el.value;\r\n if (trim) {\r\n domValue = domValue.trim();\r\n }\r\n else if (castToNumber) {\r\n domValue = toNumber(domValue);\r\n }\r\n el._assign(domValue);\r\n });\r\n if (trim) {\r\n addEventListener(el, 'change', () =\u003E {\r\n el.value = el.value.trim();\r\n });\r\n }\r\n if (!lazy) {\r\n addEventListener(el, 'compositionstart', onCompositionStart);\r\n addEventListener(el, 'compositionend', onCompositionEnd);\r\n \u002F\u002F Safari \u003C 10.2 & UIWebView doesn't fire compositionend when\r\n \u002F\u002F switching focus before confirming composition choice\r\n \u002F\u002F this also fixes the issue where some browsers e.g. iOS Chrome\r\n \u002F\u002F fires \"change\" instead of \"input\" on autocomplete.\r\n addEventListener(el, 'change', onCompositionEnd);\r\n }\r\n },\r\n \u002F\u002F set value on mounted so it's after min\u002Fmax for type=\"range\"\r\n mounted(el, { value }) {\r\n el.value = value == null ? '' : value;\r\n },\r\n beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n \u002F\u002F avoid clearing unresolved text. #2302\r\n if (el.composing)\r\n return;\r\n if (document.activeElement === el) {\r\n if (lazy) {\r\n return;\r\n }\r\n if (trim && el.value.trim() === value) {\r\n return;\r\n }\r\n if ((number || el.type === 'number') && toNumber(el.value) === value) {\r\n return;\r\n }\r\n }\r\n const newValue = value == null ? '' : value;\r\n if (el.value !== newValue) {\r\n el.value = newValue;\r\n }\r\n }\r\n};\r\nconst vModelCheckbox = {\r\n \u002F\u002F #4096 array checkboxes need to be deep traversed\r\n deep: true,\r\n created(el, _, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n addEventListener(el, 'change', () =\u003E {\r\n const modelValue = el._modelValue;\r\n const elementValue = getValue(el);\r\n const checked = el.checked;\r\n const assign = el._assign;\r\n if (isArray(modelValue)) {\r\n const index = looseIndexOf(modelValue, elementValue);\r\n const found = index !== -1;\r\n if (checked && !found) {\r\n assign(modelValue.concat(elementValue));\r\n }\r\n else if (!checked && found) {\r\n const filtered = [...modelValue];\r\n filtered.splice(index, 1);\r\n assign(filtered);\r\n }\r\n }\r\n else if (isSet(modelValue)) {\r\n const cloned = new Set(modelValue);\r\n if (checked) {\r\n cloned.add(elementValue);\r\n }\r\n else {\r\n cloned.delete(elementValue);\r\n }\r\n assign(cloned);\r\n }\r\n else {\r\n assign(getCheckboxValue(el, checked));\r\n }\r\n });\r\n },\r\n \u002F\u002F set initial checked on mount to wait for true-value\u002Ffalse-value\r\n mounted: setChecked,\r\n beforeUpdate(el, binding, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n setChecked(el, binding, vnode);\r\n }\r\n};\r\nfunction setChecked(el, { value, oldValue }, vnode) {\r\n el._modelValue = value;\r\n if (isArray(value)) {\r\n el.checked = looseIndexOf(value, vnode.props.value) \u003E -1;\r\n }\r\n else if (isSet(value)) {\r\n el.checked = value.has(vnode.props.value);\r\n }\r\n else if (value !== oldValue) {\r\n el.checked = looseEqual(value, getCheckboxValue(el, true));\r\n }\r\n}\r\nconst vModelRadio = {\r\n created(el, { value }, vnode) {\r\n el.checked = looseEqual(value, vnode.props.value);\r\n el._assign = getModelAssigner(vnode);\r\n addEventListener(el, 'change', () =\u003E {\r\n el._assign(getValue(el));\r\n });\r\n },\r\n beforeUpdate(el, { value, oldValue }, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n if (value !== oldValue) {\r\n el.checked = looseEqual(value, vnode.props.value);\r\n }\r\n }\r\n};\r\nconst vModelSelect = {\r\n \u002F\u002F \u003Cselect multiple\u003E value need to be deep traversed\r\n deep: true,\r\n created(el, { value, modifiers: { number } }, vnode) {\r\n const isSetModel = isSet(value);\r\n addEventListener(el, 'change', () =\u003E {\r\n const selectedVal = Array.prototype.filter\r\n .call(el.options, (o) =\u003E o.selected)\r\n .map((o) =\u003E number ? toNumber(getValue(o)) : getValue(o));\r\n el._assign(el.multiple\r\n ? isSetModel\r\n ? new Set(selectedVal)\r\n : selectedVal\r\n : selectedVal[0]);\r\n });\r\n el._assign = getModelAssigner(vnode);\r\n },\r\n \u002F\u002F set value in mounted & updated because \u003Cselect\u003E relies on its children\r\n \u002F\u002F \u003Coption\u003Es.\r\n mounted(el, { value }) {\r\n setSelected(el, value);\r\n },\r\n beforeUpdate(el, _binding, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n },\r\n updated(el, { value }) {\r\n setSelected(el, value);\r\n }\r\n};\r\nfunction setSelected(el, value) {\r\n const isMultiple = el.multiple;\r\n if (isMultiple && !isArray(value) && !isSet(value)) {\r\n warn$1(`\u003Cselect multiple v-model\u003E expects an Array or Set value for its binding, ` +\r\n `but got ${Object.prototype.toString.call(value).slice(8, -1)}.`);\r\n return;\r\n }\r\n for (let i = 0, l = el.options.length; i \u003C l; i++) {\r\n const option = el.options[i];\r\n const optionValue = getValue(option);\r\n if (isMultiple) {\r\n if (isArray(value)) {\r\n option.selected = looseIndexOf(value, optionValue) \u003E -1;\r\n }\r\n else {\r\n option.selected = value.has(optionValue);\r\n }\r\n }\r\n else {\r\n if (looseEqual(getValue(option), value)) {\r\n if (el.selectedIndex !== i)\r\n el.selectedIndex = i;\r\n return;\r\n }\r\n }\r\n }\r\n if (!isMultiple && el.selectedIndex !== -1) {\r\n el.selectedIndex = -1;\r\n }\r\n}\r\n\u002F\u002F retrieve raw value set via :value bindings\r\nfunction getValue(el) {\r\n return '_value' in el ? el._value : el.value;\r\n}\r\n\u002F\u002F retrieve raw value for true-value and false-value set via :true-value or :false-value bindings\r\nfunction getCheckboxValue(el, checked) {\r\n const key = checked ? '_trueValue' : '_falseValue';\r\n return key in el ? el[key] : checked;\r\n}\r\nconst vModelDynamic = {\r\n created(el, binding, vnode) {\r\n callModelHook(el, binding, vnode, null, 'created');\r\n },\r\n mounted(el, binding, vnode) {\r\n callModelHook(el, binding, vnode, null, 'mounted');\r\n },\r\n beforeUpdate(el, binding, vnode, prevVNode) {\r\n callModelHook(el, binding, vnode, prevVNode, 'beforeUpdate');\r\n },\r\n updated(el, binding, vnode, prevVNode) {\r\n callModelHook(el, binding, vnode, prevVNode, 'updated');\r\n }\r\n};\r\nfunction callModelHook(el, binding, vnode, prevVNode, hook) {\r\n let modelToUse;\r\n switch (el.tagName) {\r\n case 'SELECT':\r\n modelToUse = vModelSelect;\r\n break;\r\n case 'TEXTAREA':\r\n modelToUse = vModelText;\r\n break;\r\n default:\r\n switch (vnode.props && vnode.props.type) {\r\n case 'checkbox':\r\n modelToUse = vModelCheckbox;\r\n break;\r\n case 'radio':\r\n modelToUse = vModelRadio;\r\n break;\r\n default:\r\n modelToUse = vModelText;\r\n }\r\n }\r\n const fn = modelToUse[hook];\r\n fn && fn(el, binding, vnode, prevVNode);\r\n}\r\n\r\nconst systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];\r\nconst modifierGuards = {\r\n stop: e =\u003E e.stopPropagation(),\r\n prevent: e =\u003E e.preventDefault(),\r\n self: e =\u003E e.target !== e.currentTarget,\r\n ctrl: e =\u003E !e.ctrlKey,\r\n shift: e =\u003E !e.shiftKey,\r\n alt: e =\u003E !e.altKey,\r\n meta: e =\u003E !e.metaKey,\r\n left: e =\u003E 'button' in e && e.button !== 0,\r\n middle: e =\u003E 'button' in e && e.button !== 1,\r\n right: e =\u003E 'button' in e && e.button !== 2,\r\n exact: (e, modifiers) =\u003E systemModifiers.some(m =\u003E e[`${m}Key`] && !modifiers.includes(m))\r\n};\r\n\u002F**\r\n * @private\r\n *\u002F\r\nconst withModifiers = (fn, modifiers) =\u003E {\r\n return (event, ...args) =\u003E {\r\n for (let i = 0; i \u003C modifiers.length; i++) {\r\n const guard = modifierGuards[modifiers[i]];\r\n if (guard && guard(event, modifiers))\r\n return;\r\n }\r\n return fn(event, ...args);\r\n };\r\n};\r\n\u002F\u002F Kept for 2.x compat.\r\n\u002F\u002F Note: IE11 compat for `spacebar` and `del` is removed for now.\r\nconst keyNames = {\r\n esc: 'escape',\r\n space: ' ',\r\n up: 'arrow-up',\r\n left: 'arrow-left',\r\n right: 'arrow-right',\r\n down: 'arrow-down',\r\n delete: 'backspace'\r\n};\r\n\u002F**\r\n * @private\r\n *\u002F\r\nconst withKeys = (fn, modifiers) =\u003E {\r\n return (event) =\u003E {\r\n if (!('key' in event)) {\r\n return;\r\n }\r\n const eventKey = hyphenate(event.key);\r\n if (modifiers.some(k =\u003E k === eventKey || keyNames[k] === eventKey)) {\r\n return fn(event);\r\n }\r\n };\r\n};\r\n\r\nconst vShow = {\r\n beforeMount(el, { value }, { transition }) {\r\n el._vod = el.style.display === 'none' ? '' : el.style.display;\r\n if (transition && value) {\r\n transition.beforeEnter(el);\r\n }\r\n else {\r\n setDisplay(el, value);\r\n }\r\n },\r\n mounted(el, { value }, { transition }) {\r\n if (transition && value) {\r\n transition.enter(el);\r\n }\r\n },\r\n updated(el, { value, oldValue }, { transition }) {\r\n if (!value === !oldValue)\r\n return;\r\n if (transition) {\r\n if (value) {\r\n transition.beforeEnter(el);\r\n setDisplay(el, true);\r\n transition.enter(el);\r\n }\r\n else {\r\n transition.leave(el, () =\u003E {\r\n setDisplay(el, false);\r\n });\r\n }\r\n }\r\n else {\r\n setDisplay(el, value);\r\n }\r\n },\r\n beforeUnmount(el, { value }) {\r\n setDisplay(el, value);\r\n }\r\n};\r\nfunction setDisplay(el, value) {\r\n el.style.display = value ? el._vod : 'none';\r\n}\r\n\r\nconst rendererOptions = extend({ patchProp }, nodeOps);\r\n\u002F\u002F lazy create the renderer - this makes core renderer logic tree-shakable\r\n\u002F\u002F in case the user only imports reactivity utilities from Vue.\r\nlet renderer;\r\nlet enabledHydration = false;\r\nfunction ensureRenderer() {\r\n return (renderer ||\r\n (renderer = createRenderer(rendererOptions)));\r\n}\r\nfunction ensureHydrationRenderer() {\r\n renderer = enabledHydration\r\n ? renderer\r\n : createHydrationRenderer(rendererOptions);\r\n enabledHydration = true;\r\n return renderer;\r\n}\r\n\u002F\u002F use explicit type casts here to avoid import() calls in rolled-up d.ts\r\nconst render = ((...args) =\u003E {\r\n ensureRenderer().render(...args);\r\n});\r\nconst hydrate = ((...args) =\u003E {\r\n ensureHydrationRenderer().hydrate(...args);\r\n});\r\nconst createApp = ((...args) =\u003E {\r\n const app = ensureRenderer().createApp(...args);\r\n {\r\n injectNativeTagCheck(app);\r\n injectCompilerOptionsCheck(app);\r\n }\r\n const { mount } = app;\r\n app.mount = (containerOrSelector) =\u003E {\r\n const container = normalizeContainer(containerOrSelector);\r\n if (!container)\r\n return;\r\n const component = app._component;\r\n if (!isFunction(component) && !component.render && !component.template) {\r\n \u002F\u002F __UNSAFE__\r\n \u002F\u002F Reason: potential execution of JS expressions in in-DOM template.\r\n \u002F\u002F The user must make sure the in-DOM template is trusted. If it's\r\n \u002F\u002F rendered by the server, the template should not contain any user data.\r\n component.template = container.innerHTML;\r\n }\r\n \u002F\u002F clear content before mounting\r\n container.innerHTML = '';\r\n const proxy = mount(container, false, container instanceof SVGElement);\r\n if (container instanceof Element) {\r\n container.removeAttribute('v-cloak');\r\n container.setAttribute('data-v-app', '');\r\n }\r\n return proxy;\r\n };\r\n return app;\r\n});\r\nconst createSSRApp = ((...args) =\u003E {\r\n const app = ensureHydrationRenderer().createApp(...args);\r\n {\r\n injectNativeTagCheck(app);\r\n injectCompilerOptionsCheck(app);\r\n }\r\n const { mount } = app;\r\n app.mount = (containerOrSelector) =\u003E {\r\n const container = normalizeContainer(containerOrSelector);\r\n if (container) {\r\n return mount(container, true, container instanceof SVGElement);\r\n }\r\n };\r\n return app;\r\n});\r\nfunction injectNativeTagCheck(app) {\r\n \u002F\u002F Inject `isNativeTag`\r\n \u002F\u002F this is used for component name validation (dev only)\r\n Object.defineProperty(app.config, 'isNativeTag', {\r\n value: (tag) =\u003E isHTMLTag(tag) || isSVGTag(tag),\r\n writable: false\r\n });\r\n}\r\n\u002F\u002F dev only\r\nfunction injectCompilerOptionsCheck(app) {\r\n if (isRuntimeOnly()) {\r\n const isCustomElement = app.config.isCustomElement;\r\n Object.defineProperty(app.config, 'isCustomElement', {\r\n get() {\r\n return isCustomElement;\r\n },\r\n set() {\r\n warn$1(`The \\`isCustomElement\\` config option is deprecated. Use ` +\r\n `\\`compilerOptions.isCustomElement\\` instead.`);\r\n }\r\n });\r\n const compilerOptions = app.config.compilerOptions;\r\n const msg = `The \\`compilerOptions\\` config option is only respected when using ` +\r\n `a build of Vue.js that includes the runtime compiler (aka \"full build\"). ` +\r\n `Since you are using the runtime-only build, \\`compilerOptions\\` ` +\r\n `must be passed to \\`@vue\u002Fcompiler-dom\\` in the build setup instead.\\n` +\r\n `- For vue-loader: pass it via vue-loader's \\`compilerOptions\\` loader option.\\n` +\r\n `- For vue-cli: see https:\u002F\u002Fcli.vuejs.org\u002Fguide\u002Fwebpack.html#modifying-options-of-a-loader\\n` +\r\n `- For vite: pass it via @vitejs\u002Fplugin-vue options. See https:\u002F\u002Fgithub.com\u002Fvitejs\u002Fvite\u002Ftree\u002Fmain\u002Fpackages\u002Fplugin-vue#example-for-passing-options-to-vuecompiler-dom`;\r\n Object.defineProperty(app.config, 'compilerOptions', {\r\n get() {\r\n warn$1(msg);\r\n return compilerOptions;\r\n },\r\n set() {\r\n warn$1(msg);\r\n }\r\n });\r\n }\r\n}\r\nfunction normalizeContainer(container) {\r\n if (isString(container)) {\r\n const res = document.querySelector(container);\r\n if (!res) {\r\n warn$1(`Failed to mount app: mount target selector \"${container}\" returned null.`);\r\n }\r\n return res;\r\n }\r\n if (window.ShadowRoot &&\r\n container instanceof window.ShadowRoot &&\r\n container.mode === 'closed') {\r\n warn$1(`mounting on a ShadowRoot with \\`{mode: \"closed\"}\\` may lead to unpredictable bugs`);\r\n }\r\n return container;\r\n}\r\n\u002F**\r\n * @internal\r\n *\u002F\r\nconst initDirectivesForSSR = NOOP;\r\n\r\nvar runtimeDom = \u002F*#__PURE__*\u002FObject.freeze({\r\n __proto__: null,\r\n render: render,\r\n hydrate: hydrate,\r\n createApp: createApp,\r\n createSSRApp: createSSRApp,\r\n initDirectivesForSSR: initDirectivesForSSR,\r\n defineCustomElement: defineCustomElement,\r\n defineSSRCustomElement: defineSSRCustomElement,\r\n VueElement: VueElement,\r\n useCssModule: useCssModule,\r\n useCssVars: useCssVars,\r\n Transition: Transition,\r\n TransitionGroup: TransitionGroup,\r\n vModelText: vModelText,\r\n vModelCheckbox: vModelCheckbox,\r\n vModelRadio: vModelRadio,\r\n vModelSelect: vModelSelect,\r\n vModelDynamic: vModelDynamic,\r\n withModifiers: withModifiers,\r\n withKeys: withKeys,\r\n vShow: vShow,\r\n reactive: reactive,\r\n ref: ref,\r\n readonly: readonly,\r\n unref: unref,\r\n proxyRefs: proxyRefs,\r\n isRef: isRef,\r\n toRef: toRef,\r\n toRefs: toRefs,\r\n isProxy: isProxy,\r\n isReactive: isReactive,\r\n isReadonly: isReadonly,\r\n isShallow: isShallow,\r\n customRef: customRef,\r\n triggerRef: triggerRef,\r\n shallowRef: shallowRef,\r\n shallowReactive: shallowReactive,\r\n shallowReadonly: shallowReadonly,\r\n markRaw: markRaw,\r\n toRaw: toRaw,\r\n effect: effect,\r\n stop: stop,\r\n ReactiveEffect: ReactiveEffect,\r\n effectScope: effectScope,\r\n EffectScope: EffectScope,\r\n getCurrentScope: getCurrentScope,\r\n onScopeDispose: onScopeDispose,\r\n computed: computed$1,\r\n watch: watch,\r\n watchEffect: watchEffect,\r\n watchPostEffect: watchPostEffect,\r\n watchSyncEffect: watchSyncEffect,\r\n onBeforeMount: onBeforeMount,\r\n onMounted: onMounted,\r\n onBeforeUpdate: onBeforeUpdate,\r\n onUpdated: onUpdated,\r\n onBeforeUnmount: onBeforeUnmount,\r\n onUnmounted: onUnmounted,\r\n onActivated: onActivated,\r\n onDeactivated: onDeactivated,\r\n onRenderTracked: onRenderTracked,\r\n onRenderTriggered: onRenderTriggered,\r\n onErrorCaptured: onErrorCaptured,\r\n onServerPrefetch: onServerPrefetch,\r\n provide: provide,\r\n inject: inject,\r\n nextTick: nextTick,\r\n defineComponent: defineComponent,\r\n defineAsyncComponent: defineAsyncComponent,\r\n useAttrs: useAttrs,\r\n useSlots: useSlots,\r\n defineProps: defineProps,\r\n defineEmits: defineEmits,\r\n defineExpose: defineExpose,\r\n withDefaults: withDefaults,\r\n mergeDefaults: mergeDefaults,\r\n createPropsRestProxy: createPropsRestProxy,\r\n withAsyncContext: withAsyncContext,\r\n getCurrentInstance: getCurrentInstance,\r\n h: h,\r\n createVNode: createVNode,\r\n cloneVNode: cloneVNode,\r\n mergeProps: mergeProps,\r\n isVNode: isVNode,\r\n Fragment: Fragment,\r\n Text: Text,\r\n Comment: Comment,\r\n Static: Static,\r\n Teleport: Teleport,\r\n Suspense: Suspense,\r\n KeepAlive: KeepAlive,\r\n BaseTransition: BaseTransition,\r\n withDirectives: withDirectives,\r\n useSSRContext: useSSRContext,\r\n ssrContextKey: ssrContextKey,\r\n createRenderer: createRenderer,\r\n createHydrationRenderer: createHydrationRenderer,\r\n queuePostFlushCb: queuePostFlushCb,\r\n warn: warn$1,\r\n handleError: handleError,\r\n callWithErrorHandling: callWithErrorHandling,\r\n callWithAsyncErrorHandling: callWithAsyncErrorHandling,\r\n resolveComponent: resolveComponent,\r\n resolveDirective: resolveDirective,\r\n resolveDynamicComponent: resolveDynamicComponent,\r\n registerRuntimeCompiler: registerRuntimeCompiler,\r\n isRuntimeOnly: isRuntimeOnly,\r\n useTransitionState: useTransitionState,\r\n resolveTransitionHooks: resolveTransitionHooks,\r\n setTransitionHooks: setTransitionHooks,\r\n getTransitionRawChildren: getTransitionRawChildren,\r\n initCustomFormatter: initCustomFormatter,\r\n get devtools () { return devtools; },\r\n setDevtoolsHook: setDevtoolsHook,\r\n withCtx: withCtx,\r\n pushScopeId: pushScopeId,\r\n popScopeId: popScopeId,\r\n withScopeId: withScopeId,\r\n renderList: renderList,\r\n toHandlers: toHandlers,\r\n renderSlot: renderSlot,\r\n createSlots: createSlots,\r\n withMemo: withMemo,\r\n isMemoSame: isMemoSame,\r\n openBlock: openBlock,\r\n createBlock: createBlock,\r\n setBlockTracking: setBlockTracking,\r\n createTextVNode: createTextVNode,\r\n createCommentVNode: createCommentVNode,\r\n createStaticVNode: createStaticVNode,\r\n createElementVNode: createBaseVNode,\r\n createElementBlock: createElementBlock,\r\n guardReactiveProps: guardReactiveProps,\r\n toDisplayString: toDisplayString,\r\n camelize: camelize,\r\n capitalize: capitalize,\r\n toHandlerKey: toHandlerKey,\r\n normalizeProps: normalizeProps,\r\n normalizeClass: normalizeClass,\r\n normalizeStyle: normalizeStyle,\r\n transformVNodeArgs: transformVNodeArgs,\r\n version: version,\r\n ssrUtils: ssrUtils,\r\n resolveFilter: resolveFilter,\r\n compatUtils: compatUtils\r\n});\r\n\r\nfunction initDev() {\r\n {\r\n {\r\n console.info(`You are running a development build of Vue.\\n` +\r\n `Make sure to use the production build (*.prod.js) when deploying for production.`);\r\n }\r\n initCustomFormatter();\r\n }\r\n}\r\n\r\nfunction defaultOnError(error) {\r\n throw error;\r\n}\r\nfunction defaultOnWarn(msg) {\r\n console.warn(`[Vue warn] ${msg.message}`);\r\n}\r\nfunction createCompilerError(code, loc, messages, additionalMessage) {\r\n const msg = (messages || errorMessages)[code] + (additionalMessage || ``)\r\n ;\r\n const error = new SyntaxError(String(msg));\r\n error.code = code;\r\n error.loc = loc;\r\n return error;\r\n}\r\nconst errorMessages = {\r\n \u002F\u002F parse errors\r\n [0 \u002F* ABRUPT_CLOSING_OF_EMPTY_COMMENT *\u002F]: 'Illegal comment.',\r\n [1 \u002F* CDATA_IN_HTML_CONTENT *\u002F]: 'CDATA section is allowed only in XML context.',\r\n [2 \u002F* DUPLICATE_ATTRIBUTE *\u002F]: 'Duplicate attribute.',\r\n [3 \u002F* END_TAG_WITH_ATTRIBUTES *\u002F]: 'End tag cannot have attributes.',\r\n [4 \u002F* END_TAG_WITH_TRAILING_SOLIDUS *\u002F]: \"Illegal '\u002F' in tags.\",\r\n [5 \u002F* EOF_BEFORE_TAG_NAME *\u002F]: 'Unexpected EOF in tag.',\r\n [6 \u002F* EOF_IN_CDATA *\u002F]: 'Unexpected EOF in CDATA section.',\r\n [7 \u002F* EOF_IN_COMMENT *\u002F]: 'Unexpected EOF in comment.',\r\n [8 \u002F* EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT *\u002F]: 'Unexpected EOF in script.',\r\n [9 \u002F* EOF_IN_TAG *\u002F]: 'Unexpected EOF in tag.',\r\n [10 \u002F* INCORRECTLY_CLOSED_COMMENT *\u002F]: 'Incorrectly closed comment.',\r\n [11 \u002F* INCORRECTLY_OPENED_COMMENT *\u002F]: 'Incorrectly opened comment.',\r\n [12 \u002F* INVALID_FIRST_CHARACTER_OF_TAG_NAME *\u002F]: \"Illegal tag name. Use '<' to print '\u003C'.\",\r\n [13 \u002F* MISSING_ATTRIBUTE_VALUE *\u002F]: 'Attribute value was expected.',\r\n [14 \u002F* MISSING_END_TAG_NAME *\u002F]: 'End tag name was expected.',\r\n [15 \u002F* MISSING_WHITESPACE_BETWEEN_ATTRIBUTES *\u002F]: 'Whitespace was expected.',\r\n [16 \u002F* NESTED_COMMENT *\u002F]: \"Unexpected '\u003C!--' in comment.\",\r\n [17 \u002F* UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME *\u002F]: 'Attribute name cannot contain U+0022 (\"), U+0027 (\\'), and U+003C (\u003C).',\r\n [18 \u002F* UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE *\u002F]: 'Unquoted attribute value cannot contain U+0022 (\"), U+0027 (\\'), U+003C (\u003C), U+003D (=), and U+0060 (`).',\r\n [19 \u002F* UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME *\u002F]: \"Attribute name cannot start with '='.\",\r\n [21 \u002F* UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME *\u002F]: \"'\u003C?' is allowed only in XML context.\",\r\n [20 \u002F* UNEXPECTED_NULL_CHARACTER *\u002F]: `Unexpected null character.`,\r\n [22 \u002F* UNEXPECTED_SOLIDUS_IN_TAG *\u002F]: \"Illegal '\u002F' in tags.\",\r\n \u002F\u002F Vue-specific parse errors\r\n [23 \u002F* X_INVALID_END_TAG *\u002F]: 'Invalid end tag.',\r\n [24 \u002F* X_MISSING_END_TAG *\u002F]: 'Element is missing end tag.',\r\n [25 \u002F* X_MISSING_INTERPOLATION_END *\u002F]: 'Interpolation end sign was not found.',\r\n [27 \u002F* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END *\u002F]: 'End bracket for dynamic directive argument was not found. ' +\r\n 'Note that dynamic directive argument cannot contain spaces.',\r\n [26 \u002F* X_MISSING_DIRECTIVE_NAME *\u002F]: 'Legal directive name was expected.',\r\n \u002F\u002F transform errors\r\n [28 \u002F* X_V_IF_NO_EXPRESSION *\u002F]: `v-if\u002Fv-else-if is missing expression.`,\r\n [29 \u002F* X_V_IF_SAME_KEY *\u002F]: `v-if\u002Felse branches must use unique keys.`,\r\n [30 \u002F* X_V_ELSE_NO_ADJACENT_IF *\u002F]: `v-else\u002Fv-else-if has no adjacent v-if or v-else-if.`,\r\n [31 \u002F* X_V_FOR_NO_EXPRESSION *\u002F]: `v-for is missing expression.`,\r\n [32 \u002F* X_V_FOR_MALFORMED_EXPRESSION *\u002F]: `v-for has invalid expression.`,\r\n [33 \u002F* X_V_FOR_TEMPLATE_KEY_PLACEMENT *\u002F]: `\u003Ctemplate v-for\u003E key should be placed on the \u003Ctemplate\u003E tag.`,\r\n [34 \u002F* X_V_BIND_NO_EXPRESSION *\u002F]: `v-bind is missing expression.`,\r\n [35 \u002F* X_V_ON_NO_EXPRESSION *\u002F]: `v-on is missing expression.`,\r\n [36 \u002F* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET *\u002F]: `Unexpected custom directive on \u003Cslot\u003E outlet.`,\r\n [37 \u002F* X_V_SLOT_MIXED_SLOT_USAGE *\u002F]: `Mixed v-slot usage on both the component and nested \u003Ctemplate\u003E.` +\r\n `When there are multiple named slots, all slots should use \u003Ctemplate\u003E ` +\r\n `syntax to avoid scope ambiguity.`,\r\n [38 \u002F* X_V_SLOT_DUPLICATE_SLOT_NAMES *\u002F]: `Duplicate slot names found. `,\r\n [39 \u002F* X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN *\u002F]: `Extraneous children found when component already has explicitly named ` +\r\n `default slot. These children will be ignored.`,\r\n [40 \u002F* X_V_SLOT_MISPLACED *\u002F]: `v-slot can only be used on components or \u003Ctemplate\u003E tags.`,\r\n [41 \u002F* X_V_MODEL_NO_EXPRESSION *\u002F]: `v-model is missing expression.`,\r\n [42 \u002F* X_V_MODEL_MALFORMED_EXPRESSION *\u002F]: `v-model value must be a valid JavaScript member expression.`,\r\n [43 \u002F* X_V_MODEL_ON_SCOPE_VARIABLE *\u002F]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,\r\n [44 \u002F* X_INVALID_EXPRESSION *\u002F]: `Error parsing JavaScript expression: `,\r\n [45 \u002F* X_KEEP_ALIVE_INVALID_CHILDREN *\u002F]: `\u003CKeepAlive\u003E expects exactly one child component.`,\r\n \u002F\u002F generic errors\r\n [46 \u002F* X_PREFIX_ID_NOT_SUPPORTED *\u002F]: `\"prefixIdentifiers\" option is not supported in this build of compiler.`,\r\n [47 \u002F* X_MODULE_MODE_NOT_SUPPORTED *\u002F]: `ES module mode is not supported in this build of compiler.`,\r\n [48 \u002F* X_CACHE_HANDLER_NOT_SUPPORTED *\u002F]: `\"cacheHandlers\" option is only supported when the \"prefixIdentifiers\" option is enabled.`,\r\n [49 \u002F* X_SCOPE_ID_NOT_SUPPORTED *\u002F]: `\"scopeId\" option is only supported in module mode.`,\r\n \u002F\u002F just to fulfill types\r\n [50 \u002F* __EXTEND_POINT__ *\u002F]: ``\r\n};\r\n\r\nconst FRAGMENT = Symbol(`Fragment` );\r\nconst TELEPORT = Symbol(`Teleport` );\r\nconst SUSPENSE = Symbol(`Suspense` );\r\nconst KEEP_ALIVE = Symbol(`KeepAlive` );\r\nconst BASE_TRANSITION = Symbol(`BaseTransition` );\r\nconst OPEN_BLOCK = Symbol(`openBlock` );\r\nconst CREATE_BLOCK = Symbol(`createBlock` );\r\nconst CREATE_ELEMENT_BLOCK = Symbol(`createElementBlock` );\r\nconst CREATE_VNODE = Symbol(`createVNode` );\r\nconst CREATE_ELEMENT_VNODE = Symbol(`createElementVNode` );\r\nconst CREATE_COMMENT = Symbol(`createCommentVNode` );\r\nconst CREATE_TEXT = Symbol(`createTextVNode` );\r\nconst CREATE_STATIC = Symbol(`createStaticVNode` );\r\nconst RESOLVE_COMPONENT = Symbol(`resolveComponent` );\r\nconst RESOLVE_DYNAMIC_COMPONENT = Symbol(`resolveDynamicComponent` );\r\nconst RESOLVE_DIRECTIVE = Symbol(`resolveDirective` );\r\nconst RESOLVE_FILTER = Symbol(`resolveFilter` );\r\nconst WITH_DIRECTIVES = Symbol(`withDirectives` );\r\nconst RENDER_LIST = Symbol(`renderList` );\r\nconst RENDER_SLOT = Symbol(`renderSlot` );\r\nconst CREATE_SLOTS = Symbol(`createSlots` );\r\nconst TO_DISPLAY_STRING = Symbol(`toDisplayString` );\r\nconst MERGE_PROPS = Symbol(`mergeProps` );\r\nconst NORMALIZE_CLASS = Symbol(`normalizeClass` );\r\nconst NORMALIZE_STYLE = Symbol(`normalizeStyle` );\r\nconst NORMALIZE_PROPS = Symbol(`normalizeProps` );\r\nconst GUARD_REACTIVE_PROPS = Symbol(`guardReactiveProps` );\r\nconst TO_HANDLERS = Symbol(`toHandlers` );\r\nconst CAMELIZE = Symbol(`camelize` );\r\nconst CAPITALIZE = Symbol(`capitalize` );\r\nconst TO_HANDLER_KEY = Symbol(`toHandlerKey` );\r\nconst SET_BLOCK_TRACKING = Symbol(`setBlockTracking` );\r\nconst PUSH_SCOPE_ID = Symbol(`pushScopeId` );\r\nconst POP_SCOPE_ID = Symbol(`popScopeId` );\r\nconst WITH_CTX = Symbol(`withCtx` );\r\nconst UNREF = Symbol(`unref` );\r\nconst IS_REF = Symbol(`isRef` );\r\nconst WITH_MEMO = Symbol(`withMemo` );\r\nconst IS_MEMO_SAME = Symbol(`isMemoSame` );\r\n\u002F\u002F Name mapping for runtime helpers that need to be imported from 'vue' in\r\n\u002F\u002F generated code. Make sure these are correctly exported in the runtime!\r\n\u002F\u002F Using `any` here because TS doesn't allow symbols as index type.\r\nconst helperNameMap = {\r\n [FRAGMENT]: `Fragment`,\r\n [TELEPORT]: `Teleport`,\r\n [SUSPENSE]: `Suspense`,\r\n [KEEP_ALIVE]: `KeepAlive`,\r\n [BASE_TRANSITION]: `BaseTransition`,\r\n [OPEN_BLOCK]: `openBlock`,\r\n [CREATE_BLOCK]: `createBlock`,\r\n [CREATE_ELEMENT_BLOCK]: `createElementBlock`,\r\n [CREATE_VNODE]: `createVNode`,\r\n [CREATE_ELEMENT_VNODE]: `createElementVNode`,\r\n [CREATE_COMMENT]: `createCommentVNode`,\r\n [CREATE_TEXT]: `createTextVNode`,\r\n [CREATE_STATIC]: `createStaticVNode`,\r\n [RESOLVE_COMPONENT]: `resolveComponent`,\r\n [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,\r\n [RESOLVE_DIRECTIVE]: `resolveDirective`,\r\n [RESOLVE_FILTER]: `resolveFilter`,\r\n [WITH_DIRECTIVES]: `withDirectives`,\r\n [RENDER_LIST]: `renderList`,\r\n [RENDER_SLOT]: `renderSlot`,\r\n [CREATE_SLOTS]: `createSlots`,\r\n [TO_DISPLAY_STRING]: `toDisplayString`,\r\n [MERGE_PROPS]: `mergeProps`,\r\n [NORMALIZE_CLASS]: `normalizeClass`,\r\n [NORMALIZE_STYLE]: `normalizeStyle`,\r\n [NORMALIZE_PROPS]: `normalizeProps`,\r\n [GUARD_REACTIVE_PROPS]: `guardReactiveProps`,\r\n [TO_HANDLERS]: `toHandlers`,\r\n [CAMELIZE]: `camelize`,\r\n [CAPITALIZE]: `capitalize`,\r\n [TO_HANDLER_KEY]: `toHandlerKey`,\r\n [SET_BLOCK_TRACKING]: `setBlockTracking`,\r\n [PUSH_SCOPE_ID]: `pushScopeId`,\r\n [POP_SCOPE_ID]: `popScopeId`,\r\n [WITH_CTX]: `withCtx`,\r\n [UNREF]: `unref`,\r\n [IS_REF]: `isRef`,\r\n [WITH_MEMO]: `withMemo`,\r\n [IS_MEMO_SAME]: `isMemoSame`\r\n};\r\nfunction registerRuntimeHelpers(helpers) {\r\n Object.getOwnPropertySymbols(helpers).forEach(s =\u003E {\r\n helperNameMap[s] = helpers[s];\r\n });\r\n}\r\n\r\n\u002F\u002F AST Utilities ---------------------------------------------------------------\r\n\u002F\u002F Some expressions, e.g. sequence and conditional expressions, are never\r\n\u002F\u002F associated with template nodes, so their source locations are just a stub.\r\n\u002F\u002F Container types like CompoundExpression also don't need a real location.\r\nconst locStub = {\r\n source: '',\r\n start: { line: 1, column: 1, offset: 0 },\r\n end: { line: 1, column: 1, offset: 0 }\r\n};\r\nfunction createRoot(children, loc = locStub) {\r\n return {\r\n type: 0 \u002F* ROOT *\u002F,\r\n children,\r\n helpers: [],\r\n components: [],\r\n directives: [],\r\n hoists: [],\r\n imports: [],\r\n cached: 0,\r\n temps: 0,\r\n codegenNode: undefined,\r\n loc\r\n };\r\n}\r\nfunction createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) {\r\n if (context) {\r\n if (isBlock) {\r\n context.helper(OPEN_BLOCK);\r\n context.helper(getVNodeBlockHelper(context.inSSR, isComponent));\r\n }\r\n else {\r\n context.helper(getVNodeHelper(context.inSSR, isComponent));\r\n }\r\n if (directives) {\r\n context.helper(WITH_DIRECTIVES);\r\n }\r\n }\r\n return {\r\n type: 13 \u002F* VNODE_CALL *\u002F,\r\n tag,\r\n props,\r\n children,\r\n patchFlag,\r\n dynamicProps,\r\n directives,\r\n isBlock,\r\n disableTracking,\r\n isComponent,\r\n loc\r\n };\r\n}\r\nfunction createArrayExpression(elements, loc = locStub) {\r\n return {\r\n type: 17 \u002F* JS_ARRAY_EXPRESSION *\u002F,\r\n loc,\r\n elements\r\n };\r\n}\r\nfunction createObjectExpression(properties, loc = locStub) {\r\n return {\r\n type: 15 \u002F* JS_OBJECT_EXPRESSION *\u002F,\r\n loc,\r\n properties\r\n };\r\n}\r\nfunction createObjectProperty(key, value) {\r\n return {\r\n type: 16 \u002F* JS_PROPERTY *\u002F,\r\n loc: locStub,\r\n key: isString(key) ? createSimpleExpression(key, true) : key,\r\n value\r\n };\r\n}\r\nfunction createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0 \u002F* NOT_CONSTANT *\u002F) {\r\n return {\r\n type: 4 \u002F* SIMPLE_EXPRESSION *\u002F,\r\n loc,\r\n content,\r\n isStatic,\r\n constType: isStatic ? 3 \u002F* CAN_STRINGIFY *\u002F : constType\r\n };\r\n}\r\nfunction createCompoundExpression(children, loc = locStub) {\r\n return {\r\n type: 8 \u002F* COMPOUND_EXPRESSION *\u002F,\r\n loc,\r\n children\r\n };\r\n}\r\nfunction createCallExpression(callee, args = [], loc = locStub) {\r\n return {\r\n type: 14 \u002F* JS_CALL_EXPRESSION *\u002F,\r\n loc,\r\n callee,\r\n arguments: args\r\n };\r\n}\r\nfunction createFunctionExpression(params, returns = undefined, newline = false, isSlot = false, loc = locStub) {\r\n return {\r\n type: 18 \u002F* JS_FUNCTION_EXPRESSION *\u002F,\r\n params,\r\n returns,\r\n newline,\r\n isSlot,\r\n loc\r\n };\r\n}\r\nfunction createConditionalExpression(test, consequent, alternate, newline = true) {\r\n return {\r\n type: 19 \u002F* JS_CONDITIONAL_EXPRESSION *\u002F,\r\n test,\r\n consequent,\r\n alternate,\r\n newline,\r\n loc: locStub\r\n };\r\n}\r\nfunction createCacheExpression(index, value, isVNode = false) {\r\n return {\r\n type: 20 \u002F* JS_CACHE_EXPRESSION *\u002F,\r\n index,\r\n value,\r\n isVNode,\r\n loc: locStub\r\n };\r\n}\r\nfunction createBlockStatement(body) {\r\n return {\r\n type: 21 \u002F* JS_BLOCK_STATEMENT *\u002F,\r\n body,\r\n loc: locStub\r\n };\r\n}\r\n\r\nconst isStaticExp = (p) =\u003E p.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F && p.isStatic;\r\nconst isBuiltInType = (tag, expected) =\u003E tag === expected || tag === hyphenate(expected);\r\nfunction isCoreComponent(tag) {\r\n if (isBuiltInType(tag, 'Teleport')) {\r\n return TELEPORT;\r\n }\r\n else if (isBuiltInType(tag, 'Suspense')) {\r\n return SUSPENSE;\r\n }\r\n else if (isBuiltInType(tag, 'KeepAlive')) {\r\n return KEEP_ALIVE;\r\n }\r\n else if (isBuiltInType(tag, 'BaseTransition')) {\r\n return BASE_TRANSITION;\r\n }\r\n}\r\nconst nonIdentifierRE = \u002F^\\d|[^\\$\\w]\u002F;\r\nconst isSimpleIdentifier = (name) =\u003E !nonIdentifierRE.test(name);\r\nconst validFirstIdentCharRE = \u002F[A-Za-z_$\\xA0-\\uFFFF]\u002F;\r\nconst validIdentCharRE = \u002F[\\.\\?\\w$\\xA0-\\uFFFF]\u002F;\r\nconst whitespaceRE = \u002F\\s+[.[]\\s*|\\s*[.[]\\s+\u002Fg;\r\n\u002F**\r\n * Simple lexer to check if an expression is a member expression. This is\r\n * lax and only checks validity at the root level (i.e. does not validate exps\r\n * inside square brackets), but it's ok since these are only used on template\r\n * expressions and false positives are invalid expressions in the first place.\r\n *\u002F\r\nconst isMemberExpressionBrowser = (path) =\u003E {\r\n \u002F\u002F remove whitespaces around . or [ first\r\n path = path.trim().replace(whitespaceRE, s =\u003E s.trim());\r\n let state = 0 \u002F* inMemberExp *\u002F;\r\n let stateStack = [];\r\n let currentOpenBracketCount = 0;\r\n let currentOpenParensCount = 0;\r\n let currentStringType = null;\r\n for (let i = 0; i \u003C path.length; i++) {\r\n const char = path.charAt(i);\r\n switch (state) {\r\n case 0 \u002F* inMemberExp *\u002F:\r\n if (char === '[') {\r\n stateStack.push(state);\r\n state = 1 \u002F* inBrackets *\u002F;\r\n currentOpenBracketCount++;\r\n }\r\n else if (char === '(') {\r\n stateStack.push(state);\r\n state = 2 \u002F* inParens *\u002F;\r\n currentOpenParensCount++;\r\n }\r\n else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {\r\n return false;\r\n }\r\n break;\r\n case 1 \u002F* inBrackets *\u002F:\r\n if (char === `'` || char === `\"` || char === '`') {\r\n stateStack.push(state);\r\n state = 3 \u002F* inString *\u002F;\r\n currentStringType = char;\r\n }\r\n else if (char === `[`) {\r\n currentOpenBracketCount++;\r\n }\r\n else if (char === `]`) {\r\n if (!--currentOpenBracketCount) {\r\n state = stateStack.pop();\r\n }\r\n }\r\n break;\r\n case 2 \u002F* inParens *\u002F:\r\n if (char === `'` || char === `\"` || char === '`') {\r\n stateStack.push(state);\r\n state = 3 \u002F* inString *\u002F;\r\n currentStringType = char;\r\n }\r\n else if (char === `(`) {\r\n currentOpenParensCount++;\r\n }\r\n else if (char === `)`) {\r\n \u002F\u002F if the exp ends as a call then it should not be considered valid\r\n if (i === path.length - 1) {\r\n return false;\r\n }\r\n if (!--currentOpenParensCount) {\r\n state = stateStack.pop();\r\n }\r\n }\r\n break;\r\n case 3 \u002F* inString *\u002F:\r\n if (char === currentStringType) {\r\n state = stateStack.pop();\r\n currentStringType = null;\r\n }\r\n break;\r\n }\r\n }\r\n return !currentOpenBracketCount && !currentOpenParensCount;\r\n};\r\nconst isMemberExpression = isMemberExpressionBrowser\r\n ;\r\nfunction getInnerRange(loc, offset, length) {\r\n const source = loc.source.slice(offset, offset + length);\r\n const newLoc = {\r\n source,\r\n start: advancePositionWithClone(loc.start, loc.source, offset),\r\n end: loc.end\r\n };\r\n if (length != null) {\r\n newLoc.end = advancePositionWithClone(loc.start, loc.source, offset + length);\r\n }\r\n return newLoc;\r\n}\r\nfunction advancePositionWithClone(pos, source, numberOfCharacters = source.length) {\r\n return advancePositionWithMutation(extend({}, pos), source, numberOfCharacters);\r\n}\r\n\u002F\u002F advance by mutation without cloning (for performance reasons), since this\r\n\u002F\u002F gets called a lot in the parser\r\nfunction advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\r\n let linesCount = 0;\r\n let lastNewLinePos = -1;\r\n for (let i = 0; i \u003C numberOfCharacters; i++) {\r\n if (source.charCodeAt(i) === 10 \u002F* newline char code *\u002F) {\r\n linesCount++;\r\n lastNewLinePos = i;\r\n }\r\n }\r\n pos.offset += numberOfCharacters;\r\n pos.line += linesCount;\r\n pos.column =\r\n lastNewLinePos === -1\r\n ? pos.column + numberOfCharacters\r\n : numberOfCharacters - lastNewLinePos;\r\n return pos;\r\n}\r\nfunction assert(condition, msg) {\r\n \u002F* istanbul ignore if *\u002F\r\n if (!condition) {\r\n throw new Error(msg || `unexpected compiler condition`);\r\n }\r\n}\r\nfunction findDir(node, name, allowEmpty = false) {\r\n for (let i = 0; i \u003C node.props.length; i++) {\r\n const p = node.props[i];\r\n if (p.type === 7 \u002F* DIRECTIVE *\u002F &&\r\n (allowEmpty || p.exp) &&\r\n (isString(name) ? p.name === name : name.test(p.name))) {\r\n return p;\r\n }\r\n }\r\n}\r\nfunction findProp(node, name, dynamicOnly = false, allowEmpty = false) {\r\n for (let i = 0; i \u003C node.props.length; i++) {\r\n const p = node.props[i];\r\n if (p.type === 6 \u002F* ATTRIBUTE *\u002F) {\r\n if (dynamicOnly)\r\n continue;\r\n if (p.name === name && (p.value || allowEmpty)) {\r\n return p;\r\n }\r\n }\r\n else if (p.name === 'bind' &&\r\n (p.exp || allowEmpty) &&\r\n isStaticArgOf(p.arg, name)) {\r\n return p;\r\n }\r\n }\r\n}\r\nfunction isStaticArgOf(arg, name) {\r\n return !!(arg && isStaticExp(arg) && arg.content === name);\r\n}\r\nfunction hasDynamicKeyVBind(node) {\r\n return node.props.some(p =\u003E p.type === 7 \u002F* DIRECTIVE *\u002F &&\r\n p.name === 'bind' &&\r\n (!p.arg || \u002F\u002F v-bind=\"obj\"\r\n p.arg.type !== 4 \u002F* SIMPLE_EXPRESSION *\u002F || \u002F\u002F v-bind:[_ctx.foo]\r\n !p.arg.isStatic) \u002F\u002F v-bind:[foo]\r\n );\r\n}\r\nfunction isText(node) {\r\n return node.type === 5 \u002F* INTERPOLATION *\u002F || node.type === 2 \u002F* TEXT *\u002F;\r\n}\r\nfunction isVSlot(p) {\r\n return p.type === 7 \u002F* DIRECTIVE *\u002F && p.name === 'slot';\r\n}\r\nfunction isTemplateNode(node) {\r\n return (node.type === 1 \u002F* ELEMENT *\u002F && node.tagType === 3 \u002F* TEMPLATE *\u002F);\r\n}\r\nfunction isSlotOutlet(node) {\r\n return node.type === 1 \u002F* ELEMENT *\u002F && node.tagType === 2 \u002F* SLOT *\u002F;\r\n}\r\nfunction getVNodeHelper(ssr, isComponent) {\r\n return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;\r\n}\r\nfunction getVNodeBlockHelper(ssr, isComponent) {\r\n return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;\r\n}\r\nconst propsHelperSet = new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);\r\nfunction getUnnormalizedProps(props, callPath = []) {\r\n if (props &&\r\n !isString(props) &&\r\n props.type === 14 \u002F* JS_CALL_EXPRESSION *\u002F) {\r\n const callee = props.callee;\r\n if (!isString(callee) && propsHelperSet.has(callee)) {\r\n return getUnnormalizedProps(props.arguments[0], callPath.concat(props));\r\n }\r\n }\r\n return [props, callPath];\r\n}\r\nfunction injectProp(node, prop, context) {\r\n let propsWithInjection;\r\n \u002F**\r\n * 1. mergeProps(...)\r\n * 2. toHandlers(...)\r\n * 3. normalizeProps(...)\r\n * 4. normalizeProps(guardReactiveProps(...))\r\n *\r\n * we need to get the real props before normalization\r\n *\u002F\r\n let props = node.type === 13 \u002F* VNODE_CALL *\u002F ? node.props : node.arguments[2];\r\n let callPath = [];\r\n let parentCall;\r\n if (props &&\r\n !isString(props) &&\r\n props.type === 14 \u002F* JS_CALL_EXPRESSION *\u002F) {\r\n const ret = getUnnormalizedProps(props);\r\n props = ret[0];\r\n callPath = ret[1];\r\n parentCall = callPath[callPath.length - 1];\r\n }\r\n if (props == null || isString(props)) {\r\n propsWithInjection = createObjectExpression([prop]);\r\n }\r\n else if (props.type === 14 \u002F* JS_CALL_EXPRESSION *\u002F) {\r\n \u002F\u002F merged props... add ours\r\n \u002F\u002F only inject key to object literal if it's the first argument so that\r\n \u002F\u002F if doesn't override user provided keys\r\n const first = props.arguments[0];\r\n if (!isString(first) && first.type === 15 \u002F* JS_OBJECT_EXPRESSION *\u002F) {\r\n first.properties.unshift(prop);\r\n }\r\n else {\r\n if (props.callee === TO_HANDLERS) {\r\n \u002F\u002F #2366\r\n propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [\r\n createObjectExpression([prop]),\r\n props\r\n ]);\r\n }\r\n else {\r\n props.arguments.unshift(createObjectExpression([prop]));\r\n }\r\n }\r\n !propsWithInjection && (propsWithInjection = props);\r\n }\r\n else if (props.type === 15 \u002F* JS_OBJECT_EXPRESSION *\u002F) {\r\n let alreadyExists = false;\r\n \u002F\u002F check existing key to avoid overriding user provided keys\r\n if (prop.key.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F) {\r\n const propKeyName = prop.key.content;\r\n alreadyExists = props.properties.some(p =\u003E p.key.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F &&\r\n p.key.content === propKeyName);\r\n }\r\n if (!alreadyExists) {\r\n props.properties.unshift(prop);\r\n }\r\n propsWithInjection = props;\r\n }\r\n else {\r\n \u002F\u002F single v-bind with expression, return a merged replacement\r\n propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [\r\n createObjectExpression([prop]),\r\n props\r\n ]);\r\n \u002F\u002F in the case of nested helper call, e.g. `normalizeProps(guardReactiveProps(props))`,\r\n \u002F\u002F it will be rewritten as `normalizeProps(mergeProps({ key: 0 }, props))`,\r\n \u002F\u002F the `guardReactiveProps` will no longer be needed\r\n if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) {\r\n parentCall = callPath[callPath.length - 2];\r\n }\r\n }\r\n if (node.type === 13 \u002F* VNODE_CALL *\u002F) {\r\n if (parentCall) {\r\n parentCall.arguments[0] = propsWithInjection;\r\n }\r\n else {\r\n node.props = propsWithInjection;\r\n }\r\n }\r\n else {\r\n if (parentCall) {\r\n parentCall.arguments[0] = propsWithInjection;\r\n }\r\n else {\r\n node.arguments[2] = propsWithInjection;\r\n }\r\n }\r\n}\r\nfunction toValidAssetId(name, type) {\r\n \u002F\u002F see issue#4422, we need adding identifier on validAssetId if variable `name` has specific character\r\n return `_${type}_${name.replace(\u002F[^\\w]\u002Fg, (searchValue, replaceValue) =\u003E {\r\n return searchValue === '-' ? '_' : name.charCodeAt(replaceValue).toString();\r\n })}`;\r\n}\r\nfunction getMemoedVNodeCall(node) {\r\n if (node.type === 14 \u002F* JS_CALL_EXPRESSION *\u002F && node.callee === WITH_MEMO) {\r\n return node.arguments[1].returns;\r\n }\r\n else {\r\n return node;\r\n }\r\n}\r\nfunction makeBlock(node, { helper, removeHelper, inSSR }) {\r\n if (!node.isBlock) {\r\n node.isBlock = true;\r\n removeHelper(getVNodeHelper(inSSR, node.isComponent));\r\n helper(OPEN_BLOCK);\r\n helper(getVNodeBlockHelper(inSSR, node.isComponent));\r\n }\r\n}\r\n\r\nconst deprecationData = {\r\n [\"COMPILER_IS_ON_ELEMENT\" \u002F* COMPILER_IS_ON_ELEMENT *\u002F]: {\r\n message: `Platform-native elements with \"is\" prop will no longer be ` +\r\n `treated as components in Vue 3 unless the \"is\" value is explicitly ` +\r\n `prefixed with \"vue:\".`,\r\n link: `https:\u002F\u002Fv3-migration.vuejs.org\u002Fbreaking-changes\u002Fcustom-elements-interop.html`\r\n },\r\n [\"COMPILER_V_BIND_SYNC\" \u002F* COMPILER_V_BIND_SYNC *\u002F]: {\r\n message: key =\u003E `.sync modifier for v-bind has been removed. Use v-model with ` +\r\n `argument instead. \\`v-bind:${key}.sync\\` should be changed to ` +\r\n `\\`v-model:${key}\\`.`,\r\n link: `https:\u002F\u002Fv3-migration.vuejs.org\u002Fbreaking-changes\u002Fv-model.html`\r\n },\r\n [\"COMPILER_V_BIND_PROP\" \u002F* COMPILER_V_BIND_PROP *\u002F]: {\r\n message: `.prop modifier for v-bind has been removed and no longer necessary. ` +\r\n `Vue 3 will automatically set a binding as DOM property when appropriate.`\r\n },\r\n [\"COMPILER_V_BIND_OBJECT_ORDER\" \u002F* COMPILER_V_BIND_OBJECT_ORDER *\u002F]: {\r\n message: `v-bind=\"obj\" usage is now order sensitive and behaves like JavaScript ` +\r\n `object spread: it will now overwrite an existing non-mergeable attribute ` +\r\n `that appears before v-bind in the case of conflict. ` +\r\n `To retain 2.x behavior, move v-bind to make it the first attribute. ` +\r\n `You can also suppress this warning if the usage is intended.`,\r\n link: `https:\u002F\u002Fv3-migration.vuejs.org\u002Fbreaking-changes\u002Fv-bind.html`\r\n },\r\n [\"COMPILER_V_ON_NATIVE\" \u002F* COMPILER_V_ON_NATIVE *\u002F]: {\r\n message: `.native modifier for v-on has been removed as is no longer necessary.`,\r\n link: `https:\u002F\u002Fv3-migration.vuejs.org\u002Fbreaking-changes\u002Fv-on-native-modifier-removed.html`\r\n },\r\n [\"COMPILER_V_IF_V_FOR_PRECEDENCE\" \u002F* COMPILER_V_IF_V_FOR_PRECEDENCE *\u002F]: {\r\n message: `v-if \u002F v-for precedence when used on the same element has changed ` +\r\n `in Vue 3: v-if now takes higher precedence and will no longer have ` +\r\n `access to v-for scope variables. It is best to avoid the ambiguity ` +\r\n `with \u003Ctemplate\u003E tags or use a computed property that filters v-for ` +\r\n `data source.`,\r\n link: `https:\u002F\u002Fv3-migration.vuejs.org\u002Fbreaking-changes\u002Fv-if-v-for.html`\r\n },\r\n [\"COMPILER_NATIVE_TEMPLATE\" \u002F* COMPILER_NATIVE_TEMPLATE *\u002F]: {\r\n message: `\u003Ctemplate\u003E with no special directives will render as a native template ` +\r\n `element instead of its inner content in Vue 3.`\r\n },\r\n [\"COMPILER_INLINE_TEMPLATE\" \u002F* COMPILER_INLINE_TEMPLATE *\u002F]: {\r\n message: `\"inline-template\" has been removed in Vue 3.`,\r\n link: `https:\u002F\u002Fv3-migration.vuejs.org\u002Fbreaking-changes\u002Finline-template-attribute.html`\r\n },\r\n [\"COMPILER_FILTER\" \u002F* COMPILER_FILTERS *\u002F]: {\r\n message: `filters have been removed in Vue 3. ` +\r\n `The \"|\" symbol will be treated as native JavaScript bitwise OR operator. ` +\r\n `Use method calls or computed properties instead.`,\r\n link: `https:\u002F\u002Fv3-migration.vuejs.org\u002Fbreaking-changes\u002Ffilters.html`\r\n }\r\n};\r\nfunction getCompatValue(key, context) {\r\n const config = context.options\r\n ? context.options.compatConfig\r\n : context.compatConfig;\r\n const value = config && config[key];\r\n if (key === 'MODE') {\r\n return value || 3; \u002F\u002F compiler defaults to v3 behavior\r\n }\r\n else {\r\n return value;\r\n }\r\n}\r\nfunction isCompatEnabled(key, context) {\r\n const mode = getCompatValue('MODE', context);\r\n const value = getCompatValue(key, context);\r\n \u002F\u002F in v3 mode, only enable if explicitly set to true\r\n \u002F\u002F otherwise enable for any non-false value\r\n return mode === 3 ? value === true : value !== false;\r\n}\r\nfunction checkCompatEnabled(key, context, loc, ...args) {\r\n const enabled = isCompatEnabled(key, context);\r\n if (enabled) {\r\n warnDeprecation(key, context, loc, ...args);\r\n }\r\n return enabled;\r\n}\r\nfunction warnDeprecation(key, context, loc, ...args) {\r\n const val = getCompatValue(key, context);\r\n if (val === 'suppress-warning') {\r\n return;\r\n }\r\n const { message, link } = deprecationData[key];\r\n const msg = `(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\\n Details: ${link}` : ``}`;\r\n const err = new SyntaxError(msg);\r\n err.code = key;\r\n if (loc)\r\n err.loc = loc;\r\n context.onWarn(err);\r\n}\r\n\r\n\u002F\u002F The default decoder only provides escapes for characters reserved as part of\r\n\u002F\u002F the template syntax, and is only used if the custom renderer did not provide\r\n\u002F\u002F a platform-specific decoder.\r\nconst decodeRE = \u002F&(gt|lt|amp|apos|quot);\u002Fg;\r\nconst decodeMap = {\r\n gt: '\u003E',\r\n lt: '\u003C',\r\n amp: '&',\r\n apos: \"'\",\r\n quot: '\"'\r\n};\r\nconst defaultParserOptions = {\r\n delimiters: [`{{`, `}}`],\r\n getNamespace: () =\u003E 0 \u002F* HTML *\u002F,\r\n getTextMode: () =\u003E 0 \u002F* DATA *\u002F,\r\n isVoidTag: NO,\r\n isPreTag: NO,\r\n isCustomElement: NO,\r\n decodeEntities: (rawText) =\u003E rawText.replace(decodeRE, (_, p1) =\u003E decodeMap[p1]),\r\n onError: defaultOnError,\r\n onWarn: defaultOnWarn,\r\n comments: true\r\n};\r\nfunction baseParse(content, options = {}) {\r\n const context = createParserContext(content, options);\r\n const start = getCursor(context);\r\n return createRoot(parseChildren(context, 0 \u002F* DATA *\u002F, []), getSelection(context, start));\r\n}\r\nfunction createParserContext(content, rawOptions) {\r\n const options = extend({}, defaultParserOptions);\r\n let key;\r\n for (key in rawOptions) {\r\n \u002F\u002F @ts-ignore\r\n options[key] =\r\n rawOptions[key] === undefined\r\n ? defaultParserOptions[key]\r\n : rawOptions[key];\r\n }\r\n return {\r\n options,\r\n column: 1,\r\n line: 1,\r\n offset: 0,\r\n originalSource: content,\r\n source: content,\r\n inPre: false,\r\n inVPre: false,\r\n onWarn: options.onWarn\r\n };\r\n}\r\nfunction parseChildren(context, mode, ancestors) {\r\n const parent = last(ancestors);\r\n const ns = parent ? parent.ns : 0 \u002F* HTML *\u002F;\r\n const nodes = [];\r\n while (!isEnd(context, mode, ancestors)) {\r\n const s = context.source;\r\n let node = undefined;\r\n if (mode === 0 \u002F* DATA *\u002F || mode === 1 \u002F* RCDATA *\u002F) {\r\n if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {\r\n \u002F\u002F '{{'\r\n node = parseInterpolation(context, mode);\r\n }\r\n else if (mode === 0 \u002F* DATA *\u002F && s[0] === '\u003C') {\r\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fparsing.html#tag-open-state\r\n if (s.length === 1) {\r\n emitError(context, 5 \u002F* EOF_BEFORE_TAG_NAME *\u002F, 1);\r\n }\r\n else if (s[1] === '!') {\r\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fparsing.html#markup-declaration-open-state\r\n if (startsWith(s, '\u003C!--')) {\r\n node = parseComment(context);\r\n }\r\n else if (startsWith(s, '\u003C!DOCTYPE')) {\r\n \u002F\u002F Ignore DOCTYPE by a limitation.\r\n node = parseBogusComment(context);\r\n }\r\n else if (startsWith(s, '\u003C![CDATA[')) {\r\n if (ns !== 0 \u002F* HTML *\u002F) {\r\n node = parseCDATA(context, ancestors);\r\n }\r\n else {\r\n emitError(context, 1 \u002F* CDATA_IN_HTML_CONTENT *\u002F);\r\n node = parseBogusComment(context);\r\n }\r\n }\r\n else {\r\n emitError(context, 11 \u002F* INCORRECTLY_OPENED_COMMENT *\u002F);\r\n node = parseBogusComment(context);\r\n }\r\n }\r\n else if (s[1] === '\u002F') {\r\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fparsing.html#end-tag-open-state\r\n if (s.length === 2) {\r\n emitError(context, 5 \u002F* EOF_BEFORE_TAG_NAME *\u002F, 2);\r\n }\r\n else if (s[2] === '\u003E') {\r\n emitError(context, 14 \u002F* MISSING_END_TAG_NAME *\u002F, 2);\r\n advanceBy(context, 3);\r\n continue;\r\n }\r\n else if (\u002F[a-z]\u002Fi.test(s[2])) {\r\n emitError(context, 23 \u002F* X_INVALID_END_TAG *\u002F);\r\n parseTag(context, 1 \u002F* End *\u002F, parent);\r\n continue;\r\n }\r\n else {\r\n emitError(context, 12 \u002F* INVALID_FIRST_CHARACTER_OF_TAG_NAME *\u002F, 2);\r\n node = parseBogusComment(context);\r\n }\r\n }\r\n else if (\u002F[a-z]\u002Fi.test(s[1])) {\r\n node = parseElement(context, ancestors);\r\n }\r\n else if (s[1] === '?') {\r\n emitError(context, 21 \u002F* UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME *\u002F, 1);\r\n node = parseBogusComment(context);\r\n }\r\n else {\r\n emitError(context, 12 \u002F* INVALID_FIRST_CHARACTER_OF_TAG_NAME *\u002F, 1);\r\n }\r\n }\r\n }\r\n if (!node) {\r\n node = parseText(context, mode);\r\n }\r\n if (isArray(node)) {\r\n for (let i = 0; i \u003C node.length; i++) {\r\n pushNode(nodes, node[i]);\r\n }\r\n }\r\n else {\r\n pushNode(nodes, node);\r\n }\r\n }\r\n \u002F\u002F Whitespace handling strategy like v2\r\n let removedWhitespace = false;\r\n if (mode !== 2 \u002F* RAWTEXT *\u002F && mode !== 1 \u002F* RCDATA *\u002F) {\r\n const shouldCondense = context.options.whitespace !== 'preserve';\r\n for (let i = 0; i \u003C nodes.length; i++) {\r\n const node = nodes[i];\r\n if (!context.inPre && node.type === 2 \u002F* TEXT *\u002F) {\r\n if (!\u002F[^\\t\\r\\n\\f ]\u002F.test(node.content)) {\r\n const prev = nodes[i - 1];\r\n const next = nodes[i + 1];\r\n \u002F\u002F Remove if:\r\n \u002F\u002F - the whitespace is the first or last node, or:\r\n \u002F\u002F - (condense mode) the whitespace is adjacent to a comment, or:\r\n \u002F\u002F - (condense mode) the whitespace is between two elements AND contains newline\r\n if (!prev ||\r\n !next ||\r\n (shouldCondense &&\r\n (prev.type === 3 \u002F* COMMENT *\u002F ||\r\n next.type === 3 \u002F* COMMENT *\u002F ||\r\n (prev.type === 1 \u002F* ELEMENT *\u002F &&\r\n next.type === 1 \u002F* ELEMENT *\u002F &&\r\n \u002F[\\r\\n]\u002F.test(node.content))))) {\r\n removedWhitespace = true;\r\n nodes[i] = null;\r\n }\r\n else {\r\n \u002F\u002F Otherwise, the whitespace is condensed into a single space\r\n node.content = ' ';\r\n }\r\n }\r\n else if (shouldCondense) {\r\n \u002F\u002F in condense mode, consecutive whitespaces in text are condensed\r\n \u002F\u002F down to a single space.\r\n node.content = node.content.replace(\u002F[\\t\\r\\n\\f ]+\u002Fg, ' ');\r\n }\r\n }\r\n \u002F\u002F Remove comment nodes if desired by configuration.\r\n else if (node.type === 3 \u002F* COMMENT *\u002F && !context.options.comments) {\r\n removedWhitespace = true;\r\n nodes[i] = null;\r\n }\r\n }\r\n if (context.inPre && parent && context.options.isPreTag(parent.tag)) {\r\n \u002F\u002F remove leading newline per html spec\r\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fgrouping-content.html#the-pre-element\r\n const first = nodes[0];\r\n if (first && first.type === 2 \u002F* TEXT *\u002F) {\r\n first.content = first.content.replace(\u002F^\\r?\\n\u002F, '');\r\n }\r\n }\r\n }\r\n return removedWhitespace ? nodes.filter(Boolean) : nodes;\r\n}\r\nfunction pushNode(nodes, node) {\r\n if (node.type === 2 \u002F* TEXT *\u002F) {\r\n const prev = last(nodes);\r\n \u002F\u002F Merge if both this and the previous node are text and those are\r\n \u002F\u002F consecutive. This happens for cases like \"a \u003C b\".\r\n if (prev &&\r\n prev.type === 2 \u002F* TEXT *\u002F &&\r\n prev.loc.end.offset === node.loc.start.offset) {\r\n prev.content += node.content;\r\n prev.loc.end = node.loc.end;\r\n prev.loc.source += node.loc.source;\r\n return;\r\n }\r\n }\r\n nodes.push(node);\r\n}\r\nfunction parseCDATA(context, ancestors) {\r\n advanceBy(context, 9);\r\n const nodes = parseChildren(context, 3 \u002F* CDATA *\u002F, ancestors);\r\n if (context.source.length === 0) {\r\n emitError(context, 6 \u002F* EOF_IN_CDATA *\u002F);\r\n }\r\n else {\r\n advanceBy(context, 3);\r\n }\r\n return nodes;\r\n}\r\nfunction parseComment(context) {\r\n const start = getCursor(context);\r\n let content;\r\n \u002F\u002F Regular comment.\r\n const match = \u002F--(\\!)?\u003E\u002F.exec(context.source);\r\n if (!match) {\r\n content = context.source.slice(4);\r\n advanceBy(context, context.source.length);\r\n emitError(context, 7 \u002F* EOF_IN_COMMENT *\u002F);\r\n }\r\n else {\r\n if (match.index \u003C= 3) {\r\n emitError(context, 0 \u002F* ABRUPT_CLOSING_OF_EMPTY_COMMENT *\u002F);\r\n }\r\n if (match[1]) {\r\n emitError(context, 10 \u002F* INCORRECTLY_CLOSED_COMMENT *\u002F);\r\n }\r\n content = context.source.slice(4, match.index);\r\n \u002F\u002F Advancing with reporting nested comments.\r\n const s = context.source.slice(0, match.index);\r\n let prevIndex = 1, nestedIndex = 0;\r\n while ((nestedIndex = s.indexOf('\u003C!--', prevIndex)) !== -1) {\r\n advanceBy(context, nestedIndex - prevIndex + 1);\r\n if (nestedIndex + 4 \u003C s.length) {\r\n emitError(context, 16 \u002F* NESTED_COMMENT *\u002F);\r\n }\r\n prevIndex = nestedIndex + 1;\r\n }\r\n advanceBy(context, match.index + match[0].length - prevIndex + 1);\r\n }\r\n return {\r\n type: 3 \u002F* COMMENT *\u002F,\r\n content,\r\n loc: getSelection(context, start)\r\n };\r\n}\r\nfunction parseBogusComment(context) {\r\n const start = getCursor(context);\r\n const contentStart = context.source[1] === '?' ? 1 : 2;\r\n let content;\r\n const closeIndex = context.source.indexOf('\u003E');\r\n if (closeIndex === -1) {\r\n content = context.source.slice(contentStart);\r\n advanceBy(context, context.source.length);\r\n }\r\n else {\r\n content = context.source.slice(contentStart, closeIndex);\r\n advanceBy(context, closeIndex + 1);\r\n }\r\n return {\r\n type: 3 \u002F* COMMENT *\u002F,\r\n content,\r\n loc: getSelection(context, start)\r\n };\r\n}\r\nfunction parseElement(context, ancestors) {\r\n \u002F\u002F Start tag.\r\n const wasInPre = context.inPre;\r\n const wasInVPre = context.inVPre;\r\n const parent = last(ancestors);\r\n const element = parseTag(context, 0 \u002F* Start *\u002F, parent);\r\n const isPreBoundary = context.inPre && !wasInPre;\r\n const isVPreBoundary = context.inVPre && !wasInVPre;\r\n if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {\r\n \u002F\u002F #4030 self-closing \u003Cpre\u003E tag\r\n if (isPreBoundary) {\r\n context.inPre = false;\r\n }\r\n if (isVPreBoundary) {\r\n context.inVPre = false;\r\n }\r\n return element;\r\n }\r\n \u002F\u002F Children.\r\n ancestors.push(element);\r\n const mode = context.options.getTextMode(element, parent);\r\n const children = parseChildren(context, mode, ancestors);\r\n ancestors.pop();\r\n element.children = children;\r\n \u002F\u002F End tag.\r\n if (startsWithEndTagOpen(context.source, element.tag)) {\r\n parseTag(context, 1 \u002F* End *\u002F, parent);\r\n }\r\n else {\r\n emitError(context, 24 \u002F* X_MISSING_END_TAG *\u002F, 0, element.loc.start);\r\n if (context.source.length === 0 && element.tag.toLowerCase() === 'script') {\r\n const first = children[0];\r\n if (first && startsWith(first.loc.source, '\u003C!--')) {\r\n emitError(context, 8 \u002F* EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT *\u002F);\r\n }\r\n }\r\n }\r\n element.loc = getSelection(context, element.loc.start);\r\n if (isPreBoundary) {\r\n context.inPre = false;\r\n }\r\n if (isVPreBoundary) {\r\n context.inVPre = false;\r\n }\r\n return element;\r\n}\r\nconst isSpecialTemplateDirective = \u002F*#__PURE__*\u002F makeMap(`if,else,else-if,for,slot`);\r\nfunction parseTag(context, type, parent) {\r\n \u002F\u002F Tag open.\r\n const start = getCursor(context);\r\n const match = \u002F^\u003C\\\u002F?([a-z][^\\t\\r\\n\\f \u002F\u003E]*)\u002Fi.exec(context.source);\r\n const tag = match[1];\r\n const ns = context.options.getNamespace(tag, parent);\r\n advanceBy(context, match[0].length);\r\n advanceSpaces(context);\r\n \u002F\u002F save current state in case we need to re-parse attributes with v-pre\r\n const cursor = getCursor(context);\r\n const currentSource = context.source;\r\n \u002F\u002F check \u003Cpre\u003E tag\r\n if (context.options.isPreTag(tag)) {\r\n context.inPre = true;\r\n }\r\n \u002F\u002F Attributes.\r\n let props = parseAttributes(context, type);\r\n \u002F\u002F check v-pre\r\n if (type === 0 \u002F* Start *\u002F &&\r\n !context.inVPre &&\r\n props.some(p =\u003E p.type === 7 \u002F* DIRECTIVE *\u002F && p.name === 'pre')) {\r\n context.inVPre = true;\r\n \u002F\u002F reset context\r\n extend(context, cursor);\r\n context.source = currentSource;\r\n \u002F\u002F re-parse attrs and filter out v-pre itself\r\n props = parseAttributes(context, type).filter(p =\u003E p.name !== 'v-pre');\r\n }\r\n \u002F\u002F Tag close.\r\n let isSelfClosing = false;\r\n if (context.source.length === 0) {\r\n emitError(context, 9 \u002F* EOF_IN_TAG *\u002F);\r\n }\r\n else {\r\n isSelfClosing = startsWith(context.source, '\u002F\u003E');\r\n if (type === 1 \u002F* End *\u002F && isSelfClosing) {\r\n emitError(context, 4 \u002F* END_TAG_WITH_TRAILING_SOLIDUS *\u002F);\r\n }\r\n advanceBy(context, isSelfClosing ? 2 : 1);\r\n }\r\n if (type === 1 \u002F* End *\u002F) {\r\n return;\r\n }\r\n let tagType = 0 \u002F* ELEMENT *\u002F;\r\n if (!context.inVPre) {\r\n if (tag === 'slot') {\r\n tagType = 2 \u002F* SLOT *\u002F;\r\n }\r\n else if (tag === 'template') {\r\n if (props.some(p =\u003E p.type === 7 \u002F* DIRECTIVE *\u002F && isSpecialTemplateDirective(p.name))) {\r\n tagType = 3 \u002F* TEMPLATE *\u002F;\r\n }\r\n }\r\n else if (isComponent(tag, props, context)) {\r\n tagType = 1 \u002F* COMPONENT *\u002F;\r\n }\r\n }\r\n return {\r\n type: 1 \u002F* ELEMENT *\u002F,\r\n ns,\r\n tag,\r\n tagType,\r\n props,\r\n isSelfClosing,\r\n children: [],\r\n loc: getSelection(context, start),\r\n codegenNode: undefined \u002F\u002F to be created during transform phase\r\n };\r\n}\r\nfunction isComponent(tag, props, context) {\r\n const options = context.options;\r\n if (options.isCustomElement(tag)) {\r\n return false;\r\n }\r\n if (tag === 'component' ||\r\n \u002F^[A-Z]\u002F.test(tag) ||\r\n isCoreComponent(tag) ||\r\n (options.isBuiltInComponent && options.isBuiltInComponent(tag)) ||\r\n (options.isNativeTag && !options.isNativeTag(tag))) {\r\n return true;\r\n }\r\n \u002F\u002F at this point the tag should be a native tag, but check for potential \"is\"\r\n \u002F\u002F casting\r\n for (let i = 0; i \u003C props.length; i++) {\r\n const p = props[i];\r\n if (p.type === 6 \u002F* ATTRIBUTE *\u002F) {\r\n if (p.name === 'is' && p.value) {\r\n if (p.value.content.startsWith('vue:')) {\r\n return true;\r\n }\r\n }\r\n }\r\n else {\r\n \u002F\u002F directive\r\n \u002F\u002F v-is (TODO Deprecate)\r\n if (p.name === 'is') {\r\n return true;\r\n }\r\n else if (\r\n \u002F\u002F :is on plain element - only treat as component in compat mode\r\n p.name === 'bind' &&\r\n isStaticArgOf(p.arg, 'is') &&\r\n false &&\r\n checkCompatEnabled(\"COMPILER_IS_ON_ELEMENT\" \u002F* COMPILER_IS_ON_ELEMENT *\u002F, context, p.loc)) {\r\n return true;\r\n }\r\n }\r\n }\r\n}\r\nfunction parseAttributes(context, type) {\r\n const props = [];\r\n const attributeNames = new Set();\r\n while (context.source.length \u003E 0 &&\r\n !startsWith(context.source, '\u003E') &&\r\n !startsWith(context.source, '\u002F\u003E')) {\r\n if (startsWith(context.source, '\u002F')) {\r\n emitError(context, 22 \u002F* UNEXPECTED_SOLIDUS_IN_TAG *\u002F);\r\n advanceBy(context, 1);\r\n advanceSpaces(context);\r\n continue;\r\n }\r\n if (type === 1 \u002F* End *\u002F) {\r\n emitError(context, 3 \u002F* END_TAG_WITH_ATTRIBUTES *\u002F);\r\n }\r\n const attr = parseAttribute(context, attributeNames);\r\n \u002F\u002F Trim whitespace between class\r\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Fvuejs\u002Fcore\u002Fissues\u002F4251\r\n if (attr.type === 6 \u002F* ATTRIBUTE *\u002F &&\r\n attr.value &&\r\n attr.name === 'class') {\r\n attr.value.content = attr.value.content.replace(\u002F\\s+\u002Fg, ' ').trim();\r\n }\r\n if (type === 0 \u002F* Start *\u002F) {\r\n props.push(attr);\r\n }\r\n if (\u002F^[^\\t\\r\\n\\f \u002F\u003E]\u002F.test(context.source)) {\r\n emitError(context, 15 \u002F* MISSING_WHITESPACE_BETWEEN_ATTRIBUTES *\u002F);\r\n }\r\n advanceSpaces(context);\r\n }\r\n return props;\r\n}\r\nfunction parseAttribute(context, nameSet) {\r\n \u002F\u002F Name.\r\n const start = getCursor(context);\r\n const match = \u002F^[^\\t\\r\\n\\f \u002F\u003E][^\\t\\r\\n\\f \u002F\u003E=]*\u002F.exec(context.source);\r\n const name = match[0];\r\n if (nameSet.has(name)) {\r\n emitError(context, 2 \u002F* DUPLICATE_ATTRIBUTE *\u002F);\r\n }\r\n nameSet.add(name);\r\n if (name[0] === '=') {\r\n emitError(context, 19 \u002F* UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME *\u002F);\r\n }\r\n {\r\n const pattern = \u002F[\"'\u003C]\u002Fg;\r\n let m;\r\n while ((m = pattern.exec(name))) {\r\n emitError(context, 17 \u002F* UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME *\u002F, m.index);\r\n }\r\n }\r\n advanceBy(context, name.length);\r\n \u002F\u002F Value\r\n let value = undefined;\r\n if (\u002F^[\\t\\r\\n\\f ]*=\u002F.test(context.source)) {\r\n advanceSpaces(context);\r\n advanceBy(context, 1);\r\n advanceSpaces(context);\r\n value = parseAttributeValue(context);\r\n if (!value) {\r\n emitError(context, 13 \u002F* MISSING_ATTRIBUTE_VALUE *\u002F);\r\n }\r\n }\r\n const loc = getSelection(context, start);\r\n if (!context.inVPre && \u002F^(v-[A-Za-z0-9-]|:|\\.|@|#)\u002F.test(name)) {\r\n const match = \u002F(?:^v-([a-z0-9-]+))?(?:(?::|^\\.|^@|^#)(\\[[^\\]]+\\]|[^\\.]+))?(.+)?$\u002Fi.exec(name);\r\n let isPropShorthand = startsWith(name, '.');\r\n let dirName = match[1] ||\r\n (isPropShorthand || startsWith(name, ':')\r\n ? 'bind'\r\n : startsWith(name, '@')\r\n ? 'on'\r\n : 'slot');\r\n let arg;\r\n if (match[2]) {\r\n const isSlot = dirName === 'slot';\r\n const startOffset = name.lastIndexOf(match[2]);\r\n const loc = getSelection(context, getNewPosition(context, start, startOffset), getNewPosition(context, start, startOffset + match[2].length + ((isSlot && match[3]) || '').length));\r\n let content = match[2];\r\n let isStatic = true;\r\n if (content.startsWith('[')) {\r\n isStatic = false;\r\n if (!content.endsWith(']')) {\r\n emitError(context, 27 \u002F* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END *\u002F);\r\n content = content.slice(1);\r\n }\r\n else {\r\n content = content.slice(1, content.length - 1);\r\n }\r\n }\r\n else if (isSlot) {\r\n \u002F\u002F #1241 special case for v-slot: vuetify relies extensively on slot\r\n \u002F\u002F names containing dots. v-slot doesn't have any modifiers and Vue 2.x\r\n \u002F\u002F supports such usage so we are keeping it consistent with 2.x.\r\n content += match[3] || '';\r\n }\r\n arg = {\r\n type: 4 \u002F* SIMPLE_EXPRESSION *\u002F,\r\n content,\r\n isStatic,\r\n constType: isStatic\r\n ? 3 \u002F* CAN_STRINGIFY *\u002F\r\n : 0 \u002F* NOT_CONSTANT *\u002F,\r\n loc\r\n };\r\n }\r\n if (value && value.isQuoted) {\r\n const valueLoc = value.loc;\r\n valueLoc.start.offset++;\r\n valueLoc.start.column++;\r\n valueLoc.end = advancePositionWithClone(valueLoc.start, value.content);\r\n valueLoc.source = valueLoc.source.slice(1, -1);\r\n }\r\n const modifiers = match[3] ? match[3].slice(1).split('.') : [];\r\n if (isPropShorthand)\r\n modifiers.push('prop');\r\n return {\r\n type: 7 \u002F* DIRECTIVE *\u002F,\r\n name: dirName,\r\n exp: value && {\r\n type: 4 \u002F* SIMPLE_EXPRESSION *\u002F,\r\n content: value.content,\r\n isStatic: false,\r\n \u002F\u002F Treat as non-constant by default. This can be potentially set to\r\n \u002F\u002F other values by `transformExpression` to make it eligible for hoisting.\r\n constType: 0 \u002F* NOT_CONSTANT *\u002F,\r\n loc: value.loc\r\n },\r\n arg,\r\n modifiers,\r\n loc\r\n };\r\n }\r\n \u002F\u002F missing directive name or illegal directive name\r\n if (!context.inVPre && startsWith(name, 'v-')) {\r\n emitError(context, 26 \u002F* X_MISSING_DIRECTIVE_NAME *\u002F);\r\n }\r\n return {\r\n type: 6 \u002F* ATTRIBUTE *\u002F,\r\n name,\r\n value: value && {\r\n type: 2 \u002F* TEXT *\u002F,\r\n content: value.content,\r\n loc: value.loc\r\n },\r\n loc\r\n };\r\n}\r\nfunction parseAttributeValue(context) {\r\n const start = getCursor(context);\r\n let content;\r\n const quote = context.source[0];\r\n const isQuoted = quote === `\"` || quote === `'`;\r\n if (isQuoted) {\r\n \u002F\u002F Quoted value.\r\n advanceBy(context, 1);\r\n const endIndex = context.source.indexOf(quote);\r\n if (endIndex === -1) {\r\n content = parseTextData(context, context.source.length, 4 \u002F* ATTRIBUTE_VALUE *\u002F);\r\n }\r\n else {\r\n content = parseTextData(context, endIndex, 4 \u002F* ATTRIBUTE_VALUE *\u002F);\r\n advanceBy(context, 1);\r\n }\r\n }\r\n else {\r\n \u002F\u002F Unquoted\r\n const match = \u002F^[^\\t\\r\\n\\f \u003E]+\u002F.exec(context.source);\r\n if (!match) {\r\n return undefined;\r\n }\r\n const unexpectedChars = \u002F[\"'\u003C=`]\u002Fg;\r\n let m;\r\n while ((m = unexpectedChars.exec(match[0]))) {\r\n emitError(context, 18 \u002F* UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE *\u002F, m.index);\r\n }\r\n content = parseTextData(context, match[0].length, 4 \u002F* ATTRIBUTE_VALUE *\u002F);\r\n }\r\n return { content, isQuoted, loc: getSelection(context, start) };\r\n}\r\nfunction parseInterpolation(context, mode) {\r\n const [open, close] = context.options.delimiters;\r\n const closeIndex = context.source.indexOf(close, open.length);\r\n if (closeIndex === -1) {\r\n emitError(context, 25 \u002F* X_MISSING_INTERPOLATION_END *\u002F);\r\n return undefined;\r\n }\r\n const start = getCursor(context);\r\n advanceBy(context, open.length);\r\n const innerStart = getCursor(context);\r\n const innerEnd = getCursor(context);\r\n const rawContentLength = closeIndex - open.length;\r\n const rawContent = context.source.slice(0, rawContentLength);\r\n const preTrimContent = parseTextData(context, rawContentLength, mode);\r\n const content = preTrimContent.trim();\r\n const startOffset = preTrimContent.indexOf(content);\r\n if (startOffset \u003E 0) {\r\n advancePositionWithMutation(innerStart, rawContent, startOffset);\r\n }\r\n const endOffset = rawContentLength - (preTrimContent.length - content.length - startOffset);\r\n advancePositionWithMutation(innerEnd, rawContent, endOffset);\r\n advanceBy(context, close.length);\r\n return {\r\n type: 5 \u002F* INTERPOLATION *\u002F,\r\n content: {\r\n type: 4 \u002F* SIMPLE_EXPRESSION *\u002F,\r\n isStatic: false,\r\n \u002F\u002F Set `isConstant` to false by default and will decide in transformExpression\r\n constType: 0 \u002F* NOT_CONSTANT *\u002F,\r\n content,\r\n loc: getSelection(context, innerStart, innerEnd)\r\n },\r\n loc: getSelection(context, start)\r\n };\r\n}\r\nfunction parseText(context, mode) {\r\n const endTokens = mode === 3 \u002F* CDATA *\u002F ? [']]\u003E'] : ['\u003C', context.options.delimiters[0]];\r\n let endIndex = context.source.length;\r\n for (let i = 0; i \u003C endTokens.length; i++) {\r\n const index = context.source.indexOf(endTokens[i], 1);\r\n if (index !== -1 && endIndex \u003E index) {\r\n endIndex = index;\r\n }\r\n }\r\n const start = getCursor(context);\r\n const content = parseTextData(context, endIndex, mode);\r\n return {\r\n type: 2 \u002F* TEXT *\u002F,\r\n content,\r\n loc: getSelection(context, start)\r\n };\r\n}\r\n\u002F**\r\n * Get text data with a given length from the current location.\r\n * This translates HTML entities in the text data.\r\n *\u002F\r\nfunction parseTextData(context, length, mode) {\r\n const rawText = context.source.slice(0, length);\r\n advanceBy(context, length);\r\n if (mode === 2 \u002F* RAWTEXT *\u002F ||\r\n mode === 3 \u002F* CDATA *\u002F ||\r\n !rawText.includes('&')) {\r\n return rawText;\r\n }\r\n else {\r\n \u002F\u002F DATA or RCDATA containing \"&\"\". Entity decoding required.\r\n return context.options.decodeEntities(rawText, mode === 4 \u002F* ATTRIBUTE_VALUE *\u002F);\r\n }\r\n}\r\nfunction getCursor(context) {\r\n const { column, line, offset } = context;\r\n return { column, line, offset };\r\n}\r\nfunction getSelection(context, start, end) {\r\n end = end || getCursor(context);\r\n return {\r\n start,\r\n end,\r\n source: context.originalSource.slice(start.offset, end.offset)\r\n };\r\n}\r\nfunction last(xs) {\r\n return xs[xs.length - 1];\r\n}\r\nfunction startsWith(source, searchString) {\r\n return source.startsWith(searchString);\r\n}\r\nfunction advanceBy(context, numberOfCharacters) {\r\n const { source } = context;\r\n advancePositionWithMutation(context, source, numberOfCharacters);\r\n context.source = source.slice(numberOfCharacters);\r\n}\r\nfunction advanceSpaces(context) {\r\n const match = \u002F^[\\t\\r\\n\\f ]+\u002F.exec(context.source);\r\n if (match) {\r\n advanceBy(context, match[0].length);\r\n }\r\n}\r\nfunction getNewPosition(context, start, numberOfCharacters) {\r\n return advancePositionWithClone(start, context.originalSource.slice(start.offset, numberOfCharacters), numberOfCharacters);\r\n}\r\nfunction emitError(context, code, offset, loc = getCursor(context)) {\r\n if (offset) {\r\n loc.offset += offset;\r\n loc.column += offset;\r\n }\r\n context.options.onError(createCompilerError(code, {\r\n start: loc,\r\n end: loc,\r\n source: ''\r\n }));\r\n}\r\nfunction isEnd(context, mode, ancestors) {\r\n const s = context.source;\r\n switch (mode) {\r\n case 0 \u002F* DATA *\u002F:\r\n if (startsWith(s, '\u003C\u002F')) {\r\n \u002F\u002F TODO: probably bad performance\r\n for (let i = ancestors.length - 1; i \u003E= 0; --i) {\r\n if (startsWithEndTagOpen(s, ancestors[i].tag)) {\r\n return true;\r\n }\r\n }\r\n }\r\n break;\r\n case 1 \u002F* RCDATA *\u002F:\r\n case 2 \u002F* RAWTEXT *\u002F: {\r\n const parent = last(ancestors);\r\n if (parent && startsWithEndTagOpen(s, parent.tag)) {\r\n return true;\r\n }\r\n break;\r\n }\r\n case 3 \u002F* CDATA *\u002F:\r\n if (startsWith(s, ']]\u003E')) {\r\n return true;\r\n }\r\n break;\r\n }\r\n return !s;\r\n}\r\nfunction startsWithEndTagOpen(source, tag) {\r\n return (startsWith(source, '\u003C\u002F') &&\r\n source.slice(2, 2 + tag.length).toLowerCase() === tag.toLowerCase() &&\r\n \u002F[\\t\\r\\n\\f \u002F\u003E]\u002F.test(source[2 + tag.length] || '\u003E'));\r\n}\r\n\r\nfunction hoistStatic(root, context) {\r\n walk(root, context, \r\n \u002F\u002F Root node is unfortunately non-hoistable due to potential parent\r\n \u002F\u002F fallthrough attributes.\r\n isSingleElementRoot(root, root.children[0]));\r\n}\r\nfunction isSingleElementRoot(root, child) {\r\n const { children } = root;\r\n return (children.length === 1 &&\r\n child.type === 1 \u002F* ELEMENT *\u002F &&\r\n !isSlotOutlet(child));\r\n}\r\nfunction walk(node, context, doNotHoistNode = false) {\r\n const { children } = node;\r\n const originalCount = children.length;\r\n let hoistedCount = 0;\r\n for (let i = 0; i \u003C children.length; i++) {\r\n const child = children[i];\r\n \u002F\u002F only plain elements & text calls are eligible for hoisting.\r\n if (child.type === 1 \u002F* ELEMENT *\u002F &&\r\n child.tagType === 0 \u002F* ELEMENT *\u002F) {\r\n const constantType = doNotHoistNode\r\n ? 0 \u002F* NOT_CONSTANT *\u002F\r\n : getConstantType(child, context);\r\n if (constantType \u003E 0 \u002F* NOT_CONSTANT *\u002F) {\r\n if (constantType \u003E= 2 \u002F* CAN_HOIST *\u002F) {\r\n child.codegenNode.patchFlag =\r\n -1 \u002F* HOISTED *\u002F + (` \u002F* HOISTED *\u002F` );\r\n child.codegenNode = context.hoist(child.codegenNode);\r\n hoistedCount++;\r\n continue;\r\n }\r\n }\r\n else {\r\n \u002F\u002F node may contain dynamic children, but its props may be eligible for\r\n \u002F\u002F hoisting.\r\n const codegenNode = child.codegenNode;\r\n if (codegenNode.type === 13 \u002F* VNODE_CALL *\u002F) {\r\n const flag = getPatchFlag(codegenNode);\r\n if ((!flag ||\r\n flag === 512 \u002F* NEED_PATCH *\u002F ||\r\n flag === 1 \u002F* TEXT *\u002F) &&\r\n getGeneratedPropsConstantType(child, context) \u003E=\r\n 2 \u002F* CAN_HOIST *\u002F) {\r\n const props = getNodeProps(child);\r\n if (props) {\r\n codegenNode.props = context.hoist(props);\r\n }\r\n }\r\n if (codegenNode.dynamicProps) {\r\n codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps);\r\n }\r\n }\r\n }\r\n }\r\n else if (child.type === 12 \u002F* TEXT_CALL *\u002F &&\r\n getConstantType(child.content, context) \u003E= 2 \u002F* CAN_HOIST *\u002F) {\r\n child.codegenNode = context.hoist(child.codegenNode);\r\n hoistedCount++;\r\n }\r\n \u002F\u002F walk further\r\n if (child.type === 1 \u002F* ELEMENT *\u002F) {\r\n const isComponent = child.tagType === 1 \u002F* COMPONENT *\u002F;\r\n if (isComponent) {\r\n context.scopes.vSlot++;\r\n }\r\n walk(child, context);\r\n if (isComponent) {\r\n context.scopes.vSlot--;\r\n }\r\n }\r\n else if (child.type === 11 \u002F* FOR *\u002F) {\r\n \u002F\u002F Do not hoist v-for single child because it has to be a block\r\n walk(child, context, child.children.length === 1);\r\n }\r\n else if (child.type === 9 \u002F* IF *\u002F) {\r\n for (let i = 0; i \u003C child.branches.length; i++) {\r\n \u002F\u002F Do not hoist v-if single child because it has to be a block\r\n walk(child.branches[i], context, child.branches[i].children.length === 1);\r\n }\r\n }\r\n }\r\n if (hoistedCount && context.transformHoist) {\r\n context.transformHoist(children, context, node);\r\n }\r\n \u002F\u002F all children were hoisted - the entire children array is hoistable.\r\n if (hoistedCount &&\r\n hoistedCount === originalCount &&\r\n node.type === 1 \u002F* ELEMENT *\u002F &&\r\n node.tagType === 0 \u002F* ELEMENT *\u002F &&\r\n node.codegenNode &&\r\n node.codegenNode.type === 13 \u002F* VNODE_CALL *\u002F &&\r\n isArray(node.codegenNode.children)) {\r\n node.codegenNode.children = context.hoist(createArrayExpression(node.codegenNode.children));\r\n }\r\n}\r\nfunction getConstantType(node, context) {\r\n const { constantCache } = context;\r\n switch (node.type) {\r\n case 1 \u002F* ELEMENT *\u002F:\r\n if (node.tagType !== 0 \u002F* ELEMENT *\u002F) {\r\n return 0 \u002F* NOT_CONSTANT *\u002F;\r\n }\r\n const cached = constantCache.get(node);\r\n if (cached !== undefined) {\r\n return cached;\r\n }\r\n const codegenNode = node.codegenNode;\r\n if (codegenNode.type !== 13 \u002F* VNODE_CALL *\u002F) {\r\n return 0 \u002F* NOT_CONSTANT *\u002F;\r\n }\r\n if (codegenNode.isBlock &&\r\n node.tag !== 'svg' &&\r\n node.tag !== 'foreignObject') {\r\n return 0 \u002F* NOT_CONSTANT *\u002F;\r\n }\r\n const flag = getPatchFlag(codegenNode);\r\n if (!flag) {\r\n let returnType = 3 \u002F* CAN_STRINGIFY *\u002F;\r\n \u002F\u002F Element itself has no patch flag. However we still need to check:\r\n \u002F\u002F 1. Even for a node with no patch flag, it is possible for it to contain\r\n \u002F\u002F non-hoistable expressions that refers to scope variables, e.g. compiler\r\n \u002F\u002F injected keys or cached event handlers. Therefore we need to always\r\n \u002F\u002F check the codegenNode's props to be sure.\r\n const generatedPropsType = getGeneratedPropsConstantType(node, context);\r\n if (generatedPropsType === 0 \u002F* NOT_CONSTANT *\u002F) {\r\n constantCache.set(node, 0 \u002F* NOT_CONSTANT *\u002F);\r\n return 0 \u002F* NOT_CONSTANT *\u002F;\r\n }\r\n if (generatedPropsType \u003C returnType) {\r\n returnType = generatedPropsType;\r\n }\r\n \u002F\u002F 2. its children.\r\n for (let i = 0; i \u003C node.children.length; i++) {\r\n const childType = getConstantType(node.children[i], context);\r\n if (childType === 0 \u002F* NOT_CONSTANT *\u002F) {\r\n constantCache.set(node, 0 \u002F* NOT_CONSTANT *\u002F);\r\n return 0 \u002F* NOT_CONSTANT *\u002F;\r\n }\r\n if (childType \u003C returnType) {\r\n returnType = childType;\r\n }\r\n }\r\n \u002F\u002F 3. if the type is not already CAN_SKIP_PATCH which is the lowest non-0\r\n \u002F\u002F type, check if any of the props can cause the type to be lowered\r\n \u002F\u002F we can skip can_patch because it's guaranteed by the absence of a\r\n \u002F\u002F patchFlag.\r\n if (returnType \u003E 1 \u002F* CAN_SKIP_PATCH *\u002F) {\r\n for (let i = 0; i \u003C node.props.length; i++) {\r\n const p = node.props[i];\r\n if (p.type === 7 \u002F* DIRECTIVE *\u002F && p.name === 'bind' && p.exp) {\r\n const expType = getConstantType(p.exp, context);\r\n if (expType === 0 \u002F* NOT_CONSTANT *\u002F) {\r\n constantCache.set(node, 0 \u002F* NOT_CONSTANT *\u002F);\r\n return 0 \u002F* NOT_CONSTANT *\u002F;\r\n }\r\n if (expType \u003C returnType) {\r\n returnType = expType;\r\n }\r\n }\r\n }\r\n }\r\n \u002F\u002F only svg\u002FforeignObject could be block here, however if they are\r\n \u002F\u002F static then they don't need to be blocks since there will be no\r\n \u002F\u002F nested updates.\r\n if (codegenNode.isBlock) {\r\n context.removeHelper(OPEN_BLOCK);\r\n context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));\r\n codegenNode.isBlock = false;\r\n context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent));\r\n }\r\n constantCache.set(node, returnType);\r\n return returnType;\r\n }\r\n else {\r\n constantCache.set(node, 0 \u002F* NOT_CONSTANT *\u002F);\r\n return 0 \u002F* NOT_CONSTANT *\u002F;\r\n }\r\n case 2 \u002F* TEXT *\u002F:\r\n case 3 \u002F* COMMENT *\u002F:\r\n return 3 \u002F* CAN_STRINGIFY *\u002F;\r\n case 9 \u002F* IF *\u002F:\r\n case 11 \u002F* FOR *\u002F:\r\n case 10 \u002F* IF_BRANCH *\u002F:\r\n return 0 \u002F* NOT_CONSTANT *\u002F;\r\n case 5 \u002F* INTERPOLATION *\u002F:\r\n case 12 \u002F* TEXT_CALL *\u002F:\r\n return getConstantType(node.content, context);\r\n case 4 \u002F* SIMPLE_EXPRESSION *\u002F:\r\n return node.constType;\r\n case 8 \u002F* COMPOUND_EXPRESSION *\u002F:\r\n let returnType = 3 \u002F* CAN_STRINGIFY *\u002F;\r\n for (let i = 0; i \u003C node.children.length; i++) {\r\n const child = node.children[i];\r\n if (isString(child) || isSymbol(child)) {\r\n continue;\r\n }\r\n const childType = getConstantType(child, context);\r\n if (childType === 0 \u002F* NOT_CONSTANT *\u002F) {\r\n return 0 \u002F* NOT_CONSTANT *\u002F;\r\n }\r\n else if (childType \u003C returnType) {\r\n returnType = childType;\r\n }\r\n }\r\n return returnType;\r\n default:\r\n return 0 \u002F* NOT_CONSTANT *\u002F;\r\n }\r\n}\r\nconst allowHoistedHelperSet = new Set([\r\n NORMALIZE_CLASS,\r\n NORMALIZE_STYLE,\r\n NORMALIZE_PROPS,\r\n GUARD_REACTIVE_PROPS\r\n]);\r\nfunction getConstantTypeOfHelperCall(value, context) {\r\n if (value.type === 14 \u002F* JS_CALL_EXPRESSION *\u002F &&\r\n !isString(value.callee) &&\r\n allowHoistedHelperSet.has(value.callee)) {\r\n const arg = value.arguments[0];\r\n if (arg.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F) {\r\n return getConstantType(arg, context);\r\n }\r\n else if (arg.type === 14 \u002F* JS_CALL_EXPRESSION *\u002F) {\r\n \u002F\u002F in the case of nested helper call, e.g. `normalizeProps(guardReactiveProps(exp))`\r\n return getConstantTypeOfHelperCall(arg, context);\r\n }\r\n }\r\n return 0 \u002F* NOT_CONSTANT *\u002F;\r\n}\r\nfunction getGeneratedPropsConstantType(node, context) {\r\n let returnType = 3 \u002F* CAN_STRINGIFY *\u002F;\r\n const props = getNodeProps(node);\r\n if (props && props.type === 15 \u002F* JS_OBJECT_EXPRESSION *\u002F) {\r\n const { properties } = props;\r\n for (let i = 0; i \u003C properties.length; i++) {\r\n const { key, value } = properties[i];\r\n const keyType = getConstantType(key, context);\r\n if (keyType === 0 \u002F* NOT_CONSTANT *\u002F) {\r\n return keyType;\r\n }\r\n if (keyType \u003C returnType) {\r\n returnType = keyType;\r\n }\r\n let valueType;\r\n if (value.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F) {\r\n valueType = getConstantType(value, context);\r\n }\r\n else if (value.type === 14 \u002F* JS_CALL_EXPRESSION *\u002F) {\r\n \u002F\u002F some helper calls can be hoisted,\r\n \u002F\u002F such as the `normalizeProps` generated by the compiler for pre-normalize class,\r\n \u002F\u002F in this case we need to respect the ConstantType of the helper's arguments\r\n valueType = getConstantTypeOfHelperCall(value, context);\r\n }\r\n else {\r\n valueType = 0 \u002F* NOT_CONSTANT *\u002F;\r\n }\r\n if (valueType === 0 \u002F* NOT_CONSTANT *\u002F) {\r\n return valueType;\r\n }\r\n if (valueType \u003C returnType) {\r\n returnType = valueType;\r\n }\r\n }\r\n }\r\n return returnType;\r\n}\r\nfunction getNodeProps(node) {\r\n const codegenNode = node.codegenNode;\r\n if (codegenNode.type === 13 \u002F* VNODE_CALL *\u002F) {\r\n return codegenNode.props;\r\n }\r\n}\r\nfunction getPatchFlag(node) {\r\n const flag = node.patchFlag;\r\n return flag ? parseInt(flag, 10) : undefined;\r\n}\r\n\r\nfunction createTransformContext(root, { filename = '', prefixIdentifiers = false, hoistStatic = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {\r\n const nameMatch = filename.replace(\u002F\\?.*$\u002F, '').match(\u002F([^\u002F\\\\]+)\\.\\w+$\u002F);\r\n const context = {\r\n \u002F\u002F options\r\n selfName: nameMatch && capitalize(camelize(nameMatch[1])),\r\n prefixIdentifiers,\r\n hoistStatic,\r\n cacheHandlers,\r\n nodeTransforms,\r\n directiveTransforms,\r\n transformHoist,\r\n isBuiltInComponent,\r\n isCustomElement,\r\n expressionPlugins,\r\n scopeId,\r\n slotted,\r\n ssr,\r\n inSSR,\r\n ssrCssVars,\r\n bindingMetadata,\r\n inline,\r\n isTS,\r\n onError,\r\n onWarn,\r\n compatConfig,\r\n \u002F\u002F state\r\n root,\r\n helpers: new Map(),\r\n components: new Set(),\r\n directives: new Set(),\r\n hoists: [],\r\n imports: [],\r\n constantCache: new Map(),\r\n temps: 0,\r\n cached: 0,\r\n identifiers: Object.create(null),\r\n scopes: {\r\n vFor: 0,\r\n vSlot: 0,\r\n vPre: 0,\r\n vOnce: 0\r\n },\r\n parent: null,\r\n currentNode: root,\r\n childIndex: 0,\r\n inVOnce: false,\r\n \u002F\u002F methods\r\n helper(name) {\r\n const count = context.helpers.get(name) || 0;\r\n context.helpers.set(name, count + 1);\r\n return name;\r\n },\r\n removeHelper(name) {\r\n const count = context.helpers.get(name);\r\n if (count) {\r\n const currentCount = count - 1;\r\n if (!currentCount) {\r\n context.helpers.delete(name);\r\n }\r\n else {\r\n context.helpers.set(name, currentCount);\r\n }\r\n }\r\n },\r\n helperString(name) {\r\n return `_${helperNameMap[context.helper(name)]}`;\r\n },\r\n replaceNode(node) {\r\n \u002F* istanbul ignore if *\u002F\r\n {\r\n if (!context.currentNode) {\r\n throw new Error(`Node being replaced is already removed.`);\r\n }\r\n if (!context.parent) {\r\n throw new Error(`Cannot replace root node.`);\r\n }\r\n }\r\n context.parent.children[context.childIndex] = context.currentNode = node;\r\n },\r\n removeNode(node) {\r\n if (!context.parent) {\r\n throw new Error(`Cannot remove root node.`);\r\n }\r\n const list = context.parent.children;\r\n const removalIndex = node\r\n ? list.indexOf(node)\r\n : context.currentNode\r\n ? context.childIndex\r\n : -1;\r\n \u002F* istanbul ignore if *\u002F\r\n if (removalIndex \u003C 0) {\r\n throw new Error(`node being removed is not a child of current parent`);\r\n }\r\n if (!node || node === context.currentNode) {\r\n \u002F\u002F current node removed\r\n context.currentNode = null;\r\n context.onNodeRemoved();\r\n }\r\n else {\r\n \u002F\u002F sibling node removed\r\n if (context.childIndex \u003E removalIndex) {\r\n context.childIndex--;\r\n context.onNodeRemoved();\r\n }\r\n }\r\n context.parent.children.splice(removalIndex, 1);\r\n },\r\n onNodeRemoved: () =\u003E { },\r\n addIdentifiers(exp) {\r\n },\r\n removeIdentifiers(exp) {\r\n },\r\n hoist(exp) {\r\n if (isString(exp))\r\n exp = createSimpleExpression(exp);\r\n context.hoists.push(exp);\r\n const identifier = createSimpleExpression(`_hoisted_${context.hoists.length}`, false, exp.loc, 2 \u002F* CAN_HOIST *\u002F);\r\n identifier.hoisted = exp;\r\n return identifier;\r\n },\r\n cache(exp, isVNode = false) {\r\n return createCacheExpression(context.cached++, exp, isVNode);\r\n }\r\n };\r\n return context;\r\n}\r\nfunction transform(root, options) {\r\n const context = createTransformContext(root, options);\r\n traverseNode(root, context);\r\n if (options.hoistStatic) {\r\n hoistStatic(root, context);\r\n }\r\n if (!options.ssr) {\r\n createRootCodegen(root, context);\r\n }\r\n \u002F\u002F finalize meta information\r\n root.helpers = [...context.helpers.keys()];\r\n root.components = [...context.components];\r\n root.directives = [...context.directives];\r\n root.imports = context.imports;\r\n root.hoists = context.hoists;\r\n root.temps = context.temps;\r\n root.cached = context.cached;\r\n}\r\nfunction createRootCodegen(root, context) {\r\n const { helper } = context;\r\n const { children } = root;\r\n if (children.length === 1) {\r\n const child = children[0];\r\n \u002F\u002F if the single child is an element, turn it into a block.\r\n if (isSingleElementRoot(root, child) && child.codegenNode) {\r\n \u002F\u002F single element root is never hoisted so codegenNode will never be\r\n \u002F\u002F SimpleExpressionNode\r\n const codegenNode = child.codegenNode;\r\n if (codegenNode.type === 13 \u002F* VNODE_CALL *\u002F) {\r\n makeBlock(codegenNode, context);\r\n }\r\n root.codegenNode = codegenNode;\r\n }\r\n else {\r\n \u002F\u002F - single \u003Cslot\u002F\u003E, IfNode, ForNode: already blocks.\r\n \u002F\u002F - single text node: always patched.\r\n \u002F\u002F root codegen falls through via genNode()\r\n root.codegenNode = child;\r\n }\r\n }\r\n else if (children.length \u003E 1) {\r\n \u002F\u002F root has multiple nodes - return a fragment block.\r\n let patchFlag = 64 \u002F* STABLE_FRAGMENT *\u002F;\r\n let patchFlagText = PatchFlagNames[64 \u002F* STABLE_FRAGMENT *\u002F];\r\n \u002F\u002F check if the fragment actually contains a single valid child with\r\n \u002F\u002F the rest being comments\r\n if (children.filter(c =\u003E c.type !== 3 \u002F* COMMENT *\u002F).length === 1) {\r\n patchFlag |= 2048 \u002F* DEV_ROOT_FRAGMENT *\u002F;\r\n patchFlagText += `, ${PatchFlagNames[2048 \u002F* DEV_ROOT_FRAGMENT *\u002F]}`;\r\n }\r\n root.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, root.children, patchFlag + (` \u002F* ${patchFlagText} *\u002F` ), undefined, undefined, true, undefined, false \u002F* isComponent *\u002F);\r\n }\r\n else ;\r\n}\r\nfunction traverseChildren(parent, context) {\r\n let i = 0;\r\n const nodeRemoved = () =\u003E {\r\n i--;\r\n };\r\n for (; i \u003C parent.children.length; i++) {\r\n const child = parent.children[i];\r\n if (isString(child))\r\n continue;\r\n context.parent = parent;\r\n context.childIndex = i;\r\n context.onNodeRemoved = nodeRemoved;\r\n traverseNode(child, context);\r\n }\r\n}\r\nfunction traverseNode(node, context) {\r\n context.currentNode = node;\r\n \u002F\u002F apply transform plugins\r\n const { nodeTransforms } = context;\r\n const exitFns = [];\r\n for (let i = 0; i \u003C nodeTransforms.length; i++) {\r\n const onExit = nodeTransforms[i](node, context);\r\n if (onExit) {\r\n if (isArray(onExit)) {\r\n exitFns.push(...onExit);\r\n }\r\n else {\r\n exitFns.push(onExit);\r\n }\r\n }\r\n if (!context.currentNode) {\r\n \u002F\u002F node was removed\r\n return;\r\n }\r\n else {\r\n \u002F\u002F node may have been replaced\r\n node = context.currentNode;\r\n }\r\n }\r\n switch (node.type) {\r\n case 3 \u002F* COMMENT *\u002F:\r\n if (!context.ssr) {\r\n \u002F\u002F inject import for the Comment symbol, which is needed for creating\r\n \u002F\u002F comment nodes with `createVNode`\r\n context.helper(CREATE_COMMENT);\r\n }\r\n break;\r\n case 5 \u002F* INTERPOLATION *\u002F:\r\n \u002F\u002F no need to traverse, but we need to inject toString helper\r\n if (!context.ssr) {\r\n context.helper(TO_DISPLAY_STRING);\r\n }\r\n break;\r\n \u002F\u002F for container types, further traverse downwards\r\n case 9 \u002F* IF *\u002F:\r\n for (let i = 0; i \u003C node.branches.length; i++) {\r\n traverseNode(node.branches[i], context);\r\n }\r\n break;\r\n case 10 \u002F* IF_BRANCH *\u002F:\r\n case 11 \u002F* FOR *\u002F:\r\n case 1 \u002F* ELEMENT *\u002F:\r\n case 0 \u002F* ROOT *\u002F:\r\n traverseChildren(node, context);\r\n break;\r\n }\r\n \u002F\u002F exit transforms\r\n context.currentNode = node;\r\n let i = exitFns.length;\r\n while (i--) {\r\n exitFns[i]();\r\n }\r\n}\r\nfunction createStructuralDirectiveTransform(name, fn) {\r\n const matches = isString(name)\r\n ? (n) =\u003E n === name\r\n : (n) =\u003E name.test(n);\r\n return (node, context) =\u003E {\r\n if (node.type === 1 \u002F* ELEMENT *\u002F) {\r\n const { props } = node;\r\n \u002F\u002F structural directive transforms are not concerned with slots\r\n \u002F\u002F as they are handled separately in vSlot.ts\r\n if (node.tagType === 3 \u002F* TEMPLATE *\u002F && props.some(isVSlot)) {\r\n return;\r\n }\r\n const exitFns = [];\r\n for (let i = 0; i \u003C props.length; i++) {\r\n const prop = props[i];\r\n if (prop.type === 7 \u002F* DIRECTIVE *\u002F && matches(prop.name)) {\r\n \u002F\u002F structural directives are removed to avoid infinite recursion\r\n \u002F\u002F also we remove them *before* applying so that it can further\r\n \u002F\u002F traverse itself in case it moves the node around\r\n props.splice(i, 1);\r\n i--;\r\n const onExit = fn(node, prop, context);\r\n if (onExit)\r\n exitFns.push(onExit);\r\n }\r\n }\r\n return exitFns;\r\n }\r\n };\r\n}\r\n\r\nconst PURE_ANNOTATION = `\u002F*#__PURE__*\u002F`;\r\nfunction createCodegenContext(ast, { mode = 'function', prefixIdentifiers = mode === 'module', sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssrRuntimeModuleName = 'vue\u002Fserver-renderer', ssr = false, isTS = false, inSSR = false }) {\r\n const context = {\r\n mode,\r\n prefixIdentifiers,\r\n sourceMap,\r\n filename,\r\n scopeId,\r\n optimizeImports,\r\n runtimeGlobalName,\r\n runtimeModuleName,\r\n ssrRuntimeModuleName,\r\n ssr,\r\n isTS,\r\n inSSR,\r\n source: ast.loc.source,\r\n code: ``,\r\n column: 1,\r\n line: 1,\r\n offset: 0,\r\n indentLevel: 0,\r\n pure: false,\r\n map: undefined,\r\n helper(key) {\r\n return `_${helperNameMap[key]}`;\r\n },\r\n push(code, node) {\r\n context.code += code;\r\n },\r\n indent() {\r\n newline(++context.indentLevel);\r\n },\r\n deindent(withoutNewLine = false) {\r\n if (withoutNewLine) {\r\n --context.indentLevel;\r\n }\r\n else {\r\n newline(--context.indentLevel);\r\n }\r\n },\r\n newline() {\r\n newline(context.indentLevel);\r\n }\r\n };\r\n function newline(n) {\r\n context.push('\\n' + ` `.repeat(n));\r\n }\r\n return context;\r\n}\r\nfunction generate(ast, options = {}) {\r\n const context = createCodegenContext(ast, options);\r\n if (options.onContextCreated)\r\n options.onContextCreated(context);\r\n const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;\r\n const hasHelpers = ast.helpers.length \u003E 0;\r\n const useWithBlock = !prefixIdentifiers && mode !== 'module';\r\n \u002F\u002F preambles\r\n \u002F\u002F in setup() inline mode, the preamble is generated in a sub context\r\n \u002F\u002F and returned separately.\r\n const preambleContext = context;\r\n {\r\n genFunctionPreamble(ast, preambleContext);\r\n }\r\n \u002F\u002F enter render function\r\n const functionName = ssr ? `ssrRender` : `render`;\r\n const args = ssr ? ['_ctx', '_push', '_parent', '_attrs'] : ['_ctx', '_cache'];\r\n const signature = args.join(', ');\r\n {\r\n push(`function ${functionName}(${signature}) {`);\r\n }\r\n indent();\r\n if (useWithBlock) {\r\n push(`with (_ctx) {`);\r\n indent();\r\n \u002F\u002F function mode const declarations should be inside with block\r\n \u002F\u002F also they should be renamed to avoid collision with user properties\r\n if (hasHelpers) {\r\n push(`const { ${ast.helpers\r\n .map(s =\u003E `${helperNameMap[s]}: _${helperNameMap[s]}`)\r\n .join(', ')} } = _Vue`);\r\n push(`\\n`);\r\n newline();\r\n }\r\n }\r\n \u002F\u002F generate asset resolution statements\r\n if (ast.components.length) {\r\n genAssets(ast.components, 'component', context);\r\n if (ast.directives.length || ast.temps \u003E 0) {\r\n newline();\r\n }\r\n }\r\n if (ast.directives.length) {\r\n genAssets(ast.directives, 'directive', context);\r\n if (ast.temps \u003E 0) {\r\n newline();\r\n }\r\n }\r\n if (ast.temps \u003E 0) {\r\n push(`let `);\r\n for (let i = 0; i \u003C ast.temps; i++) {\r\n push(`${i \u003E 0 ? `, ` : ``}_temp${i}`);\r\n }\r\n }\r\n if (ast.components.length || ast.directives.length || ast.temps) {\r\n push(`\\n`);\r\n newline();\r\n }\r\n \u002F\u002F generate the VNode tree expression\r\n if (!ssr) {\r\n push(`return `);\r\n }\r\n if (ast.codegenNode) {\r\n genNode(ast.codegenNode, context);\r\n }\r\n else {\r\n push(`null`);\r\n }\r\n if (useWithBlock) {\r\n deindent();\r\n push(`}`);\r\n }\r\n deindent();\r\n push(`}`);\r\n return {\r\n ast,\r\n code: context.code,\r\n preamble: ``,\r\n \u002F\u002F SourceMapGenerator does have toJSON() method but it's not in the types\r\n map: context.map ? context.map.toJSON() : undefined\r\n };\r\n}\r\nfunction genFunctionPreamble(ast, context) {\r\n const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName, ssrRuntimeModuleName } = context;\r\n const VueBinding = runtimeGlobalName;\r\n const aliasHelper = (s) =\u003E `${helperNameMap[s]}: _${helperNameMap[s]}`;\r\n \u002F\u002F Generate const declaration for helpers\r\n \u002F\u002F In prefix mode, we place the const declaration at top so it's done\r\n \u002F\u002F only once; But if we not prefixing, we place the declaration inside the\r\n \u002F\u002F with block so it doesn't incur the `in` check cost for every helper access.\r\n if (ast.helpers.length \u003E 0) {\r\n {\r\n \u002F\u002F \"with\" mode.\r\n \u002F\u002F save Vue in a separate variable to avoid collision\r\n push(`const _Vue = ${VueBinding}\\n`);\r\n \u002F\u002F in \"with\" mode, helpers are declared inside the with block to avoid\r\n \u002F\u002F has check cost, but hoists are lifted out of the function - we need\r\n \u002F\u002F to provide the helper here.\r\n if (ast.hoists.length) {\r\n const staticHelpers = [\r\n CREATE_VNODE,\r\n CREATE_ELEMENT_VNODE,\r\n CREATE_COMMENT,\r\n CREATE_TEXT,\r\n CREATE_STATIC\r\n ]\r\n .filter(helper =\u003E ast.helpers.includes(helper))\r\n .map(aliasHelper)\r\n .join(', ');\r\n push(`const { ${staticHelpers} } = _Vue\\n`);\r\n }\r\n }\r\n }\r\n genHoists(ast.hoists, context);\r\n newline();\r\n push(`return `);\r\n}\r\nfunction genAssets(assets, type, { helper, push, newline, isTS }) {\r\n const resolver = helper(type === 'component'\r\n ? RESOLVE_COMPONENT\r\n : RESOLVE_DIRECTIVE);\r\n for (let i = 0; i \u003C assets.length; i++) {\r\n let id = assets[i];\r\n \u002F\u002F potential component implicit self-reference inferred from SFC filename\r\n const maybeSelfReference = id.endsWith('__self');\r\n if (maybeSelfReference) {\r\n id = id.slice(0, -6);\r\n }\r\n push(`const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}`);\r\n if (i \u003C assets.length - 1) {\r\n newline();\r\n }\r\n }\r\n}\r\nfunction genHoists(hoists, context) {\r\n if (!hoists.length) {\r\n return;\r\n }\r\n context.pure = true;\r\n const { push, newline, helper, scopeId, mode } = context;\r\n newline();\r\n for (let i = 0; i \u003C hoists.length; i++) {\r\n const exp = hoists[i];\r\n if (exp) {\r\n push(`const _hoisted_${i + 1} = ${``}`);\r\n genNode(exp, context);\r\n newline();\r\n }\r\n }\r\n context.pure = false;\r\n}\r\nfunction isText$1(n) {\r\n return (isString(n) ||\r\n n.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F ||\r\n n.type === 2 \u002F* TEXT *\u002F ||\r\n n.type === 5 \u002F* INTERPOLATION *\u002F ||\r\n n.type === 8 \u002F* COMPOUND_EXPRESSION *\u002F);\r\n}\r\nfunction genNodeListAsArray(nodes, context) {\r\n const multilines = nodes.length \u003E 3 ||\r\n (nodes.some(n =\u003E isArray(n) || !isText$1(n)));\r\n context.push(`[`);\r\n multilines && context.indent();\r\n genNodeList(nodes, context, multilines);\r\n multilines && context.deindent();\r\n context.push(`]`);\r\n}\r\nfunction genNodeList(nodes, context, multilines = false, comma = true) {\r\n const { push, newline } = context;\r\n for (let i = 0; i \u003C nodes.length; i++) {\r\n const node = nodes[i];\r\n if (isString(node)) {\r\n push(node);\r\n }\r\n else if (isArray(node)) {\r\n genNodeListAsArray(node, context);\r\n }\r\n else {\r\n genNode(node, context);\r\n }\r\n if (i \u003C nodes.length - 1) {\r\n if (multilines) {\r\n comma && push(',');\r\n newline();\r\n }\r\n else {\r\n comma && push(', ');\r\n }\r\n }\r\n }\r\n}\r\nfunction genNode(node, context) {\r\n if (isString(node)) {\r\n context.push(node);\r\n return;\r\n }\r\n if (isSymbol(node)) {\r\n context.push(context.helper(node));\r\n return;\r\n }\r\n switch (node.type) {\r\n case 1 \u002F* ELEMENT *\u002F:\r\n case 9 \u002F* IF *\u002F:\r\n case 11 \u002F* FOR *\u002F:\r\n assert(node.codegenNode != null, `Codegen node is missing for element\u002Fif\u002Ffor node. ` +\r\n `Apply appropriate transforms first.`);\r\n genNode(node.codegenNode, context);\r\n break;\r\n case 2 \u002F* TEXT *\u002F:\r\n genText(node, context);\r\n break;\r\n case 4 \u002F* SIMPLE_EXPRESSION *\u002F:\r\n genExpression(node, context);\r\n break;\r\n case 5 \u002F* INTERPOLATION *\u002F:\r\n genInterpolation(node, context);\r\n break;\r\n case 12 \u002F* TEXT_CALL *\u002F:\r\n genNode(node.codegenNode, context);\r\n break;\r\n case 8 \u002F* COMPOUND_EXPRESSION *\u002F:\r\n genCompoundExpression(node, context);\r\n break;\r\n case 3 \u002F* COMMENT *\u002F:\r\n genComment(node, context);\r\n break;\r\n case 13 \u002F* VNODE_CALL *\u002F:\r\n genVNodeCall(node, context);\r\n break;\r\n case 14 \u002F* JS_CALL_EXPRESSION *\u002F:\r\n genCallExpression(node, context);\r\n break;\r\n case 15 \u002F* JS_OBJECT_EXPRESSION *\u002F:\r\n genObjectExpression(node, context);\r\n break;\r\n case 17 \u002F* JS_ARRAY_EXPRESSION *\u002F:\r\n genArrayExpression(node, context);\r\n break;\r\n case 18 \u002F* JS_FUNCTION_EXPRESSION *\u002F:\r\n genFunctionExpression(node, context);\r\n break;\r\n case 19 \u002F* JS_CONDITIONAL_EXPRESSION *\u002F:\r\n genConditionalExpression(node, context);\r\n break;\r\n case 20 \u002F* JS_CACHE_EXPRESSION *\u002F:\r\n genCacheExpression(node, context);\r\n break;\r\n case 21 \u002F* JS_BLOCK_STATEMENT *\u002F:\r\n genNodeList(node.body, context, true, false);\r\n break;\r\n \u002F\u002F SSR only types\r\n case 22 \u002F* JS_TEMPLATE_LITERAL *\u002F:\r\n break;\r\n case 23 \u002F* JS_IF_STATEMENT *\u002F:\r\n break;\r\n case 24 \u002F* JS_ASSIGNMENT_EXPRESSION *\u002F:\r\n break;\r\n case 25 \u002F* JS_SEQUENCE_EXPRESSION *\u002F:\r\n break;\r\n case 26 \u002F* JS_RETURN_STATEMENT *\u002F:\r\n break;\r\n \u002F* istanbul ignore next *\u002F\r\n case 10 \u002F* IF_BRANCH *\u002F:\r\n \u002F\u002F noop\r\n break;\r\n default:\r\n {\r\n assert(false, `unhandled codegen node type: ${node.type}`);\r\n \u002F\u002F make sure we exhaust all possible types\r\n const exhaustiveCheck = node;\r\n return exhaustiveCheck;\r\n }\r\n }\r\n}\r\nfunction genText(node, context) {\r\n context.push(JSON.stringify(node.content), node);\r\n}\r\nfunction genExpression(node, context) {\r\n const { content, isStatic } = node;\r\n context.push(isStatic ? JSON.stringify(content) : content, node);\r\n}\r\nfunction genInterpolation(node, context) {\r\n const { push, helper, pure } = context;\r\n if (pure)\r\n push(PURE_ANNOTATION);\r\n push(`${helper(TO_DISPLAY_STRING)}(`);\r\n genNode(node.content, context);\r\n push(`)`);\r\n}\r\nfunction genCompoundExpression(node, context) {\r\n for (let i = 0; i \u003C node.children.length; i++) {\r\n const child = node.children[i];\r\n if (isString(child)) {\r\n context.push(child);\r\n }\r\n else {\r\n genNode(child, context);\r\n }\r\n }\r\n}\r\nfunction genExpressionAsPropertyKey(node, context) {\r\n const { push } = context;\r\n if (node.type === 8 \u002F* COMPOUND_EXPRESSION *\u002F) {\r\n push(`[`);\r\n genCompoundExpression(node, context);\r\n push(`]`);\r\n }\r\n else if (node.isStatic) {\r\n \u002F\u002F only quote keys if necessary\r\n const text = isSimpleIdentifier(node.content)\r\n ? node.content\r\n : JSON.stringify(node.content);\r\n push(text, node);\r\n }\r\n else {\r\n push(`[${node.content}]`, node);\r\n }\r\n}\r\nfunction genComment(node, context) {\r\n const { push, helper, pure } = context;\r\n if (pure) {\r\n push(PURE_ANNOTATION);\r\n }\r\n push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node);\r\n}\r\nfunction genVNodeCall(node, context) {\r\n const { push, helper, pure } = context;\r\n const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking, isComponent } = node;\r\n if (directives) {\r\n push(helper(WITH_DIRECTIVES) + `(`);\r\n }\r\n if (isBlock) {\r\n push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);\r\n }\r\n if (pure) {\r\n push(PURE_ANNOTATION);\r\n }\r\n const callHelper = isBlock\r\n ? getVNodeBlockHelper(context.inSSR, isComponent)\r\n : getVNodeHelper(context.inSSR, isComponent);\r\n push(helper(callHelper) + `(`, node);\r\n genNodeList(genNullableArgs([tag, props, children, patchFlag, dynamicProps]), context);\r\n push(`)`);\r\n if (isBlock) {\r\n push(`)`);\r\n }\r\n if (directives) {\r\n push(`, `);\r\n genNode(directives, context);\r\n push(`)`);\r\n }\r\n}\r\nfunction genNullableArgs(args) {\r\n let i = args.length;\r\n while (i--) {\r\n if (args[i] != null)\r\n break;\r\n }\r\n return args.slice(0, i + 1).map(arg =\u003E arg || `null`);\r\n}\r\n\u002F\u002F JavaScript\r\nfunction genCallExpression(node, context) {\r\n const { push, helper, pure } = context;\r\n const callee = isString(node.callee) ? node.callee : helper(node.callee);\r\n if (pure) {\r\n push(PURE_ANNOTATION);\r\n }\r\n push(callee + `(`, node);\r\n genNodeList(node.arguments, context);\r\n push(`)`);\r\n}\r\nfunction genObjectExpression(node, context) {\r\n const { push, indent, deindent, newline } = context;\r\n const { properties } = node;\r\n if (!properties.length) {\r\n push(`{}`, node);\r\n return;\r\n }\r\n const multilines = properties.length \u003E 1 ||\r\n (properties.some(p =\u003E p.value.type !== 4 \u002F* SIMPLE_EXPRESSION *\u002F));\r\n push(multilines ? `{` : `{ `);\r\n multilines && indent();\r\n for (let i = 0; i \u003C properties.length; i++) {\r\n const { key, value } = properties[i];\r\n \u002F\u002F key\r\n genExpressionAsPropertyKey(key, context);\r\n push(`: `);\r\n \u002F\u002F value\r\n genNode(value, context);\r\n if (i \u003C properties.length - 1) {\r\n \u002F\u002F will only reach this if it's multilines\r\n push(`,`);\r\n newline();\r\n }\r\n }\r\n multilines && deindent();\r\n push(multilines ? `}` : ` }`);\r\n}\r\nfunction genArrayExpression(node, context) {\r\n genNodeListAsArray(node.elements, context);\r\n}\r\nfunction genFunctionExpression(node, context) {\r\n const { push, indent, deindent } = context;\r\n const { params, returns, body, newline, isSlot } = node;\r\n if (isSlot) {\r\n \u002F\u002F wrap slot functions with owner context\r\n push(`_${helperNameMap[WITH_CTX]}(`);\r\n }\r\n push(`(`, node);\r\n if (isArray(params)) {\r\n genNodeList(params, context);\r\n }\r\n else if (params) {\r\n genNode(params, context);\r\n }\r\n push(`) =\u003E `);\r\n if (newline || body) {\r\n push(`{`);\r\n indent();\r\n }\r\n if (returns) {\r\n if (newline) {\r\n push(`return `);\r\n }\r\n if (isArray(returns)) {\r\n genNodeListAsArray(returns, context);\r\n }\r\n else {\r\n genNode(returns, context);\r\n }\r\n }\r\n else if (body) {\r\n genNode(body, context);\r\n }\r\n if (newline || body) {\r\n deindent();\r\n push(`}`);\r\n }\r\n if (isSlot) {\r\n push(`)`);\r\n }\r\n}\r\nfunction genConditionalExpression(node, context) {\r\n const { test, consequent, alternate, newline: needNewline } = node;\r\n const { push, indent, deindent, newline } = context;\r\n if (test.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F) {\r\n const needsParens = !isSimpleIdentifier(test.content);\r\n needsParens && push(`(`);\r\n genExpression(test, context);\r\n needsParens && push(`)`);\r\n }\r\n else {\r\n push(`(`);\r\n genNode(test, context);\r\n push(`)`);\r\n }\r\n needNewline && indent();\r\n context.indentLevel++;\r\n needNewline || push(` `);\r\n push(`? `);\r\n genNode(consequent, context);\r\n context.indentLevel--;\r\n needNewline && newline();\r\n needNewline || push(` `);\r\n push(`: `);\r\n const isNested = alternate.type === 19 \u002F* JS_CONDITIONAL_EXPRESSION *\u002F;\r\n if (!isNested) {\r\n context.indentLevel++;\r\n }\r\n genNode(alternate, context);\r\n if (!isNested) {\r\n context.indentLevel--;\r\n }\r\n needNewline && deindent(true \u002F* without newline *\u002F);\r\n}\r\nfunction genCacheExpression(node, context) {\r\n const { push, helper, indent, deindent, newline } = context;\r\n push(`_cache[${node.index}] || (`);\r\n if (node.isVNode) {\r\n indent();\r\n push(`${helper(SET_BLOCK_TRACKING)}(-1),`);\r\n newline();\r\n }\r\n push(`_cache[${node.index}] = `);\r\n genNode(node.value, context);\r\n if (node.isVNode) {\r\n push(`,`);\r\n newline();\r\n push(`${helper(SET_BLOCK_TRACKING)}(1),`);\r\n newline();\r\n push(`_cache[${node.index}]`);\r\n deindent();\r\n }\r\n push(`)`);\r\n}\r\n\r\n\u002F\u002F these keywords should not appear inside expressions, but operators like\r\n\u002F\u002F typeof, instanceof and in are allowed\r\nconst prohibitedKeywordRE = new RegExp('\\\\b' +\r\n ('do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +\r\n 'super,throw,while,yield,delete,export,import,return,switch,default,' +\r\n 'extends,finally,continue,debugger,function,arguments,typeof,void')\r\n .split(',')\r\n .join('\\\\b|\\\\b') +\r\n '\\\\b');\r\n\u002F\u002F strip strings in expressions\r\nconst stripStringRE = \u002F'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|`(?:[^`\\\\]|\\\\.)*\\$\\{|\\}(?:[^`\\\\]|\\\\.)*`|`(?:[^`\\\\]|\\\\.)*`\u002Fg;\r\n\u002F**\r\n * Validate a non-prefixed expression.\r\n * This is only called when using the in-browser runtime compiler since it\r\n * doesn't prefix expressions.\r\n *\u002F\r\nfunction validateBrowserExpression(node, context, asParams = false, asRawStatements = false) {\r\n const exp = node.content;\r\n \u002F\u002F empty expressions are validated per-directive since some directives\r\n \u002F\u002F do allow empty expressions.\r\n if (!exp.trim()) {\r\n return;\r\n }\r\n try {\r\n new Function(asRawStatements\r\n ? ` ${exp} `\r\n : `return ${asParams ? `(${exp}) =\u003E {}` : `(${exp})`}`);\r\n }\r\n catch (e) {\r\n let message = e.message;\r\n const keywordMatch = exp\r\n .replace(stripStringRE, '')\r\n .match(prohibitedKeywordRE);\r\n if (keywordMatch) {\r\n message = `avoid using JavaScript keyword as property name: \"${keywordMatch[0]}\"`;\r\n }\r\n context.onError(createCompilerError(44 \u002F* X_INVALID_EXPRESSION *\u002F, node.loc, undefined, message));\r\n }\r\n}\r\n\r\nconst transformExpression = (node, context) =\u003E {\r\n if (node.type === 5 \u002F* INTERPOLATION *\u002F) {\r\n node.content = processExpression(node.content, context);\r\n }\r\n else if (node.type === 1 \u002F* ELEMENT *\u002F) {\r\n \u002F\u002F handle directives on element\r\n for (let i = 0; i \u003C node.props.length; i++) {\r\n const dir = node.props[i];\r\n \u002F\u002F do not process for v-on & v-for since they are special handled\r\n if (dir.type === 7 \u002F* DIRECTIVE *\u002F && dir.name !== 'for') {\r\n const exp = dir.exp;\r\n const arg = dir.arg;\r\n \u002F\u002F do not process exp if this is v-on:arg - we need special handling\r\n \u002F\u002F for wrapping inline statements.\r\n if (exp &&\r\n exp.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F &&\r\n !(dir.name === 'on' && arg)) {\r\n dir.exp = processExpression(exp, context, \r\n \u002F\u002F slot args must be processed as function params\r\n dir.name === 'slot');\r\n }\r\n if (arg && arg.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F && !arg.isStatic) {\r\n dir.arg = processExpression(arg, context);\r\n }\r\n }\r\n }\r\n }\r\n};\r\n\u002F\u002F Important: since this function uses Node.js only dependencies, it should\r\n\u002F\u002F always be used with a leading !true check so that it can be\r\n\u002F\u002F tree-shaken from the browser build.\r\nfunction processExpression(node, context, \r\n\u002F\u002F some expressions like v-slot props & v-for aliases should be parsed as\r\n\u002F\u002F function params\r\nasParams = false, \r\n\u002F\u002F v-on handler values may contain multiple statements\r\nasRawStatements = false, localVars = Object.create(context.identifiers)) {\r\n {\r\n {\r\n \u002F\u002F simple in-browser validation (same logic in 2.x)\r\n validateBrowserExpression(node, context, asParams, asRawStatements);\r\n }\r\n return node;\r\n }\r\n}\r\n\r\nconst transformIf = createStructuralDirectiveTransform(\u002F^(if|else|else-if)$\u002F, (node, dir, context) =\u003E {\r\n return processIf(node, dir, context, (ifNode, branch, isRoot) =\u003E {\r\n \u002F\u002F #1587: We need to dynamically increment the key based on the current\r\n \u002F\u002F node's sibling nodes, since chained v-if\u002Felse branches are\r\n \u002F\u002F rendered at the same depth\r\n const siblings = context.parent.children;\r\n let i = siblings.indexOf(ifNode);\r\n let key = 0;\r\n while (i-- \u003E= 0) {\r\n const sibling = siblings[i];\r\n if (sibling && sibling.type === 9 \u002F* IF *\u002F) {\r\n key += sibling.branches.length;\r\n }\r\n }\r\n \u002F\u002F Exit callback. Complete the codegenNode when all children have been\r\n \u002F\u002F transformed.\r\n return () =\u003E {\r\n if (isRoot) {\r\n ifNode.codegenNode = createCodegenNodeForBranch(branch, key, context);\r\n }\r\n else {\r\n \u002F\u002F attach this branch's codegen node to the v-if root.\r\n const parentCondition = getParentCondition(ifNode.codegenNode);\r\n parentCondition.alternate = createCodegenNodeForBranch(branch, key + ifNode.branches.length - 1, context);\r\n }\r\n };\r\n });\r\n});\r\n\u002F\u002F target-agnostic transform used for both Client and SSR\r\nfunction processIf(node, dir, context, processCodegen) {\r\n if (dir.name !== 'else' &&\r\n (!dir.exp || !dir.exp.content.trim())) {\r\n const loc = dir.exp ? dir.exp.loc : node.loc;\r\n context.onError(createCompilerError(28 \u002F* X_V_IF_NO_EXPRESSION *\u002F, dir.loc));\r\n dir.exp = createSimpleExpression(`true`, false, loc);\r\n }\r\n if (dir.exp) {\r\n validateBrowserExpression(dir.exp, context);\r\n }\r\n if (dir.name === 'if') {\r\n const branch = createIfBranch(node, dir);\r\n const ifNode = {\r\n type: 9 \u002F* IF *\u002F,\r\n loc: node.loc,\r\n branches: [branch]\r\n };\r\n context.replaceNode(ifNode);\r\n if (processCodegen) {\r\n return processCodegen(ifNode, branch, true);\r\n }\r\n }\r\n else {\r\n \u002F\u002F locate the adjacent v-if\r\n const siblings = context.parent.children;\r\n const comments = [];\r\n let i = siblings.indexOf(node);\r\n while (i-- \u003E= -1) {\r\n const sibling = siblings[i];\r\n if (sibling && sibling.type === 3 \u002F* COMMENT *\u002F) {\r\n context.removeNode(sibling);\r\n comments.unshift(sibling);\r\n continue;\r\n }\r\n if (sibling &&\r\n sibling.type === 2 \u002F* TEXT *\u002F &&\r\n !sibling.content.trim().length) {\r\n context.removeNode(sibling);\r\n continue;\r\n }\r\n if (sibling && sibling.type === 9 \u002F* IF *\u002F) {\r\n \u002F\u002F Check if v-else was followed by v-else-if\r\n if (dir.name === 'else-if' &&\r\n sibling.branches[sibling.branches.length - 1].condition === undefined) {\r\n context.onError(createCompilerError(30 \u002F* X_V_ELSE_NO_ADJACENT_IF *\u002F, node.loc));\r\n }\r\n \u002F\u002F move the node to the if node's branches\r\n context.removeNode();\r\n const branch = createIfBranch(node, dir);\r\n if (comments.length &&\r\n \u002F\u002F #3619 ignore comments if the v-if is direct child of \u003Ctransition\u003E\r\n !(context.parent &&\r\n context.parent.type === 1 \u002F* ELEMENT *\u002F &&\r\n isBuiltInType(context.parent.tag, 'transition'))) {\r\n branch.children = [...comments, ...branch.children];\r\n }\r\n \u002F\u002F check if user is forcing same key on different branches\r\n {\r\n const key = branch.userKey;\r\n if (key) {\r\n sibling.branches.forEach(({ userKey }) =\u003E {\r\n if (isSameKey(userKey, key)) {\r\n context.onError(createCompilerError(29 \u002F* X_V_IF_SAME_KEY *\u002F, branch.userKey.loc));\r\n }\r\n });\r\n }\r\n }\r\n sibling.branches.push(branch);\r\n const onExit = processCodegen && processCodegen(sibling, branch, false);\r\n \u002F\u002F since the branch was removed, it will not be traversed.\r\n \u002F\u002F make sure to traverse here.\r\n traverseNode(branch, context);\r\n \u002F\u002F call on exit\r\n if (onExit)\r\n onExit();\r\n \u002F\u002F make sure to reset currentNode after traversal to indicate this\r\n \u002F\u002F node has been removed.\r\n context.currentNode = null;\r\n }\r\n else {\r\n context.onError(createCompilerError(30 \u002F* X_V_ELSE_NO_ADJACENT_IF *\u002F, node.loc));\r\n }\r\n break;\r\n }\r\n }\r\n}\r\nfunction createIfBranch(node, dir) {\r\n return {\r\n type: 10 \u002F* IF_BRANCH *\u002F,\r\n loc: node.loc,\r\n condition: dir.name === 'else' ? undefined : dir.exp,\r\n children: node.tagType === 3 \u002F* TEMPLATE *\u002F && !findDir(node, 'for')\r\n ? node.children\r\n : [node],\r\n userKey: findProp(node, `key`)\r\n };\r\n}\r\nfunction createCodegenNodeForBranch(branch, keyIndex, context) {\r\n if (branch.condition) {\r\n return createConditionalExpression(branch.condition, createChildrenCodegenNode(branch, keyIndex, context), \r\n \u002F\u002F make sure to pass in asBlock: true so that the comment node call\r\n \u002F\u002F closes the current block.\r\n createCallExpression(context.helper(CREATE_COMMENT), [\r\n '\"v-if\"' ,\r\n 'true'\r\n ]));\r\n }\r\n else {\r\n return createChildrenCodegenNode(branch, keyIndex, context);\r\n }\r\n}\r\nfunction createChildrenCodegenNode(branch, keyIndex, context) {\r\n const { helper } = context;\r\n const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2 \u002F* CAN_HOIST *\u002F));\r\n const { children } = branch;\r\n const firstChild = children[0];\r\n const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1 \u002F* ELEMENT *\u002F;\r\n if (needFragmentWrapper) {\r\n if (children.length === 1 && firstChild.type === 11 \u002F* FOR *\u002F) {\r\n \u002F\u002F optimize away nested fragments when child is a ForNode\r\n const vnodeCall = firstChild.codegenNode;\r\n injectProp(vnodeCall, keyProperty, context);\r\n return vnodeCall;\r\n }\r\n else {\r\n let patchFlag = 64 \u002F* STABLE_FRAGMENT *\u002F;\r\n let patchFlagText = PatchFlagNames[64 \u002F* STABLE_FRAGMENT *\u002F];\r\n \u002F\u002F check if the fragment actually contains a single valid child with\r\n \u002F\u002F the rest being comments\r\n if (children.filter(c =\u003E c.type !== 3 \u002F* COMMENT *\u002F).length === 1) {\r\n patchFlag |= 2048 \u002F* DEV_ROOT_FRAGMENT *\u002F;\r\n patchFlagText += `, ${PatchFlagNames[2048 \u002F* DEV_ROOT_FRAGMENT *\u002F]}`;\r\n }\r\n return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag + (` \u002F* ${patchFlagText} *\u002F` ), undefined, undefined, true, false, false \u002F* isComponent *\u002F, branch.loc);\r\n }\r\n }\r\n else {\r\n const ret = firstChild.codegenNode;\r\n const vnodeCall = getMemoedVNodeCall(ret);\r\n \u002F\u002F Change createVNode to createBlock.\r\n if (vnodeCall.type === 13 \u002F* VNODE_CALL *\u002F) {\r\n makeBlock(vnodeCall, context);\r\n }\r\n \u002F\u002F inject branch key\r\n injectProp(vnodeCall, keyProperty, context);\r\n return ret;\r\n }\r\n}\r\nfunction isSameKey(a, b) {\r\n if (!a || a.type !== b.type) {\r\n return false;\r\n }\r\n if (a.type === 6 \u002F* ATTRIBUTE *\u002F) {\r\n if (a.value.content !== b.value.content) {\r\n return false;\r\n }\r\n }\r\n else {\r\n \u002F\u002F directive\r\n const exp = a.exp;\r\n const branchExp = b.exp;\r\n if (exp.type !== branchExp.type) {\r\n return false;\r\n }\r\n if (exp.type !== 4 \u002F* SIMPLE_EXPRESSION *\u002F ||\r\n exp.isStatic !== branchExp.isStatic ||\r\n exp.content !== branchExp.content) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction getParentCondition(node) {\r\n while (true) {\r\n if (node.type === 19 \u002F* JS_CONDITIONAL_EXPRESSION *\u002F) {\r\n if (node.alternate.type === 19 \u002F* JS_CONDITIONAL_EXPRESSION *\u002F) {\r\n node = node.alternate;\r\n }\r\n else {\r\n return node;\r\n }\r\n }\r\n else if (node.type === 20 \u002F* JS_CACHE_EXPRESSION *\u002F) {\r\n node = node.value;\r\n }\r\n }\r\n}\r\n\r\nconst transformFor = createStructuralDirectiveTransform('for', (node, dir, context) =\u003E {\r\n const { helper, removeHelper } = context;\r\n return processFor(node, dir, context, forNode =\u003E {\r\n \u002F\u002F create the loop render function expression now, and add the\r\n \u002F\u002F iterator on exit after all children have been traversed\r\n const renderExp = createCallExpression(helper(RENDER_LIST), [\r\n forNode.source\r\n ]);\r\n const isTemplate = isTemplateNode(node);\r\n const memo = findDir(node, 'memo');\r\n const keyProp = findProp(node, `key`);\r\n const keyExp = keyProp &&\r\n (keyProp.type === 6 \u002F* ATTRIBUTE *\u002F\r\n ? createSimpleExpression(keyProp.value.content, true)\r\n : keyProp.exp);\r\n const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;\r\n const isStableFragment = forNode.source.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F &&\r\n forNode.source.constType \u003E 0 \u002F* NOT_CONSTANT *\u002F;\r\n const fragmentFlag = isStableFragment\r\n ? 64 \u002F* STABLE_FRAGMENT *\u002F\r\n : keyProp\r\n ? 128 \u002F* KEYED_FRAGMENT *\u002F\r\n : 256 \u002F* UNKEYED_FRAGMENT *\u002F;\r\n forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, renderExp, fragmentFlag +\r\n (` \u002F* ${PatchFlagNames[fragmentFlag]} *\u002F` ), undefined, undefined, true \u002F* isBlock *\u002F, !isStableFragment \u002F* disableTracking *\u002F, false \u002F* isComponent *\u002F, node.loc);\r\n return () =\u003E {\r\n \u002F\u002F finish the codegen now that all children have been traversed\r\n let childBlock;\r\n const { children } = forNode;\r\n \u002F\u002F check \u003Ctemplate v-for\u003E key placement\r\n if (isTemplate) {\r\n node.children.some(c =\u003E {\r\n if (c.type === 1 \u002F* ELEMENT *\u002F) {\r\n const key = findProp(c, 'key');\r\n if (key) {\r\n context.onError(createCompilerError(33 \u002F* X_V_FOR_TEMPLATE_KEY_PLACEMENT *\u002F, key.loc));\r\n return true;\r\n }\r\n }\r\n });\r\n }\r\n const needFragmentWrapper = children.length !== 1 || children[0].type !== 1 \u002F* ELEMENT *\u002F;\r\n const slotOutlet = isSlotOutlet(node)\r\n ? node\r\n : isTemplate &&\r\n node.children.length === 1 &&\r\n isSlotOutlet(node.children[0])\r\n ? node.children[0] \u002F\u002F api-extractor somehow fails to infer this\r\n : null;\r\n if (slotOutlet) {\r\n \u002F\u002F \u003Cslot v-for=\"...\"\u003E or \u003Ctemplate v-for=\"...\"\u003E\u003Cslot\u002F\u003E\u003C\u002Ftemplate\u003E\r\n childBlock = slotOutlet.codegenNode;\r\n if (isTemplate && keyProperty) {\r\n \u002F\u002F \u003Ctemplate v-for=\"...\" :key=\"...\"\u003E\u003Cslot\u002F\u003E\u003C\u002Ftemplate\u003E\r\n \u002F\u002F we need to inject the key to the renderSlot() call.\r\n \u002F\u002F the props for renderSlot is passed as the 3rd argument.\r\n injectProp(childBlock, keyProperty, context);\r\n }\r\n }\r\n else if (needFragmentWrapper) {\r\n \u002F\u002F \u003Ctemplate v-for=\"...\"\u003E with text or multi-elements\r\n \u002F\u002F should generate a fragment block for each loop\r\n childBlock = createVNodeCall(context, helper(FRAGMENT), keyProperty ? createObjectExpression([keyProperty]) : undefined, node.children, 64 \u002F* STABLE_FRAGMENT *\u002F +\r\n (` \u002F* ${PatchFlagNames[64 \u002F* STABLE_FRAGMENT *\u002F]} *\u002F`\r\n ), undefined, undefined, true, undefined, false \u002F* isComponent *\u002F);\r\n }\r\n else {\r\n \u002F\u002F Normal element v-for. Directly use the child's codegenNode\r\n \u002F\u002F but mark it as a block.\r\n childBlock = children[0]\r\n .codegenNode;\r\n if (isTemplate && keyProperty) {\r\n injectProp(childBlock, keyProperty, context);\r\n }\r\n if (childBlock.isBlock !== !isStableFragment) {\r\n if (childBlock.isBlock) {\r\n \u002F\u002F switch from block to vnode\r\n removeHelper(OPEN_BLOCK);\r\n removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));\r\n }\r\n else {\r\n \u002F\u002F switch from vnode to block\r\n removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));\r\n }\r\n }\r\n childBlock.isBlock = !isStableFragment;\r\n if (childBlock.isBlock) {\r\n helper(OPEN_BLOCK);\r\n helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));\r\n }\r\n else {\r\n helper(getVNodeHelper(context.inSSR, childBlock.isComponent));\r\n }\r\n }\r\n if (memo) {\r\n const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [\r\n createSimpleExpression(`_cached`)\r\n ]));\r\n loop.body = createBlockStatement([\r\n createCompoundExpression([`const _memo = (`, memo.exp, `)`]),\r\n createCompoundExpression([\r\n `if (_cached`,\r\n ...(keyExp ? [` && _cached.key === `, keyExp] : []),\r\n ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`\r\n ]),\r\n createCompoundExpression([`const _item = `, childBlock]),\r\n createSimpleExpression(`_item.memo = _memo`),\r\n createSimpleExpression(`return _item`)\r\n ]);\r\n renderExp.arguments.push(loop, createSimpleExpression(`_cache`), createSimpleExpression(String(context.cached++)));\r\n }\r\n else {\r\n renderExp.arguments.push(createFunctionExpression(createForLoopParams(forNode.parseResult), childBlock, true \u002F* force newline *\u002F));\r\n }\r\n };\r\n });\r\n});\r\n\u002F\u002F target-agnostic transform used for both Client and SSR\r\nfunction processFor(node, dir, context, processCodegen) {\r\n if (!dir.exp) {\r\n context.onError(createCompilerError(31 \u002F* X_V_FOR_NO_EXPRESSION *\u002F, dir.loc));\r\n return;\r\n }\r\n const parseResult = parseForExpression(\r\n \u002F\u002F can only be simple expression because vFor transform is applied\r\n \u002F\u002F before expression transform.\r\n dir.exp, context);\r\n if (!parseResult) {\r\n context.onError(createCompilerError(32 \u002F* X_V_FOR_MALFORMED_EXPRESSION *\u002F, dir.loc));\r\n return;\r\n }\r\n const { addIdentifiers, removeIdentifiers, scopes } = context;\r\n const { source, value, key, index } = parseResult;\r\n const forNode = {\r\n type: 11 \u002F* FOR *\u002F,\r\n loc: dir.loc,\r\n source,\r\n valueAlias: value,\r\n keyAlias: key,\r\n objectIndexAlias: index,\r\n parseResult,\r\n children: isTemplateNode(node) ? node.children : [node]\r\n };\r\n context.replaceNode(forNode);\r\n \u002F\u002F bookkeeping\r\n scopes.vFor++;\r\n const onExit = processCodegen && processCodegen(forNode);\r\n return () =\u003E {\r\n scopes.vFor--;\r\n if (onExit)\r\n onExit();\r\n };\r\n}\r\nconst forAliasRE = \u002F([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)\u002F;\r\n\u002F\u002F This regex doesn't cover the case if key or index aliases have destructuring,\r\n\u002F\u002F but those do not make sense in the first place, so this works in practice.\r\nconst forIteratorRE = \u002F,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$\u002F;\r\nconst stripParensRE = \u002F^\\(|\\)$\u002Fg;\r\nfunction parseForExpression(input, context) {\r\n const loc = input.loc;\r\n const exp = input.content;\r\n const inMatch = exp.match(forAliasRE);\r\n if (!inMatch)\r\n return;\r\n const [, LHS, RHS] = inMatch;\r\n const result = {\r\n source: createAliasExpression(loc, RHS.trim(), exp.indexOf(RHS, LHS.length)),\r\n value: undefined,\r\n key: undefined,\r\n index: undefined\r\n };\r\n {\r\n validateBrowserExpression(result.source, context);\r\n }\r\n let valueContent = LHS.trim().replace(stripParensRE, '').trim();\r\n const trimmedOffset = LHS.indexOf(valueContent);\r\n const iteratorMatch = valueContent.match(forIteratorRE);\r\n if (iteratorMatch) {\r\n valueContent = valueContent.replace(forIteratorRE, '').trim();\r\n const keyContent = iteratorMatch[1].trim();\r\n let keyOffset;\r\n if (keyContent) {\r\n keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);\r\n result.key = createAliasExpression(loc, keyContent, keyOffset);\r\n {\r\n validateBrowserExpression(result.key, context, true);\r\n }\r\n }\r\n if (iteratorMatch[2]) {\r\n const indexContent = iteratorMatch[2].trim();\r\n if (indexContent) {\r\n result.index = createAliasExpression(loc, indexContent, exp.indexOf(indexContent, result.key\r\n ? keyOffset + keyContent.length\r\n : trimmedOffset + valueContent.length));\r\n {\r\n validateBrowserExpression(result.index, context, true);\r\n }\r\n }\r\n }\r\n }\r\n if (valueContent) {\r\n result.value = createAliasExpression(loc, valueContent, trimmedOffset);\r\n {\r\n validateBrowserExpression(result.value, context, true);\r\n }\r\n }\r\n return result;\r\n}\r\nfunction createAliasExpression(range, content, offset) {\r\n return createSimpleExpression(content, false, getInnerRange(range, offset, content.length));\r\n}\r\nfunction createForLoopParams({ value, key, index }, memoArgs = []) {\r\n return createParamsList([value, key, index, ...memoArgs]);\r\n}\r\nfunction createParamsList(args) {\r\n let i = args.length;\r\n while (i--) {\r\n if (args[i])\r\n break;\r\n }\r\n return args\r\n .slice(0, i + 1)\r\n .map((arg, i) =\u003E arg || createSimpleExpression(`_`.repeat(i + 1), false));\r\n}\r\n\r\nconst defaultFallback = createSimpleExpression(`undefined`, false);\r\n\u002F\u002F A NodeTransform that:\r\n\u002F\u002F 1. Tracks scope identifiers for scoped slots so that they don't get prefixed\r\n\u002F\u002F by transformExpression. This is only applied in non-browser builds with\r\n\u002F\u002F { prefixIdentifiers: true }.\r\n\u002F\u002F 2. Track v-slot depths so that we know a slot is inside another slot.\r\n\u002F\u002F Note the exit callback is executed before buildSlots() on the same node,\r\n\u002F\u002F so only nested slots see positive numbers.\r\nconst trackSlotScopes = (node, context) =\u003E {\r\n if (node.type === 1 \u002F* ELEMENT *\u002F &&\r\n (node.tagType === 1 \u002F* COMPONENT *\u002F ||\r\n node.tagType === 3 \u002F* TEMPLATE *\u002F)) {\r\n \u002F\u002F We are only checking non-empty v-slot here\r\n \u002F\u002F since we only care about slots that introduce scope variables.\r\n const vSlot = findDir(node, 'slot');\r\n if (vSlot) {\r\n vSlot.exp;\r\n context.scopes.vSlot++;\r\n return () =\u003E {\r\n context.scopes.vSlot--;\r\n };\r\n }\r\n }\r\n};\r\nconst buildClientSlotFn = (props, children, loc) =\u003E createFunctionExpression(props, children, false \u002F* newline *\u002F, true \u002F* isSlot *\u002F, children.length ? children[0].loc : loc);\r\n\u002F\u002F Instead of being a DirectiveTransform, v-slot processing is called during\r\n\u002F\u002F transformElement to build the slots object for a component.\r\nfunction buildSlots(node, context, buildSlotFn = buildClientSlotFn) {\r\n context.helper(WITH_CTX);\r\n const { children, loc } = node;\r\n const slotsProperties = [];\r\n const dynamicSlots = [];\r\n \u002F\u002F If the slot is inside a v-for or another v-slot, force it to be dynamic\r\n \u002F\u002F since it likely uses a scope variable.\r\n let hasDynamicSlots = context.scopes.vSlot \u003E 0 || context.scopes.vFor \u003E 0;\r\n \u002F\u002F 1. Check for slot with slotProps on component itself.\r\n \u002F\u002F \u003CComp v-slot=\"{ prop }\"\u002F\u003E\r\n const onComponentSlot = findDir(node, 'slot', true);\r\n if (onComponentSlot) {\r\n const { arg, exp } = onComponentSlot;\r\n if (arg && !isStaticExp(arg)) {\r\n hasDynamicSlots = true;\r\n }\r\n slotsProperties.push(createObjectProperty(arg || createSimpleExpression('default', true), buildSlotFn(exp, children, loc)));\r\n }\r\n \u002F\u002F 2. Iterate through children and check for template slots\r\n \u002F\u002F \u003Ctemplate v-slot:foo=\"{ prop }\"\u003E\r\n let hasTemplateSlots = false;\r\n let hasNamedDefaultSlot = false;\r\n const implicitDefaultChildren = [];\r\n const seenSlotNames = new Set();\r\n for (let i = 0; i \u003C children.length; i++) {\r\n const slotElement = children[i];\r\n let slotDir;\r\n if (!isTemplateNode(slotElement) ||\r\n !(slotDir = findDir(slotElement, 'slot', true))) {\r\n \u002F\u002F not a \u003Ctemplate v-slot\u003E, skip.\r\n if (slotElement.type !== 3 \u002F* COMMENT *\u002F) {\r\n implicitDefaultChildren.push(slotElement);\r\n }\r\n continue;\r\n }\r\n if (onComponentSlot) {\r\n \u002F\u002F already has on-component slot - this is incorrect usage.\r\n context.onError(createCompilerError(37 \u002F* X_V_SLOT_MIXED_SLOT_USAGE *\u002F, slotDir.loc));\r\n break;\r\n }\r\n hasTemplateSlots = true;\r\n const { children: slotChildren, loc: slotLoc } = slotElement;\r\n const { arg: slotName = createSimpleExpression(`default`, true), exp: slotProps, loc: dirLoc } = slotDir;\r\n \u002F\u002F check if name is dynamic.\r\n let staticSlotName;\r\n if (isStaticExp(slotName)) {\r\n staticSlotName = slotName ? slotName.content : `default`;\r\n }\r\n else {\r\n hasDynamicSlots = true;\r\n }\r\n const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);\r\n \u002F\u002F check if this slot is conditional (v-if\u002Fv-for)\r\n let vIf;\r\n let vElse;\r\n let vFor;\r\n if ((vIf = findDir(slotElement, 'if'))) {\r\n hasDynamicSlots = true;\r\n dynamicSlots.push(createConditionalExpression(vIf.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback));\r\n }\r\n else if ((vElse = findDir(slotElement, \u002F^else(-if)?$\u002F, true \u002F* allowEmpty *\u002F))) {\r\n \u002F\u002F find adjacent v-if\r\n let j = i;\r\n let prev;\r\n while (j--) {\r\n prev = children[j];\r\n if (prev.type !== 3 \u002F* COMMENT *\u002F) {\r\n break;\r\n }\r\n }\r\n if (prev && isTemplateNode(prev) && findDir(prev, 'if')) {\r\n \u002F\u002F remove node\r\n children.splice(i, 1);\r\n i--;\r\n \u002F\u002F attach this slot to previous conditional\r\n let conditional = dynamicSlots[dynamicSlots.length - 1];\r\n while (conditional.alternate.type === 19 \u002F* JS_CONDITIONAL_EXPRESSION *\u002F) {\r\n conditional = conditional.alternate;\r\n }\r\n conditional.alternate = vElse.exp\r\n ? createConditionalExpression(vElse.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback)\r\n : buildDynamicSlot(slotName, slotFunction);\r\n }\r\n else {\r\n context.onError(createCompilerError(30 \u002F* X_V_ELSE_NO_ADJACENT_IF *\u002F, vElse.loc));\r\n }\r\n }\r\n else if ((vFor = findDir(slotElement, 'for'))) {\r\n hasDynamicSlots = true;\r\n const parseResult = vFor.parseResult ||\r\n parseForExpression(vFor.exp, context);\r\n if (parseResult) {\r\n \u002F\u002F Render the dynamic slots as an array and add it to the createSlot()\r\n \u002F\u002F args. The runtime knows how to handle it appropriately.\r\n dynamicSlots.push(createCallExpression(context.helper(RENDER_LIST), [\r\n parseResult.source,\r\n createFunctionExpression(createForLoopParams(parseResult), buildDynamicSlot(slotName, slotFunction), true \u002F* force newline *\u002F)\r\n ]));\r\n }\r\n else {\r\n context.onError(createCompilerError(32 \u002F* X_V_FOR_MALFORMED_EXPRESSION *\u002F, vFor.loc));\r\n }\r\n }\r\n else {\r\n \u002F\u002F check duplicate static names\r\n if (staticSlotName) {\r\n if (seenSlotNames.has(staticSlotName)) {\r\n context.onError(createCompilerError(38 \u002F* X_V_SLOT_DUPLICATE_SLOT_NAMES *\u002F, dirLoc));\r\n continue;\r\n }\r\n seenSlotNames.add(staticSlotName);\r\n if (staticSlotName === 'default') {\r\n hasNamedDefaultSlot = true;\r\n }\r\n }\r\n slotsProperties.push(createObjectProperty(slotName, slotFunction));\r\n }\r\n }\r\n if (!onComponentSlot) {\r\n const buildDefaultSlotProperty = (props, children) =\u003E {\r\n const fn = buildSlotFn(props, children, loc);\r\n return createObjectProperty(`default`, fn);\r\n };\r\n if (!hasTemplateSlots) {\r\n \u002F\u002F implicit default slot (on component)\r\n slotsProperties.push(buildDefaultSlotProperty(undefined, children));\r\n }\r\n else if (implicitDefaultChildren.length &&\r\n \u002F\u002F #3766\r\n \u002F\u002F with whitespace: 'preserve', whitespaces between slots will end up in\r\n \u002F\u002F implicitDefaultChildren. Ignore if all implicit children are whitespaces.\r\n implicitDefaultChildren.some(node =\u003E isNonWhitespaceContent(node))) {\r\n \u002F\u002F implicit default slot (mixed with named slots)\r\n if (hasNamedDefaultSlot) {\r\n context.onError(createCompilerError(39 \u002F* X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN *\u002F, implicitDefaultChildren[0].loc));\r\n }\r\n else {\r\n slotsProperties.push(buildDefaultSlotProperty(undefined, implicitDefaultChildren));\r\n }\r\n }\r\n }\r\n const slotFlag = hasDynamicSlots\r\n ? 2 \u002F* DYNAMIC *\u002F\r\n : hasForwardedSlots(node.children)\r\n ? 3 \u002F* FORWARDED *\u002F\r\n : 1 \u002F* STABLE *\u002F;\r\n let slots = createObjectExpression(slotsProperties.concat(createObjectProperty(`_`, \r\n \u002F\u002F 2 = compiled but dynamic = can skip normalization, but must run diff\r\n \u002F\u002F 1 = compiled and static = can skip normalization AND diff as optimized\r\n createSimpleExpression(slotFlag + (` \u002F* ${slotFlagsText[slotFlag]} *\u002F` ), false))), loc);\r\n if (dynamicSlots.length) {\r\n slots = createCallExpression(context.helper(CREATE_SLOTS), [\r\n slots,\r\n createArrayExpression(dynamicSlots)\r\n ]);\r\n }\r\n return {\r\n slots,\r\n hasDynamicSlots\r\n };\r\n}\r\nfunction buildDynamicSlot(name, fn) {\r\n return createObjectExpression([\r\n createObjectProperty(`name`, name),\r\n createObjectProperty(`fn`, fn)\r\n ]);\r\n}\r\nfunction hasForwardedSlots(children) {\r\n for (let i = 0; i \u003C children.length; i++) {\r\n const child = children[i];\r\n switch (child.type) {\r\n case 1 \u002F* ELEMENT *\u002F:\r\n if (child.tagType === 2 \u002F* SLOT *\u002F ||\r\n hasForwardedSlots(child.children)) {\r\n return true;\r\n }\r\n break;\r\n case 9 \u002F* IF *\u002F:\r\n if (hasForwardedSlots(child.branches))\r\n return true;\r\n break;\r\n case 10 \u002F* IF_BRANCH *\u002F:\r\n case 11 \u002F* FOR *\u002F:\r\n if (hasForwardedSlots(child.children))\r\n return true;\r\n break;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction isNonWhitespaceContent(node) {\r\n if (node.type !== 2 \u002F* TEXT *\u002F && node.type !== 12 \u002F* TEXT_CALL *\u002F)\r\n return true;\r\n return node.type === 2 \u002F* TEXT *\u002F\r\n ? !!node.content.trim()\r\n : isNonWhitespaceContent(node.content);\r\n}\r\n\r\n\u002F\u002F some directive transforms (e.g. v-model) may return a symbol for runtime\r\n\u002F\u002F import, which should be used instead of a resolveDirective call.\r\nconst directiveImportMap = new WeakMap();\r\n\u002F\u002F generate a JavaScript AST for this element's codegen\r\nconst transformElement = (node, context) =\u003E {\r\n \u002F\u002F perform the work on exit, after all child expressions have been\r\n \u002F\u002F processed and merged.\r\n return function postTransformElement() {\r\n node = context.currentNode;\r\n if (!(node.type === 1 \u002F* ELEMENT *\u002F &&\r\n (node.tagType === 0 \u002F* ELEMENT *\u002F ||\r\n node.tagType === 1 \u002F* COMPONENT *\u002F))) {\r\n return;\r\n }\r\n const { tag, props } = node;\r\n const isComponent = node.tagType === 1 \u002F* COMPONENT *\u002F;\r\n \u002F\u002F The goal of the transform is to create a codegenNode implementing the\r\n \u002F\u002F VNodeCall interface.\r\n let vnodeTag = isComponent\r\n ? resolveComponentType(node, context)\r\n : `\"${tag}\"`;\r\n const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;\r\n let vnodeProps;\r\n let vnodeChildren;\r\n let vnodePatchFlag;\r\n let patchFlag = 0;\r\n let vnodeDynamicProps;\r\n let dynamicPropNames;\r\n let vnodeDirectives;\r\n let shouldUseBlock = \r\n \u002F\u002F dynamic component may resolve to plain elements\r\n isDynamicComponent ||\r\n vnodeTag === TELEPORT ||\r\n vnodeTag === SUSPENSE ||\r\n (!isComponent &&\r\n \u002F\u002F \u003Csvg\u003E and \u003CforeignObject\u003E must be forced into blocks so that block\r\n \u002F\u002F updates inside get proper isSVG flag at runtime. (#639, #643)\r\n \u002F\u002F This is technically web-specific, but splitting the logic out of core\r\n \u002F\u002F leads to too much unnecessary complexity.\r\n (tag === 'svg' || tag === 'foreignObject'));\r\n \u002F\u002F props\r\n if (props.length \u003E 0) {\r\n const propsBuildResult = buildProps(node, context);\r\n vnodeProps = propsBuildResult.props;\r\n patchFlag = propsBuildResult.patchFlag;\r\n dynamicPropNames = propsBuildResult.dynamicPropNames;\r\n const directives = propsBuildResult.directives;\r\n vnodeDirectives =\r\n directives && directives.length\r\n ? createArrayExpression(directives.map(dir =\u003E buildDirectiveArgs(dir, context)))\r\n : undefined;\r\n if (propsBuildResult.shouldUseBlock) {\r\n shouldUseBlock = true;\r\n }\r\n }\r\n \u002F\u002F children\r\n if (node.children.length \u003E 0) {\r\n if (vnodeTag === KEEP_ALIVE) {\r\n \u002F\u002F Although a built-in component, we compile KeepAlive with raw children\r\n \u002F\u002F instead of slot functions so that it can be used inside Transition\r\n \u002F\u002F or other Transition-wrapping HOCs.\r\n \u002F\u002F To ensure correct updates with block optimizations, we need to:\r\n \u002F\u002F 1. Force keep-alive into a block. This avoids its children being\r\n \u002F\u002F collected by a parent block.\r\n shouldUseBlock = true;\r\n \u002F\u002F 2. Force keep-alive to always be updated, since it uses raw children.\r\n patchFlag |= 1024 \u002F* DYNAMIC_SLOTS *\u002F;\r\n if (node.children.length \u003E 1) {\r\n context.onError(createCompilerError(45 \u002F* X_KEEP_ALIVE_INVALID_CHILDREN *\u002F, {\r\n start: node.children[0].loc.start,\r\n end: node.children[node.children.length - 1].loc.end,\r\n source: ''\r\n }));\r\n }\r\n }\r\n const shouldBuildAsSlots = isComponent &&\r\n \u002F\u002F Teleport is not a real component and has dedicated runtime handling\r\n vnodeTag !== TELEPORT &&\r\n \u002F\u002F explained above.\r\n vnodeTag !== KEEP_ALIVE;\r\n if (shouldBuildAsSlots) {\r\n const { slots, hasDynamicSlots } = buildSlots(node, context);\r\n vnodeChildren = slots;\r\n if (hasDynamicSlots) {\r\n patchFlag |= 1024 \u002F* DYNAMIC_SLOTS *\u002F;\r\n }\r\n }\r\n else if (node.children.length === 1 && vnodeTag !== TELEPORT) {\r\n const child = node.children[0];\r\n const type = child.type;\r\n \u002F\u002F check for dynamic text children\r\n const hasDynamicTextChild = type === 5 \u002F* INTERPOLATION *\u002F ||\r\n type === 8 \u002F* COMPOUND_EXPRESSION *\u002F;\r\n if (hasDynamicTextChild &&\r\n getConstantType(child, context) === 0 \u002F* NOT_CONSTANT *\u002F) {\r\n patchFlag |= 1 \u002F* TEXT *\u002F;\r\n }\r\n \u002F\u002F pass directly if the only child is a text node\r\n \u002F\u002F (plain \u002F interpolation \u002F expression)\r\n if (hasDynamicTextChild || type === 2 \u002F* TEXT *\u002F) {\r\n vnodeChildren = child;\r\n }\r\n else {\r\n vnodeChildren = node.children;\r\n }\r\n }\r\n else {\r\n vnodeChildren = node.children;\r\n }\r\n }\r\n \u002F\u002F patchFlag & dynamicPropNames\r\n if (patchFlag !== 0) {\r\n {\r\n if (patchFlag \u003C 0) {\r\n \u002F\u002F special flags (negative and mutually exclusive)\r\n vnodePatchFlag = patchFlag + ` \u002F* ${PatchFlagNames[patchFlag]} *\u002F`;\r\n }\r\n else {\r\n \u002F\u002F bitwise flags\r\n const flagNames = Object.keys(PatchFlagNames)\r\n .map(Number)\r\n .filter(n =\u003E n \u003E 0 && patchFlag & n)\r\n .map(n =\u003E PatchFlagNames[n])\r\n .join(`, `);\r\n vnodePatchFlag = patchFlag + ` \u002F* ${flagNames} *\u002F`;\r\n }\r\n }\r\n if (dynamicPropNames && dynamicPropNames.length) {\r\n vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);\r\n }\r\n }\r\n node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, vnodePatchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false \u002F* disableTracking *\u002F, isComponent, node.loc);\r\n };\r\n};\r\nfunction resolveComponentType(node, context, ssr = false) {\r\n let { tag } = node;\r\n \u002F\u002F 1. dynamic component\r\n const isExplicitDynamic = isComponentTag(tag);\r\n const isProp = findProp(node, 'is');\r\n if (isProp) {\r\n if (isExplicitDynamic ||\r\n (false )) {\r\n const exp = isProp.type === 6 \u002F* ATTRIBUTE *\u002F\r\n ? isProp.value && createSimpleExpression(isProp.value.content, true)\r\n : isProp.exp;\r\n if (exp) {\r\n return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [\r\n exp\r\n ]);\r\n }\r\n }\r\n else if (isProp.type === 6 \u002F* ATTRIBUTE *\u002F &&\r\n isProp.value.content.startsWith('vue:')) {\r\n \u002F\u002F \u003Cbutton is=\"vue:xxx\"\u003E\r\n \u002F\u002F if not \u003Ccomponent\u003E, only is value that starts with \"vue:\" will be\r\n \u002F\u002F treated as component by the parse phase and reach here, unless it's\r\n \u002F\u002F compat mode where all is values are considered components\r\n tag = isProp.value.content.slice(4);\r\n }\r\n }\r\n \u002F\u002F 1.5 v-is (TODO: Deprecate)\r\n const isDir = !isExplicitDynamic && findDir(node, 'is');\r\n if (isDir && isDir.exp) {\r\n return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [\r\n isDir.exp\r\n ]);\r\n }\r\n \u002F\u002F 2. built-in components (Teleport, Transition, KeepAlive, Suspense...)\r\n const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);\r\n if (builtIn) {\r\n \u002F\u002F built-ins are simply fallthroughs \u002F have special handling during ssr\r\n \u002F\u002F so we don't need to import their runtime equivalents\r\n if (!ssr)\r\n context.helper(builtIn);\r\n return builtIn;\r\n }\r\n \u002F\u002F 5. user component (resolve)\r\n context.helper(RESOLVE_COMPONENT);\r\n context.components.add(tag);\r\n return toValidAssetId(tag, `component`);\r\n}\r\nfunction buildProps(node, context, props = node.props, ssr = false) {\r\n const { tag, loc: elementLoc, children } = node;\r\n const isComponent = node.tagType === 1 \u002F* COMPONENT *\u002F;\r\n let properties = [];\r\n const mergeArgs = [];\r\n const runtimeDirectives = [];\r\n const hasChildren = children.length \u003E 0;\r\n let shouldUseBlock = false;\r\n \u002F\u002F patchFlag analysis\r\n let patchFlag = 0;\r\n let hasRef = false;\r\n let hasClassBinding = false;\r\n let hasStyleBinding = false;\r\n let hasHydrationEventBinding = false;\r\n let hasDynamicKeys = false;\r\n let hasVnodeHook = false;\r\n const dynamicPropNames = [];\r\n const analyzePatchFlag = ({ key, value }) =\u003E {\r\n if (isStaticExp(key)) {\r\n const name = key.content;\r\n const isEventHandler = isOn(name);\r\n if (!isComponent &&\r\n isEventHandler &&\r\n \u002F\u002F omit the flag for click handlers because hydration gives click\r\n \u002F\u002F dedicated fast path.\r\n name.toLowerCase() !== 'onclick' &&\r\n \u002F\u002F omit v-model handlers\r\n name !== 'onUpdate:modelValue' &&\r\n \u002F\u002F omit onVnodeXXX hooks\r\n !isReservedProp(name)) {\r\n hasHydrationEventBinding = true;\r\n }\r\n if (isEventHandler && isReservedProp(name)) {\r\n hasVnodeHook = true;\r\n }\r\n if (value.type === 20 \u002F* JS_CACHE_EXPRESSION *\u002F ||\r\n ((value.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F ||\r\n value.type === 8 \u002F* COMPOUND_EXPRESSION *\u002F) &&\r\n getConstantType(value, context) \u003E 0)) {\r\n \u002F\u002F skip if the prop is a cached handler or has constant value\r\n return;\r\n }\r\n if (name === 'ref') {\r\n hasRef = true;\r\n }\r\n else if (name === 'class') {\r\n hasClassBinding = true;\r\n }\r\n else if (name === 'style') {\r\n hasStyleBinding = true;\r\n }\r\n else if (name !== 'key' && !dynamicPropNames.includes(name)) {\r\n dynamicPropNames.push(name);\r\n }\r\n \u002F\u002F treat the dynamic class and style binding of the component as dynamic props\r\n if (isComponent &&\r\n (name === 'class' || name === 'style') &&\r\n !dynamicPropNames.includes(name)) {\r\n dynamicPropNames.push(name);\r\n }\r\n }\r\n else {\r\n hasDynamicKeys = true;\r\n }\r\n };\r\n for (let i = 0; i \u003C props.length; i++) {\r\n \u002F\u002F static attribute\r\n const prop = props[i];\r\n if (prop.type === 6 \u002F* ATTRIBUTE *\u002F) {\r\n const { loc, name, value } = prop;\r\n let isStatic = true;\r\n if (name === 'ref') {\r\n hasRef = true;\r\n if (context.scopes.vFor \u003E 0) {\r\n properties.push(createObjectProperty(createSimpleExpression('ref_for', true), createSimpleExpression('true')));\r\n }\r\n }\r\n \u002F\u002F skip is on \u003Ccomponent\u003E, or is=\"vue:xxx\"\r\n if (name === 'is' &&\r\n (isComponentTag(tag) ||\r\n (value && value.content.startsWith('vue:')) ||\r\n (false ))) {\r\n continue;\r\n }\r\n properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), createSimpleExpression(value ? value.content : '', isStatic, value ? value.loc : loc)));\r\n }\r\n else {\r\n \u002F\u002F directives\r\n const { name, arg, exp, loc } = prop;\r\n const isVBind = name === 'bind';\r\n const isVOn = name === 'on';\r\n \u002F\u002F skip v-slot - it is handled by its dedicated transform.\r\n if (name === 'slot') {\r\n if (!isComponent) {\r\n context.onError(createCompilerError(40 \u002F* X_V_SLOT_MISPLACED *\u002F, loc));\r\n }\r\n continue;\r\n }\r\n \u002F\u002F skip v-once\u002Fv-memo - they are handled by dedicated transforms.\r\n if (name === 'once' || name === 'memo') {\r\n continue;\r\n }\r\n \u002F\u002F skip v-is and :is on \u003Ccomponent\u003E\r\n if (name === 'is' ||\r\n (isVBind &&\r\n isStaticArgOf(arg, 'is') &&\r\n (isComponentTag(tag) ||\r\n (false )))) {\r\n continue;\r\n }\r\n \u002F\u002F skip v-on in SSR compilation\r\n if (isVOn && ssr) {\r\n continue;\r\n }\r\n if (\r\n \u002F\u002F #938: elements with dynamic keys should be forced into blocks\r\n (isVBind && isStaticArgOf(arg, 'key')) ||\r\n \u002F\u002F inline before-update hooks need to force block so that it is invoked\r\n \u002F\u002F before children\r\n (isVOn && hasChildren && isStaticArgOf(arg, 'vue:before-update'))) {\r\n shouldUseBlock = true;\r\n }\r\n if (isVBind && isStaticArgOf(arg, 'ref') && context.scopes.vFor \u003E 0) {\r\n properties.push(createObjectProperty(createSimpleExpression('ref_for', true), createSimpleExpression('true')));\r\n }\r\n \u002F\u002F special case for v-bind and v-on with no argument\r\n if (!arg && (isVBind || isVOn)) {\r\n hasDynamicKeys = true;\r\n if (exp) {\r\n if (properties.length) {\r\n mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));\r\n properties = [];\r\n }\r\n if (isVBind) {\r\n mergeArgs.push(exp);\r\n }\r\n else {\r\n \u002F\u002F v-on=\"obj\" -\u003E toHandlers(obj)\r\n mergeArgs.push({\r\n type: 14 \u002F* JS_CALL_EXPRESSION *\u002F,\r\n loc,\r\n callee: context.helper(TO_HANDLERS),\r\n arguments: [exp]\r\n });\r\n }\r\n }\r\n else {\r\n context.onError(createCompilerError(isVBind\r\n ? 34 \u002F* X_V_BIND_NO_EXPRESSION *\u002F\r\n : 35 \u002F* X_V_ON_NO_EXPRESSION *\u002F, loc));\r\n }\r\n continue;\r\n }\r\n const directiveTransform = context.directiveTransforms[name];\r\n if (directiveTransform) {\r\n \u002F\u002F has built-in directive transform.\r\n const { props, needRuntime } = directiveTransform(prop, node, context);\r\n !ssr && props.forEach(analyzePatchFlag);\r\n properties.push(...props);\r\n if (needRuntime) {\r\n runtimeDirectives.push(prop);\r\n if (isSymbol(needRuntime)) {\r\n directiveImportMap.set(prop, needRuntime);\r\n }\r\n }\r\n }\r\n else if (!isBuiltInDirective(name)) {\r\n \u002F\u002F no built-in transform, this is a user custom directive.\r\n runtimeDirectives.push(prop);\r\n \u002F\u002F custom dirs may use beforeUpdate so they need to force blocks\r\n \u002F\u002F to ensure before-update gets called before children update\r\n if (hasChildren) {\r\n shouldUseBlock = true;\r\n }\r\n }\r\n }\r\n }\r\n let propsExpression = undefined;\r\n \u002F\u002F has v-bind=\"object\" or v-on=\"object\", wrap with mergeProps\r\n if (mergeArgs.length) {\r\n if (properties.length) {\r\n mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));\r\n }\r\n if (mergeArgs.length \u003E 1) {\r\n propsExpression = createCallExpression(context.helper(MERGE_PROPS), mergeArgs, elementLoc);\r\n }\r\n else {\r\n \u002F\u002F single v-bind with nothing else - no need for a mergeProps call\r\n propsExpression = mergeArgs[0];\r\n }\r\n }\r\n else if (properties.length) {\r\n propsExpression = createObjectExpression(dedupeProperties(properties), elementLoc);\r\n }\r\n \u002F\u002F patchFlag analysis\r\n if (hasDynamicKeys) {\r\n patchFlag |= 16 \u002F* FULL_PROPS *\u002F;\r\n }\r\n else {\r\n if (hasClassBinding && !isComponent) {\r\n patchFlag |= 2 \u002F* CLASS *\u002F;\r\n }\r\n if (hasStyleBinding && !isComponent) {\r\n patchFlag |= 4 \u002F* STYLE *\u002F;\r\n }\r\n if (dynamicPropNames.length) {\r\n patchFlag |= 8 \u002F* PROPS *\u002F;\r\n }\r\n if (hasHydrationEventBinding) {\r\n patchFlag |= 32 \u002F* HYDRATE_EVENTS *\u002F;\r\n }\r\n }\r\n if (!shouldUseBlock &&\r\n (patchFlag === 0 || patchFlag === 32 \u002F* HYDRATE_EVENTS *\u002F) &&\r\n (hasRef || hasVnodeHook || runtimeDirectives.length \u003E 0)) {\r\n patchFlag |= 512 \u002F* NEED_PATCH *\u002F;\r\n }\r\n \u002F\u002F pre-normalize props, SSR is skipped for now\r\n if (!context.inSSR && propsExpression) {\r\n switch (propsExpression.type) {\r\n case 15 \u002F* JS_OBJECT_EXPRESSION *\u002F:\r\n \u002F\u002F means that there is no v-bind,\r\n \u002F\u002F but still need to deal with dynamic key binding\r\n let classKeyIndex = -1;\r\n let styleKeyIndex = -1;\r\n let hasDynamicKey = false;\r\n for (let i = 0; i \u003C propsExpression.properties.length; i++) {\r\n const key = propsExpression.properties[i].key;\r\n if (isStaticExp(key)) {\r\n if (key.content === 'class') {\r\n classKeyIndex = i;\r\n }\r\n else if (key.content === 'style') {\r\n styleKeyIndex = i;\r\n }\r\n }\r\n else if (!key.isHandlerKey) {\r\n hasDynamicKey = true;\r\n }\r\n }\r\n const classProp = propsExpression.properties[classKeyIndex];\r\n const styleProp = propsExpression.properties[styleKeyIndex];\r\n \u002F\u002F no dynamic key\r\n if (!hasDynamicKey) {\r\n if (classProp && !isStaticExp(classProp.value)) {\r\n classProp.value = createCallExpression(context.helper(NORMALIZE_CLASS), [classProp.value]);\r\n }\r\n if (styleProp &&\r\n !isStaticExp(styleProp.value) &&\r\n \u002F\u002F the static style is compiled into an object,\r\n \u002F\u002F so use `hasStyleBinding` to ensure that it is a dynamic style binding\r\n (hasStyleBinding ||\r\n \u002F\u002F v-bind:style and style both exist,\r\n \u002F\u002F v-bind:style with static literal object\r\n styleProp.value.type === 17 \u002F* JS_ARRAY_EXPRESSION *\u002F)) {\r\n styleProp.value = createCallExpression(context.helper(NORMALIZE_STYLE), [styleProp.value]);\r\n }\r\n }\r\n else {\r\n \u002F\u002F dynamic key binding, wrap with `normalizeProps`\r\n propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [propsExpression]);\r\n }\r\n break;\r\n case 14 \u002F* JS_CALL_EXPRESSION *\u002F:\r\n \u002F\u002F mergeProps call, do nothing\r\n break;\r\n default:\r\n \u002F\u002F single v-bind\r\n propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [\r\n createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [\r\n propsExpression\r\n ])\r\n ]);\r\n break;\r\n }\r\n }\r\n return {\r\n props: propsExpression,\r\n directives: runtimeDirectives,\r\n patchFlag,\r\n dynamicPropNames,\r\n shouldUseBlock\r\n };\r\n}\r\n\u002F\u002F Dedupe props in an object literal.\r\n\u002F\u002F Literal duplicated attributes would have been warned during the parse phase,\r\n\u002F\u002F however, it's possible to encounter duplicated `onXXX` handlers with different\r\n\u002F\u002F modifiers. We also need to merge static and dynamic class \u002F style attributes.\r\n\u002F\u002F - onXXX handlers \u002F style: merge into array\r\n\u002F\u002F - class: merge into single expression with concatenation\r\nfunction dedupeProperties(properties) {\r\n const knownProps = new Map();\r\n const deduped = [];\r\n for (let i = 0; i \u003C properties.length; i++) {\r\n const prop = properties[i];\r\n \u002F\u002F dynamic keys are always allowed\r\n if (prop.key.type === 8 \u002F* COMPOUND_EXPRESSION *\u002F || !prop.key.isStatic) {\r\n deduped.push(prop);\r\n continue;\r\n }\r\n const name = prop.key.content;\r\n const existing = knownProps.get(name);\r\n if (existing) {\r\n if (name === 'style' || name === 'class' || isOn(name)) {\r\n mergeAsArray$1(existing, prop);\r\n }\r\n \u002F\u002F unexpected duplicate, should have emitted error during parse\r\n }\r\n else {\r\n knownProps.set(name, prop);\r\n deduped.push(prop);\r\n }\r\n }\r\n return deduped;\r\n}\r\nfunction mergeAsArray$1(existing, incoming) {\r\n if (existing.value.type === 17 \u002F* JS_ARRAY_EXPRESSION *\u002F) {\r\n existing.value.elements.push(incoming.value);\r\n }\r\n else {\r\n existing.value = createArrayExpression([existing.value, incoming.value], existing.loc);\r\n }\r\n}\r\nfunction buildDirectiveArgs(dir, context) {\r\n const dirArgs = [];\r\n const runtime = directiveImportMap.get(dir);\r\n if (runtime) {\r\n \u002F\u002F built-in directive with runtime\r\n dirArgs.push(context.helperString(runtime));\r\n }\r\n else {\r\n {\r\n \u002F\u002F inject statement for resolving directive\r\n context.helper(RESOLVE_DIRECTIVE);\r\n context.directives.add(dir.name);\r\n dirArgs.push(toValidAssetId(dir.name, `directive`));\r\n }\r\n }\r\n const { loc } = dir;\r\n if (dir.exp)\r\n dirArgs.push(dir.exp);\r\n if (dir.arg) {\r\n if (!dir.exp) {\r\n dirArgs.push(`void 0`);\r\n }\r\n dirArgs.push(dir.arg);\r\n }\r\n if (Object.keys(dir.modifiers).length) {\r\n if (!dir.arg) {\r\n if (!dir.exp) {\r\n dirArgs.push(`void 0`);\r\n }\r\n dirArgs.push(`void 0`);\r\n }\r\n const trueExpression = createSimpleExpression(`true`, false, loc);\r\n dirArgs.push(createObjectExpression(dir.modifiers.map(modifier =\u003E createObjectProperty(modifier, trueExpression)), loc));\r\n }\r\n return createArrayExpression(dirArgs, dir.loc);\r\n}\r\nfunction stringifyDynamicPropNames(props) {\r\n let propsNamesString = `[`;\r\n for (let i = 0, l = props.length; i \u003C l; i++) {\r\n propsNamesString += JSON.stringify(props[i]);\r\n if (i \u003C l - 1)\r\n propsNamesString += ', ';\r\n }\r\n return propsNamesString + `]`;\r\n}\r\nfunction isComponentTag(tag) {\r\n return tag === 'component' || tag === 'Component';\r\n}\r\n\r\nconst transformSlotOutlet = (node, context) =\u003E {\r\n if (isSlotOutlet(node)) {\r\n const { children, loc } = node;\r\n const { slotName, slotProps } = processSlotOutlet(node, context);\r\n const slotArgs = [\r\n context.prefixIdentifiers ? `_ctx.$slots` : `$slots`,\r\n slotName,\r\n '{}',\r\n 'undefined',\r\n 'true'\r\n ];\r\n let expectedLen = 2;\r\n if (slotProps) {\r\n slotArgs[2] = slotProps;\r\n expectedLen = 3;\r\n }\r\n if (children.length) {\r\n slotArgs[3] = createFunctionExpression([], children, false, false, loc);\r\n expectedLen = 4;\r\n }\r\n if (context.scopeId && !context.slotted) {\r\n expectedLen = 5;\r\n }\r\n slotArgs.splice(expectedLen); \u002F\u002F remove unused arguments\r\n node.codegenNode = createCallExpression(context.helper(RENDER_SLOT), slotArgs, loc);\r\n }\r\n};\r\nfunction processSlotOutlet(node, context) {\r\n let slotName = `\"default\"`;\r\n let slotProps = undefined;\r\n const nonNameProps = [];\r\n for (let i = 0; i \u003C node.props.length; i++) {\r\n const p = node.props[i];\r\n if (p.type === 6 \u002F* ATTRIBUTE *\u002F) {\r\n if (p.value) {\r\n if (p.name === 'name') {\r\n slotName = JSON.stringify(p.value.content);\r\n }\r\n else {\r\n p.name = camelize(p.name);\r\n nonNameProps.push(p);\r\n }\r\n }\r\n }\r\n else {\r\n if (p.name === 'bind' && isStaticArgOf(p.arg, 'name')) {\r\n if (p.exp)\r\n slotName = p.exp;\r\n }\r\n else {\r\n if (p.name === 'bind' && p.arg && isStaticExp(p.arg)) {\r\n p.arg.content = camelize(p.arg.content);\r\n }\r\n nonNameProps.push(p);\r\n }\r\n }\r\n }\r\n if (nonNameProps.length \u003E 0) {\r\n const { props, directives } = buildProps(node, context, nonNameProps);\r\n slotProps = props;\r\n if (directives.length) {\r\n context.onError(createCompilerError(36 \u002F* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET *\u002F, directives[0].loc));\r\n }\r\n }\r\n return {\r\n slotName,\r\n slotProps\r\n };\r\n}\r\n\r\nconst fnExpRE = \u002F^\\s*([\\w$_]+|(async\\s*)?\\([^)]*?\\))\\s*=\u003E|^\\s*(async\\s+)?function(?:\\s+[\\w$]+)?\\s*\\(\u002F;\r\nconst transformOn = (dir, node, context, augmentor) =\u003E {\r\n const { loc, modifiers, arg } = dir;\r\n if (!dir.exp && !modifiers.length) {\r\n context.onError(createCompilerError(35 \u002F* X_V_ON_NO_EXPRESSION *\u002F, loc));\r\n }\r\n let eventName;\r\n if (arg.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F) {\r\n if (arg.isStatic) {\r\n let rawName = arg.content;\r\n \u002F\u002F TODO deprecate @vnodeXXX usage\r\n if (rawName.startsWith('vue:')) {\r\n rawName = `vnode-${rawName.slice(4)}`;\r\n }\r\n \u002F\u002F for all event listeners, auto convert it to camelCase. See issue #2249\r\n eventName = createSimpleExpression(toHandlerKey(camelize(rawName)), true, arg.loc);\r\n }\r\n else {\r\n \u002F\u002F #2388\r\n eventName = createCompoundExpression([\r\n `${context.helperString(TO_HANDLER_KEY)}(`,\r\n arg,\r\n `)`\r\n ]);\r\n }\r\n }\r\n else {\r\n \u002F\u002F already a compound expression.\r\n eventName = arg;\r\n eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);\r\n eventName.children.push(`)`);\r\n }\r\n \u002F\u002F handler processing\r\n let exp = dir.exp;\r\n if (exp && !exp.content.trim()) {\r\n exp = undefined;\r\n }\r\n let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;\r\n if (exp) {\r\n const isMemberExp = isMemberExpression(exp.content);\r\n const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));\r\n const hasMultipleStatements = exp.content.includes(`;`);\r\n {\r\n validateBrowserExpression(exp, context, false, hasMultipleStatements);\r\n }\r\n if (isInlineStatement || (shouldCache && isMemberExp)) {\r\n \u002F\u002F wrap inline statement in a function expression\r\n exp = createCompoundExpression([\r\n `${isInlineStatement\r\n ? `$event`\r\n : `${``}(...args)`} =\u003E ${hasMultipleStatements ? `{` : `(`}`,\r\n exp,\r\n hasMultipleStatements ? `}` : `)`\r\n ]);\r\n }\r\n }\r\n let ret = {\r\n props: [\r\n createObjectProperty(eventName, exp || createSimpleExpression(`() =\u003E {}`, false, loc))\r\n ]\r\n };\r\n \u002F\u002F apply extended compiler augmentor\r\n if (augmentor) {\r\n ret = augmentor(ret);\r\n }\r\n if (shouldCache) {\r\n \u002F\u002F cache handlers so that it's always the same handler being passed down.\r\n \u002F\u002F this avoids unnecessary re-renders when users use inline handlers on\r\n \u002F\u002F components.\r\n ret.props[0].value = context.cache(ret.props[0].value);\r\n }\r\n \u002F\u002F mark the key as handler for props normalization check\r\n ret.props.forEach(p =\u003E (p.key.isHandlerKey = true));\r\n return ret;\r\n};\r\n\r\n\u002F\u002F v-bind without arg is handled directly in .\u002FtransformElements.ts due to it affecting\r\n\u002F\u002F codegen for the entire props object. This transform here is only for v-bind\r\n\u002F\u002F *with* args.\r\nconst transformBind = (dir, _node, context) =\u003E {\r\n const { exp, modifiers, loc } = dir;\r\n const arg = dir.arg;\r\n if (arg.type !== 4 \u002F* SIMPLE_EXPRESSION *\u002F) {\r\n arg.children.unshift(`(`);\r\n arg.children.push(`) || \"\"`);\r\n }\r\n else if (!arg.isStatic) {\r\n arg.content = `${arg.content} || \"\"`;\r\n }\r\n \u002F\u002F .sync is replaced by v-model:arg\r\n if (modifiers.includes('camel')) {\r\n if (arg.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F) {\r\n if (arg.isStatic) {\r\n arg.content = camelize(arg.content);\r\n }\r\n else {\r\n arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;\r\n }\r\n }\r\n else {\r\n arg.children.unshift(`${context.helperString(CAMELIZE)}(`);\r\n arg.children.push(`)`);\r\n }\r\n }\r\n if (!context.inSSR) {\r\n if (modifiers.includes('prop')) {\r\n injectPrefix(arg, '.');\r\n }\r\n if (modifiers.includes('attr')) {\r\n injectPrefix(arg, '^');\r\n }\r\n }\r\n if (!exp ||\r\n (exp.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F && !exp.content.trim())) {\r\n context.onError(createCompilerError(34 \u002F* X_V_BIND_NO_EXPRESSION *\u002F, loc));\r\n return {\r\n props: [createObjectProperty(arg, createSimpleExpression('', true, loc))]\r\n };\r\n }\r\n return {\r\n props: [createObjectProperty(arg, exp)]\r\n };\r\n};\r\nconst injectPrefix = (arg, prefix) =\u003E {\r\n if (arg.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F) {\r\n if (arg.isStatic) {\r\n arg.content = prefix + arg.content;\r\n }\r\n else {\r\n arg.content = `\\`${prefix}\\${${arg.content}}\\``;\r\n }\r\n }\r\n else {\r\n arg.children.unshift(`'${prefix}' + (`);\r\n arg.children.push(`)`);\r\n }\r\n};\r\n\r\n\u002F\u002F Merge adjacent text nodes and expressions into a single expression\r\n\u002F\u002F e.g. \u003Cdiv\u003Eabc {{ d }} {{ e }}\u003C\u002Fdiv\u003E should have a single expression node as child.\r\nconst transformText = (node, context) =\u003E {\r\n if (node.type === 0 \u002F* ROOT *\u002F ||\r\n node.type === 1 \u002F* ELEMENT *\u002F ||\r\n node.type === 11 \u002F* FOR *\u002F ||\r\n node.type === 10 \u002F* IF_BRANCH *\u002F) {\r\n \u002F\u002F perform the transform on node exit so that all expressions have already\r\n \u002F\u002F been processed.\r\n return () =\u003E {\r\n const children = node.children;\r\n let currentContainer = undefined;\r\n let hasText = false;\r\n for (let i = 0; i \u003C children.length; i++) {\r\n const child = children[i];\r\n if (isText(child)) {\r\n hasText = true;\r\n for (let j = i + 1; j \u003C children.length; j++) {\r\n const next = children[j];\r\n if (isText(next)) {\r\n if (!currentContainer) {\r\n currentContainer = children[i] = {\r\n type: 8 \u002F* COMPOUND_EXPRESSION *\u002F,\r\n loc: child.loc,\r\n children: [child]\r\n };\r\n }\r\n \u002F\u002F merge adjacent text node into current\r\n currentContainer.children.push(` + `, next);\r\n children.splice(j, 1);\r\n j--;\r\n }\r\n else {\r\n currentContainer = undefined;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!hasText ||\r\n \u002F\u002F if this is a plain element with a single text child, leave it\r\n \u002F\u002F as-is since the runtime has dedicated fast path for this by directly\r\n \u002F\u002F setting textContent of the element.\r\n \u002F\u002F for component root it's always normalized anyway.\r\n (children.length === 1 &&\r\n (node.type === 0 \u002F* ROOT *\u002F ||\r\n (node.type === 1 \u002F* ELEMENT *\u002F &&\r\n node.tagType === 0 \u002F* ELEMENT *\u002F &&\r\n \u002F\u002F #3756\r\n \u002F\u002F custom directives can potentially add DOM elements arbitrarily,\r\n \u002F\u002F we need to avoid setting textContent of the element at runtime\r\n \u002F\u002F to avoid accidentally overwriting the DOM elements added\r\n \u002F\u002F by the user through custom directives.\r\n !node.props.find(p =\u003E p.type === 7 \u002F* DIRECTIVE *\u002F &&\r\n !context.directiveTransforms[p.name]) &&\r\n \u002F\u002F in compat mode, \u003Ctemplate\u003E tags with no special directives\r\n \u002F\u002F will be rendered as a fragment so its children must be\r\n \u002F\u002F converted into vnodes.\r\n !(false ))))) {\r\n return;\r\n }\r\n \u002F\u002F pre-convert text nodes into createTextVNode(text) calls to avoid\r\n \u002F\u002F runtime normalization.\r\n for (let i = 0; i \u003C children.length; i++) {\r\n const child = children[i];\r\n if (isText(child) || child.type === 8 \u002F* COMPOUND_EXPRESSION *\u002F) {\r\n const callArgs = [];\r\n \u002F\u002F createTextVNode defaults to single whitespace, so if it is a\r\n \u002F\u002F single space the code could be an empty call to save bytes.\r\n if (child.type !== 2 \u002F* TEXT *\u002F || child.content !== ' ') {\r\n callArgs.push(child);\r\n }\r\n \u002F\u002F mark dynamic text with flag so it gets patched inside a block\r\n if (!context.ssr &&\r\n getConstantType(child, context) === 0 \u002F* NOT_CONSTANT *\u002F) {\r\n callArgs.push(1 \u002F* TEXT *\u002F +\r\n (` \u002F* ${PatchFlagNames[1 \u002F* TEXT *\u002F]} *\u002F` ));\r\n }\r\n children[i] = {\r\n type: 12 \u002F* TEXT_CALL *\u002F,\r\n content: child,\r\n loc: child.loc,\r\n codegenNode: createCallExpression(context.helper(CREATE_TEXT), callArgs)\r\n };\r\n }\r\n }\r\n };\r\n }\r\n};\r\n\r\nconst seen = new WeakSet();\r\nconst transformOnce = (node, context) =\u003E {\r\n if (node.type === 1 \u002F* ELEMENT *\u002F && findDir(node, 'once', true)) {\r\n if (seen.has(node) || context.inVOnce) {\r\n return;\r\n }\r\n seen.add(node);\r\n context.inVOnce = true;\r\n context.helper(SET_BLOCK_TRACKING);\r\n return () =\u003E {\r\n context.inVOnce = false;\r\n const cur = context.currentNode;\r\n if (cur.codegenNode) {\r\n cur.codegenNode = context.cache(cur.codegenNode, true \u002F* isVNode *\u002F);\r\n }\r\n };\r\n }\r\n};\r\n\r\nconst transformModel = (dir, node, context) =\u003E {\r\n const { exp, arg } = dir;\r\n if (!exp) {\r\n context.onError(createCompilerError(41 \u002F* X_V_MODEL_NO_EXPRESSION *\u002F, dir.loc));\r\n return createTransformProps();\r\n }\r\n const rawExp = exp.loc.source;\r\n const expString = exp.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F ? exp.content : rawExp;\r\n \u002F\u002F im SFC \u003Cscript setup\u003E inline mode, the exp may have been transformed into\r\n \u002F\u002F _unref(exp)\r\n context.bindingMetadata[rawExp];\r\n const maybeRef = !true \u002F* SETUP_CONST *\u002F;\r\n if (!expString.trim() ||\r\n (!isMemberExpression(expString) && !maybeRef)) {\r\n context.onError(createCompilerError(42 \u002F* X_V_MODEL_MALFORMED_EXPRESSION *\u002F, exp.loc));\r\n return createTransformProps();\r\n }\r\n const propName = arg ? arg : createSimpleExpression('modelValue', true);\r\n const eventName = arg\r\n ? isStaticExp(arg)\r\n ? `onUpdate:${arg.content}`\r\n : createCompoundExpression(['\"onUpdate:\" + ', arg])\r\n : `onUpdate:modelValue`;\r\n let assignmentExp;\r\n const eventArg = context.isTS ? `($event: any)` : `$event`;\r\n {\r\n assignmentExp = createCompoundExpression([\r\n `${eventArg} =\u003E ((`,\r\n exp,\r\n `) = $event)`\r\n ]);\r\n }\r\n const props = [\r\n \u002F\u002F modelValue: foo\r\n createObjectProperty(propName, dir.exp),\r\n \u002F\u002F \"onUpdate:modelValue\": $event =\u003E (foo = $event)\r\n createObjectProperty(eventName, assignmentExp)\r\n ];\r\n \u002F\u002F modelModifiers: { foo: true, \"bar-baz\": true }\r\n if (dir.modifiers.length && node.tagType === 1 \u002F* COMPONENT *\u002F) {\r\n const modifiers = dir.modifiers\r\n .map(m =\u003E (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`)\r\n .join(`, `);\r\n const modifiersKey = arg\r\n ? isStaticExp(arg)\r\n ? `${arg.content}Modifiers`\r\n : createCompoundExpression([arg, ' + \"Modifiers\"'])\r\n : `modelModifiers`;\r\n props.push(createObjectProperty(modifiersKey, createSimpleExpression(`{ ${modifiers} }`, false, dir.loc, 2 \u002F* CAN_HOIST *\u002F)));\r\n }\r\n return createTransformProps(props);\r\n};\r\nfunction createTransformProps(props = []) {\r\n return { props };\r\n}\r\n\r\nconst seen$1 = new WeakSet();\r\nconst transformMemo = (node, context) =\u003E {\r\n if (node.type === 1 \u002F* ELEMENT *\u002F) {\r\n const dir = findDir(node, 'memo');\r\n if (!dir || seen$1.has(node)) {\r\n return;\r\n }\r\n seen$1.add(node);\r\n return () =\u003E {\r\n const codegenNode = node.codegenNode ||\r\n context.currentNode.codegenNode;\r\n if (codegenNode && codegenNode.type === 13 \u002F* VNODE_CALL *\u002F) {\r\n \u002F\u002F non-component sub tree should be turned into a block\r\n if (node.tagType !== 1 \u002F* COMPONENT *\u002F) {\r\n makeBlock(codegenNode, context);\r\n }\r\n node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [\r\n dir.exp,\r\n createFunctionExpression(undefined, codegenNode),\r\n `_cache`,\r\n String(context.cached++)\r\n ]);\r\n }\r\n };\r\n }\r\n};\r\n\r\nfunction getBaseTransformPreset(prefixIdentifiers) {\r\n return [\r\n [\r\n transformOnce,\r\n transformIf,\r\n transformMemo,\r\n transformFor,\r\n ...([]),\r\n ...([transformExpression]\r\n ),\r\n transformSlotOutlet,\r\n transformElement,\r\n trackSlotScopes,\r\n transformText\r\n ],\r\n {\r\n on: transformOn,\r\n bind: transformBind,\r\n model: transformModel\r\n }\r\n ];\r\n}\r\n\u002F\u002F we name it `baseCompile` so that higher order compilers like\r\n\u002F\u002F @vue\u002Fcompiler-dom can export `compile` while re-exporting everything else.\r\nfunction baseCompile(template, options = {}) {\r\n const onError = options.onError || defaultOnError;\r\n const isModuleMode = options.mode === 'module';\r\n \u002F* istanbul ignore if *\u002F\r\n {\r\n if (options.prefixIdentifiers === true) {\r\n onError(createCompilerError(46 \u002F* X_PREFIX_ID_NOT_SUPPORTED *\u002F));\r\n }\r\n else if (isModuleMode) {\r\n onError(createCompilerError(47 \u002F* X_MODULE_MODE_NOT_SUPPORTED *\u002F));\r\n }\r\n }\r\n const prefixIdentifiers = !true ;\r\n if (options.cacheHandlers) {\r\n onError(createCompilerError(48 \u002F* X_CACHE_HANDLER_NOT_SUPPORTED *\u002F));\r\n }\r\n if (options.scopeId && !isModuleMode) {\r\n onError(createCompilerError(49 \u002F* X_SCOPE_ID_NOT_SUPPORTED *\u002F));\r\n }\r\n const ast = isString(template) ? baseParse(template, options) : template;\r\n const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();\r\n transform(ast, extend({}, options, {\r\n prefixIdentifiers,\r\n nodeTransforms: [\r\n ...nodeTransforms,\r\n ...(options.nodeTransforms || []) \u002F\u002F user transforms\r\n ],\r\n directiveTransforms: extend({}, directiveTransforms, options.directiveTransforms || {} \u002F\u002F user transforms\r\n )\r\n }));\r\n return generate(ast, extend({}, options, {\r\n prefixIdentifiers\r\n }));\r\n}\r\n\r\nconst noopDirectiveTransform = () =\u003E ({ props: [] });\r\n\r\nconst V_MODEL_RADIO = Symbol(`vModelRadio` );\r\nconst V_MODEL_CHECKBOX = Symbol(`vModelCheckbox` );\r\nconst V_MODEL_TEXT = Symbol(`vModelText` );\r\nconst V_MODEL_SELECT = Symbol(`vModelSelect` );\r\nconst V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );\r\nconst V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );\r\nconst V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );\r\nconst V_SHOW = Symbol(`vShow` );\r\nconst TRANSITION$1 = Symbol(`Transition` );\r\nconst TRANSITION_GROUP = Symbol(`TransitionGroup` );\r\nregisterRuntimeHelpers({\r\n [V_MODEL_RADIO]: `vModelRadio`,\r\n [V_MODEL_CHECKBOX]: `vModelCheckbox`,\r\n [V_MODEL_TEXT]: `vModelText`,\r\n [V_MODEL_SELECT]: `vModelSelect`,\r\n [V_MODEL_DYNAMIC]: `vModelDynamic`,\r\n [V_ON_WITH_MODIFIERS]: `withModifiers`,\r\n [V_ON_WITH_KEYS]: `withKeys`,\r\n [V_SHOW]: `vShow`,\r\n [TRANSITION$1]: `Transition`,\r\n [TRANSITION_GROUP]: `TransitionGroup`\r\n});\r\n\r\n\u002F* eslint-disable no-restricted-globals *\u002F\r\nlet decoder;\r\nfunction decodeHtmlBrowser(raw, asAttr = false) {\r\n if (!decoder) {\r\n decoder = document.createElement('div');\r\n }\r\n if (asAttr) {\r\n decoder.innerHTML = `\u003Cdiv foo=\"${raw.replace(\u002F\"\u002Fg, '"')}\"\u003E`;\r\n return decoder.children[0].getAttribute('foo');\r\n }\r\n else {\r\n decoder.innerHTML = raw;\r\n return decoder.textContent;\r\n }\r\n}\r\n\r\nconst isRawTextContainer = \u002F*#__PURE__*\u002F makeMap('style,iframe,script,noscript', true);\r\nconst parserOptions = {\r\n isVoidTag,\r\n isNativeTag: tag =\u003E isHTMLTag(tag) || isSVGTag(tag),\r\n isPreTag: tag =\u003E tag === 'pre',\r\n decodeEntities: decodeHtmlBrowser ,\r\n isBuiltInComponent: (tag) =\u003E {\r\n if (isBuiltInType(tag, `Transition`)) {\r\n return TRANSITION$1;\r\n }\r\n else if (isBuiltInType(tag, `TransitionGroup`)) {\r\n return TRANSITION_GROUP;\r\n }\r\n },\r\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fparsing.html#tree-construction-dispatcher\r\n getNamespace(tag, parent) {\r\n let ns = parent ? parent.ns : 0 \u002F* HTML *\u002F;\r\n if (parent && ns === 2 \u002F* MATH_ML *\u002F) {\r\n if (parent.tag === 'annotation-xml') {\r\n if (tag === 'svg') {\r\n return 1 \u002F* SVG *\u002F;\r\n }\r\n if (parent.props.some(a =\u003E a.type === 6 \u002F* ATTRIBUTE *\u002F &&\r\n a.name === 'encoding' &&\r\n a.value != null &&\r\n (a.value.content === 'text\u002Fhtml' ||\r\n a.value.content === 'application\u002Fxhtml+xml'))) {\r\n ns = 0 \u002F* HTML *\u002F;\r\n }\r\n }\r\n else if (\u002F^m(?:[ions]|text)$\u002F.test(parent.tag) &&\r\n tag !== 'mglyph' &&\r\n tag !== 'malignmark') {\r\n ns = 0 \u002F* HTML *\u002F;\r\n }\r\n }\r\n else if (parent && ns === 1 \u002F* SVG *\u002F) {\r\n if (parent.tag === 'foreignObject' ||\r\n parent.tag === 'desc' ||\r\n parent.tag === 'title') {\r\n ns = 0 \u002F* HTML *\u002F;\r\n }\r\n }\r\n if (ns === 0 \u002F* HTML *\u002F) {\r\n if (tag === 'svg') {\r\n return 1 \u002F* SVG *\u002F;\r\n }\r\n if (tag === 'math') {\r\n return 2 \u002F* MATH_ML *\u002F;\r\n }\r\n }\r\n return ns;\r\n },\r\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fparsing.html#parsing-html-fragments\r\n getTextMode({ tag, ns }) {\r\n if (ns === 0 \u002F* HTML *\u002F) {\r\n if (tag === 'textarea' || tag === 'title') {\r\n return 1 \u002F* RCDATA *\u002F;\r\n }\r\n if (isRawTextContainer(tag)) {\r\n return 2 \u002F* RAWTEXT *\u002F;\r\n }\r\n }\r\n return 0 \u002F* DATA *\u002F;\r\n }\r\n};\r\n\r\n\u002F\u002F Parse inline CSS strings for static style attributes into an object.\r\n\u002F\u002F This is a NodeTransform since it works on the static `style` attribute and\r\n\u002F\u002F converts it into a dynamic equivalent:\r\n\u002F\u002F style=\"color: red\" -\u003E :style='{ \"color\": \"red\" }'\r\n\u002F\u002F It is then processed by `transformElement` and included in the generated\r\n\u002F\u002F props.\r\nconst transformStyle = node =\u003E {\r\n if (node.type === 1 \u002F* ELEMENT *\u002F) {\r\n node.props.forEach((p, i) =\u003E {\r\n if (p.type === 6 \u002F* ATTRIBUTE *\u002F && p.name === 'style' && p.value) {\r\n \u002F\u002F replace p with an expression node\r\n node.props[i] = {\r\n type: 7 \u002F* DIRECTIVE *\u002F,\r\n name: `bind`,\r\n arg: createSimpleExpression(`style`, true, p.loc),\r\n exp: parseInlineCSS(p.value.content, p.loc),\r\n modifiers: [],\r\n loc: p.loc\r\n };\r\n }\r\n });\r\n }\r\n};\r\nconst parseInlineCSS = (cssText, loc) =\u003E {\r\n const normalized = parseStringStyle(cssText);\r\n return createSimpleExpression(JSON.stringify(normalized), false, loc, 3 \u002F* CAN_STRINGIFY *\u002F);\r\n};\r\n\r\nfunction createDOMCompilerError(code, loc) {\r\n return createCompilerError(code, loc, DOMErrorMessages );\r\n}\r\nconst DOMErrorMessages = {\r\n [50 \u002F* X_V_HTML_NO_EXPRESSION *\u002F]: `v-html is missing expression.`,\r\n [51 \u002F* X_V_HTML_WITH_CHILDREN *\u002F]: `v-html will override element children.`,\r\n [52 \u002F* X_V_TEXT_NO_EXPRESSION *\u002F]: `v-text is missing expression.`,\r\n [53 \u002F* X_V_TEXT_WITH_CHILDREN *\u002F]: `v-text will override element children.`,\r\n [54 \u002F* X_V_MODEL_ON_INVALID_ELEMENT *\u002F]: `v-model can only be used on \u003Cinput\u003E, \u003Ctextarea\u003E and \u003Cselect\u003E elements.`,\r\n [55 \u002F* X_V_MODEL_ARG_ON_ELEMENT *\u002F]: `v-model argument is not supported on plain elements.`,\r\n [56 \u002F* X_V_MODEL_ON_FILE_INPUT_ELEMENT *\u002F]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,\r\n [57 \u002F* X_V_MODEL_UNNECESSARY_VALUE *\u002F]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,\r\n [58 \u002F* X_V_SHOW_NO_EXPRESSION *\u002F]: `v-show is missing expression.`,\r\n [59 \u002F* X_TRANSITION_INVALID_CHILDREN *\u002F]: `\u003CTransition\u003E expects exactly one child element or component.`,\r\n [60 \u002F* X_IGNORED_SIDE_EFFECT_TAG *\u002F]: `Tags with side effect (\u003Cscript\u003E and \u003Cstyle\u003E) are ignored in client component templates.`\r\n};\r\n\r\nconst transformVHtml = (dir, node, context) =\u003E {\r\n const { exp, loc } = dir;\r\n if (!exp) {\r\n context.onError(createDOMCompilerError(50 \u002F* X_V_HTML_NO_EXPRESSION *\u002F, loc));\r\n }\r\n if (node.children.length) {\r\n context.onError(createDOMCompilerError(51 \u002F* X_V_HTML_WITH_CHILDREN *\u002F, loc));\r\n node.children.length = 0;\r\n }\r\n return {\r\n props: [\r\n createObjectProperty(createSimpleExpression(`innerHTML`, true, loc), exp || createSimpleExpression('', true))\r\n ]\r\n };\r\n};\r\n\r\nconst transformVText = (dir, node, context) =\u003E {\r\n const { exp, loc } = dir;\r\n if (!exp) {\r\n context.onError(createDOMCompilerError(52 \u002F* X_V_TEXT_NO_EXPRESSION *\u002F, loc));\r\n }\r\n if (node.children.length) {\r\n context.onError(createDOMCompilerError(53 \u002F* X_V_TEXT_WITH_CHILDREN *\u002F, loc));\r\n node.children.length = 0;\r\n }\r\n return {\r\n props: [\r\n createObjectProperty(createSimpleExpression(`textContent`, true), exp\r\n ? createCallExpression(context.helperString(TO_DISPLAY_STRING), [exp], loc)\r\n : createSimpleExpression('', true))\r\n ]\r\n };\r\n};\r\n\r\nconst transformModel$1 = (dir, node, context) =\u003E {\r\n const baseResult = transformModel(dir, node, context);\r\n \u002F\u002F base transform has errors OR component v-model (only need props)\r\n if (!baseResult.props.length || node.tagType === 1 \u002F* COMPONENT *\u002F) {\r\n return baseResult;\r\n }\r\n if (dir.arg) {\r\n context.onError(createDOMCompilerError(55 \u002F* X_V_MODEL_ARG_ON_ELEMENT *\u002F, dir.arg.loc));\r\n }\r\n function checkDuplicatedValue() {\r\n const value = findProp(node, 'value');\r\n if (value) {\r\n context.onError(createDOMCompilerError(57 \u002F* X_V_MODEL_UNNECESSARY_VALUE *\u002F, value.loc));\r\n }\r\n }\r\n const { tag } = node;\r\n const isCustomElement = context.isCustomElement(tag);\r\n if (tag === 'input' ||\r\n tag === 'textarea' ||\r\n tag === 'select' ||\r\n isCustomElement) {\r\n let directiveToUse = V_MODEL_TEXT;\r\n let isInvalidType = false;\r\n if (tag === 'input' || isCustomElement) {\r\n const type = findProp(node, `type`);\r\n if (type) {\r\n if (type.type === 7 \u002F* DIRECTIVE *\u002F) {\r\n \u002F\u002F :type=\"foo\"\r\n directiveToUse = V_MODEL_DYNAMIC;\r\n }\r\n else if (type.value) {\r\n switch (type.value.content) {\r\n case 'radio':\r\n directiveToUse = V_MODEL_RADIO;\r\n break;\r\n case 'checkbox':\r\n directiveToUse = V_MODEL_CHECKBOX;\r\n break;\r\n case 'file':\r\n isInvalidType = true;\r\n context.onError(createDOMCompilerError(56 \u002F* X_V_MODEL_ON_FILE_INPUT_ELEMENT *\u002F, dir.loc));\r\n break;\r\n default:\r\n \u002F\u002F text type\r\n checkDuplicatedValue();\r\n break;\r\n }\r\n }\r\n }\r\n else if (hasDynamicKeyVBind(node)) {\r\n \u002F\u002F element has bindings with dynamic keys, which can possibly contain\r\n \u002F\u002F \"type\".\r\n directiveToUse = V_MODEL_DYNAMIC;\r\n }\r\n else {\r\n \u002F\u002F text type\r\n checkDuplicatedValue();\r\n }\r\n }\r\n else if (tag === 'select') {\r\n directiveToUse = V_MODEL_SELECT;\r\n }\r\n else {\r\n \u002F\u002F textarea\r\n checkDuplicatedValue();\r\n }\r\n \u002F\u002F inject runtime directive\r\n \u002F\u002F by returning the helper symbol via needRuntime\r\n \u002F\u002F the import will replaced a resolveDirective call.\r\n if (!isInvalidType) {\r\n baseResult.needRuntime = context.helper(directiveToUse);\r\n }\r\n }\r\n else {\r\n context.onError(createDOMCompilerError(54 \u002F* X_V_MODEL_ON_INVALID_ELEMENT *\u002F, dir.loc));\r\n }\r\n \u002F\u002F native vmodel doesn't need the `modelValue` props since they are also\r\n \u002F\u002F passed to the runtime as `binding.value`. removing it reduces code size.\r\n baseResult.props = baseResult.props.filter(p =\u003E !(p.key.type === 4 \u002F* SIMPLE_EXPRESSION *\u002F &&\r\n p.key.content === 'modelValue'));\r\n return baseResult;\r\n};\r\n\r\nconst isEventOptionModifier = \u002F*#__PURE__*\u002F makeMap(`passive,once,capture`);\r\nconst isNonKeyModifier = \u002F*#__PURE__*\u002F makeMap(\r\n\u002F\u002F event propagation management\r\n`stop,prevent,self,` +\r\n \u002F\u002F system modifiers + exact\r\n `ctrl,shift,alt,meta,exact,` +\r\n \u002F\u002F mouse\r\n `middle`);\r\n\u002F\u002F left & right could be mouse or key modifiers based on event type\r\nconst maybeKeyModifier = \u002F*#__PURE__*\u002F makeMap('left,right');\r\nconst isKeyboardEvent = \u002F*#__PURE__*\u002F makeMap(`onkeyup,onkeydown,onkeypress`, true);\r\nconst resolveModifiers = (key, modifiers, context, loc) =\u003E {\r\n const keyModifiers = [];\r\n const nonKeyModifiers = [];\r\n const eventOptionModifiers = [];\r\n for (let i = 0; i \u003C modifiers.length; i++) {\r\n const modifier = modifiers[i];\r\n if (isEventOptionModifier(modifier)) {\r\n \u002F\u002F eventOptionModifiers: modifiers for addEventListener() options,\r\n \u002F\u002F e.g. .passive & .capture\r\n eventOptionModifiers.push(modifier);\r\n }\r\n else {\r\n \u002F\u002F runtimeModifiers: modifiers that needs runtime guards\r\n if (maybeKeyModifier(modifier)) {\r\n if (isStaticExp(key)) {\r\n if (isKeyboardEvent(key.content)) {\r\n keyModifiers.push(modifier);\r\n }\r\n else {\r\n nonKeyModifiers.push(modifier);\r\n }\r\n }\r\n else {\r\n keyModifiers.push(modifier);\r\n nonKeyModifiers.push(modifier);\r\n }\r\n }\r\n else {\r\n if (isNonKeyModifier(modifier)) {\r\n nonKeyModifiers.push(modifier);\r\n }\r\n else {\r\n keyModifiers.push(modifier);\r\n }\r\n }\r\n }\r\n }\r\n return {\r\n keyModifiers,\r\n nonKeyModifiers,\r\n eventOptionModifiers\r\n };\r\n};\r\nconst transformClick = (key, event) =\u003E {\r\n const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === 'onclick';\r\n return isStaticClick\r\n ? createSimpleExpression(event, true)\r\n : key.type !== 4 \u002F* SIMPLE_EXPRESSION *\u002F\r\n ? createCompoundExpression([\r\n `(`,\r\n key,\r\n `) === \"onClick\" ? \"${event}\" : (`,\r\n key,\r\n `)`\r\n ])\r\n : key;\r\n};\r\nconst transformOn$1 = (dir, node, context) =\u003E {\r\n return transformOn(dir, node, context, baseResult =\u003E {\r\n const { modifiers } = dir;\r\n if (!modifiers.length)\r\n return baseResult;\r\n let { key, value: handlerExp } = baseResult.props[0];\r\n const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);\r\n \u002F\u002F normalize click.right and click.middle since they don't actually fire\r\n if (nonKeyModifiers.includes('right')) {\r\n key = transformClick(key, `onContextmenu`);\r\n }\r\n if (nonKeyModifiers.includes('middle')) {\r\n key = transformClick(key, `onMouseup`);\r\n }\r\n if (nonKeyModifiers.length) {\r\n handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [\r\n handlerExp,\r\n JSON.stringify(nonKeyModifiers)\r\n ]);\r\n }\r\n if (keyModifiers.length &&\r\n \u002F\u002F if event name is dynamic, always wrap with keys guard\r\n (!isStaticExp(key) || isKeyboardEvent(key.content))) {\r\n handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [\r\n handlerExp,\r\n JSON.stringify(keyModifiers)\r\n ]);\r\n }\r\n if (eventOptionModifiers.length) {\r\n const modifierPostfix = eventOptionModifiers.map(capitalize).join('');\r\n key = isStaticExp(key)\r\n ? createSimpleExpression(`${key.content}${modifierPostfix}`, true)\r\n : createCompoundExpression([`(`, key, `) + \"${modifierPostfix}\"`]);\r\n }\r\n return {\r\n props: [createObjectProperty(key, handlerExp)]\r\n };\r\n });\r\n};\r\n\r\nconst transformShow = (dir, node, context) =\u003E {\r\n const { exp, loc } = dir;\r\n if (!exp) {\r\n context.onError(createDOMCompilerError(58 \u002F* X_V_SHOW_NO_EXPRESSION *\u002F, loc));\r\n }\r\n return {\r\n props: [],\r\n needRuntime: context.helper(V_SHOW)\r\n };\r\n};\r\n\r\nconst warnTransitionChildren = (node, context) =\u003E {\r\n if (node.type === 1 \u002F* ELEMENT *\u002F &&\r\n node.tagType === 1 \u002F* COMPONENT *\u002F) {\r\n const component = context.isBuiltInComponent(node.tag);\r\n if (component === TRANSITION$1) {\r\n return () =\u003E {\r\n if (node.children.length && hasMultipleChildren(node)) {\r\n context.onError(createDOMCompilerError(59 \u002F* X_TRANSITION_INVALID_CHILDREN *\u002F, {\r\n start: node.children[0].loc.start,\r\n end: node.children[node.children.length - 1].loc.end,\r\n source: ''\r\n }));\r\n }\r\n };\r\n }\r\n }\r\n};\r\nfunction hasMultipleChildren(node) {\r\n \u002F\u002F #1352 filter out potential comment nodes.\r\n const children = (node.children = node.children.filter(c =\u003E c.type !== 3 \u002F* COMMENT *\u002F &&\r\n !(c.type === 2 \u002F* TEXT *\u002F && !c.content.trim())));\r\n const child = children[0];\r\n return (children.length !== 1 ||\r\n child.type === 11 \u002F* FOR *\u002F ||\r\n (child.type === 9 \u002F* IF *\u002F && child.branches.some(hasMultipleChildren)));\r\n}\r\n\r\nconst ignoreSideEffectTags = (node, context) =\u003E {\r\n if (node.type === 1 \u002F* ELEMENT *\u002F &&\r\n node.tagType === 0 \u002F* ELEMENT *\u002F &&\r\n (node.tag === 'script' || node.tag === 'style')) {\r\n context.onError(createDOMCompilerError(60 \u002F* X_IGNORED_SIDE_EFFECT_TAG *\u002F, node.loc));\r\n context.removeNode();\r\n }\r\n};\r\n\r\nconst DOMNodeTransforms = [\r\n transformStyle,\r\n ...([warnTransitionChildren] )\r\n];\r\nconst DOMDirectiveTransforms = {\r\n cloak: noopDirectiveTransform,\r\n html: transformVHtml,\r\n text: transformVText,\r\n model: transformModel$1,\r\n on: transformOn$1,\r\n show: transformShow\r\n};\r\nfunction compile$1(template, options = {}) {\r\n return baseCompile(template, extend({}, parserOptions, options, {\r\n nodeTransforms: [\r\n \u002F\u002F ignore \u003Cscript\u003E and \u003Ctag\u003E\r\n \u002F\u002F this is not put inside DOMNodeTransforms because that list is used\r\n \u002F\u002F by compiler-ssr to generate vnode fallback branches\r\n ignoreSideEffectTags,\r\n ...DOMNodeTransforms,\r\n ...(options.nodeTransforms || [])\r\n ],\r\n directiveTransforms: extend({}, DOMDirectiveTransforms, options.directiveTransforms || {}),\r\n transformHoist: null \r\n }));\r\n}\r\n\r\n\u002F\u002F This entry is the \"full-build\" that includes both the runtime\r\n{\r\n initDev();\r\n}\r\nconst compileCache = Object.create(null);\r\nfunction compileToFunction(template, options) {\r\n if (!isString(template)) {\r\n if (template.nodeType) {\r\n template = template.innerHTML;\r\n }\r\n else {\r\n warn$1(`invalid template option: `, template);\r\n return NOOP;\r\n }\r\n }\r\n const key = template;\r\n const cached = compileCache[key];\r\n if (cached) {\r\n return cached;\r\n }\r\n if (template[0] === '#') {\r\n const el = document.querySelector(template);\r\n if (!el) {\r\n warn$1(`Template element not found or is empty: ${template}`);\r\n }\r\n \u002F\u002F __UNSAFE__\r\n \u002F\u002F Reason: potential execution of JS expressions in in-DOM template.\r\n \u002F\u002F The user must make sure the in-DOM template is trusted. If it's rendered\r\n \u002F\u002F by the server, the template should not contain any user data.\r\n template = el ? el.innerHTML : ``;\r\n }\r\n const { code } = compile$1(template, extend({\r\n hoistStatic: true,\r\n onError: onError ,\r\n onWarn: e =\u003E onError(e, true) \r\n }, options));\r\n function onError(err, asWarning = false) {\r\n const message = asWarning\r\n ? err.message\r\n : `Template compilation error: ${err.message}`;\r\n const codeFrame = err.loc &&\r\n generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);\r\n warn$1(codeFrame ? `${message}\\n${codeFrame}` : message);\r\n }\r\n \u002F\u002F The wildcard import results in a huge object with every export\r\n \u002F\u002F with keys that cannot be mangled, and can be quite heavy size-wise.\r\n \u002F\u002F In the global build we know `Vue` is available globally so we can avoid\r\n \u002F\u002F the wildcard object.\r\n const render = (new Function('Vue', code)(runtimeDom));\r\n render._rc = true;\r\n return (compileCache[key] = render);\r\n}\r\nregisterRuntimeCompiler(compileToFunction);\r\n\r\nexport { BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed$1 as computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineProps, defineSSRCustomElement, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn$1 as warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };\r\n","id":"mod_Gb85zFJuKSgtPcnExkJ5YQ","is_binary":false,"title":"vue.esm-browser.js","sha":null,"inserted_at":"2022-05-05T11:47:58","updated_at":"2022-05-05T11:55:53","upload_id":null,"shortid":"HyvOKVbLq","source_id":"src_Kq5Ma5FroqMHuRp6X1QN26","directory_shortid":null},{"code":"https:\u002F\u002Fuploads.codesandbox.io\u002Fuploads\u002Fuser\u002Fa612cc57-8dc5-4d7f-95f1-a351ce567551\u002FtkKf-vuelogo.png","id":"mod_QHUhee593yJNH5o1KG1Wm3","is_binary":true,"title":"vuelogo.png","sha":null,"inserted_at":"2022-05-05T11:58:08","updated_at":"2022-05-05T11:58:11","upload_id":null,"shortid":"BJlq0jE-I5","source_id":"src_Kq5Ma5FroqMHuRp6X1QN26","directory_shortid":"2QLNN"},{"code":"https:\u002F\u002Fuploads.codesandbox.io\u002Fuploads\u002Fuser\u002Fa612cc57-8dc5-4d7f-95f1-a351ce567551\u002FAAND-logo-jquery.png","id":"mod_PWMuQwL9CLMTMM5vvgRkZr","is_binary":true,"title":"logo-jquery.png","sha":null,"inserted_at":"2022-05-05T11:58:08","updated_at":"2022-05-05T11:58:14","upload_id":null,"shortid":"BJ90jEWLc","source_id":"src_Kq5Ma5FroqMHuRp6X1QN26","directory_shortid":"2QLNN"},{"code":"#root div {\r\n display: flex;\r\n justify-content: center;\r\n}\r\n#jqueryapp {\r\n background-color: #0769ad;\r\n}\r\n#vueapp {\r\n background-color: #8558bc;\r\n line-height: 200px;\r\n}\r\n","id":"mod_5oTdywhHHZbyHT1rt4zVxw","is_binary":false,"title":"app.css","sha":null,"inserted_at":"2022-05-05T11:57:47","updated_at":"2022-05-05T12:01:19","upload_id":null,"shortid":"NXBvN","source_id":"src_Kq5Ma5FroqMHuRp6X1QN26","directory_shortid":null},{"code":"\u002F\u002F 定义 HelloJquery 组件\r\nconst HelloJquery = {\r\n data() {\r\n return {\r\n message: \"Hello Jquery\",\r\n imgsrc: \"assets\u002Flogo-jquery.png\"\r\n };\r\n },\r\n template: `\u003Cdiv id=\"jqueryapp\"\u003E\r\n \u003Cimg :src=\"imgsrc\" \u002F\u003E\r\n \u003Ch1\u003E{{message}}\u003C\u002Fh1\u003E\r\n \u003C\u002Fdiv\u003E`\r\n};\r\n\r\nexport default HelloJquery;\r\n","id":"mod_BKc1iAHMffgUq89UWHE93B","is_binary":false,"title":"HelloJquery.js","sha":null,"inserted_at":"2022-05-05T12:12:36","updated_at":"2022-05-05T12:13:15","upload_id":null,"shortid":"Xp65A","source_id":"src_Kq5Ma5FroqMHuRp6X1QN26","directory_shortid":"o8gNY"},{"code":"\u002F\u002F 定义 HelloVue 组件\r\nconst HelloVue = {\r\n data() {\r\n return {\r\n message: \"Hello Vue3\",\r\n imgsrc: \"assets\u002Fvuelogo.png\",\r\n styleObject: {\r\n fontSize: \"32px\"\r\n }\r\n };\r\n },\r\n methods: {\r\n changeFontSize(e) {\r\n this.styleObject.fontSize = e.type === \"mouseover\" ? \"48px\" : \"32px\";\r\n }\r\n },\r\n template: `\u003Cdiv id=\"vueapp\"\u003E\r\n \u003Cimg :src=\"imgsrc\" \u002F\u003E\r\n \u003Ch1 \r\n @mouseover=\"changeFontSize\"\r\n @mouseout=\"changeFontSize\"\r\n :style=\"styleObject\"\r\n \u003E{{message}}\u003C\u002Fh1\u003E\r\n \u003C\u002Fdiv\u003E`\r\n};\r\n\r\nexport default HelloVue;\r\n","id":"mod_Wf12aiL8d1coAFz4eFJb1k","is_binary":false,"title":"HelloVue.js","sha":null,"inserted_at":"2022-05-05T12:12:47","updated_at":"2022-05-05T12:18:03","upload_id":null,"shortid":"vJrm5","source_id":"src_Kq5Ma5FroqMHuRp6X1QN26","directory_shortid":"o8gNY"},{"code":"import { createApp } from \".\u002Fvue.esm-browser.js\";\n\nimport HelloWorld from \".\u002Fcomponents\u002FHelloWorld.js\";\nimport HelloJquery from \".\u002Fcomponents\u002FHelloJquery.js\";\nimport HelloVue from \".\u002Fcomponents\u002FHelloVue.js\";\n\n\u002F\u002F 定义根组件,使用 components 注册子组件\nconst rootApp = {\n components: { HelloWorld, HelloJquery, HelloVue },\n template: `\u003CHelloWorld \u002F\u003E\u003CHelloJquery \u002F\u003E\u003CHelloVue \u002F\u003E`\n};\n\u002F\u002F 创建Vue应用实例并挂载应用\ncreateApp(rootApp).mount(\"#root\");\n","id":"mod_G13pEE5FVNv8GdRCt1U9yW","is_binary":false,"title":"app.js","sha":null,"inserted_at":"2022-05-05T11:12:39","updated_at":"2022-05-05T12:21:39","upload_id":null,"shortid":"4DzKk","source_id":"src_Kq5Ma5FroqMHuRp6X1QN26","directory_shortid":null},{"code":"\u002F\u002F 定义 HelloWorld 组件\r\nconst HelloWorld = {\r\n data() {\r\n return {\r\n message: \"Hello world\"\r\n };\r\n },\r\n template: `\u003Cdiv id=\"jsapp\"\u003E\u003Ch1\u003E{{message}}\u003C\u002Fh1\u003E\u003C\u002Fdiv\u003E`\r\n};\r\n\r\nexport default HelloWorld;\r\n","id":"mod_XNvDMgNhaZQncSY4kV6ada","is_binary":false,"title":"HelloWorld.js","sha":null,"inserted_at":"2022-05-05T12:07:38","updated_at":"2022-05-05T12:22:10","upload_id":null,"shortid":"Dw15K","source_id":"src_Kq5Ma5FroqMHuRp6X1QN26","directory_shortid":"o8gNY"},{"code":"\u003C!DOCTYPE html\u003E\n\u003Chtml lang=\"en\"\u003E\n \u003Chead\u003E\n \u003Cmeta charset=\"UTF-8\" \u002F\u003E\n \u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" \u002F\u003E\n \u003Cmeta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\" \u002F\u003E\n \u003Ctitle\u003EStatic Template\u003C\u002Ftitle\u003E\n \u003Clink rel=\"stylesheet\" href=\"app.css\"\u003E\u003C\u002Fscript\u003E\n \u003C\u002Fhead\u003E\n \u003Cbody\u003E\n \u003Cdiv id=\"root\"\u003E\u003C\u002Fdiv\u003E\n \u003Cscript type=\"module\" src=\"app.js\"\u003E\u003C\u002Fscript\u003E\n \u003C\u002Fbody\u003E\n\u003C\u002Fhtml\u003E\n","id":"mod_CAT4ShVGwbd4qykYSo2WKy","is_binary":false,"title":"index.html","sha":null,"inserted_at":"2022-05-05T11:10:41","updated_at":"2022-05-05T12:24:06","upload_id":null,"shortid":"SynEipfsL","source_id":"src_Kq5Ma5FroqMHuRp6X1QN26","directory_shortid":null}],"privacy":0,"feature_flags":{"comments":false,"container_lsp":false},"screenshot_url":"https:\u002F\u002Fscreenshots.codesandbox.io\u002Fmdvq8g\u002F191.png","draft":false,"inserted_at":"2022-05-05T11:10:41","original_git":null,"team":{"id":"ws_GRWsJTeRd7WgR9g9b3BgGH","name":"xiaoshao2017","settings":{"ai_consent":{"public_sandboxes":false,"private_sandboxes":false}},"subscription_type":null,"avatar_url":"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F25574804?v=4"},"version":191,"permissions":{"prevent_sandbox_export":false,"prevent_sandbox_leaving":false},"like_count":0,"tags":[],"id":"mdvq8g","original_git_commit_sha":"312eabdfd38e00b86d7f127f5c7d82e2cde34945","ai_consent":false,"is_frozen":false,"free_plan_editing_restricted":false,"external_resources":[],"author":{"id":"user_MWS5bqdPngT6Lz9aBfVcYY","name":" ","username":"xiaoshao2017","avatar_url":"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F25574804?v=4","personal_workspace_id":"ws_GRWsJTeRd7WgR9g9b3BgGH","subscription_plan":null,"subscription_since":null},"settings":{"ai_consent":null,"use_pint":false},"updated_at":"2022-05-05T13:19:30","user_liked":false,"npm_registries":[],"git":null,"picks":[],"restricted":false};