How to use normalizeEmitsOptions method in Playwright Internal

Best JavaScript code snippet using playwright-internal

vue.runtime.esm.js

Source:vue.runtime.esm.js Github

copy

Full Screen

...1268 if (handler) {1269 callWithAsyncErrorHandling(handler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);1270 }1271}1272function normalizeEmitsOptions(comp, appContext, asMixin = false) {1273 const appId = appContext.app ? appContext.app._uid : -1;1274 const cache = comp.__emits || (comp.__emits = {});1275 const cached = cache[appId];1276 if (cached !== undefined) {1277 return cached;1278 }1279 const raw = comp.emits;1280 let normalized = {};1281 // apply mixin/extends props1282 let hasExtends = false;1283 if (__VUE_OPTIONS_API__ && !isFunction(comp)) {1284 const extendEmits = (raw) => {1285 hasExtends = true;1286 extend(normalized, normalizeEmitsOptions(raw, appContext, true));1287 };1288 if (!asMixin && appContext.mixins.length) {1289 appContext.mixins.forEach(extendEmits);1290 }1291 if (comp.extends) {1292 extendEmits(comp.extends);1293 }1294 if (comp.mixins) {1295 comp.mixins.forEach(extendEmits);1296 }1297 }1298 if (!raw && !hasExtends) {1299 return (cache[appId] = null);1300 }1301 if (isArray(raw)) {1302 raw.forEach(key => (normalized[key] = null));1303 }1304 else {1305 extend(normalized, raw);1306 }1307 return (cache[appId] = normalized);1308}1309// Check if an incoming prop key is a declared emit event listener.1310// e.g. With `emits: { click: null }`, props named `onClick` and `onclick` are1311// both considered matched listeners.1312function isEmitListener(options, key) {1313 if (!options || !isOn(key)) {1314 return false;1315 }1316 key = key.replace(/Once$/, '');1317 return (hasOwn(options, key[2].toLowerCase() + key.slice(3)) ||1318 hasOwn(options, key.slice(2)));1319}1320// mark the current rendering instance for asset resolution (e.g.1321// resolveComponent, resolveDirective) during render1322let currentRenderingInstance = null;1323function markAttrsAccessed() {1324}1325function initProps(instance, rawProps, isStateful, // result of bitwise flag comparison1326isSSR = false) {1327 const props = {};1328 const attrs = {};1329 // def(attrs, InternalObjectKey, 1) // fixed by xxxxxx1330 def(attrs, '__vInternal', 1);1331 setFullProps(instance, rawProps, props, attrs);1332 // validation1333 if ((process.env.NODE_ENV !== 'production')) {1334 validateProps(props, instance);1335 }1336 if (isStateful) {1337 // stateful1338 instance.props = isSSR ? props : shallowReactive(props);1339 }1340 else {1341 if (!instance.type.props) {1342 // functional w/ optional props, props === attrs1343 instance.props = attrs;1344 }1345 else {1346 // functional w/ declared props1347 instance.props = props;1348 }1349 }1350 instance.attrs = attrs;1351}1352function setFullProps(instance, rawProps, props, attrs) {1353 const [options, needCastKeys] = instance.propsOptions;1354 if (rawProps) {1355 for (const key in rawProps) {1356 const value = rawProps[key];1357 // key, ref are reserved and never passed down1358 if (isReservedProp(key)) {1359 continue;1360 }1361 // prop option names are camelized during normalization, so to support1362 // kebab -> camel conversion here we need to camelize the key.1363 let camelKey;1364 if (options && hasOwn(options, (camelKey = camelize(key)))) {1365 props[camelKey] = value;1366 }1367 else if (!isEmitListener(instance.emitsOptions, key)) {1368 // Any non-declared (either as a prop or an emitted event) props are put1369 // into a separate `attrs` object for spreading. Make sure to preserve1370 // original key casing1371 attrs[key] = value;1372 }1373 }1374 }1375 if (needCastKeys) {1376 const rawCurrentProps = toRaw(props);1377 for (let i = 0; i < needCastKeys.length; i++) {1378 const key = needCastKeys[i];1379 props[key] = resolvePropValue(options, rawCurrentProps, key, rawCurrentProps[key], instance);1380 }1381 }1382}1383function resolvePropValue(options, props, key, value, instance) {1384 const opt = options[key];1385 if (opt != null) {1386 const hasDefault = hasOwn(opt, 'default');1387 // default values1388 if (hasDefault && value === undefined) {1389 const defaultValue = opt.default;1390 if (opt.type !== Function && isFunction(defaultValue)) {1391 setCurrentInstance(instance);1392 value = defaultValue(props);1393 setCurrentInstance(null);1394 }1395 else {1396 value = defaultValue;1397 }1398 }1399 // boolean casting1400 if (opt[0 /* shouldCast */]) {1401 if (!hasOwn(props, key) && !hasDefault) {1402 value = false;1403 }1404 else if (opt[1 /* shouldCastTrue */] &&1405 (value === '' || value === hyphenate(key))) {1406 value = true;1407 }1408 }1409 }1410 return value;1411}1412function normalizePropsOptions(comp, appContext, asMixin = false) {1413 const appId = appContext.app ? appContext.app._uid : -1;1414 const cache = comp.__props || (comp.__props = {});1415 const cached = cache[appId];1416 if (cached) {1417 return cached;1418 }1419 const raw = comp.props;1420 const normalized = {};1421 const needCastKeys = [];1422 // apply mixin/extends props1423 let hasExtends = false;1424 if (__VUE_OPTIONS_API__ && !isFunction(comp)) {1425 const extendProps = (raw) => {1426 hasExtends = true;1427 const [props, keys] = normalizePropsOptions(raw, appContext, true);1428 extend(normalized, props);1429 if (keys)1430 needCastKeys.push(...keys);1431 };1432 if (!asMixin && appContext.mixins.length) {1433 appContext.mixins.forEach(extendProps);1434 }1435 if (comp.extends) {1436 extendProps(comp.extends);1437 }1438 if (comp.mixins) {1439 comp.mixins.forEach(extendProps);1440 }1441 }1442 if (!raw && !hasExtends) {1443 return (cache[appId] = EMPTY_ARR);1444 }1445 if (isArray(raw)) {1446 for (let i = 0; i < raw.length; i++) {1447 if ((process.env.NODE_ENV !== 'production') && !isString(raw[i])) {1448 warn(`props must be strings when using array syntax.`, raw[i]);1449 }1450 const normalizedKey = camelize(raw[i]);1451 if (validatePropName(normalizedKey)) {1452 normalized[normalizedKey] = EMPTY_OBJ;1453 }1454 }1455 }1456 else if (raw) {1457 if ((process.env.NODE_ENV !== 'production') && !isObject(raw)) {1458 warn(`invalid props options`, raw);1459 }1460 for (const key in raw) {1461 const normalizedKey = camelize(key);1462 if (validatePropName(normalizedKey)) {1463 const opt = raw[key];1464 const prop = (normalized[normalizedKey] =1465 isArray(opt) || isFunction(opt) ? { type: opt } : opt);1466 if (prop) {1467 const booleanIndex = getTypeIndex(Boolean, prop.type);1468 const stringIndex = getTypeIndex(String, prop.type);1469 prop[0 /* shouldCast */] = booleanIndex > -1;1470 prop[1 /* shouldCastTrue */] =1471 stringIndex < 0 || booleanIndex < stringIndex;1472 // if the prop needs boolean casting or default value1473 if (booleanIndex > -1 || hasOwn(prop, 'default')) {1474 needCastKeys.push(normalizedKey);1475 }1476 }1477 }1478 }1479 }1480 return (cache[appId] = [normalized, needCastKeys]);1481}1482// use function string name to check type constructors1483// so that it works across vms / iframes.1484function getType(ctor) {1485 const match = ctor && ctor.toString().match(/^\s*function (\w+)/);1486 return match ? match[1] : '';1487}1488function isSameType(a, b) {1489 return getType(a) === getType(b);1490}1491function getTypeIndex(type, expectedTypes) {1492 if (isArray(expectedTypes)) {1493 for (let i = 0, len = expectedTypes.length; i < len; i++) {1494 if (isSameType(expectedTypes[i], type)) {1495 return i;1496 }1497 }1498 }1499 else if (isFunction(expectedTypes)) {1500 return isSameType(expectedTypes, type) ? 0 : -1;1501 }1502 return -1;1503}1504/**1505 * dev only1506 */1507function validateProps(props, instance) {1508 const rawValues = toRaw(props);1509 const options = instance.propsOptions[0];1510 for (const key in options) {1511 let opt = options[key];1512 if (opt == null)1513 continue;1514 validateProp(key, rawValues[key], opt, !hasOwn(rawValues, key));1515 }1516}1517/**1518 * dev only1519 */1520function validatePropName(key) {1521 if (key[0] !== '$') {1522 return true;1523 }1524 else if ((process.env.NODE_ENV !== 'production')) {1525 warn(`Invalid prop name: "${key}" is a reserved property.`);1526 }1527 return false;1528}1529/**1530 * dev only1531 */1532function validateProp(name, value, prop, isAbsent) {1533 const { type, required, validator } = prop;1534 // required!1535 if (required && isAbsent) {1536 warn('Missing required prop: "' + name + '"');1537 return;1538 }1539 // missing but optional1540 if (value == null && !prop.required) {1541 return;1542 }1543 // type check1544 if (type != null && type !== true) {1545 let isValid = false;1546 const types = isArray(type) ? type : [type];1547 const expectedTypes = [];1548 // value is valid as long as one of the specified types match1549 for (let i = 0; i < types.length && !isValid; i++) {1550 const { valid, expectedType } = assertType(value, types[i]);1551 expectedTypes.push(expectedType || '');1552 isValid = valid;1553 }1554 if (!isValid) {1555 warn(getInvalidTypeMessage(name, value, expectedTypes));1556 return;1557 }1558 }1559 // custom validator1560 if (validator && !validator(value)) {1561 warn('Invalid prop: custom validator check failed for prop "' + name + '".');1562 }1563}1564const isSimpleType = /*#__PURE__*/ makeMap('String,Number,Boolean,Function,Symbol');1565/**1566 * dev only1567 */1568function assertType(value, type) {1569 let valid;1570 const expectedType = getType(type);1571 if (isSimpleType(expectedType)) {1572 const t = typeof value;1573 valid = t === expectedType.toLowerCase();1574 // for primitive wrapper objects1575 if (!valid && t === 'object') {1576 valid = value instanceof type;1577 }1578 }1579 else if (expectedType === 'Object') {1580 valid = isObject(value);1581 }1582 else if (expectedType === 'Array') {1583 valid = isArray(value);1584 }1585 else {1586 valid = value instanceof type;1587 }1588 return {1589 valid,1590 expectedType1591 };1592}1593/**1594 * dev only1595 */1596function getInvalidTypeMessage(name, value, expectedTypes) {1597 let message = `Invalid prop: type check failed for prop "${name}".` +1598 ` Expected ${expectedTypes.map(capitalize).join(', ')}`;1599 const expectedType = expectedTypes[0];1600 const receivedType = toRawType(value);1601 const expectedValue = styleValue(value, expectedType);1602 const receivedValue = styleValue(value, receivedType);1603 // check if we need to specify expected value1604 if (expectedTypes.length === 1 &&1605 isExplicable(expectedType) &&1606 !isBoolean(expectedType, receivedType)) {1607 message += ` with value ${expectedValue}`;1608 }1609 message += `, got ${receivedType} `;1610 // check if we need to specify received value1611 if (isExplicable(receivedType)) {1612 message += `with value ${receivedValue}.`;1613 }1614 return message;1615}1616/**1617 * dev only1618 */1619function styleValue(value, type) {1620 if (type === 'String') {1621 return `"${value}"`;1622 }1623 else if (type === 'Number') {1624 return `${Number(value)}`;1625 }1626 else {1627 return `${value}`;1628 }1629}1630/**1631 * dev only1632 */1633function isExplicable(type) {1634 const explicitTypes = ['string', 'number', 'boolean'];1635 return explicitTypes.some(elem => type.toLowerCase() === elem);1636}1637/**1638 * dev only1639 */1640function isBoolean(...args) {1641 return args.some(elem => elem.toLowerCase() === 'boolean');1642}1643function injectHook(type, hook, target = currentInstance, prepend = false) {1644 if (target) {1645 const hooks = target[type] || (target[type] = []);1646 // cache the error handling wrapper for injected hooks so the same hook1647 // can be properly deduped by the scheduler. "__weh" stands for "with error1648 // handling".1649 const wrappedHook = hook.__weh ||1650 (hook.__weh = (...args) => {1651 if (target.isUnmounted) {1652 return;1653 }1654 // disable tracking inside all lifecycle hooks1655 // since they can potentially be called inside effects.1656 pauseTracking();1657 // Set currentInstance during hook invocation.1658 // This assumes the hook does not synchronously trigger other hooks, which1659 // can only be false when the user does something really funky.1660 setCurrentInstance(target);1661 const res = callWithAsyncErrorHandling(hook, target, type, args);1662 setCurrentInstance(null);1663 resetTracking();1664 return res;1665 });1666 if (prepend) {1667 hooks.unshift(wrappedHook);1668 }1669 else {1670 hooks.push(wrappedHook);1671 }1672 return wrappedHook;1673 }1674 else if ((process.env.NODE_ENV !== 'production')) {1675 const apiName = `on${capitalize(ErrorTypeStrings[type].replace(/ hook$/, ''))}`;1676 warn(`${apiName} is called when there is no active component instance to be ` +1677 `associated with. ` +1678 `Lifecycle injection APIs can only be used during execution of setup().` +1679 ( ``));1680 }1681}1682const createHook = (lifecycle) => (hook, target = currentInstance) => 1683// post-create lifecycle registrations are noops during SSR1684!isInSSRComponentSetup && injectHook(lifecycle, hook, target);1685const onBeforeMount = createHook("bm" /* BEFORE_MOUNT */);1686const onMounted = createHook("m" /* MOUNTED */);1687const onBeforeUpdate = createHook("bu" /* BEFORE_UPDATE */);1688const onUpdated = createHook("u" /* UPDATED */);1689const onBeforeUnmount = createHook("bum" /* BEFORE_UNMOUNT */);1690const onUnmounted = createHook("um" /* UNMOUNTED */);1691const onRenderTriggered = createHook("rtg" /* RENDER_TRIGGERED */);1692const onRenderTracked = createHook("rtc" /* RENDER_TRACKED */);1693const onErrorCaptured = (hook, target = currentInstance) => {1694 injectHook("ec" /* ERROR_CAPTURED */, hook, target);1695};1696const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;1697function onActivated(hook, target) {1698 registerKeepAliveHook(hook, "a" /* ACTIVATED */, target);1699}1700function onDeactivated(hook, target) {1701 registerKeepAliveHook(hook, "da" /* DEACTIVATED */, target);1702}1703function registerKeepAliveHook(hook, type, target = currentInstance) {1704 // cache the deactivate branch check wrapper for injected hooks so the same1705 // hook can be properly deduped by the scheduler. "__wdc" stands for "with1706 // deactivation check".1707 const wrappedHook = hook.__wdc ||1708 (hook.__wdc = () => {1709 // only fire the hook if the target instance is NOT in a deactivated branch.1710 let current = target;1711 while (current) {1712 if (current.isDeactivated) {1713 return;1714 }1715 current = current.parent;1716 }1717 hook();1718 });1719 injectHook(type, wrappedHook, target);1720 // In addition to registering it on the target instance, we walk up the parent1721 // chain and register it on all ancestor instances that are keep-alive roots.1722 // This avoids the need to walk the entire component tree when invoking these1723 // hooks, and more importantly, avoids the need to track child components in1724 // arrays.1725 if (target) {1726 let current = target.parent;1727 while (current && current.parent) {1728 if (isKeepAlive(current.parent.vnode)) {1729 injectToKeepAliveRoot(wrappedHook, type, target, current);1730 }1731 current = current.parent;1732 }1733 }1734}1735function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {1736 // injectHook wraps the original for error handling, so make sure to remove1737 // the wrapped version.1738 const injected = injectHook(type, hook, keepAliveRoot, true /* prepend */);1739 onUnmounted(() => {1740 remove(keepAliveRoot[type], injected);1741 }, target);1742}1743/**1744Runtime helper for applying directives to a vnode. Example usage:1745const comp = resolveComponent('comp')1746const foo = resolveDirective('foo')1747const bar = resolveDirective('bar')1748return withDirectives(h(comp), [1749 [foo, this.x],1750 [bar, this.y]1751])1752*/1753const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text');1754function validateDirectiveName(name) {1755 if (isBuiltInDirective(name)) {1756 warn('Do not use built-in directive ids as custom directive id: ' + name);1757 }1758}1759function createAppContext() {1760 return {1761 app: null,1762 config: {1763 isNativeTag: NO,1764 performance: false,1765 globalProperties: {},1766 optionMergeStrategies: {},1767 isCustomElement: NO,1768 errorHandler: undefined,1769 warnHandler: undefined1770 },1771 mixins: [],1772 components: {},1773 directives: {},1774 provides: Object.create(null)1775 };1776}1777let uid$1 = 0;1778// fixed by xxxxxx1779function createAppAPI() {1780 return function createApp(rootComponent, rootProps = null) {1781 if (rootProps != null && !isObject(rootProps)) {1782 (process.env.NODE_ENV !== 'production') && warn(`root props passed to app.mount() must be an object.`);1783 rootProps = null;1784 }1785 const context = createAppContext();1786 const installedPlugins = new Set();1787 // fixed by xxxxxx1788 // let isMounted = false1789 const app = (context.app = {1790 _uid: uid$1++,1791 _component: rootComponent,1792 _props: rootProps,1793 _container: null,1794 _context: context,1795 version,1796 get config() {1797 return context.config;1798 },1799 set config(v) {1800 if ((process.env.NODE_ENV !== 'production')) {1801 warn(`app.config cannot be replaced. Modify individual options instead.`);1802 }1803 },1804 use(plugin, ...options) {1805 if (installedPlugins.has(plugin)) {1806 (process.env.NODE_ENV !== 'production') && warn(`Plugin has already been applied to target app.`);1807 }1808 else if (plugin && isFunction(plugin.install)) {1809 installedPlugins.add(plugin);1810 plugin.install(app, ...options);1811 }1812 else if (isFunction(plugin)) {1813 installedPlugins.add(plugin);1814 plugin(app, ...options);1815 }1816 else if ((process.env.NODE_ENV !== 'production')) {1817 warn(`A plugin must either be a function or an object with an "install" ` +1818 `function.`);1819 }1820 return app;1821 },1822 mixin(mixin) {1823 if (__VUE_OPTIONS_API__) {1824 if (!context.mixins.includes(mixin)) {1825 context.mixins.push(mixin);1826 }1827 else if ((process.env.NODE_ENV !== 'production')) {1828 warn('Mixin has already been applied to target app' +1829 (mixin.name ? `: ${mixin.name}` : ''));1830 }1831 }1832 else if ((process.env.NODE_ENV !== 'production')) {1833 warn('Mixins are only available in builds supporting Options API');1834 }1835 return app;1836 },1837 component(name, component) {1838 if ((process.env.NODE_ENV !== 'production')) {1839 validateComponentName(name, context.config);1840 }1841 if (!component) {1842 return context.components[name];1843 }1844 if ((process.env.NODE_ENV !== 'production') && context.components[name]) {1845 warn(`Component "${name}" has already been registered in target app.`);1846 }1847 context.components[name] = component;1848 return app;1849 },1850 directive(name, directive) {1851 if ((process.env.NODE_ENV !== 'production')) {1852 validateDirectiveName(name);1853 }1854 if (!directive) {1855 return context.directives[name];1856 }1857 if ((process.env.NODE_ENV !== 'production') && context.directives[name]) {1858 warn(`Directive "${name}" has already been registered in target app.`);1859 }1860 context.directives[name] = directive;1861 return app;1862 },1863 // fixed by xxxxxx1864 mount() { },1865 // fixed by xxxxxx1866 unmount() { },1867 provide(key, value) {1868 if ((process.env.NODE_ENV !== 'production') && key in context.provides) {1869 warn(`App already provides property with key "${String(key)}". ` +1870 `It will be overwritten with the new value.`);1871 }1872 // TypeScript doesn't allow symbols as index type1873 // https://github.com/Microsoft/TypeScript/issues/245871874 context.provides[key] = value;1875 return app;1876 }1877 });1878 return app;1879 };1880}1881const queuePostRenderEffect = queuePostFlushCb;1882// Simple effect.1883function watchEffect(effect, options) {1884 return doWatch(effect, null, options);1885}1886// initial value for watchers to trigger on undefined initial values1887const INITIAL_WATCHER_VALUE = {};1888// implementation1889function watch(source, cb, options) {1890 if ((process.env.NODE_ENV !== 'production') && !isFunction(cb)) {1891 warn(`\`watch(fn, options?)\` signature has been moved to a separate API. ` +1892 `Use \`watchEffect(fn, options?)\` instead. \`watch\` now only ` +1893 `supports \`watch(source, cb, options?) signature.`);1894 }1895 return doWatch(source, cb, options);1896}1897function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ, instance = currentInstance) {1898 if ((process.env.NODE_ENV !== 'production') && !cb) {1899 if (immediate !== undefined) {1900 warn(`watch() "immediate" option is only respected when using the ` +1901 `watch(source, callback, options?) signature.`);1902 }1903 if (deep !== undefined) {1904 warn(`watch() "deep" option is only respected when using the ` +1905 `watch(source, callback, options?) signature.`);1906 }1907 }1908 const warnInvalidSource = (s) => {1909 warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +1910 `a reactive object, or an array of these types.`);1911 };1912 let getter;1913 const isRefSource = isRef(source);1914 if (isRefSource) {1915 getter = () => source.value;1916 }1917 else if (isReactive(source)) {1918 getter = () => source;1919 deep = true;1920 }1921 else if (isArray(source)) {1922 getter = () => source.map(s => {1923 if (isRef(s)) {1924 return s.value;1925 }1926 else if (isReactive(s)) {1927 return traverse(s);1928 }1929 else if (isFunction(s)) {1930 return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */);1931 }1932 else {1933 (process.env.NODE_ENV !== 'production') && warnInvalidSource(s);1934 }1935 });1936 }1937 else if (isFunction(source)) {1938 if (cb) {1939 // getter with cb1940 getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */);1941 }1942 else {1943 // no cb -> simple effect1944 getter = () => {1945 if (instance && instance.isUnmounted) {1946 return;1947 }1948 if (cleanup) {1949 cleanup();1950 }1951 return callWithErrorHandling(source, instance, 3 /* WATCH_CALLBACK */, [onInvalidate]);1952 };1953 }1954 }1955 else {1956 getter = NOOP;1957 (process.env.NODE_ENV !== 'production') && warnInvalidSource(source);1958 }1959 if (cb && deep) {1960 const baseGetter = getter;1961 getter = () => traverse(baseGetter());1962 }1963 let cleanup;1964 const onInvalidate = (fn) => {1965 cleanup = runner.options.onStop = () => {1966 callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);1967 };1968 };1969 let oldValue = isArray(source) ? [] : INITIAL_WATCHER_VALUE;1970 const job = () => {1971 if (!runner.active) {1972 return;1973 }1974 if (cb) {1975 // watch(source, cb)1976 const newValue = runner();1977 if (deep || isRefSource || hasChanged(newValue, oldValue)) {1978 // cleanup before running cb again1979 if (cleanup) {1980 cleanup();1981 }1982 callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [1983 newValue,1984 // pass undefined as the old value when it's changed for the first time1985 oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,1986 onInvalidate1987 ]);1988 oldValue = newValue;1989 }1990 }1991 else {1992 // watchEffect1993 runner();1994 }1995 };1996 // important: mark the job as a watcher callback so that scheduler knows it1997 // it is allowed to self-trigger (#1727)1998 job.allowRecurse = !!cb;1999 let scheduler;2000 if (flush === 'sync') {2001 scheduler = job;2002 }2003 else if (flush === 'post') {2004 scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);2005 }2006 else {2007 // default: 'pre'2008 scheduler = () => {2009 if (!instance || instance.isMounted) {2010 queuePreFlushCb(job);2011 }2012 else {2013 // with 'pre' option, the first call must happen before2014 // the component is mounted so it is called synchronously.2015 job();2016 }2017 };2018 }2019 const runner = effect(getter, {2020 lazy: true,2021 onTrack,2022 onTrigger,2023 scheduler2024 });2025 recordInstanceBoundEffect(runner);2026 // initial run2027 if (cb) {2028 if (immediate) {2029 job();2030 }2031 else {2032 oldValue = runner();2033 }2034 }2035 else if (flush === 'post') {2036 queuePostRenderEffect(runner, instance && instance.suspense);2037 }2038 else {2039 runner();2040 }2041 return () => {2042 stop(runner);2043 if (instance) {2044 remove(instance.effects, runner);2045 }2046 };2047}2048// this.$watch2049function instanceWatch(source, cb, options) {2050 const publicThis = this.proxy;2051 const getter = isString(source)2052 ? () => publicThis[source]2053 : source.bind(publicThis);2054 return doWatch(getter, cb.bind(publicThis), options, this);2055}2056function traverse(value, seen = new Set()) {2057 if (!isObject(value) || seen.has(value)) {2058 return value;2059 }2060 seen.add(value);2061 if (isRef(value)) {2062 traverse(value.value, seen);2063 }2064 else if (isArray(value)) {2065 for (let i = 0; i < value.length; i++) {2066 traverse(value[i], seen);2067 }2068 }2069 else if (isMap(value)) {2070 value.forEach((_, key) => {2071 // to register mutation dep for existing keys2072 traverse(value.get(key), seen);2073 });2074 }2075 else if (isSet(value)) {2076 value.forEach(v => {2077 traverse(v, seen);2078 });2079 }2080 else {2081 for (const key in value) {2082 traverse(value[key], seen);2083 }2084 }2085 return value;2086}2087function provide(key, value) {2088 if (!currentInstance) {2089 if ((process.env.NODE_ENV !== 'production')) {2090 warn(`provide() can only be used inside setup().`);2091 }2092 }2093 else {2094 let provides = currentInstance.provides;2095 // by default an instance inherits its parent's provides object2096 // but when it needs to provide values of its own, it creates its2097 // own provides object using parent provides object as prototype.2098 // this way in `inject` we can simply look up injections from direct2099 // parent and let the prototype chain do the work.2100 const parentProvides = currentInstance.parent && currentInstance.parent.provides;2101 if (parentProvides === provides) {2102 provides = currentInstance.provides = Object.create(parentProvides);2103 }2104 // TS doesn't allow symbol as index type2105 provides[key] = value;2106 }2107}2108function inject(key, defaultValue, treatDefaultAsFactory = false) {2109 // fallback to `currentRenderingInstance` so that this can be called in2110 // a functional component2111 const instance = currentInstance || currentRenderingInstance;2112 if (instance) {2113 const provides = instance.provides;2114 if (key in provides) {2115 // TS doesn't allow symbol as index type2116 return provides[key];2117 }2118 else if (arguments.length > 1) {2119 return treatDefaultAsFactory && isFunction(defaultValue)2120 ? defaultValue()2121 : defaultValue;2122 }2123 else if ((process.env.NODE_ENV !== 'production')) {2124 warn(`injection "${String(key)}" not found.`);2125 }2126 }2127 else if ((process.env.NODE_ENV !== 'production')) {2128 warn(`inject() can only be used inside setup() or functional components.`);2129 }2130}2131function createDuplicateChecker() {2132 const cache = Object.create(null);2133 return (type, key) => {2134 if (cache[key]) {2135 warn(`${type} property "${key}" is already defined in ${cache[key]}.`);2136 }2137 else {2138 cache[key] = type;2139 }2140 };2141}2142let isInBeforeCreate = false;2143function applyOptions(instance, options, deferredData = [], deferredWatch = [], asMixin = false) {2144 const { 2145 // composition2146 mixins, extends: extendsOptions, 2147 // state2148 data: dataOptions, computed: computedOptions, methods, watch: watchOptions, provide: provideOptions, inject: injectOptions, 2149 // assets2150 components, directives, 2151 // lifecycle2152 beforeMount, mounted, beforeUpdate, updated, activated, deactivated, beforeDestroy, beforeUnmount, destroyed, unmounted, render, renderTracked, renderTriggered, errorCaptured } = options;2153 const publicThis = instance.proxy;2154 const ctx = instance.ctx;2155 const globalMixins = instance.appContext.mixins;2156 if (asMixin && render && instance.render === NOOP) {2157 instance.render = render;2158 }2159 // applyOptions is called non-as-mixin once per instance2160 if (!asMixin) {2161 isInBeforeCreate = true;2162 callSyncHook('beforeCreate', options, publicThis, globalMixins);2163 isInBeforeCreate = false;2164 // global mixins are applied first2165 applyMixins(instance, globalMixins, deferredData, deferredWatch);2166 }2167 // extending a base component...2168 if (extendsOptions) {2169 applyOptions(instance, extendsOptions, deferredData, deferredWatch, true);2170 }2171 // local mixins2172 if (mixins) {2173 applyMixins(instance, mixins, deferredData, deferredWatch);2174 }2175 const checkDuplicateProperties = (process.env.NODE_ENV !== 'production') ? createDuplicateChecker() : null;2176 if ((process.env.NODE_ENV !== 'production')) {2177 const [propsOptions] = instance.propsOptions;2178 if (propsOptions) {2179 for (const key in propsOptions) {2180 checkDuplicateProperties("Props" /* PROPS */, key);2181 }2182 }2183 }2184 // options initialization order (to be consistent with Vue 2):2185 // - props (already done outside of this function)2186 // - inject2187 // - methods2188 // - data (deferred since it relies on `this` access)2189 // - computed2190 // - watch (deferred since it relies on `this` access)2191 // fixed by xxxxxx2192 if (!__VUE_CREATED_DEFERRED__ && injectOptions) {2193 if (isArray(injectOptions)) {2194 for (let i = 0; i < injectOptions.length; i++) {2195 const key = injectOptions[i];2196 ctx[key] = inject(key);2197 if ((process.env.NODE_ENV !== 'production')) {2198 checkDuplicateProperties("Inject" /* INJECT */, key);2199 }2200 }2201 }2202 else {2203 for (const key in injectOptions) {2204 const opt = injectOptions[key];2205 if (isObject(opt)) {2206 ctx[key] = inject(opt.from || key, opt.default, true /* treat default function as factory */);2207 }2208 else {2209 ctx[key] = inject(opt);2210 }2211 if ((process.env.NODE_ENV !== 'production')) {2212 checkDuplicateProperties("Inject" /* INJECT */, key);2213 }2214 }2215 }2216 }2217 if (methods) {2218 for (const key in methods) {2219 const methodHandler = methods[key];2220 if (isFunction(methodHandler)) {2221 ctx[key] = methodHandler.bind(publicThis);2222 if ((process.env.NODE_ENV !== 'production')) {2223 checkDuplicateProperties("Methods" /* METHODS */, key);2224 }2225 }2226 else if ((process.env.NODE_ENV !== 'production')) {2227 warn(`Method "${key}" has type "${typeof methodHandler}" in the component definition. ` +2228 `Did you reference the function correctly?`);2229 }2230 }2231 }2232 if (!asMixin) {2233 if (deferredData.length) {2234 deferredData.forEach(dataFn => resolveData(instance, dataFn, publicThis));2235 }2236 if (dataOptions) {2237 resolveData(instance, dataOptions, publicThis);2238 }2239 if ((process.env.NODE_ENV !== 'production')) {2240 const rawData = toRaw(instance.data);2241 for (const key in rawData) {2242 checkDuplicateProperties("Data" /* DATA */, key);2243 // expose data on ctx during dev2244 if (key[0] !== '$' && key[0] !== '_') {2245 Object.defineProperty(ctx, key, {2246 configurable: true,2247 enumerable: true,2248 get: () => rawData[key],2249 set: NOOP2250 });2251 }2252 }2253 }2254 }2255 else if (dataOptions) {2256 deferredData.push(dataOptions);2257 }2258 if (computedOptions) {2259 for (const key in computedOptions) {2260 const opt = computedOptions[key];2261 const get = isFunction(opt)2262 ? opt.bind(publicThis, publicThis)2263 : isFunction(opt.get)2264 ? opt.get.bind(publicThis, publicThis)2265 : NOOP;2266 if ((process.env.NODE_ENV !== 'production') && get === NOOP) {2267 warn(`Computed property "${key}" has no getter.`);2268 }2269 const set = !isFunction(opt) && isFunction(opt.set)2270 ? opt.set.bind(publicThis)2271 : (process.env.NODE_ENV !== 'production')2272 ? () => {2273 warn(`Write operation failed: computed property "${key}" is readonly.`);2274 }2275 : NOOP;2276 const c = computed$1({2277 get,2278 set2279 });2280 Object.defineProperty(ctx, key, {2281 enumerable: true,2282 configurable: true,2283 get: () => c.value,2284 set: v => (c.value = v)2285 });2286 if ((process.env.NODE_ENV !== 'production')) {2287 checkDuplicateProperties("Computed" /* COMPUTED */, key);2288 }2289 }2290 }2291 if (watchOptions) {2292 deferredWatch.push(watchOptions);2293 }2294 if (!asMixin && deferredWatch.length) {2295 deferredWatch.forEach(watchOptions => {2296 for (const key in watchOptions) {2297 createWatcher(watchOptions[key], ctx, publicThis, key);2298 }2299 });2300 }2301 // fixed by xxxxxx2302 if (!__VUE_CREATED_DEFERRED__ && provideOptions) {2303 const provides = isFunction(provideOptions)2304 ? provideOptions.call(publicThis)2305 : provideOptions;2306 for (const key in provides) {2307 provide(key, provides[key]);2308 }2309 }2310 // asset options.2311 // To reduce memory usage, only components with mixins or extends will have2312 // resolved asset registry attached to instance.2313 if (asMixin) {2314 if (components) {2315 extend(instance.components ||2316 (instance.components = extend({}, instance.type.components)), components);2317 }2318 if (directives) {2319 extend(instance.directives ||2320 (instance.directives = extend({}, instance.type.directives)), directives);2321 }2322 }2323 // fixed by xxxxxx2324 // lifecycle options2325 if (__VUE_CREATED_DEFERRED__) {2326 ctx.$callSyncHook = function (name) {2327 return callSyncHook(name, options, publicThis, globalMixins);2328 };2329 }2330 else if (!asMixin) {2331 callSyncHook('created', options, publicThis, globalMixins);2332 }2333 if (beforeMount) {2334 onBeforeMount(beforeMount.bind(publicThis));2335 }2336 if (mounted) {2337 onMounted(mounted.bind(publicThis));2338 }2339 if (beforeUpdate) {2340 onBeforeUpdate(beforeUpdate.bind(publicThis));2341 }2342 if (updated) {2343 onUpdated(updated.bind(publicThis));2344 }2345 if (activated) {2346 onActivated(activated.bind(publicThis));2347 }2348 if (deactivated) {2349 onDeactivated(deactivated.bind(publicThis));2350 }2351 if (errorCaptured) {2352 onErrorCaptured(errorCaptured.bind(publicThis));2353 }2354 if (renderTracked) {2355 onRenderTracked(renderTracked.bind(publicThis));2356 }2357 if (renderTriggered) {2358 onRenderTriggered(renderTriggered.bind(publicThis));2359 }2360 if ((process.env.NODE_ENV !== 'production') && beforeDestroy) {2361 warn(`\`beforeDestroy\` has been renamed to \`beforeUnmount\`.`);2362 }2363 if (beforeUnmount) {2364 onBeforeUnmount(beforeUnmount.bind(publicThis));2365 }2366 if ((process.env.NODE_ENV !== 'production') && destroyed) {2367 warn(`\`destroyed\` has been renamed to \`unmounted\`.`);2368 }2369 if (unmounted) {2370 onUnmounted(unmounted.bind(publicThis));2371 }2372 // fixed by xxxxxx2373 if (instance.ctx.$onApplyOptions) {2374 instance.ctx.$onApplyOptions(options, instance, publicThis);2375 }2376}2377function callSyncHook(name, options, ctx, globalMixins) {2378 callHookFromMixins(name, globalMixins, ctx);2379 const { extends: base, mixins } = options;2380 if (base) {2381 callHookFromExtends(name, base, ctx);2382 }2383 if (mixins) {2384 callHookFromMixins(name, mixins, ctx);2385 }2386 const selfHook = options[name];2387 if (selfHook) {2388 selfHook.call(ctx);2389 }2390}2391function callHookFromExtends(name, base, ctx) {2392 if (base.extends) {2393 callHookFromExtends(name, base.extends, ctx);2394 }2395 const baseHook = base[name];2396 if (baseHook) {2397 baseHook.call(ctx);2398 }2399}2400function callHookFromMixins(name, mixins, ctx) {2401 for (let i = 0; i < mixins.length; i++) {2402 const chainedMixins = mixins[i].mixins;2403 if (chainedMixins) {2404 callHookFromMixins(name, chainedMixins, ctx);2405 }2406 const fn = mixins[i][name];2407 if (fn) {2408 fn.call(ctx);2409 }2410 }2411}2412function applyMixins(instance, mixins, deferredData, deferredWatch) {2413 for (let i = 0; i < mixins.length; i++) {2414 applyOptions(instance, mixins[i], deferredData, deferredWatch, true);2415 }2416}2417function resolveData(instance, dataFn, publicThis) {2418 if ((process.env.NODE_ENV !== 'production') && !isFunction(dataFn)) {2419 warn(`The data option must be a function. ` +2420 `Plain object usage is no longer supported.`);2421 }2422 const data = dataFn.call(publicThis, publicThis);2423 if ((process.env.NODE_ENV !== 'production') && isPromise(data)) {2424 warn(`data() returned a Promise - note data() cannot be async; If you ` +2425 `intend to perform data fetching before component renders, use ` +2426 `async setup() + <Suspense>.`);2427 }2428 if (!isObject(data)) {2429 (process.env.NODE_ENV !== 'production') && warn(`data() should return an object.`);2430 }2431 else if (instance.data === EMPTY_OBJ) {2432 instance.data = reactive(data);2433 }2434 else {2435 // existing data: this is a mixin or extends.2436 extend(instance.data, data);2437 }2438}2439function createWatcher(raw, ctx, publicThis, key) {2440 const getter = key.includes('.')2441 ? createPathGetter(publicThis, key)2442 : () => publicThis[key];2443 if (isString(raw)) {2444 const handler = ctx[raw];2445 if (isFunction(handler)) {2446 watch(getter, handler);2447 }2448 else if ((process.env.NODE_ENV !== 'production')) {2449 warn(`Invalid watch handler specified by key "${raw}"`, handler);2450 }2451 }2452 else if (isFunction(raw)) {2453 watch(getter, raw.bind(publicThis));2454 }2455 else if (isObject(raw)) {2456 if (isArray(raw)) {2457 raw.forEach(r => createWatcher(r, ctx, publicThis, key));2458 }2459 else {2460 const handler = isFunction(raw.handler)2461 ? raw.handler.bind(publicThis)2462 : ctx[raw.handler];2463 if (isFunction(handler)) {2464 watch(getter, handler, raw);2465 }2466 else if ((process.env.NODE_ENV !== 'production')) {2467 warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);2468 }2469 }2470 }2471 else if ((process.env.NODE_ENV !== 'production')) {2472 warn(`Invalid watch option: "${key}"`, raw);2473 }2474}2475function createPathGetter(ctx, path) {2476 const segments = path.split('.');2477 return () => {2478 let cur = ctx;2479 for (let i = 0; i < segments.length && cur; i++) {2480 cur = cur[segments[i]];2481 }2482 return cur;2483 };2484}2485function resolveMergedOptions(instance) {2486 const raw = instance.type;2487 const { __merged, mixins, extends: extendsOptions } = raw;2488 if (__merged)2489 return __merged;2490 const globalMixins = instance.appContext.mixins;2491 if (!globalMixins.length && !mixins && !extendsOptions)2492 return raw;2493 const options = {};2494 globalMixins.forEach(m => mergeOptions(options, m, instance));2495 mergeOptions(options, raw, instance);2496 return (raw.__merged = options);2497}2498function mergeOptions(to, from, instance) {2499 const strats = instance.appContext.config.optionMergeStrategies;2500 const { mixins, extends: extendsOptions } = from;2501 extendsOptions && mergeOptions(to, extendsOptions, instance);2502 mixins &&2503 mixins.forEach((m) => mergeOptions(to, m, instance));2504 for (const key in from) {2505 if (strats && hasOwn(strats, key)) {2506 to[key] = strats[key](to[key], from[key], instance.proxy, key);2507 }2508 else {2509 to[key] = from[key];2510 }2511 }2512}2513const publicPropertiesMap = extend(Object.create(null), {2514 $: i => i,2515 $el: i => i.vnode.el,2516 $data: i => i.data,2517 $props: i => ((process.env.NODE_ENV !== 'production') ? shallowReadonly(i.props) : i.props),2518 $attrs: i => ((process.env.NODE_ENV !== 'production') ? shallowReadonly(i.attrs) : i.attrs),2519 $slots: i => ((process.env.NODE_ENV !== 'production') ? shallowReadonly(i.slots) : i.slots),2520 $refs: i => ((process.env.NODE_ENV !== 'production') ? shallowReadonly(i.refs) : i.refs),2521 $parent: i => i.parent && i.parent.proxy,2522 $root: i => i.root && i.root.proxy,2523 $emit: i => i.emit,2524 $options: i => (__VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type),2525 $forceUpdate: i => () => queueJob(i.update),2526 // $nextTick: () => nextTick, // fixed by xxxxxx2527 $watch: i => (__VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP)2528});2529const PublicInstanceProxyHandlers = {2530 get({ _: instance }, key) {2531 const { ctx, setupState, data, props, accessCache, type, appContext } = instance;2532 // let @vue/reactivity know it should never observe Vue public instances.2533 if (key === "__v_skip" /* SKIP */) {2534 return true;2535 }2536 // data / props / ctx2537 // This getter gets called for every property access on the render context2538 // during render and is a major hotspot. The most expensive part of this2539 // is the multiple hasOwn() calls. It's much faster to do a simple property2540 // access on a plain object, so we use an accessCache object (with null2541 // prototype) to memoize what access type a key corresponds to.2542 let normalizedProps;2543 if (key[0] !== '$') {2544 const n = accessCache[key];2545 if (n !== undefined) {2546 switch (n) {2547 case 0 /* SETUP */:2548 return setupState[key];2549 case 1 /* DATA */:2550 return data[key];2551 case 3 /* CONTEXT */:2552 return ctx[key];2553 case 2 /* PROPS */:2554 return props[key];2555 // default: just fallthrough2556 }2557 }2558 else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {2559 accessCache[key] = 0 /* SETUP */;2560 return setupState[key];2561 }2562 else if (data !== EMPTY_OBJ && hasOwn(data, key)) {2563 accessCache[key] = 1 /* DATA */;2564 return data[key];2565 }2566 else if (2567 // only cache other properties when instance has declared (thus stable)2568 // props2569 (normalizedProps = instance.propsOptions[0]) &&2570 hasOwn(normalizedProps, key)) {2571 accessCache[key] = 2 /* PROPS */;2572 return props[key];2573 }2574 else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {2575 accessCache[key] = 3 /* CONTEXT */;2576 return ctx[key];2577 }2578 else if (!__VUE_OPTIONS_API__ || !isInBeforeCreate) {2579 accessCache[key] = 4 /* OTHER */;2580 }2581 }2582 const publicGetter = publicPropertiesMap[key];2583 let cssModule, globalProperties;2584 // public $xxx properties2585 if (publicGetter) {2586 if (key === '$attrs') {2587 track(instance, "get" /* GET */, key);2588 (process.env.NODE_ENV !== 'production') && markAttrsAccessed();2589 }2590 return publicGetter(instance);2591 }2592 else if (2593 // css module (injected by vue-loader)2594 (cssModule = type.__cssModules) &&2595 (cssModule = cssModule[key])) {2596 return cssModule;2597 }2598 else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {2599 // user may set custom properties to `this` that start with `$`2600 accessCache[key] = 3 /* CONTEXT */;2601 return ctx[key];2602 }2603 else if (2604 // global properties2605 ((globalProperties = appContext.config.globalProperties),2606 hasOwn(globalProperties, key))) {2607 return globalProperties[key];2608 }2609 else if ((process.env.NODE_ENV !== 'production') &&2610 currentRenderingInstance &&2611 (!isString(key) ||2612 // #1091 avoid internal isRef/isVNode checks on component instance leading2613 // to infinite warning loop2614 key.indexOf('__v') !== 0)) {2615 if (data !== EMPTY_OBJ &&2616 (key[0] === '$' || key[0] === '_') &&2617 hasOwn(data, key)) {2618 warn(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +2619 `character ("$" or "_") and is not proxied on the render context.`);2620 }2621 else {2622 warn(`Property ${JSON.stringify(key)} was accessed during render ` +2623 `but is not defined on instance.`);2624 }2625 }2626 },2627 set({ _: instance }, key, value) {2628 const { data, setupState, ctx } = instance;2629 if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {2630 setupState[key] = value;2631 }2632 else if (data !== EMPTY_OBJ && hasOwn(data, key)) {2633 data[key] = value;2634 }2635 else if (key in instance.props) {2636 (process.env.NODE_ENV !== 'production') &&2637 warn(`Attempting to mutate prop "${key}". Props are readonly.`, instance);2638 return false;2639 }2640 if (key[0] === '$' && key.slice(1) in instance) {2641 (process.env.NODE_ENV !== 'production') &&2642 warn(`Attempting to mutate public property "${key}". ` +2643 `Properties starting with $ are reserved and readonly.`, instance);2644 return false;2645 }2646 else {2647 if ((process.env.NODE_ENV !== 'production') && key in instance.appContext.config.globalProperties) {2648 Object.defineProperty(ctx, key, {2649 enumerable: true,2650 configurable: true,2651 value2652 });2653 }2654 else {2655 ctx[key] = value;2656 }2657 }2658 return true;2659 },2660 has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {2661 let normalizedProps;2662 return (accessCache[key] !== undefined ||2663 (data !== EMPTY_OBJ && hasOwn(data, key)) ||2664 (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||2665 ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||2666 hasOwn(ctx, key) ||2667 hasOwn(publicPropertiesMap, key) ||2668 hasOwn(appContext.config.globalProperties, key));2669 }2670};2671if ((process.env.NODE_ENV !== 'production') && !false) {2672 PublicInstanceProxyHandlers.ownKeys = (target) => {2673 warn(`Avoid app logic that relies on enumerating keys on a component instance. ` +2674 `The keys will be empty in production mode to avoid performance overhead.`);2675 return Reflect.ownKeys(target);2676 };2677}2678const RuntimeCompiledPublicInstanceProxyHandlers = extend({}, PublicInstanceProxyHandlers, {2679 get(target, key) {2680 // fast path for unscopables when using `with` block2681 if (key === Symbol.unscopables) {2682 return;2683 }2684 return PublicInstanceProxyHandlers.get(target, key, target);2685 },2686 has(_, key) {2687 const has = key[0] !== '_' && !isGloballyWhitelisted(key);2688 if ((process.env.NODE_ENV !== 'production') && !has && PublicInstanceProxyHandlers.has(_, key)) {2689 warn(`Property ${JSON.stringify(key)} should not start with _ which is a reserved prefix for Vue internals.`);2690 }2691 return has;2692 }2693});2694// In dev mode, the proxy target exposes the same properties as seen on `this`2695// for easier console inspection. In prod mode it will be an empty object so2696// these properties definitions can be skipped.2697function createRenderContext(instance) {2698 const target = {};2699 // expose internal instance for proxy handlers2700 Object.defineProperty(target, `_`, {2701 configurable: true,2702 enumerable: false,2703 get: () => instance2704 });2705 // expose public properties2706 Object.keys(publicPropertiesMap).forEach(key => {2707 Object.defineProperty(target, key, {2708 configurable: true,2709 enumerable: false,2710 get: () => publicPropertiesMap[key](instance),2711 // intercepted by the proxy so no need for implementation,2712 // but needed to prevent set errors2713 set: NOOP2714 });2715 });2716 // expose global properties2717 const { globalProperties } = instance.appContext.config;2718 Object.keys(globalProperties).forEach(key => {2719 Object.defineProperty(target, key, {2720 configurable: true,2721 enumerable: false,2722 get: () => globalProperties[key],2723 set: NOOP2724 });2725 });2726 return target;2727}2728// dev only2729function exposePropsOnRenderContext(instance) {2730 const { ctx, propsOptions: [propsOptions] } = instance;2731 if (propsOptions) {2732 Object.keys(propsOptions).forEach(key => {2733 Object.defineProperty(ctx, key, {2734 enumerable: true,2735 configurable: true,2736 get: () => instance.props[key],2737 set: NOOP2738 });2739 });2740 }2741}2742// dev only2743function exposeSetupStateOnRenderContext(instance) {2744 const { ctx, setupState } = instance;2745 Object.keys(toRaw(setupState)).forEach(key => {2746 if (key[0] === '$' || key[0] === '_') {2747 warn(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +2748 `which are reserved prefixes for Vue internals.`);2749 return;2750 }2751 Object.defineProperty(ctx, key, {2752 enumerable: true,2753 configurable: true,2754 get: () => setupState[key],2755 set: NOOP2756 });2757 });2758}2759const emptyAppContext = createAppContext();2760let uid$2 = 0;2761function createComponentInstance(vnode, parent, suspense) {2762 const type = vnode.type;2763 // inherit parent app context - or - if root, adopt from root vnode2764 const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;2765 const instance = {2766 uid: uid$2++,2767 vnode,2768 type,2769 parent,2770 appContext,2771 root: null,2772 next: null,2773 subTree: null,2774 update: null,2775 render: null,2776 proxy: null,2777 withProxy: null,2778 effects: null,2779 provides: parent ? parent.provides : Object.create(appContext.provides),2780 accessCache: null,2781 renderCache: [],2782 // local resovled assets2783 components: null,2784 directives: null,2785 // resolved props and emits options2786 propsOptions: normalizePropsOptions(type, appContext),2787 emitsOptions: normalizeEmitsOptions(type, appContext),2788 // emit2789 emit: null,2790 emitted: null,2791 // state2792 ctx: EMPTY_OBJ,2793 data: EMPTY_OBJ,2794 props: EMPTY_OBJ,2795 attrs: EMPTY_OBJ,2796 slots: EMPTY_OBJ,2797 refs: EMPTY_OBJ,2798 setupState: EMPTY_OBJ,2799 setupContext: null,2800 // suspense related2801 suspense, ...

Full Screen

Full Screen

jquery-3.6.0.min.js

Source:jquery-3.6.0.min.js Github

copy

Full Screen

...541 } else e.emitted = {};542 e.emitted[i] = !0, callWithAsyncErrorHandling(c, e, 6, o)543 }544}545function normalizeEmitsOptions(e, t, n = !1) {546 const r = t.emitsCache, o = r.get(e);547 if (void 0 !== o) return o;548 const s = e.emits;549 let a = {}, i = !1;550 if (!isFunction(e)) {551 const extendEmits = e => {552 const n = normalizeEmitsOptions(e, t, !0);553 n && (i = !0, b(a, n))554 };555 !n && t.mixins.length && t.mixins.forEach(extendEmits), e.extends && extendEmits(e.extends), e.mixins && e.mixins.forEach(extendEmits)556 }557 return s || i ? (w(s) ? s.forEach((e => a[e] = null)) : b(a, s), r.set(e, a), a) : (r.set(e, null), null)558}559function isEmitListener(e, t) {560 return !(!e || !isOn(t)) && (t = t.slice(2).replace(/Once$/, ""), hasOwn(e, t[0].toLowerCase() + t.slice(1)) || hasOwn(e, C(t)) || hasOwn(e, t))561}562let be = null, Re = null;563function setCurrentRenderingInstance(e) {564 const t = be;565 return be = e, Re = e && e.type.__scopeId || null, t566}567function pushScopeId(e) {568 Re = e569}570function popScopeId() {571 Re = null572}573const withScopeId = e => withCtx;574function withCtx(e, t = be, n) {575 if (!t) return e;576 if (e._n) return e;577 const renderFnWithContext = (...n) => {578 renderFnWithContext._d && setBlockTracking(-1);579 const r = setCurrentRenderingInstance(t), o = e(...n);580 return setCurrentRenderingInstance(r), renderFnWithContext._d && setBlockTracking(1), o581 };582 return renderFnWithContext._n = !0, renderFnWithContext._c = !0, renderFnWithContext._d = !0, renderFnWithContext583}584function renderComponentRoot(e) {585 const {586 type: t,587 vnode: n,588 proxy: r,589 withProxy: o,590 props: s,591 propsOptions: [a],592 slots: i,593 attrs: l,594 emit: c,595 render: u,596 renderCache: f,597 data: p,598 setupState: d,599 ctx: m,600 inheritAttrs: g601 } = e;602 let v;603 const y = setCurrentRenderingInstance(e);604 try {605 let e;606 if (4 & n.shapeFlag) {607 const t = o || r;608 v = normalizeVNode(u.call(t, t, f, s, d, p, m)), e = l609 } else {610 const n = t;611 0, v = normalizeVNode(n.length > 1 ? n(s, {612 attrs: l,613 slots: i,614 emit: c615 }) : n(s, null)), e = t.props ? l : getFunctionalFallthrough(l)616 }617 let y = v;618 if (e && !1 !== g) {619 const t = Object.keys(e), {shapeFlag: n} = y;620 t.length && (1 & n || 6 & n) && (a && t.some(isModelListener) && (e = filterModelListeners(e, a)), y = cloneVNode(y, e))621 }622 0, n.dirs && (y.dirs = y.dirs ? y.dirs.concat(n.dirs) : n.dirs), n.transition && (y.transition = n.transition), v = y623 } catch (b) {624 ze.length = 0, handleError(b, e, 1), v = De(He)625 }626 return setCurrentRenderingInstance(y), v627}628const getFunctionalFallthrough = e => {629 let t;630 for (const n in e) ("class" === n || "style" === n || isOn(n)) && ((t || (t = {}))[n] = e[n]);631 return t632}, filterModelListeners = (e, t) => {633 const n = {};634 for (const r in e) isModelListener(r) && r.slice(9) in t || (n[r] = e[r]);635 return n636};637function hasPropsChanged(e, t, n) {638 const r = Object.keys(t);639 if (r.length !== Object.keys(e).length) return !0;640 for (let o = 0; o < r.length; o++) {641 const s = r[o];642 if (t[s] !== e[s] && !isEmitListener(n, s)) return !0643 }644 return !1645}646function provide(e, t) {647 if (Ye) {648 let n = Ye.provides;649 const r = Ye.parent && Ye.parent.provides;650 r === n && (n = Ye.provides = Object.create(r)), n[e] = t651 } else ;652}653function inject(e, t, n = !1) {654 const r = Ye || be;655 if (r) {656 const o = null == r.parent ? r.vnode.appContext && r.vnode.appContext.provides : r.parent.provides;657 if (o && e in o) return o[e];658 if (arguments.length > 1) return n && isFunction(t) ? t.call(r.proxy) : t659 }660}661const we = {};662function watch(e, t, n) {663 return doWatch(e, t, n)664}665function doWatch(e, t, {immediate: n, deep: r, flush: o, onTrack: s, onTrigger: a} = g, i = Ye) {666 let l, c, u = !1, f = !1;667 if (isRef(e) ? (l = () => e.value, u = !!e._shallow) : isReactive(e) ? (l = () => e, r = !0) : w(e) ? (f = !0, u = e.some(isReactive), l = () => e.map((e => isRef(e) ? e.value : isReactive(e) ? traverse(e) : isFunction(e) ? callWithErrorHandling(e, i, 2) : void 0))) : l = isFunction(e) ? t ? () => callWithErrorHandling(e, i, 2) : () => {668 if (!i || !i.isUnmounted) return c && c(), callWithAsyncErrorHandling(e, i, 3, [onInvalidate])669 } : NOOP, t && r) {670 const e = l;671 l = () => traverse(e())672 }673 let onInvalidate = e => {674 c = m.options.onStop = () => {675 callWithErrorHandling(e, i, 4)676 }677 }, p = f ? [] : we;678 const job = () => {679 if (m.active) if (t) {680 const e = m();681 (r || u || (f ? e.some(((e, t) => hasChanged(e, p[t]))) : hasChanged(e, p))) && (c && c(), callWithAsyncErrorHandling(t, i, 3, [e, p === we ? void 0 : p, onInvalidate]), p = e)682 } else m()683 };684 let d;685 job.allowRecurse = !!t, d = "sync" === o ? job : "post" === o ? () => Me(job, i && i.suspense) : () => {686 !i || i.isMounted ? function queuePreFlushCb(e) {687 queueCb(e, fe, ue, pe)688 }(job) : job()689 };690 const m = effect(l, {lazy: !0, onTrack: s, onTrigger: a, scheduler: d});691 return recordInstanceBoundEffect(m, i), t ? n ? job() : p = m() : "post" === o ? Me(m, i && i.suspense) : m(), () => {692 stop(m), i && remove(i.effects, m)693 }694}695function instanceWatch(e, t, n) {696 const r = this.proxy, o = isString$1(e) ? e.includes(".") ? createPathGetter(r, e) : () => r[e] : e.bind(r, r);697 let s;698 return isFunction(t) ? s = t : (s = t.handler, n = t), doWatch(o, s.bind(r), n, this)699}700function createPathGetter(e, t) {701 const n = t.split(".");702 return () => {703 let t = e;704 for (let e = 0; e < n.length && t; e++) t = t[n[e]];705 return t706 }707}708function traverse(e, t = new Set) {709 if (!isObject(e) || t.has(e) || e.__v_skip) return e;710 if (t.add(e), isRef(e)) traverse(e.value, t); else if (w(e)) for (let n = 0; n < e.length; n++) traverse(e[n], t); else if (isSet(e) || isMap(e)) e.forEach((e => {711 traverse(e, t)712 })); else if (isPlainObject(e)) for (const n in e) traverse(e[n], t);713 return e714}715function defineComponent(e) {716 return isFunction(e) ? {setup: e, name: e.name} : e717}718const isAsyncWrapper = e => !!e.type.__asyncLoader;719function defineAsyncComponent(e) {720 isFunction(e) && (e = {loader: e});721 const {722 loader: t,723 loadingComponent: n,724 errorComponent: r,725 delay: o = 200,726 timeout: s,727 suspensible: a = !0,728 onError: i729 } = e;730 let l, c = null, u = 0;731 const load = () => {732 let e;733 return c || (e = c = t().catch((e => {734 if (e = e instanceof Error ? e : new Error(String(e)), i) return new Promise(((t, n) => {735 i(e, (() => t((u++, c = null, load()))), (() => n(e)), u + 1)736 }));737 throw e738 })).then((t => e !== c && c ? c : (t && (t.__esModule || "Module" === t[Symbol.toStringTag]) && (t = t.default), l = t, t))))739 };740 return defineComponent({741 name: "AsyncComponentWrapper", __asyncLoader: load, get __asyncResolved() {742 return l743 }, setup() {744 const e = Ye;745 if (l) return () => createInnerComp(l, e);746 const onError = t => {747 c = null, handleError(t, e, 13, !r)748 };749 if (a && e.suspense) return load().then((t => () => createInnerComp(t, e))).catch((e => (onError(e), () => r ? De(r, {error: e}) : null)));750 const t = ref(!1), i = ref(), u = ref(!!o);751 return o && setTimeout((() => {752 u.value = !1753 }), o), null != s && setTimeout((() => {754 if (!t.value && !i.value) {755 const e = new Error(`Async component timed out after ${s}ms.`);756 onError(e), i.value = e757 }758 }), s), load().then((() => {759 t.value = !0, e.parent && isKeepAlive(e.parent.vnode) && queueJob(e.parent.update)760 })).catch((e => {761 onError(e), i.value = e762 })), () => t.value && l ? createInnerComp(l, e) : i.value && r ? De(r, {error: i.value}) : n && !u.value ? De(n) : void 0763 }764 })765}766function createInnerComp(e, {vnode: {ref: t, props: n, children: r}}) {767 const o = De(e, n, r);768 return o.ref = t, o769}770const isKeepAlive = e => e.type.__isKeepAlive;771function onActivated(e, t) {772 registerKeepAliveHook(e, "a", t)773}774function onDeactivated(e, t) {775 registerKeepAliveHook(e, "da", t)776}777function registerKeepAliveHook(e, t, n = Ye) {778 const r = e.__wdc || (e.__wdc = () => {779 let t = n;780 for (; t;) {781 if (t.isDeactivated) return;782 t = t.parent783 }784 e()785 });786 if (injectHook(t, r, n), n) {787 let e = n.parent;788 for (; e && e.parent;) isKeepAlive(e.parent.vnode) && injectToKeepAliveRoot(r, t, n, e), e = e.parent789 }790}791function injectToKeepAliveRoot(e, t, n, r) {792 const o = injectHook(t, e, r, !0);793 Ce((() => {794 remove(r[t], o)795 }), n)796}797function injectHook(e, t, n = Ye, r = !1) {798 if (n) {799 const o = n[e] || (n[e] = []), s = t.__weh || (t.__weh = (...r) => {800 if (n.isUnmounted) return;801 pauseTracking(), setCurrentInstance(n);802 const o = callWithAsyncErrorHandling(t, n, e, r);803 return setCurrentInstance(null), resetTracking(), o804 });805 return r ? o.unshift(s) : o.push(s), s806 }807}808const createHook = e => (t, n = Ye) => (!Xe || "sp" === e) && injectHook(e, t, n), _e = createHook("bm"),809 ke = createHook("m"), xe = createHook("bu"), Se = createHook("u"), Ee = createHook("bum"), Ce = createHook("um"),810 Ae = createHook("sp"), Oe = createHook("rtg"), Pe = createHook("rtc");811function onErrorCaptured(e, t = Ye) {812 injectHook("ec", e, t)813}814let Te = !0;815function applyOptions(e) {816 const t = resolveMergedOptions(e), n = e.proxy, r = e.ctx;817 Te = !1, t.beforeCreate && callHook(t.beforeCreate, e, "bc");818 const {819 data: o,820 computed: s,821 methods: a,822 watch: i,823 provide: l,824 inject: c,825 created: u,826 beforeMount: f,827 mounted: p,828 beforeUpdate: d,829 updated: m,830 activated: v,831 deactivated: y,832 beforeDestroy: b,833 beforeUnmount: R,834 destroyed: _,835 unmounted: k,836 render: x,837 renderTracked: S,838 renderTriggered: E,839 errorCaptured: C,840 serverPrefetch: A,841 expose: O,842 inheritAttrs: P,843 components: T,844 directives: j,845 filters: N846 } = t;847 if (c && function resolveInjections(e, t, n = NOOP) {848 w(e) && (e = normalizeInject(e));849 for (const r in e) {850 const n = e[r];851 isObject(n) ? t[r] = "default" in n ? inject(n.from || r, n.default, !0) : inject(n.from || r) : t[r] = inject(n)852 }853 }(c, r, null), a) for (const g in a) {854 const e = a[g];855 isFunction(e) && (r[g] = e.bind(n))856 }857 if (o) {858 const t = o.call(n, n);859 isObject(t) && (e.data = reactive(t))860 }861 if (Te = !0, s) for (const g in s) {862 const e = s[g], t = computed({863 get: isFunction(e) ? e.bind(n, n) : isFunction(e.get) ? e.get.bind(n, n) : NOOP,864 set: !isFunction(e) && isFunction(e.set) ? e.set.bind(n) : NOOP865 });866 Object.defineProperty(r, g, {enumerable: !0, configurable: !0, get: () => t.value, set: e => t.value = e})867 }868 if (i) for (const g in i) createWatcher(i[g], r, n, g);869 if (l) {870 const e = isFunction(l) ? l.call(n) : l;871 Reflect.ownKeys(e).forEach((t => {872 provide(t, e[t])873 }))874 }875 function registerLifecycleHook(e, t) {876 w(t) ? t.forEach((t => e(t.bind(n)))) : t && e(t.bind(n))877 }878 if (u && callHook(u, e, "c"), registerLifecycleHook(_e, f), registerLifecycleHook(ke, p), registerLifecycleHook(xe, d), registerLifecycleHook(Se, m), registerLifecycleHook(onActivated, v), registerLifecycleHook(onDeactivated, y), registerLifecycleHook(onErrorCaptured, C), registerLifecycleHook(Pe, S), registerLifecycleHook(Oe, E), registerLifecycleHook(Ee, R), registerLifecycleHook(Ce, k), registerLifecycleHook(Ae, A), w(O)) if (O.length) {879 const t = e.exposed || (e.exposed = proxyRefs({}));880 O.forEach((e => {881 t[e] = function toRef(e, t) {882 return isRef(e[t]) ? e[t] : new ObjectRefImpl(e, t)883 }(n, e)884 }))885 } else e.exposed || (e.exposed = g);886 x && e.render === NOOP && (e.render = x), null != P && (e.inheritAttrs = P), T && (e.components = T), j && (e.directives = j)887}888function callHook(e, t, n) {889 callWithAsyncErrorHandling(w(e) ? e.map((e => e.bind(t.proxy))) : e.bind(t.proxy), t, n)890}891function createWatcher(e, t, n, r) {892 const o = r.includes(".") ? createPathGetter(n, r) : () => n[r];893 if (isString$1(e)) {894 const n = t[e];895 isFunction(n) && watch(o, n)896 } else if (isFunction(e)) watch(o, e.bind(n)); else if (isObject(e)) if (w(e)) e.forEach((e => createWatcher(e, t, n, r))); else {897 const r = isFunction(e.handler) ? e.handler.bind(n) : t[e.handler];898 isFunction(r) && watch(o, r, e)899 }900}901function resolveMergedOptions(e) {902 const t = e.type, {mixins: n, extends: r} = t, {903 mixins: o,904 optionsCache: s,905 config: {optionMergeStrategies: a}906 } = e.appContext, i = s.get(t);907 let l;908 return i ? l = i : o.length || n || r ? (l = {}, o.length && o.forEach((e => mergeOptions$1(l, e, a, !0))), mergeOptions$1(l, t, a)) : l = t, s.set(t, l), l909}910function mergeOptions$1(e, t, n, r = !1) {911 const {mixins: o, extends: s} = t;912 s && mergeOptions$1(e, s, n, !0), o && o.forEach((t => mergeOptions$1(e, t, n, !0)));913 for (const a in t) if (r && "expose" === a) ; else {914 const r = je[a] || n && n[a];915 e[a] = r ? r(e[a], t[a]) : t[a]916 }917 return e918}919const je = {920 data: mergeDataFn,921 props: mergeObjectOptions,922 emits: mergeObjectOptions,923 methods: mergeObjectOptions,924 computed: mergeObjectOptions,925 beforeCreate: mergeAsArray,926 created: mergeAsArray,927 beforeMount: mergeAsArray,928 mounted: mergeAsArray,929 beforeUpdate: mergeAsArray,930 updated: mergeAsArray,931 beforeDestroy: mergeAsArray,932 destroyed: mergeAsArray,933 activated: mergeAsArray,934 deactivated: mergeAsArray,935 errorCaptured: mergeAsArray,936 serverPrefetch: mergeAsArray,937 components: mergeObjectOptions,938 directives: mergeObjectOptions,939 watch: function mergeWatchOptions(e, t) {940 if (!e) return t;941 if (!t) return e;942 const n = b(Object.create(null), e);943 for (const r in t) n[r] = mergeAsArray(e[r], t[r]);944 return n945 },946 provide: mergeDataFn,947 inject: function mergeInject(e, t) {948 return mergeObjectOptions(normalizeInject(e), normalizeInject(t))949 }950};951function mergeDataFn(e, t) {952 return t ? e ? function mergedDataFn() {953 return b(isFunction(e) ? e.call(this, this) : e, isFunction(t) ? t.call(this, this) : t)954 } : t : e955}956function normalizeInject(e) {957 if (w(e)) {958 const t = {};959 for (let n = 0; n < e.length; n++) t[e[n]] = e[n];960 return t961 }962 return e963}964function mergeAsArray(e, t) {965 return e ? [...new Set([].concat(e, t))] : t966}967function mergeObjectOptions(e, t) {968 return e ? b(b(Object.create(null), e), t) : t969}970function initProps(e, t, n, r = !1) {971 const o = {}, s = {};972 def(s, Ue, 1), e.propsDefaults = Object.create(null), setFullProps(e, t, o, s);973 for (const a in e.propsOptions[0]) a in o || (o[a] = void 0);974 n ? e.props = r ? o : function shallowReactive(e) {975 return createReactiveObject(e, !1, q, Z, ne)976 }(o) : e.type.props ? e.props = o : e.props = s, e.attrs = s977}978function setFullProps(e, t, n, r) {979 const [o, s] = e.propsOptions;980 let a, i = !1;981 if (t) for (let l in t) {982 if (k(l)) continue;983 const c = t[l];984 let u;985 o && hasOwn(o, u = S(l)) ? s && s.includes(u) ? (a || (a = {}))[u] = c : n[u] = c : isEmitListener(e.emitsOptions, l) || c !== r[l] && (r[l] = c, i = !0)986 }987 if (s) {988 const t = toRaw(n), r = a || g;989 for (let a = 0; a < s.length; a++) {990 const i = s[a];991 n[i] = resolvePropValue(o, t, i, r[i], e, !hasOwn(r, i))992 }993 }994 return i995}996function resolvePropValue(e, t, n, r, o, s) {997 const a = e[n];998 if (null != a) {999 const e = hasOwn(a, "default");1000 if (e && void 0 === r) {1001 const e = a.default;1002 if (a.type !== Function && isFunction(e)) {1003 const {propsDefaults: s} = o;1004 n in s ? r = s[n] : (setCurrentInstance(o), r = s[n] = e.call(null, t), setCurrentInstance(null))1005 } else r = e1006 }1007 a[0] && (s && !e ? r = !1 : !a[1] || "" !== r && r !== C(n) || (r = !0))1008 }1009 return r1010}1011function normalizePropsOptions(e, t, n = !1) {1012 const r = t.propsCache, o = r.get(e);1013 if (o) return o;1014 const s = e.props, a = {}, i = [];1015 let l = !1;1016 if (!isFunction(e)) {1017 const extendProps = e => {1018 l = !0;1019 const [n, r] = normalizePropsOptions(e, t, !0);1020 b(a, n), r && i.push(...r)1021 };1022 !n && t.mixins.length && t.mixins.forEach(extendProps), e.extends && extendProps(e.extends), e.mixins && e.mixins.forEach(extendProps)1023 }1024 if (!s && !l) return r.set(e, v), v;1025 if (w(s)) for (let u = 0; u < s.length; u++) {1026 const e = S(s[u]);1027 validatePropName(e) && (a[e] = g)1028 } else if (s) for (const u in s) {1029 const e = S(u);1030 if (validatePropName(e)) {1031 const t = s[u], n = a[e] = w(t) || isFunction(t) ? {type: t} : t;1032 if (n) {1033 const t = getTypeIndex(Boolean, n.type), r = getTypeIndex(String, n.type);1034 n[0] = t > -1, n[1] = r < 0 || t < r, (t > -1 || hasOwn(n, "default")) && i.push(e)1035 }1036 }1037 }1038 const c = [a, i];1039 return r.set(e, c), c1040}1041function validatePropName(e) {1042 return "$" !== e[0]1043}1044function getType(e) {1045 const t = e && e.toString().match(/^\s*function (\w+)/);1046 return t ? t[1] : ""1047}1048function isSameType(e, t) {1049 return getType(e) === getType(t)1050}1051function getTypeIndex(e, t) {1052 return w(t) ? t.findIndex((t => isSameType(t, e))) : isFunction(t) && isSameType(t, e) ? 0 : -11053}1054const isInternalKey = e => "_" === e[0] || "$stable" === e,1055 normalizeSlotValue = e => w(e) ? e.map(normalizeVNode) : [normalizeVNode(e)], normalizeSlot$1 = (e, t, n) => {1056 const r = withCtx((e => normalizeSlotValue(t(e))), n);1057 return r._c = !1, r1058 }, normalizeObjectSlots = (e, t, n) => {1059 const r = e._ctx;1060 for (const o in e) {1061 if (isInternalKey(o)) continue;1062 const n = e[o];1063 if (isFunction(n)) t[o] = normalizeSlot$1(0, n, r); else if (null != n) {1064 const e = normalizeSlotValue(n);1065 t[o] = () => e1066 }1067 }1068 }, normalizeVNodeSlots = (e, t) => {1069 const n = normalizeSlotValue(t);1070 e.slots.default = () => n1071 };1072function withDirectives(e, t) {1073 if (null === be) return e;1074 const n = be.proxy, r = e.dirs || (e.dirs = []);1075 for (let o = 0; o < t.length; o++) {1076 let [e, s, a, i = g] = t[o];1077 isFunction(e) && (e = {mounted: e, updated: e}), r.push({1078 dir: e,1079 instance: n,1080 value: s,1081 oldValue: void 0,1082 arg: a,1083 modifiers: i1084 })1085 }1086 return e1087}1088function invokeDirectiveHook(e, t, n, r) {1089 const o = e.dirs, s = t && t.dirs;1090 for (let a = 0; a < o.length; a++) {1091 const i = o[a];1092 s && (i.oldValue = s[a].value);1093 let l = i.dir[r];1094 l && (pauseTracking(), callWithAsyncErrorHandling(l, n, 8, [e.el, i, e, t]), resetTracking())1095 }1096}1097function createAppContext() {1098 return {1099 app: null,1100 config: {1101 isNativeTag: NO,1102 performance: !1,1103 globalProperties: {},1104 optionMergeStrategies: {},1105 errorHandler: void 0,1106 warnHandler: void 0,1107 compilerOptions: {}1108 },1109 mixins: [],1110 components: {},1111 directives: {},1112 provides: Object.create(null),1113 optionsCache: new WeakMap,1114 propsCache: new WeakMap,1115 emitsCache: new WeakMap1116 }1117}1118let Ne = 0;1119function createAppAPI(e, t) {1120 return function createApp2(n, r = null) {1121 null == r || isObject(r) || (r = null);1122 const o = createAppContext(), s = new Set;1123 let a = !1;1124 const i = o.app = {1125 _uid: Ne++,1126 _component: n,1127 _props: r,1128 _container: null,1129 _context: o,1130 _instance: null,1131 version: Ze,1132 get config() {1133 return o.config1134 },1135 set config(e) {1136 },1137 use: (e, ...t) => (s.has(e) || (e && isFunction(e.install) ? (s.add(e), e.install(i, ...t)) : isFunction(e) && (s.add(e), e(i, ...t))), i),1138 mixin: e => (o.mixins.includes(e) || o.mixins.push(e), i),1139 component: (e, t) => t ? (o.components[e] = t, i) : o.components[e],1140 directive: (e, t) => t ? (o.directives[e] = t, i) : o.directives[e],1141 mount(s, l, c) {1142 if (!a) {1143 const u = De(n, r);1144 return u.appContext = o, l && t ? t(u, s) : e(u, s, c), a = !0, i._container = s, s.__vue_app__ = i, u.component.proxy1145 }1146 },1147 unmount() {1148 a && (e(null, i._container), delete i._container.__vue_app__)1149 },1150 provide: (e, t) => (o.provides[e] = t, i)1151 };1152 return i1153 }1154}1155const Ie = {scheduler: queueJob, allowRecurse: !0}, Me = function queueEffectWithSuspense(e, t) {1156 t && t.pendingBranch ? w(e) ? t.effects.push(...e) : t.effects.push(e) : function queuePostFlushCb(e) {1157 queueCb(e, he, de, me)1158 }(e)1159}, setRef = (e, t, n, r, o = !1) => {1160 if (w(e)) return void e.forEach(((e, s) => setRef(e, t && (w(t) ? t[s] : t), n, r, o)));1161 if (isAsyncWrapper(r) && !o) return;1162 const s = 4 & r.shapeFlag ? r.component.exposed || r.component.proxy : r.el, a = o ? null : s, {i, r: l} = e,1163 c = t && t.r, u = i.refs === g ? i.refs = {} : i.refs, f = i.setupState;1164 if (null != c && c !== l && (isString$1(c) ? (u[c] = null, hasOwn(f, c) && (f[c] = null)) : isRef(c) && (c.value = null)), isString$1(l)) {1165 const doSet = () => {1166 u[l] = a, hasOwn(f, l) && (f[l] = a)1167 };1168 a ? (doSet.id = -1, Me(doSet, n)) : doSet()1169 } else if (isRef(l)) {1170 const doSet = () => {1171 l.value = a1172 };1173 a ? (doSet.id = -1, Me(doSet, n)) : doSet()1174 } else isFunction(l) && callWithErrorHandling(l, i, 12, [a, u])1175};1176function createRenderer(e) {1177 return function baseCreateRenderer(e, t) {1178 const {1179 insert: n,1180 remove: r,1181 patchProp: o,1182 forcePatchProp: s,1183 createElement: a,1184 createText: i,1185 createComment: l,1186 setText: c,1187 setElementText: u,1188 parentNode: f,1189 nextSibling: p,1190 setScopeId: d = NOOP,1191 cloneNode: m,1192 insertStaticContent: y1193 } = e, patch = (e, t, n, r = null, o = null, s = null, a = !1, i = null, l = !1) => {1194 e && !isSameVNodeType(e, t) && (r = getNextHostNode(e), unmount(e, o, s, !0), e = null), -2 === t.patchFlag && (l = !1, t.dynamicChildren = null);1195 const {type: c, ref: u, shapeFlag: f} = t;1196 switch (c) {1197 case Ve:1198 processText(e, t, n, r);1199 break;1200 case He:1201 processCommentNode(e, t, n, r);1202 break;1203 case Be:1204 null == e && mountStaticNode(t, n, r, a);1205 break;1206 case Le:1207 processFragment(e, t, n, r, o, s, a, i, l);1208 break;1209 default:1210 1 & f ? processElement(e, t, n, r, o, s, a, i, l) : 6 & f ? processComponent(e, t, n, r, o, s, a, i, l) : (64 & f || 128 & f) && c.process(e, t, n, r, o, s, a, i, l, R)1211 }1212 null != u && o && setRef(u, e && e.ref, s, t || e, !t)1213 }, processText = (e, t, r, o) => {1214 if (null == e) n(t.el = i(t.children), r, o); else {1215 const n = t.el = e.el;1216 t.children !== e.children && c(n, t.children)1217 }1218 }, processCommentNode = (e, t, r, o) => {1219 null == e ? n(t.el = l(t.children || ""), r, o) : t.el = e.el1220 }, mountStaticNode = (e, t, n, r) => {1221 [e.el, e.anchor] = y(e.children, t, n, r, e.el && [e.el, e.anchor])1222 }, moveStaticNode = ({el: e, anchor: t}, r, o) => {1223 let s;1224 for (; e && e !== t;) s = p(e), n(e, r, o), e = s;1225 n(t, r, o)1226 }, removeStaticNode = ({el: e, anchor: t}) => {1227 let n;1228 for (; e && e !== t;) n = p(e), r(e), e = n;1229 r(t)1230 }, processElement = (e, t, n, r, o, s, a, i, l) => {1231 a = a || "svg" === t.type, null == e ? mountElement(t, n, r, o, s, a, i, l) : patchElement(e, t, o, s, a, i, l)1232 }, mountElement = (e, t, r, s, i, l, c, f) => {1233 let p, d;1234 const {type: g, props: v, shapeFlag: y, transition: b, patchFlag: R, dirs: w} = e;1235 if (e.el && void 0 !== m && -1 === R) p = e.el = m(e.el); else {1236 if (p = e.el = a(e.type, l, v && v.is, v), 8 & y ? u(p, e.children) : 16 & y && mountChildren(e.children, p, null, s, i, l && "foreignObject" !== g, c, f || !!e.dynamicChildren), w && invokeDirectiveHook(e, null, s, "created"), v) {1237 for (const t in v) k(t) || o(p, t, null, v[t], l, e.children, s, i, unmountChildren);1238 (d = v.onVnodeBeforeMount) && invokeVNodeHook(d, s, e)1239 }1240 setScopeId(p, e, e.scopeId, c, s)1241 }1242 w && invokeDirectiveHook(e, null, s, "beforeMount");1243 const _ = (!i || i && !i.pendingBranch) && b && !b.persisted;1244 _ && b.beforeEnter(p), n(p, t, r), ((d = v && v.onVnodeMounted) || _ || w) && Me((() => {1245 d && invokeVNodeHook(d, s, e), _ && b.enter(p), w && invokeDirectiveHook(e, null, s, "mounted")1246 }), i)1247 }, setScopeId = (e, t, n, r, o) => {1248 if (n && d(e, n), r) for (let s = 0; s < r.length; s++) d(e, r[s]);1249 if (o) {1250 if (t === o.subTree) {1251 const t = o.vnode;1252 setScopeId(e, t, t.scopeId, t.slotScopeIds, o.parent)1253 }1254 }1255 }, mountChildren = (e, t, n, r, o, s, a, i, l = 0) => {1256 for (let c = l; c < e.length; c++) {1257 const l = e[c] = i ? cloneIfMounted(e[c]) : normalizeVNode(e[c]);1258 patch(null, l, t, n, r, o, s, a, i)1259 }1260 }, patchElement = (e, t, n, r, a, i, l) => {1261 const c = t.el = e.el;1262 let {patchFlag: f, dynamicChildren: p, dirs: d} = t;1263 f |= 16 & e.patchFlag;1264 const m = e.props || g, v = t.props || g;1265 let y;1266 if ((y = v.onVnodeBeforeUpdate) && invokeVNodeHook(y, n, t, e), d && invokeDirectiveHook(t, e, n, "beforeUpdate"), f > 0) {1267 if (16 & f) patchProps(c, t, m, v, n, r, a); else if (2 & f && m.class !== v.class && o(c, "class", null, v.class, a), 4 & f && o(c, "style", m.style, v.style, a), 8 & f) {1268 const i = t.dynamicProps;1269 for (let t = 0; t < i.length; t++) {1270 const l = i[t], u = m[l], f = v[l];1271 (f !== u || s && s(c, l)) && o(c, l, u, f, a, e.children, n, r, unmountChildren)1272 }1273 }1274 1 & f && e.children !== t.children && u(c, t.children)1275 } else l || null != p || patchProps(c, t, m, v, n, r, a);1276 const b = a && "foreignObject" !== t.type;1277 p ? patchBlockChildren(e.dynamicChildren, p, c, n, r, b, i) : l || patchChildren(e, t, c, null, n, r, b, i, !1), ((y = v.onVnodeUpdated) || d) && Me((() => {1278 y && invokeVNodeHook(y, n, t, e), d && invokeDirectiveHook(t, e, n, "updated")1279 }), r)1280 }, patchBlockChildren = (e, t, n, r, o, s, a) => {1281 for (let i = 0; i < t.length; i++) {1282 const l = e[i], c = t[i],1283 u = l.el && (l.type === Le || !isSameVNodeType(l, c) || 6 & l.shapeFlag || 64 & l.shapeFlag) ? f(l.el) : n;1284 patch(l, c, u, null, r, o, s, a, !0)1285 }1286 }, patchProps = (e, t, n, r, a, i, l) => {1287 if (n !== r) {1288 for (const c in r) {1289 if (k(c)) continue;1290 const u = r[c], f = n[c];1291 (u !== f || s && s(e, c)) && o(e, c, f, u, l, t.children, a, i, unmountChildren)1292 }1293 if (n !== g) for (const s in n) k(s) || s in r || o(e, s, n[s], null, l, t.children, a, i, unmountChildren)1294 }1295 }, processFragment = (e, t, r, o, s, a, l, c, u) => {1296 const f = t.el = e ? e.el : i(""), p = t.anchor = e ? e.anchor : i("");1297 let {patchFlag: d, dynamicChildren: m, slotScopeIds: g} = t;1298 m && (u = !0), g && (c = c ? c.concat(g) : g), null == e ? (n(f, r, o), n(p, r, o), mountChildren(t.children, r, p, s, a, l, c, u)) : d > 0 && 64 & d && m && e.dynamicChildren ? (patchBlockChildren(e.dynamicChildren, m, r, s, a, l, c), (null != t.key || s && t === s.subTree) && traverseStaticChildren(e, t, !0)) : patchChildren(e, t, r, p, s, a, l, c, u)1299 }, processComponent = (e, t, n, r, o, s, a, i, l) => {1300 t.slotScopeIds = i, null == e ? 512 & t.shapeFlag ? o.ctx.activate(t, n, r, a, l) : mountComponent(t, n, r, o, s, a, l) : updateComponent(e, t, l)1301 }, mountComponent = (e, t, n, r, o, s, a) => {1302 const i = e.component = function createComponentInstance(e, t, n) {1303 const r = e.type, o = (t ? t.appContext : e.appContext) || Qe, s = {1304 uid: Je++,1305 vnode: e,1306 type: r,1307 parent: t,1308 appContext: o,1309 root: null,1310 next: null,1311 subTree: null,1312 update: null,1313 render: null,1314 proxy: null,1315 exposed: null,1316 withProxy: null,1317 effects: null,1318 provides: t ? t.provides : Object.create(o.provides),1319 accessCache: null,1320 renderCache: [],1321 components: null,1322 directives: null,1323 propsOptions: normalizePropsOptions(r, o),1324 emitsOptions: normalizeEmitsOptions(r, o),1325 emit: null,1326 emitted: null,1327 propsDefaults: g,1328 inheritAttrs: r.inheritAttrs,1329 ctx: g,1330 data: g,1331 props: g,1332 attrs: g,1333 slots: g,1334 refs: g,1335 setupState: g,1336 setupContext: null,1337 suspense: n,1338 suspenseId: n ? n.pendingId : 0,...

Full Screen

Full Screen

index.147aad71.js

Source:index.147aad71.js Github

copy

Full Screen

...1032 }1033 callWithAsyncErrorHandling(onceHandler, instance, 6, args);1034 }1035}1036function normalizeEmitsOptions(comp, appContext, asMixin = false) {1037 if (!appContext.deopt && comp.__emits !== void 0) {1038 return comp.__emits;1039 }1040 const raw = comp.emits;1041 let normalized = {};1042 let hasExtends = false;1043 if (!isFunction(comp)) {1044 const extendEmits = (raw2) => {1045 hasExtends = true;1046 extend(normalized, normalizeEmitsOptions(raw2, appContext, true));1047 };1048 if (!asMixin && appContext.mixins.length) {1049 appContext.mixins.forEach(extendEmits);1050 }1051 if (comp.extends) {1052 extendEmits(comp.extends);1053 }1054 if (comp.mixins) {1055 comp.mixins.forEach(extendEmits);1056 }1057 }1058 if (!raw && !hasExtends) {1059 return comp.__emits = null;1060 }1061 if (isArray(raw)) {1062 raw.forEach((key) => normalized[key] = null);1063 } else {1064 extend(normalized, raw);1065 }1066 return comp.__emits = normalized;1067}1068function isEmitListener(options, key) {1069 if (!options || !isOn(key)) {1070 return false;1071 }1072 key = key.replace(/Once$/, "");1073 return hasOwn(options, key[2].toLowerCase() + key.slice(3)) || hasOwn(options, key.slice(2));1074}1075let currentRenderingInstance = null;1076function setCurrentRenderingInstance(instance) {1077 currentRenderingInstance = instance;1078}1079let accessedAttrs = false;1080function markAttrsAccessed() {1081 accessedAttrs = true;1082}1083function renderComponentRoot(instance) {1084 const {type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit: emit2, render: render2, renderCache, data, setupState, ctx} = instance;1085 let result;1086 currentRenderingInstance = instance;1087 try {1088 let fallthroughAttrs;1089 if (vnode.shapeFlag & 4) {1090 const proxyToUse = withProxy || proxy;1091 result = normalizeVNode(render2.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx));1092 fallthroughAttrs = attrs;1093 } else {1094 const render3 = Component;1095 if (false)1096 ;1097 result = normalizeVNode(render3.length > 1 ? render3(props, {attrs, slots, emit: emit2}) : render3(props, null));1098 fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);1099 }1100 let root = result;1101 let setRoot = void 0;1102 if (false)1103 ;1104 if (Component.inheritAttrs !== false && fallthroughAttrs) {1105 const keys = Object.keys(fallthroughAttrs);1106 const {shapeFlag} = root;1107 if (keys.length) {1108 if (shapeFlag & 1 || shapeFlag & 6) {1109 if (propsOptions && keys.some(isModelListener)) {1110 fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);1111 }1112 root = cloneVNode(root, fallthroughAttrs);1113 } else if (false)1114 ;1115 }1116 }1117 if (vnode.dirs) {1118 if (false)1119 ;1120 root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;1121 }1122 if (vnode.transition) {1123 if (false)1124 ;1125 root.transition = vnode.transition;1126 }1127 if (false)1128 ;1129 else {1130 result = root;1131 }1132 } catch (err) {1133 handleError(err, instance, 1);1134 result = createVNode(Comment);1135 }1136 currentRenderingInstance = null;1137 return result;1138}1139const getChildRoot = (vnode) => {1140 if (vnode.type !== Fragment) {1141 return [vnode, void 0];1142 }1143 const rawChildren = vnode.children;1144 const dynamicChildren = vnode.dynamicChildren;1145 const childRoot = filterSingleRoot(rawChildren);1146 if (!childRoot) {1147 return [vnode, void 0];1148 }1149 const index = rawChildren.indexOf(childRoot);1150 const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;1151 const setRoot = (updatedRoot) => {1152 rawChildren[index] = updatedRoot;1153 if (dynamicChildren) {1154 if (dynamicIndex > -1) {1155 dynamicChildren[dynamicIndex] = updatedRoot;1156 } else if (updatedRoot.patchFlag > 0) {1157 vnode.dynamicChildren = [...dynamicChildren, updatedRoot];1158 }1159 }1160 };1161 return [normalizeVNode(childRoot), setRoot];1162};1163function filterSingleRoot(children) {1164 const filtered = children.filter((child) => {1165 return !(isVNode(child) && child.type === Comment && child.children !== "v-if");1166 });1167 return filtered.length === 1 && isVNode(filtered[0]) ? filtered[0] : null;1168}1169const getFunctionalFallthrough = (attrs) => {1170 let res;1171 for (const key in attrs) {1172 if (key === "class" || key === "style" || isOn(key)) {1173 (res || (res = {}))[key] = attrs[key];1174 }1175 }1176 return res;1177};1178const filterModelListeners = (attrs, props) => {1179 const res = {};1180 for (const key in attrs) {1181 if (!isModelListener(key) || !(key.slice(9) in props)) {1182 res[key] = attrs[key];1183 }1184 }1185 return res;1186};1187const isElementRoot = (vnode) => {1188 return vnode.shapeFlag & 6 || vnode.shapeFlag & 1 || vnode.type === Comment;1189};1190function shouldUpdateComponent(prevVNode, nextVNode, optimized) {1191 const {props: prevProps, children: prevChildren, component} = prevVNode;1192 const {props: nextProps, children: nextChildren, patchFlag} = nextVNode;1193 const emits = component.emitsOptions;1194 if (nextVNode.dirs || nextVNode.transition) {1195 return true;1196 }1197 if (optimized && patchFlag > 0) {1198 if (patchFlag & 1024) {1199 return true;1200 }1201 if (patchFlag & 16) {1202 if (!prevProps) {1203 return !!nextProps;1204 }1205 return hasPropsChanged(prevProps, nextProps, emits);1206 } else if (patchFlag & 8) {1207 const dynamicProps = nextVNode.dynamicProps;1208 for (let i = 0; i < dynamicProps.length; i++) {1209 const key = dynamicProps[i];1210 if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {1211 return true;1212 }1213 }1214 }1215 } else {1216 if (prevChildren || nextChildren) {1217 if (!nextChildren || !nextChildren.$stable) {1218 return true;1219 }1220 }1221 if (prevProps === nextProps) {1222 return false;1223 }1224 if (!prevProps) {1225 return !!nextProps;1226 }1227 if (!nextProps) {1228 return true;1229 }1230 return hasPropsChanged(prevProps, nextProps, emits);1231 }1232 return false;1233}1234function hasPropsChanged(prevProps, nextProps, emitsOptions) {1235 const nextKeys = Object.keys(nextProps);1236 if (nextKeys.length !== Object.keys(prevProps).length) {1237 return true;1238 }1239 for (let i = 0; i < nextKeys.length; i++) {1240 const key = nextKeys[i];1241 if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {1242 return true;1243 }1244 }1245 return false;1246}1247function updateHOCHostEl({vnode, parent}, el) {1248 while (parent && parent.subTree === vnode) {1249 (vnode = parent.vnode).el = el;1250 parent = parent.parent;1251 }1252}1253const isSuspense = (type) => type.__isSuspense;1254function normalizeSuspenseChildren(vnode) {1255 const {shapeFlag, children} = vnode;1256 let content;1257 let fallback;1258 if (shapeFlag & 32) {1259 content = normalizeSuspenseSlot(children.default);1260 fallback = normalizeSuspenseSlot(children.fallback);1261 } else {1262 content = normalizeSuspenseSlot(children);1263 fallback = normalizeVNode(null);1264 }1265 return {1266 content,1267 fallback1268 };1269}1270function normalizeSuspenseSlot(s) {1271 if (isFunction(s)) {1272 s = s();1273 }1274 if (isArray(s)) {1275 const singleChild = filterSingleRoot(s);1276 s = singleChild;1277 }1278 return normalizeVNode(s);1279}1280function queueEffectWithSuspense(fn, suspense) {1281 if (suspense && suspense.pendingBranch) {1282 if (isArray(fn)) {1283 suspense.effects.push(...fn);1284 } else {1285 suspense.effects.push(fn);1286 }1287 } else {1288 queuePostFlushCb(fn);1289 }1290}1291let isRenderingCompiledSlot = 0;1292const setCompiledSlotRendering = (n) => isRenderingCompiledSlot += n;1293function renderSlot(slots, name, props = {}, fallback) {1294 let slot = slots[name];1295 isRenderingCompiledSlot++;1296 const rendered = (openBlock(), createBlock(Fragment, {key: props.key}, slot ? slot(props) : fallback ? fallback() : [], slots._ === 1 ? 64 : -2));1297 isRenderingCompiledSlot--;1298 return rendered;1299}1300function withCtx(fn, ctx = currentRenderingInstance) {1301 if (!ctx)1302 return fn;1303 const renderFnWithContext = (...args) => {1304 if (!isRenderingCompiledSlot) {1305 openBlock(true);1306 }1307 const owner = currentRenderingInstance;1308 setCurrentRenderingInstance(ctx);1309 const res = fn(...args);1310 setCurrentRenderingInstance(owner);1311 if (!isRenderingCompiledSlot) {1312 closeBlock();1313 }1314 return res;1315 };1316 renderFnWithContext._c = true;1317 return renderFnWithContext;1318}1319let currentScopeId = null;1320function initProps(instance, rawProps, isStateful, isSSR = false) {1321 const props = {};1322 const attrs = {};1323 def(attrs, InternalObjectKey, 1);1324 setFullProps(instance, rawProps, props, attrs);1325 if (isStateful) {1326 instance.props = isSSR ? props : shallowReactive(props);1327 } else {1328 if (!instance.type.props) {1329 instance.props = attrs;1330 } else {1331 instance.props = props;1332 }1333 }1334 instance.attrs = attrs;1335}1336function updateProps(instance, rawProps, rawPrevProps, optimized) {1337 const {props, attrs, vnode: {patchFlag}} = instance;1338 const rawCurrentProps = toRaw(props);1339 const [options] = instance.propsOptions;1340 if ((optimized || patchFlag > 0) && !(patchFlag & 16)) {1341 if (patchFlag & 8) {1342 const propsToUpdate = instance.vnode.dynamicProps;1343 for (let i = 0; i < propsToUpdate.length; i++) {1344 const key = propsToUpdate[i];1345 const value = rawProps[key];1346 if (options) {1347 if (hasOwn(attrs, key)) {1348 attrs[key] = value;1349 } else {1350 const camelizedKey = camelize(key);1351 props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance);1352 }1353 } else {1354 attrs[key] = value;1355 }1356 }1357 }1358 } else {1359 setFullProps(instance, rawProps, props, attrs);1360 let kebabKey;1361 for (const key in rawCurrentProps) {1362 if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {1363 if (options) {1364 if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) {1365 props[key] = resolvePropValue(options, rawProps || EMPTY_OBJ, key, void 0, instance);1366 }1367 } else {1368 delete props[key];1369 }1370 }1371 }1372 if (attrs !== rawCurrentProps) {1373 for (const key in attrs) {1374 if (!rawProps || !hasOwn(rawProps, key)) {1375 delete attrs[key];1376 }1377 }1378 }1379 }1380 trigger(instance, "set", "$attrs");1381}1382function setFullProps(instance, rawProps, props, attrs) {1383 const [options, needCastKeys] = instance.propsOptions;1384 if (rawProps) {1385 for (const key in rawProps) {1386 const value = rawProps[key];1387 if (isReservedProp(key)) {1388 continue;1389 }1390 let camelKey;1391 if (options && hasOwn(options, camelKey = camelize(key))) {1392 props[camelKey] = value;1393 } else if (!isEmitListener(instance.emitsOptions, key)) {1394 attrs[key] = value;1395 }1396 }1397 }1398 if (needCastKeys) {1399 const rawCurrentProps = toRaw(props);1400 for (let i = 0; i < needCastKeys.length; i++) {1401 const key = needCastKeys[i];1402 props[key] = resolvePropValue(options, rawCurrentProps, key, rawCurrentProps[key], instance);1403 }1404 }1405}1406function resolvePropValue(options, props, key, value, instance) {1407 const opt = options[key];1408 if (opt != null) {1409 const hasDefault = hasOwn(opt, "default");1410 if (hasDefault && value === void 0) {1411 const defaultValue = opt.default;1412 if (opt.type !== Function && isFunction(defaultValue)) {1413 setCurrentInstance(instance);1414 value = defaultValue(props);1415 setCurrentInstance(null);1416 } else {1417 value = defaultValue;1418 }1419 }1420 if (opt[0]) {1421 if (!hasOwn(props, key) && !hasDefault) {1422 value = false;1423 } else if (opt[1] && (value === "" || value === hyphenate(key))) {1424 value = true;1425 }1426 }1427 }1428 return value;1429}1430function normalizePropsOptions(comp, appContext, asMixin = false) {1431 if (!appContext.deopt && comp.__props) {1432 return comp.__props;1433 }1434 const raw = comp.props;1435 const normalized = {};1436 const needCastKeys = [];1437 let hasExtends = false;1438 if (!isFunction(comp)) {1439 const extendProps = (raw2) => {1440 hasExtends = true;1441 const [props, keys] = normalizePropsOptions(raw2, appContext, true);1442 extend(normalized, props);1443 if (keys)1444 needCastKeys.push(...keys);1445 };1446 if (!asMixin && appContext.mixins.length) {1447 appContext.mixins.forEach(extendProps);1448 }1449 if (comp.extends) {1450 extendProps(comp.extends);1451 }1452 if (comp.mixins) {1453 comp.mixins.forEach(extendProps);1454 }1455 }1456 if (!raw && !hasExtends) {1457 return comp.__props = EMPTY_ARR;1458 }1459 if (isArray(raw)) {1460 for (let i = 0; i < raw.length; i++) {1461 const normalizedKey = camelize(raw[i]);1462 if (validatePropName(normalizedKey)) {1463 normalized[normalizedKey] = EMPTY_OBJ;1464 }1465 }1466 } else if (raw) {1467 for (const key in raw) {1468 const normalizedKey = camelize(key);1469 if (validatePropName(normalizedKey)) {1470 const opt = raw[key];1471 const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? {type: opt} : opt;1472 if (prop) {1473 const booleanIndex = getTypeIndex(Boolean, prop.type);1474 const stringIndex = getTypeIndex(String, prop.type);1475 prop[0] = booleanIndex > -1;1476 prop[1] = stringIndex < 0 || booleanIndex < stringIndex;1477 if (booleanIndex > -1 || hasOwn(prop, "default")) {1478 needCastKeys.push(normalizedKey);1479 }1480 }1481 }1482 }1483 }1484 return comp.__props = [normalized, needCastKeys];1485}1486function validatePropName(key) {1487 if (key[0] !== "$") {1488 return true;1489 }1490 return false;1491}1492function getType(ctor) {1493 const match = ctor && ctor.toString().match(/^\s*function (\w+)/);1494 return match ? match[1] : "";1495}1496function isSameType(a, b) {1497 return getType(a) === getType(b);1498}1499function getTypeIndex(type, expectedTypes) {1500 if (isArray(expectedTypes)) {1501 for (let i = 0, len = expectedTypes.length; i < len; i++) {1502 if (isSameType(expectedTypes[i], type)) {1503 return i;1504 }1505 }1506 } else if (isFunction(expectedTypes)) {1507 return isSameType(expectedTypes, type) ? 0 : -1;1508 }1509 return -1;1510}1511function injectHook(type, hook, target = currentInstance, prepend = false) {1512 if (target) {1513 const hooks = target[type] || (target[type] = []);1514 const wrappedHook = hook.__weh || (hook.__weh = (...args) => {1515 if (target.isUnmounted) {1516 return;1517 }1518 pauseTracking();1519 setCurrentInstance(target);1520 const res = callWithAsyncErrorHandling(hook, target, type, args);1521 setCurrentInstance(null);1522 resetTracking();1523 return res;1524 });1525 if (prepend) {1526 hooks.unshift(wrappedHook);1527 } else {1528 hooks.push(wrappedHook);1529 }1530 return wrappedHook;1531 }1532}1533const createHook = (lifecycle) => (hook, target = currentInstance) => !isInSSRComponentSetup && injectHook(lifecycle, hook, target);1534const onBeforeMount = createHook("bm");1535const onMounted = createHook("m");1536const onBeforeUpdate = createHook("bu");1537const onUpdated = createHook("u");1538const onBeforeUnmount = createHook("bum");1539const onUnmounted = createHook("um");1540const onRenderTriggered = createHook("rtg");1541const onRenderTracked = createHook("rtc");1542const onErrorCaptured = (hook, target = currentInstance) => {1543 injectHook("ec", hook, target);1544};1545const INITIAL_WATCHER_VALUE = {};1546function watch(source, cb, options) {1547 return doWatch(source, cb, options);1548}1549function doWatch(source, cb, {immediate, deep, flush, onTrack, onTrigger} = EMPTY_OBJ, instance = currentInstance) {1550 let getter;1551 let forceTrigger = false;1552 if (isRef(source)) {1553 getter = () => source.value;1554 forceTrigger = !!source._shallow;1555 } else if (isReactive(source)) {1556 getter = () => source;1557 deep = true;1558 } else if (isArray(source)) {1559 getter = () => source.map((s) => {1560 if (isRef(s)) {1561 return s.value;1562 } else if (isReactive(s)) {1563 return traverse(s);1564 } else if (isFunction(s)) {1565 return callWithErrorHandling(s, instance, 2);1566 } else1567 ;1568 });1569 } else if (isFunction(source)) {1570 if (cb) {1571 getter = () => callWithErrorHandling(source, instance, 2);1572 } else {1573 getter = () => {1574 if (instance && instance.isUnmounted) {1575 return;1576 }1577 if (cleanup2) {1578 cleanup2();1579 }1580 return callWithErrorHandling(source, instance, 3, [onInvalidate]);1581 };1582 }1583 } else {1584 getter = NOOP;1585 }1586 if (cb && deep) {1587 const baseGetter = getter;1588 getter = () => traverse(baseGetter());1589 }1590 let cleanup2;1591 const onInvalidate = (fn) => {1592 cleanup2 = runner.options.onStop = () => {1593 callWithErrorHandling(fn, instance, 4);1594 };1595 };1596 let oldValue = isArray(source) ? [] : INITIAL_WATCHER_VALUE;1597 const job = () => {1598 if (!runner.active) {1599 return;1600 }1601 if (cb) {1602 const newValue = runner();1603 if (deep || forceTrigger || hasChanged(newValue, oldValue)) {1604 if (cleanup2) {1605 cleanup2();1606 }1607 callWithAsyncErrorHandling(cb, instance, 3, [1608 newValue,1609 oldValue === INITIAL_WATCHER_VALUE ? void 0 : oldValue,1610 onInvalidate1611 ]);1612 oldValue = newValue;1613 }1614 } else {1615 runner();1616 }1617 };1618 job.allowRecurse = !!cb;1619 let scheduler;1620 if (flush === "sync") {1621 scheduler = job;1622 } else if (flush === "post") {1623 scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);1624 } else {1625 scheduler = () => {1626 if (!instance || instance.isMounted) {1627 queuePreFlushCb(job);1628 } else {1629 job();1630 }1631 };1632 }1633 const runner = effect(getter, {1634 lazy: true,1635 onTrack,1636 onTrigger,1637 scheduler1638 });1639 recordInstanceBoundEffect(runner);1640 if (cb) {1641 if (immediate) {1642 job();1643 } else {1644 oldValue = runner();1645 }1646 } else if (flush === "post") {1647 queuePostRenderEffect(runner, instance && instance.suspense);1648 } else {1649 runner();1650 }1651 return () => {1652 stop(runner);1653 if (instance) {1654 remove(instance.effects, runner);1655 }1656 };1657}1658function instanceWatch(source, cb, options) {1659 const publicThis = this.proxy;1660 const getter = isString(source) ? () => publicThis[source] : source.bind(publicThis);1661 return doWatch(getter, cb.bind(publicThis), options, this);1662}1663function traverse(value, seen = new Set()) {1664 if (!isObject(value) || seen.has(value)) {1665 return value;1666 }1667 seen.add(value);1668 if (isRef(value)) {1669 traverse(value.value, seen);1670 } else if (isArray(value)) {1671 for (let i = 0; i < value.length; i++) {1672 traverse(value[i], seen);1673 }1674 } else if (isSet(value) || isMap(value)) {1675 value.forEach((v) => {1676 traverse(v, seen);1677 });1678 } else {1679 for (const key in value) {1680 traverse(value[key], seen);1681 }1682 }1683 return value;1684}1685const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;1686function onActivated(hook, target) {1687 registerKeepAliveHook(hook, "a", target);1688}1689function onDeactivated(hook, target) {1690 registerKeepAliveHook(hook, "da", target);1691}1692function registerKeepAliveHook(hook, type, target = currentInstance) {1693 const wrappedHook = hook.__wdc || (hook.__wdc = () => {1694 let current = target;1695 while (current) {1696 if (current.isDeactivated) {1697 return;1698 }1699 current = current.parent;1700 }1701 hook();1702 });1703 injectHook(type, wrappedHook, target);1704 if (target) {1705 let current = target.parent;1706 while (current && current.parent) {1707 if (isKeepAlive(current.parent.vnode)) {1708 injectToKeepAliveRoot(wrappedHook, type, target, current);1709 }1710 current = current.parent;1711 }1712 }1713}1714function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {1715 const injected = injectHook(type, hook, keepAliveRoot, true);1716 onUnmounted(() => {1717 remove(keepAliveRoot[type], injected);1718 }, target);1719}1720const isInternalKey = (key) => key[0] === "_" || key === "$stable";1721const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];1722const normalizeSlot = (key, rawSlot, ctx) => withCtx((props) => {1723 return normalizeSlotValue(rawSlot(props));1724}, ctx);1725const normalizeObjectSlots = (rawSlots, slots) => {1726 const ctx = rawSlots._ctx;1727 for (const key in rawSlots) {1728 if (isInternalKey(key))1729 continue;1730 const value = rawSlots[key];1731 if (isFunction(value)) {1732 slots[key] = normalizeSlot(key, value, ctx);1733 } else if (value != null) {1734 const normalized = normalizeSlotValue(value);1735 slots[key] = () => normalized;1736 }1737 }1738};1739const normalizeVNodeSlots = (instance, children) => {1740 const normalized = normalizeSlotValue(children);1741 instance.slots.default = () => normalized;1742};1743const initSlots = (instance, children) => {1744 if (instance.vnode.shapeFlag & 32) {1745 const type = children._;1746 if (type) {1747 instance.slots = children;1748 def(children, "_", type);1749 } else {1750 normalizeObjectSlots(children, instance.slots = {});1751 }1752 } else {1753 instance.slots = {};1754 if (children) {1755 normalizeVNodeSlots(instance, children);1756 }1757 }1758 def(instance.slots, InternalObjectKey, 1);1759};1760const updateSlots = (instance, children) => {1761 const {vnode, slots} = instance;1762 let needDeletionCheck = true;1763 let deletionComparisonTarget = EMPTY_OBJ;1764 if (vnode.shapeFlag & 32) {1765 const type = children._;1766 if (type) {1767 if (type === 1) {1768 needDeletionCheck = false;1769 } else {1770 extend(slots, children);1771 }1772 } else {1773 needDeletionCheck = !children.$stable;1774 normalizeObjectSlots(children, slots);1775 }1776 deletionComparisonTarget = children;1777 } else if (children) {1778 normalizeVNodeSlots(instance, children);1779 deletionComparisonTarget = {default: 1};1780 }1781 if (needDeletionCheck) {1782 for (const key in slots) {1783 if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {1784 delete slots[key];1785 }1786 }1787 }1788};1789function invokeDirectiveHook(vnode, prevVNode, instance, name) {1790 const bindings = vnode.dirs;1791 const oldBindings = prevVNode && prevVNode.dirs;1792 for (let i = 0; i < bindings.length; i++) {1793 const binding = bindings[i];1794 if (oldBindings) {1795 binding.oldValue = oldBindings[i].value;1796 }1797 const hook = binding.dir[name];1798 if (hook) {1799 callWithAsyncErrorHandling(hook, instance, 8, [1800 vnode.el,1801 binding,1802 vnode,1803 prevVNode1804 ]);1805 }1806 }1807}1808function createAppContext() {1809 return {1810 app: null,1811 config: {1812 isNativeTag: NO,1813 performance: false,1814 globalProperties: {},1815 optionMergeStrategies: {},1816 isCustomElement: NO,1817 errorHandler: void 0,1818 warnHandler: void 01819 },1820 mixins: [],1821 components: {},1822 directives: {},1823 provides: Object.create(null)1824 };1825}1826let uid$1 = 0;1827function createAppAPI(render2, hydrate) {1828 return function createApp2(rootComponent, rootProps = null) {1829 if (rootProps != null && !isObject(rootProps)) {1830 rootProps = null;1831 }1832 const context = createAppContext();1833 const installedPlugins = new Set();1834 let isMounted = false;1835 const app = context.app = {1836 _uid: uid$1++,1837 _component: rootComponent,1838 _props: rootProps,1839 _container: null,1840 _context: context,1841 version,1842 get config() {1843 return context.config;1844 },1845 set config(v) {1846 },1847 use(plugin, ...options) {1848 if (installedPlugins.has(plugin))1849 ;1850 else if (plugin && isFunction(plugin.install)) {1851 installedPlugins.add(plugin);1852 plugin.install(app, ...options);1853 } else if (isFunction(plugin)) {1854 installedPlugins.add(plugin);1855 plugin(app, ...options);1856 } else1857 ;1858 return app;1859 },1860 mixin(mixin) {1861 {1862 if (!context.mixins.includes(mixin)) {1863 context.mixins.push(mixin);1864 if (mixin.props || mixin.emits) {1865 context.deopt = true;1866 }1867 }1868 }1869 return app;1870 },1871 component(name, component) {1872 if (!component) {1873 return context.components[name];1874 }1875 context.components[name] = component;1876 return app;1877 },1878 directive(name, directive) {1879 if (!directive) {1880 return context.directives[name];1881 }1882 context.directives[name] = directive;1883 return app;1884 },1885 mount(rootContainer, isHydrate) {1886 if (!isMounted) {1887 const vnode = createVNode(rootComponent, rootProps);1888 vnode.appContext = context;1889 if (isHydrate && hydrate) {1890 hydrate(vnode, rootContainer);1891 } else {1892 render2(vnode, rootContainer);1893 }1894 isMounted = true;1895 app._container = rootContainer;1896 rootContainer.__vue_app__ = app;1897 return vnode.component.proxy;1898 }1899 },1900 unmount() {1901 if (isMounted) {1902 render2(null, app._container);1903 }1904 },1905 provide(key, value) {1906 context.provides[key] = value;1907 return app;1908 }1909 };1910 return app;1911 };1912}1913const prodEffectOptions = {1914 scheduler: queueJob,1915 allowRecurse: true1916};1917const queuePostRenderEffect = queueEffectWithSuspense;1918const setRef = (rawRef, oldRawRef, parentComponent, parentSuspense, vnode) => {1919 if (isArray(rawRef)) {1920 rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentComponent, parentSuspense, vnode));1921 return;1922 }1923 let value;1924 if (!vnode) {1925 value = null;1926 } else {1927 if (vnode.shapeFlag & 4) {1928 value = vnode.component.proxy;1929 } else {1930 value = vnode.el;1931 }1932 }1933 const {i: owner, r: ref} = rawRef;1934 const oldRef = oldRawRef && oldRawRef.r;1935 const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;1936 const setupState = owner.setupState;1937 if (oldRef != null && oldRef !== ref) {1938 if (isString(oldRef)) {1939 refs[oldRef] = null;1940 if (hasOwn(setupState, oldRef)) {1941 setupState[oldRef] = null;1942 }1943 } else if (isRef(oldRef)) {1944 oldRef.value = null;1945 }1946 }1947 if (isString(ref)) {1948 const doSet = () => {1949 refs[ref] = value;1950 if (hasOwn(setupState, ref)) {1951 setupState[ref] = value;1952 }1953 };1954 if (value) {1955 doSet.id = -1;1956 queuePostRenderEffect(doSet, parentSuspense);1957 } else {1958 doSet();1959 }1960 } else if (isRef(ref)) {1961 const doSet = () => {1962 ref.value = value;1963 };1964 if (value) {1965 doSet.id = -1;1966 queuePostRenderEffect(doSet, parentSuspense);1967 } else {1968 doSet();1969 }1970 } else if (isFunction(ref)) {1971 callWithErrorHandling(ref, parentComponent, 12, [1972 value,1973 refs1974 ]);1975 } else1976 ;1977};1978function createRenderer(options) {1979 return baseCreateRenderer(options);1980}1981function baseCreateRenderer(options, createHydrationFns) {1982 const {insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent} = options;1983 const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, optimized = false) => {1984 if (n1 && !isSameVNodeType(n1, n2)) {1985 anchor = getNextHostNode(n1);1986 unmount(n1, parentComponent, parentSuspense, true);1987 n1 = null;1988 }1989 if (n2.patchFlag === -2) {1990 optimized = false;1991 n2.dynamicChildren = null;1992 }1993 const {type, ref, shapeFlag} = n2;1994 switch (type) {1995 case Text:1996 processText(n1, n2, container, anchor);1997 break;1998 case Comment:1999 processCommentNode(n1, n2, container, anchor);2000 break;2001 case Static:2002 if (n1 == null) {2003 mountStaticNode(n2, container, anchor, isSVG);2004 }2005 break;2006 case Fragment:2007 processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);2008 break;2009 default:2010 if (shapeFlag & 1) {2011 processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);2012 } else if (shapeFlag & 6) {2013 processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);2014 } else if (shapeFlag & 64) {2015 type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized, internals);2016 } else if (shapeFlag & 128) {2017 type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized, internals);2018 } else2019 ;2020 }2021 if (ref != null && parentComponent) {2022 setRef(ref, n1 && n1.ref, parentComponent, parentSuspense, n2);2023 }2024 };2025 const processText = (n1, n2, container, anchor) => {2026 if (n1 == null) {2027 hostInsert(n2.el = hostCreateText(n2.children), container, anchor);2028 } else {2029 const el = n2.el = n1.el;2030 if (n2.children !== n1.children) {2031 hostSetText(el, n2.children);2032 }2033 }2034 };2035 const processCommentNode = (n1, n2, container, anchor) => {2036 if (n1 == null) {2037 hostInsert(n2.el = hostCreateComment(n2.children || ""), container, anchor);2038 } else {2039 n2.el = n1.el;2040 }2041 };2042 const mountStaticNode = (n2, container, anchor, isSVG) => {2043 [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);2044 };2045 const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {2046 isSVG = isSVG || n2.type === "svg";2047 if (n1 == null) {2048 mountElement(n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);2049 } else {2050 patchElement(n1, n2, parentComponent, parentSuspense, isSVG, optimized);2051 }2052 };2053 const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {2054 let el;2055 let vnodeHook;2056 const {type, props, shapeFlag, transition, scopeId, patchFlag, dirs} = vnode;2057 if (vnode.el && hostCloneNode !== void 0 && patchFlag === -1) {2058 el = vnode.el = hostCloneNode(vnode.el);2059 } else {2060 el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is);2061 if (shapeFlag & 8) {2062 hostSetElementText(el, vnode.children);2063 } else if (shapeFlag & 16) {2064 mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== "foreignObject", optimized || !!vnode.dynamicChildren);2065 }2066 if (dirs) {2067 invokeDirectiveHook(vnode, null, parentComponent, "created");2068 }2069 if (props) {2070 for (const key in props) {2071 if (!isReservedProp(key)) {2072 hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);2073 }2074 }2075 if (vnodeHook = props.onVnodeBeforeMount) {2076 invokeVNodeHook(vnodeHook, parentComponent, vnode);2077 }2078 }2079 setScopeId(el, scopeId, vnode, parentComponent);2080 }2081 if (dirs) {2082 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");2083 }2084 const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;2085 if (needCallTransitionHooks) {2086 transition.beforeEnter(el);2087 }2088 hostInsert(el, container, anchor);2089 if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {2090 queuePostRenderEffect(() => {2091 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);2092 needCallTransitionHooks && transition.enter(el);2093 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");2094 }, parentSuspense);2095 }2096 };2097 const setScopeId = (el, scopeId, vnode, parentComponent) => {2098 if (scopeId) {2099 hostSetScopeId(el, scopeId);2100 }2101 if (parentComponent) {2102 const treeOwnerId = parentComponent.type.__scopeId;2103 if (treeOwnerId && treeOwnerId !== scopeId) {2104 hostSetScopeId(el, treeOwnerId + "-s");2105 }2106 let subTree = parentComponent.subTree;2107 if (vnode === subTree) {2108 setScopeId(el, parentComponent.vnode.scopeId, parentComponent.vnode, parentComponent.parent);2109 }2110 }2111 };2112 const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, optimized, start = 0) => {2113 for (let i = start; i < children.length; i++) {2114 const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);2115 patch(null, child, container, anchor, parentComponent, parentSuspense, isSVG, optimized);2116 }2117 };2118 const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, optimized) => {2119 const el = n2.el = n1.el;2120 let {patchFlag, dynamicChildren, dirs} = n2;2121 patchFlag |= n1.patchFlag & 16;2122 const oldProps = n1.props || EMPTY_OBJ;2123 const newProps = n2.props || EMPTY_OBJ;2124 let vnodeHook;2125 if (vnodeHook = newProps.onVnodeBeforeUpdate) {2126 invokeVNodeHook(vnodeHook, parentComponent, n2, n1);2127 }2128 if (dirs) {2129 invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");2130 }2131 if (patchFlag > 0) {2132 if (patchFlag & 16) {2133 patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);2134 } else {2135 if (patchFlag & 2) {2136 if (oldProps.class !== newProps.class) {2137 hostPatchProp(el, "class", null, newProps.class, isSVG);2138 }2139 }2140 if (patchFlag & 4) {2141 hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);2142 }2143 if (patchFlag & 8) {2144 const propsToUpdate = n2.dynamicProps;2145 for (let i = 0; i < propsToUpdate.length; i++) {2146 const key = propsToUpdate[i];2147 const prev = oldProps[key];2148 const next = newProps[key];2149 if (next !== prev || hostForcePatchProp && hostForcePatchProp(el, key)) {2150 hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren);2151 }2152 }2153 }2154 }2155 if (patchFlag & 1) {2156 if (n1.children !== n2.children) {2157 hostSetElementText(el, n2.children);2158 }2159 }2160 } else if (!optimized && dynamicChildren == null) {2161 patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);2162 }2163 const areChildrenSVG = isSVG && n2.type !== "foreignObject";2164 if (dynamicChildren) {2165 patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, areChildrenSVG);2166 } else if (!optimized) {2167 patchChildren(n1, n2, el, null, parentComponent, parentSuspense, areChildrenSVG);2168 }2169 if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {2170 queuePostRenderEffect(() => {2171 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);2172 dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");2173 }, parentSuspense);2174 }2175 };2176 const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG) => {2177 for (let i = 0; i < newChildren.length; i++) {2178 const oldVNode = oldChildren[i];2179 const newVNode = newChildren[i];2180 const container = oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 6 || oldVNode.shapeFlag & 64 ? hostParentNode(oldVNode.el) : fallbackContainer;2181 patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, isSVG, true);2182 }2183 };2184 const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {2185 if (oldProps !== newProps) {2186 for (const key in newProps) {2187 if (isReservedProp(key))2188 continue;2189 const next = newProps[key];2190 const prev = oldProps[key];2191 if (next !== prev || hostForcePatchProp && hostForcePatchProp(el, key)) {2192 hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);2193 }2194 }2195 if (oldProps !== EMPTY_OBJ) {2196 for (const key in oldProps) {2197 if (!isReservedProp(key) && !(key in newProps)) {2198 hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);2199 }2200 }2201 }2202 }2203 };2204 const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {2205 const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");2206 const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");2207 let {patchFlag, dynamicChildren} = n2;2208 if (patchFlag > 0) {2209 optimized = true;2210 }2211 if (n1 == null) {2212 hostInsert(fragmentStartAnchor, container, anchor);2213 hostInsert(fragmentEndAnchor, container, anchor);2214 mountChildren(n2.children, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, optimized);2215 } else {2216 if (patchFlag > 0 && patchFlag & 64 && dynamicChildren) {2217 patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, isSVG);2218 if (n2.key != null || parentComponent && n2 === parentComponent.subTree) {2219 traverseStaticChildren(n1, n2, true);2220 }2221 } else {2222 patchChildren(n1, n2, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, optimized);2223 }2224 }2225 };2226 const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {2227 if (n1 == null) {2228 if (n2.shapeFlag & 512) {2229 parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);2230 } else {2231 mountComponent(n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);2232 }2233 } else {2234 updateComponent(n1, n2, optimized);2235 }2236 };2237 const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {2238 const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);2239 if (isKeepAlive(initialVNode)) {2240 instance.ctx.renderer = internals;2241 }2242 setupComponent(instance);2243 if (instance.asyncDep) {2244 parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);2245 if (!initialVNode.el) {2246 const placeholder = instance.subTree = createVNode(Comment);2247 processCommentNode(null, placeholder, container, anchor);2248 }2249 return;2250 }2251 setupRenderEffect(instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized);2252 };2253 const updateComponent = (n1, n2, optimized) => {2254 const instance = n2.component = n1.component;2255 if (shouldUpdateComponent(n1, n2, optimized)) {2256 if (instance.asyncDep && !instance.asyncResolved) {2257 updateComponentPreRender(instance, n2, optimized);2258 return;2259 } else {2260 instance.next = n2;2261 invalidateJob(instance.update);2262 instance.update();2263 }2264 } else {2265 n2.component = n1.component;2266 n2.el = n1.el;2267 instance.vnode = n2;2268 }2269 };2270 const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {2271 instance.update = effect(function componentEffect() {2272 if (!instance.isMounted) {2273 let vnodeHook;2274 const {el, props} = initialVNode;2275 const {bm, m, parent} = instance;2276 if (bm) {2277 invokeArrayFns(bm);2278 }2279 if (vnodeHook = props && props.onVnodeBeforeMount) {2280 invokeVNodeHook(vnodeHook, parent, initialVNode);2281 }2282 const subTree = instance.subTree = renderComponentRoot(instance);2283 if (el && hydrateNode) {2284 hydrateNode(initialVNode.el, subTree, instance, parentSuspense);2285 } else {2286 patch(null, subTree, container, anchor, instance, parentSuspense, isSVG);2287 initialVNode.el = subTree.el;2288 }2289 if (m) {2290 queuePostRenderEffect(m, parentSuspense);2291 }2292 if (vnodeHook = props && props.onVnodeMounted) {2293 queuePostRenderEffect(() => {2294 invokeVNodeHook(vnodeHook, parent, initialVNode);2295 }, parentSuspense);2296 }2297 const {a} = instance;2298 if (a && initialVNode.shapeFlag & 256) {2299 queuePostRenderEffect(a, parentSuspense);2300 }2301 instance.isMounted = true;2302 } else {2303 let {next, bu, u, parent, vnode} = instance;2304 let originNext = next;2305 let vnodeHook;2306 if (next) {2307 next.el = vnode.el;2308 updateComponentPreRender(instance, next, optimized);2309 } else {2310 next = vnode;2311 }2312 if (bu) {2313 invokeArrayFns(bu);2314 }2315 if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {2316 invokeVNodeHook(vnodeHook, parent, next, vnode);2317 }2318 const nextTree = renderComponentRoot(instance);2319 const prevTree = instance.subTree;2320 instance.subTree = nextTree;2321 patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, isSVG);2322 next.el = nextTree.el;2323 if (originNext === null) {2324 updateHOCHostEl(instance, nextTree.el);2325 }2326 if (u) {2327 queuePostRenderEffect(u, parentSuspense);2328 }2329 if (vnodeHook = next.props && next.props.onVnodeUpdated) {2330 queuePostRenderEffect(() => {2331 invokeVNodeHook(vnodeHook, parent, next, vnode);2332 }, parentSuspense);2333 }2334 }2335 }, prodEffectOptions);2336 };2337 const updateComponentPreRender = (instance, nextVNode, optimized) => {2338 nextVNode.component = instance;2339 const prevProps = instance.vnode.props;2340 instance.vnode = nextVNode;2341 instance.next = null;2342 updateProps(instance, nextVNode.props, prevProps, optimized);2343 updateSlots(instance, nextVNode.children);2344 flushPreFlushCbs(void 0, instance.update);2345 };2346 const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized = false) => {2347 const c1 = n1 && n1.children;2348 const prevShapeFlag = n1 ? n1.shapeFlag : 0;2349 const c2 = n2.children;2350 const {patchFlag, shapeFlag} = n2;2351 if (patchFlag > 0) {2352 if (patchFlag & 128) {2353 patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);2354 return;2355 } else if (patchFlag & 256) {2356 patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);2357 return;2358 }2359 }2360 if (shapeFlag & 8) {2361 if (prevShapeFlag & 16) {2362 unmountChildren(c1, parentComponent, parentSuspense);2363 }2364 if (c2 !== c1) {2365 hostSetElementText(container, c2);2366 }2367 } else {2368 if (prevShapeFlag & 16) {2369 if (shapeFlag & 16) {2370 patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);2371 } else {2372 unmountChildren(c1, parentComponent, parentSuspense, true);2373 }2374 } else {2375 if (prevShapeFlag & 8) {2376 hostSetElementText(container, "");2377 }2378 if (shapeFlag & 16) {2379 mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);2380 }2381 }2382 }2383 };2384 const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {2385 c1 = c1 || EMPTY_ARR;2386 c2 = c2 || EMPTY_ARR;2387 const oldLength = c1.length;2388 const newLength = c2.length;2389 const commonLength = Math.min(oldLength, newLength);2390 let i;2391 for (i = 0; i < commonLength; i++) {2392 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);2393 patch(c1[i], nextChild, container, null, parentComponent, parentSuspense, isSVG, optimized);2394 }2395 if (oldLength > newLength) {2396 unmountChildren(c1, parentComponent, parentSuspense, true, false, commonLength);2397 } else {2398 mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, optimized, commonLength);2399 }2400 };2401 const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, optimized) => {2402 let i = 0;2403 const l2 = c2.length;2404 let e1 = c1.length - 1;2405 let e2 = l2 - 1;2406 while (i <= e1 && i <= e2) {2407 const n1 = c1[i];2408 const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);2409 if (isSameVNodeType(n1, n2)) {2410 patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, optimized);2411 } else {2412 break;2413 }2414 i++;2415 }2416 while (i <= e1 && i <= e2) {2417 const n1 = c1[e1];2418 const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);2419 if (isSameVNodeType(n1, n2)) {2420 patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, optimized);2421 } else {2422 break;2423 }2424 e1--;2425 e2--;2426 }2427 if (i > e1) {2428 if (i <= e2) {2429 const nextPos = e2 + 1;2430 const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;2431 while (i <= e2) {2432 patch(null, c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), container, anchor, parentComponent, parentSuspense, isSVG);2433 i++;2434 }2435 }2436 } else if (i > e2) {2437 while (i <= e1) {2438 unmount(c1[i], parentComponent, parentSuspense, true);2439 i++;2440 }2441 } else {2442 const s1 = i;2443 const s2 = i;2444 const keyToNewIndexMap = new Map();2445 for (i = s2; i <= e2; i++) {2446 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);2447 if (nextChild.key != null) {2448 keyToNewIndexMap.set(nextChild.key, i);2449 }2450 }2451 let j;2452 let patched = 0;2453 const toBePatched = e2 - s2 + 1;2454 let moved = false;2455 let maxNewIndexSoFar = 0;2456 const newIndexToOldIndexMap = new Array(toBePatched);2457 for (i = 0; i < toBePatched; i++)2458 newIndexToOldIndexMap[i] = 0;2459 for (i = s1; i <= e1; i++) {2460 const prevChild = c1[i];2461 if (patched >= toBePatched) {2462 unmount(prevChild, parentComponent, parentSuspense, true);2463 continue;2464 }2465 let newIndex;2466 if (prevChild.key != null) {2467 newIndex = keyToNewIndexMap.get(prevChild.key);2468 } else {2469 for (j = s2; j <= e2; j++) {2470 if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {2471 newIndex = j;2472 break;2473 }2474 }2475 }2476 if (newIndex === void 0) {2477 unmount(prevChild, parentComponent, parentSuspense, true);2478 } else {2479 newIndexToOldIndexMap[newIndex - s2] = i + 1;2480 if (newIndex >= maxNewIndexSoFar) {2481 maxNewIndexSoFar = newIndex;2482 } else {2483 moved = true;2484 }2485 patch(prevChild, c2[newIndex], container, null, parentComponent, parentSuspense, isSVG, optimized);2486 patched++;2487 }2488 }2489 const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;2490 j = increasingNewIndexSequence.length - 1;2491 for (i = toBePatched - 1; i >= 0; i--) {2492 const nextIndex = s2 + i;2493 const nextChild = c2[nextIndex];2494 const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;2495 if (newIndexToOldIndexMap[i] === 0) {2496 patch(null, nextChild, container, anchor, parentComponent, parentSuspense, isSVG);2497 } else if (moved) {2498 if (j < 0 || i !== increasingNewIndexSequence[j]) {2499 move(nextChild, container, anchor, 2);2500 } else {2501 j--;2502 }2503 }2504 }2505 }2506 };2507 const move = (vnode, container, anchor, moveType, parentSuspense = null) => {2508 const {el, type, transition, children, shapeFlag} = vnode;2509 if (shapeFlag & 6) {2510 move(vnode.component.subTree, container, anchor, moveType);2511 return;2512 }2513 if (shapeFlag & 128) {2514 vnode.suspense.move(container, anchor, moveType);2515 return;2516 }2517 if (shapeFlag & 64) {2518 type.move(vnode, container, anchor, internals);2519 return;2520 }2521 if (type === Fragment) {2522 hostInsert(el, container, anchor);2523 for (let i = 0; i < children.length; i++) {2524 move(children[i], container, anchor, moveType);2525 }2526 hostInsert(vnode.anchor, container, anchor);2527 return;2528 }2529 const needTransition = moveType !== 2 && shapeFlag & 1 && transition;2530 if (needTransition) {2531 if (moveType === 0) {2532 transition.beforeEnter(el);2533 hostInsert(el, container, anchor);2534 queuePostRenderEffect(() => transition.enter(el), parentSuspense);2535 } else {2536 const {leave, delayLeave, afterLeave} = transition;2537 const remove3 = () => hostInsert(el, container, anchor);2538 const performLeave = () => {2539 leave(el, () => {2540 remove3();2541 afterLeave && afterLeave();2542 });2543 };2544 if (delayLeave) {2545 delayLeave(el, remove3, performLeave);2546 } else {2547 performLeave();2548 }2549 }2550 } else {2551 hostInsert(el, container, anchor);2552 }2553 };2554 const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {2555 const {type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs} = vnode;2556 if (ref != null && parentComponent) {2557 setRef(ref, null, parentComponent, parentSuspense, null);2558 }2559 if (shapeFlag & 256) {2560 parentComponent.ctx.deactivate(vnode);2561 return;2562 }2563 const shouldInvokeDirs = shapeFlag & 1 && dirs;2564 let vnodeHook;2565 if (vnodeHook = props && props.onVnodeBeforeUnmount) {2566 invokeVNodeHook(vnodeHook, parentComponent, vnode);2567 }2568 if (shapeFlag & 6) {2569 unmountComponent(vnode.component, parentSuspense, doRemove);2570 } else {2571 if (shapeFlag & 128) {2572 vnode.suspense.unmount(parentSuspense, doRemove);2573 return;2574 }2575 if (shouldInvokeDirs) {2576 invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");2577 }2578 if (dynamicChildren && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {2579 unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);2580 } else if (type === Fragment && (patchFlag & 128 || patchFlag & 256) || !optimized && shapeFlag & 16) {2581 unmountChildren(children, parentComponent, parentSuspense);2582 }2583 if (shapeFlag & 64 && (doRemove || !isTeleportDisabled(vnode.props))) {2584 vnode.type.remove(vnode, internals);2585 }2586 if (doRemove) {2587 remove2(vnode);2588 }2589 }2590 if ((vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {2591 queuePostRenderEffect(() => {2592 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);2593 shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");2594 }, parentSuspense);2595 }2596 };2597 const remove2 = (vnode) => {2598 const {type, el, anchor, transition} = vnode;2599 if (type === Fragment) {2600 removeFragment(el, anchor);2601 return;2602 }2603 const performRemove = () => {2604 hostRemove(el);2605 if (transition && !transition.persisted && transition.afterLeave) {2606 transition.afterLeave();2607 }2608 };2609 if (vnode.shapeFlag & 1 && transition && !transition.persisted) {2610 const {leave, delayLeave} = transition;2611 const performLeave = () => leave(el, performRemove);2612 if (delayLeave) {2613 delayLeave(vnode.el, performRemove, performLeave);2614 } else {2615 performLeave();2616 }2617 } else {2618 performRemove();2619 }2620 };2621 const removeFragment = (cur, end) => {2622 let next;2623 while (cur !== end) {2624 next = hostNextSibling(cur);2625 hostRemove(cur);2626 cur = next;2627 }2628 hostRemove(end);2629 };2630 const unmountComponent = (instance, parentSuspense, doRemove) => {2631 const {bum, effects, update, subTree, um} = instance;2632 if (bum) {2633 invokeArrayFns(bum);2634 }2635 if (effects) {2636 for (let i = 0; i < effects.length; i++) {2637 stop(effects[i]);2638 }2639 }2640 if (update) {2641 stop(update);2642 unmount(subTree, instance, parentSuspense, doRemove);2643 }2644 if (um) {2645 queuePostRenderEffect(um, parentSuspense);2646 }2647 queuePostRenderEffect(() => {2648 instance.isUnmounted = true;2649 }, parentSuspense);2650 if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {2651 parentSuspense.deps--;2652 if (parentSuspense.deps === 0) {2653 parentSuspense.resolve();2654 }2655 }2656 };2657 const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {2658 for (let i = start; i < children.length; i++) {2659 unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);2660 }2661 };2662 const getNextHostNode = (vnode) => {2663 if (vnode.shapeFlag & 6) {2664 return getNextHostNode(vnode.component.subTree);2665 }2666 if (vnode.shapeFlag & 128) {2667 return vnode.suspense.next();2668 }2669 return hostNextSibling(vnode.anchor || vnode.el);2670 };2671 const render2 = (vnode, container) => {2672 if (vnode == null) {2673 if (container._vnode) {2674 unmount(container._vnode, null, null, true);2675 }2676 } else {2677 patch(container._vnode || null, vnode, container);2678 }2679 flushPostFlushCbs();2680 container._vnode = vnode;2681 };2682 const internals = {2683 p: patch,2684 um: unmount,2685 m: move,2686 r: remove2,2687 mt: mountComponent,2688 mc: mountChildren,2689 pc: patchChildren,2690 pbc: patchBlockChildren,2691 n: getNextHostNode,2692 o: options2693 };2694 let hydrate;2695 let hydrateNode;2696 if (createHydrationFns) {2697 [hydrate, hydrateNode] = createHydrationFns(internals);2698 }2699 return {2700 render: render2,2701 hydrate,2702 createApp: createAppAPI(render2, hydrate)2703 };2704}2705function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {2706 callWithAsyncErrorHandling(hook, instance, 7, [2707 vnode,2708 prevVNode2709 ]);2710}2711function traverseStaticChildren(n1, n2, shallow = false) {2712 const ch1 = n1.children;2713 const ch2 = n2.children;2714 if (isArray(ch1) && isArray(ch2)) {2715 for (let i = 0; i < ch1.length; i++) {2716 const c1 = ch1[i];2717 let c2 = ch2[i];2718 if (c2.shapeFlag & 1 && !c2.dynamicChildren) {2719 if (c2.patchFlag <= 0 || c2.patchFlag === 32) {2720 c2 = ch2[i] = cloneIfMounted(ch2[i]);2721 c2.el = c1.el;2722 }2723 if (!shallow)2724 traverseStaticChildren(c1, c2);2725 }2726 }2727 }2728}2729function getSequence(arr) {2730 const p2 = arr.slice();2731 const result = [0];2732 let i, j, u, v, c;2733 const len = arr.length;2734 for (i = 0; i < len; i++) {2735 const arrI = arr[i];2736 if (arrI !== 0) {2737 j = result[result.length - 1];2738 if (arr[j] < arrI) {2739 p2[i] = j;2740 result.push(i);2741 continue;2742 }2743 u = 0;2744 v = result.length - 1;2745 while (u < v) {2746 c = (u + v) / 2 | 0;2747 if (arr[result[c]] < arrI) {2748 u = c + 1;2749 } else {2750 v = c;2751 }2752 }2753 if (arrI < arr[result[u]]) {2754 if (u > 0) {2755 p2[i] = result[u - 1];2756 }2757 result[u] = i;2758 }2759 }2760 }2761 u = result.length;2762 v = result[u - 1];2763 while (u-- > 0) {2764 result[u] = v;2765 v = p2[v];2766 }2767 return result;2768}2769const isTeleport = (type) => type.__isTeleport;2770const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");2771const COMPONENTS = "components";2772function resolveComponent(name) {2773 return resolveAsset(COMPONENTS, name) || name;2774}2775const NULL_DYNAMIC_COMPONENT = Symbol();2776function resolveAsset(type, name, warnMissing = true) {2777 const instance = currentRenderingInstance || currentInstance;2778 if (instance) {2779 const Component = instance.type;2780 if (type === COMPONENTS) {2781 const selfName = Component.displayName || Component.name;2782 if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {2783 return Component;2784 }2785 }2786 const res = resolve(instance[type] || Component[type], name) || resolve(instance.appContext[type], name);2787 return res;2788 }2789}2790function resolve(registry, name) {2791 return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);2792}2793const Fragment = Symbol(void 0);2794const Text = Symbol(void 0);2795const Comment = Symbol(void 0);2796const Static = Symbol(void 0);2797const blockStack = [];2798let currentBlock = null;2799function openBlock(disableTracking = false) {2800 blockStack.push(currentBlock = disableTracking ? null : []);2801}2802function closeBlock() {2803 blockStack.pop();2804 currentBlock = blockStack[blockStack.length - 1] || null;2805}2806function createBlock(type, props, children, patchFlag, dynamicProps) {2807 const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true);2808 vnode.dynamicChildren = currentBlock || EMPTY_ARR;2809 closeBlock();2810 if (currentBlock) {2811 currentBlock.push(vnode);2812 }2813 return vnode;2814}2815function isVNode(value) {2816 return value ? value.__v_isVNode === true : false;2817}2818function isSameVNodeType(n1, n2) {2819 return n1.type === n2.type && n1.key === n2.key;2820}2821const InternalObjectKey = `__vInternal`;2822const normalizeKey = ({key}) => key != null ? key : null;2823const normalizeRef = ({ref}) => {2824 return ref != null ? isArray(ref) ? ref : {i: currentRenderingInstance, r: ref} : null;2825};2826const createVNode = _createVNode;2827function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {2828 if (!type || type === NULL_DYNAMIC_COMPONENT) {2829 type = Comment;2830 }2831 if (isVNode(type)) {2832 const cloned = cloneVNode(type, props, true);2833 if (children) {2834 normalizeChildren(cloned, children);2835 }2836 return cloned;2837 }2838 if (isClassComponent(type)) {2839 type = type.__vccOpts;2840 }2841 if (props) {2842 if (isProxy(props) || InternalObjectKey in props) {2843 props = extend({}, props);2844 }2845 let {class: klass, style} = props;2846 if (klass && !isString(klass)) {2847 props.class = normalizeClass(klass);2848 }2849 if (isObject(style)) {2850 if (isProxy(style) && !isArray(style)) {2851 style = extend({}, style);2852 }2853 props.style = normalizeStyle(style);2854 }2855 }2856 const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;2857 const vnode = {2858 __v_isVNode: true,2859 ["__v_skip"]: true,2860 type,2861 props,2862 key: props && normalizeKey(props),2863 ref: props && normalizeRef(props),2864 scopeId: currentScopeId,2865 children: null,2866 component: null,2867 suspense: null,2868 ssContent: null,2869 ssFallback: null,2870 dirs: null,2871 transition: null,2872 el: null,2873 anchor: null,2874 target: null,2875 targetAnchor: null,2876 staticCount: 0,2877 shapeFlag,2878 patchFlag,2879 dynamicProps,2880 dynamicChildren: null,2881 appContext: null2882 };2883 normalizeChildren(vnode, children);2884 if (shapeFlag & 128) {2885 const {content, fallback} = normalizeSuspenseChildren(vnode);2886 vnode.ssContent = content;2887 vnode.ssFallback = fallback;2888 }2889 if (!isBlockNode && currentBlock && (patchFlag > 0 || shapeFlag & 6) && patchFlag !== 32) {2890 currentBlock.push(vnode);2891 }2892 return vnode;2893}2894function cloneVNode(vnode, extraProps, mergeRef = false) {2895 const {props, ref, patchFlag} = vnode;2896 const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;2897 return {2898 __v_isVNode: true,2899 ["__v_skip"]: true,2900 type: vnode.type,2901 props: mergedProps,2902 key: mergedProps && normalizeKey(mergedProps),2903 ref: extraProps && extraProps.ref ? mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref,2904 scopeId: vnode.scopeId,2905 children: vnode.children,2906 target: vnode.target,2907 targetAnchor: vnode.targetAnchor,2908 staticCount: vnode.staticCount,2909 shapeFlag: vnode.shapeFlag,2910 patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,2911 dynamicProps: vnode.dynamicProps,2912 dynamicChildren: vnode.dynamicChildren,2913 appContext: vnode.appContext,2914 dirs: vnode.dirs,2915 transition: vnode.transition,2916 component: vnode.component,2917 suspense: vnode.suspense,2918 ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),2919 ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),2920 el: vnode.el,2921 anchor: vnode.anchor2922 };2923}2924function createTextVNode(text = " ", flag = 0) {2925 return createVNode(Text, null, text, flag);2926}2927function normalizeVNode(child) {2928 if (child == null || typeof child === "boolean") {2929 return createVNode(Comment);2930 } else if (isArray(child)) {2931 return createVNode(Fragment, null, child);2932 } else if (typeof child === "object") {2933 return child.el === null ? child : cloneVNode(child);2934 } else {2935 return createVNode(Text, null, String(child));2936 }2937}2938function cloneIfMounted(child) {2939 return child.el === null ? child : cloneVNode(child);2940}2941function normalizeChildren(vnode, children) {2942 let type = 0;2943 const {shapeFlag} = vnode;2944 if (children == null) {2945 children = null;2946 } else if (isArray(children)) {2947 type = 16;2948 } else if (typeof children === "object") {2949 if (shapeFlag & 1 || shapeFlag & 64) {2950 const slot = children.default;2951 if (slot) {2952 slot._c && setCompiledSlotRendering(1);2953 normalizeChildren(vnode, slot());2954 slot._c && setCompiledSlotRendering(-1);2955 }2956 return;2957 } else {2958 type = 32;2959 const slotFlag = children._;2960 if (!slotFlag && !(InternalObjectKey in children)) {2961 children._ctx = currentRenderingInstance;2962 } else if (slotFlag === 3 && currentRenderingInstance) {2963 if (currentRenderingInstance.vnode.patchFlag & 1024) {2964 children._ = 2;2965 vnode.patchFlag |= 1024;2966 } else {2967 children._ = 1;2968 }2969 }2970 }2971 } else if (isFunction(children)) {2972 children = {default: children, _ctx: currentRenderingInstance};2973 type = 32;2974 } else {2975 children = String(children);2976 if (shapeFlag & 64) {2977 type = 16;2978 children = [createTextVNode(children)];2979 } else {2980 type = 8;2981 }2982 }2983 vnode.children = children;2984 vnode.shapeFlag |= type;2985}2986function mergeProps(...args) {2987 const ret = extend({}, args[0]);2988 for (let i = 1; i < args.length; i++) {2989 const toMerge = args[i];2990 for (const key in toMerge) {2991 if (key === "class") {2992 if (ret.class !== toMerge.class) {2993 ret.class = normalizeClass([ret.class, toMerge.class]);2994 }2995 } else if (key === "style") {2996 ret.style = normalizeStyle([ret.style, toMerge.style]);2997 } else if (isOn(key)) {2998 const existing = ret[key];2999 const incoming = toMerge[key];3000 if (existing !== incoming) {3001 ret[key] = existing ? [].concat(existing, toMerge[key]) : incoming;3002 }3003 } else if (key !== "") {3004 ret[key] = toMerge[key];3005 }3006 }3007 }3008 return ret;3009}3010function provide(key, value) {3011 if (!currentInstance)3012 ;3013 else {3014 let provides = currentInstance.provides;3015 const parentProvides = currentInstance.parent && currentInstance.parent.provides;3016 if (parentProvides === provides) {3017 provides = currentInstance.provides = Object.create(parentProvides);3018 }3019 provides[key] = value;3020 }3021}3022function inject(key, defaultValue, treatDefaultAsFactory = false) {3023 const instance = currentInstance || currentRenderingInstance;3024 if (instance) {3025 const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides;3026 if (provides && key in provides) {3027 return provides[key];3028 } else if (arguments.length > 1) {3029 return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue() : defaultValue;3030 } else3031 ;3032 }3033}3034let isInBeforeCreate = false;3035function applyOptions(instance, options, deferredData = [], deferredWatch = [], deferredProvide = [], asMixin = false) {3036 const {3037 mixins,3038 extends: extendsOptions,3039 data: dataOptions,3040 computed: computedOptions,3041 methods,3042 watch: watchOptions,3043 provide: provideOptions,3044 inject: injectOptions,3045 components,3046 directives,3047 beforeMount,3048 mounted,3049 beforeUpdate,3050 updated,3051 activated,3052 deactivated,3053 beforeDestroy,3054 beforeUnmount,3055 destroyed,3056 unmounted,3057 render: render2,3058 renderTracked,3059 renderTriggered,3060 errorCaptured3061 } = options;3062 const publicThis = instance.proxy;3063 const ctx = instance.ctx;3064 const globalMixins = instance.appContext.mixins;3065 if (asMixin && render2 && instance.render === NOOP) {3066 instance.render = render2;3067 }3068 if (!asMixin) {3069 isInBeforeCreate = true;3070 callSyncHook("beforeCreate", "bc", options, instance, globalMixins);3071 isInBeforeCreate = false;3072 applyMixins(instance, globalMixins, deferredData, deferredWatch, deferredProvide);3073 }3074 if (extendsOptions) {3075 applyOptions(instance, extendsOptions, deferredData, deferredWatch, deferredProvide, true);3076 }3077 if (mixins) {3078 applyMixins(instance, mixins, deferredData, deferredWatch, deferredProvide);3079 }3080 if (injectOptions) {3081 if (isArray(injectOptions)) {3082 for (let i = 0; i < injectOptions.length; i++) {3083 const key = injectOptions[i];3084 ctx[key] = inject(key);3085 }3086 } else {3087 for (const key in injectOptions) {3088 const opt = injectOptions[key];3089 if (isObject(opt)) {3090 ctx[key] = inject(opt.from || key, opt.default, true);3091 } else {3092 ctx[key] = inject(opt);3093 }3094 }3095 }3096 }3097 if (methods) {3098 for (const key in methods) {3099 const methodHandler = methods[key];3100 if (isFunction(methodHandler)) {3101 ctx[key] = methodHandler.bind(publicThis);3102 }3103 }3104 }3105 if (!asMixin) {3106 if (deferredData.length) {3107 deferredData.forEach((dataFn) => resolveData(instance, dataFn, publicThis));3108 }3109 if (dataOptions) {3110 resolveData(instance, dataOptions, publicThis);3111 }3112 } else if (dataOptions) {3113 deferredData.push(dataOptions);3114 }3115 if (computedOptions) {3116 for (const key in computedOptions) {3117 const opt = computedOptions[key];3118 const get2 = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;3119 const set2 = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : NOOP;3120 const c = computed$1({3121 get: get2,3122 set: set23123 });3124 Object.defineProperty(ctx, key, {3125 enumerable: true,3126 configurable: true,3127 get: () => c.value,3128 set: (v) => c.value = v3129 });3130 }3131 }3132 if (watchOptions) {3133 deferredWatch.push(watchOptions);3134 }3135 if (!asMixin && deferredWatch.length) {3136 deferredWatch.forEach((watchOptions2) => {3137 for (const key in watchOptions2) {3138 createWatcher(watchOptions2[key], ctx, publicThis, key);3139 }3140 });3141 }3142 if (provideOptions) {3143 deferredProvide.push(provideOptions);3144 }3145 if (!asMixin && deferredProvide.length) {3146 deferredProvide.forEach((provideOptions2) => {3147 const provides = isFunction(provideOptions2) ? provideOptions2.call(publicThis) : provideOptions2;3148 for (const key in provides) {3149 provide(key, provides[key]);3150 }3151 });3152 }3153 if (asMixin) {3154 if (components) {3155 extend(instance.components || (instance.components = extend({}, instance.type.components)), components);3156 }3157 if (directives) {3158 extend(instance.directives || (instance.directives = extend({}, instance.type.directives)), directives);3159 }3160 }3161 if (!asMixin) {3162 callSyncHook("created", "c", options, instance, globalMixins);3163 }3164 if (beforeMount) {3165 onBeforeMount(beforeMount.bind(publicThis));3166 }3167 if (mounted) {3168 onMounted(mounted.bind(publicThis));3169 }3170 if (beforeUpdate) {3171 onBeforeUpdate(beforeUpdate.bind(publicThis));3172 }3173 if (updated) {3174 onUpdated(updated.bind(publicThis));3175 }3176 if (activated) {3177 onActivated(activated.bind(publicThis));3178 }3179 if (deactivated) {3180 onDeactivated(deactivated.bind(publicThis));3181 }3182 if (errorCaptured) {3183 onErrorCaptured(errorCaptured.bind(publicThis));3184 }3185 if (renderTracked) {3186 onRenderTracked(renderTracked.bind(publicThis));3187 }3188 if (renderTriggered) {3189 onRenderTriggered(renderTriggered.bind(publicThis));3190 }3191 if (beforeUnmount) {3192 onBeforeUnmount(beforeUnmount.bind(publicThis));3193 }3194 if (unmounted) {3195 onUnmounted(unmounted.bind(publicThis));3196 }3197}3198function callSyncHook(name, type, options, instance, globalMixins) {3199 callHookFromMixins(name, type, globalMixins, instance);3200 const {extends: base, mixins} = options;3201 if (base) {3202 callHookFromExtends(name, type, base, instance);3203 }3204 if (mixins) {3205 callHookFromMixins(name, type, mixins, instance);3206 }3207 const selfHook = options[name];3208 if (selfHook) {3209 callWithAsyncErrorHandling(selfHook.bind(instance.proxy), instance, type);3210 }3211}3212function callHookFromExtends(name, type, base, instance) {3213 if (base.extends) {3214 callHookFromExtends(name, type, base.extends, instance);3215 }3216 const baseHook = base[name];3217 if (baseHook) {3218 callWithAsyncErrorHandling(baseHook.bind(instance.proxy), instance, type);3219 }3220}3221function callHookFromMixins(name, type, mixins, instance) {3222 for (let i = 0; i < mixins.length; i++) {3223 const chainedMixins = mixins[i].mixins;3224 if (chainedMixins) {3225 callHookFromMixins(name, type, chainedMixins, instance);3226 }3227 const fn = mixins[i][name];3228 if (fn) {3229 callWithAsyncErrorHandling(fn.bind(instance.proxy), instance, type);3230 }3231 }3232}3233function applyMixins(instance, mixins, deferredData, deferredWatch, deferredProvide) {3234 for (let i = 0; i < mixins.length; i++) {3235 applyOptions(instance, mixins[i], deferredData, deferredWatch, deferredProvide, true);3236 }3237}3238function resolveData(instance, dataFn, publicThis) {3239 const data = dataFn.call(publicThis, publicThis);3240 if (!isObject(data))3241 ;3242 else if (instance.data === EMPTY_OBJ) {3243 instance.data = reactive(data);3244 } else {3245 extend(instance.data, data);3246 }3247}3248function createWatcher(raw, ctx, publicThis, key) {3249 const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];3250 if (isString(raw)) {3251 const handler = ctx[raw];3252 if (isFunction(handler)) {3253 watch(getter, handler);3254 }3255 } else if (isFunction(raw)) {3256 watch(getter, raw.bind(publicThis));3257 } else if (isObject(raw)) {3258 if (isArray(raw)) {3259 raw.forEach((r) => createWatcher(r, ctx, publicThis, key));3260 } else {3261 const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];3262 if (isFunction(handler)) {3263 watch(getter, handler, raw);3264 }3265 }3266 } else3267 ;3268}3269function createPathGetter(ctx, path) {3270 const segments = path.split(".");3271 return () => {3272 let cur = ctx;3273 for (let i = 0; i < segments.length && cur; i++) {3274 cur = cur[segments[i]];3275 }3276 return cur;3277 };3278}3279function resolveMergedOptions(instance) {3280 const raw = instance.type;3281 const {__merged, mixins, extends: extendsOptions} = raw;3282 if (__merged)3283 return __merged;3284 const globalMixins = instance.appContext.mixins;3285 if (!globalMixins.length && !mixins && !extendsOptions)3286 return raw;3287 const options = {};3288 globalMixins.forEach((m) => mergeOptions(options, m, instance));3289 mergeOptions(options, raw, instance);3290 return raw.__merged = options;3291}3292function mergeOptions(to, from, instance) {3293 const strats = instance.appContext.config.optionMergeStrategies;3294 const {mixins, extends: extendsOptions} = from;3295 extendsOptions && mergeOptions(to, extendsOptions, instance);3296 mixins && mixins.forEach((m) => mergeOptions(to, m, instance));3297 for (const key in from) {3298 if (strats && hasOwn(strats, key)) {3299 to[key] = strats[key](to[key], from[key], instance.proxy, key);3300 } else {3301 to[key] = from[key];3302 }3303 }3304}3305const publicPropertiesMap = extend(Object.create(null), {3306 $: (i) => i,3307 $el: (i) => i.vnode.el,3308 $data: (i) => i.data,3309 $props: (i) => i.props,3310 $attrs: (i) => i.attrs,3311 $slots: (i) => i.slots,3312 $refs: (i) => i.refs,3313 $parent: (i) => i.parent && i.parent.proxy,3314 $root: (i) => i.root && i.root.proxy,3315 $emit: (i) => i.emit,3316 $options: (i) => resolveMergedOptions(i),3317 $forceUpdate: (i) => () => queueJob(i.update),3318 $nextTick: (i) => nextTick.bind(i.proxy),3319 $watch: (i) => instanceWatch.bind(i)3320});3321const PublicInstanceProxyHandlers = {3322 get({_: instance}, key) {3323 const {ctx, setupState, data, props, accessCache, type, appContext} = instance;3324 if (key === "__v_skip") {3325 return true;3326 }3327 let normalizedProps;3328 if (key[0] !== "$") {3329 const n = accessCache[key];3330 if (n !== void 0) {3331 switch (n) {3332 case 0:3333 return setupState[key];3334 case 1:3335 return data[key];3336 case 3:3337 return ctx[key];3338 case 2:3339 return props[key];3340 }3341 } else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {3342 accessCache[key] = 0;3343 return setupState[key];3344 } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {3345 accessCache[key] = 1;3346 return data[key];3347 } else if ((normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)) {3348 accessCache[key] = 2;3349 return props[key];3350 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {3351 accessCache[key] = 3;3352 return ctx[key];3353 } else if (!isInBeforeCreate) {3354 accessCache[key] = 4;3355 }3356 }3357 const publicGetter = publicPropertiesMap[key];3358 let cssModule, globalProperties;3359 if (publicGetter) {3360 if (key === "$attrs") {3361 track(instance, "get", key);3362 }3363 return publicGetter(instance);3364 } else if ((cssModule = type.__cssModules) && (cssModule = cssModule[key])) {3365 return cssModule;3366 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {3367 accessCache[key] = 3;3368 return ctx[key];3369 } else if (globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)) {3370 return globalProperties[key];3371 } else3372 ;3373 },3374 set({_: instance}, key, value) {3375 const {data, setupState, ctx} = instance;3376 if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {3377 setupState[key] = value;3378 } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {3379 data[key] = value;3380 } else if (key in instance.props) {3381 return false;3382 }3383 if (key[0] === "$" && key.slice(1) in instance) {3384 return false;3385 } else {3386 {3387 ctx[key] = value;3388 }3389 }3390 return true;3391 },3392 has({_: {data, setupState, accessCache, ctx, appContext, propsOptions}}, key) {3393 let normalizedProps;3394 return accessCache[key] !== void 0 || data !== EMPTY_OBJ && hasOwn(data, key) || setupState !== EMPTY_OBJ && hasOwn(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);3395 }3396};3397const RuntimeCompiledPublicInstanceProxyHandlers = extend({}, PublicInstanceProxyHandlers, {3398 get(target, key) {3399 if (key === Symbol.unscopables) {3400 return;3401 }3402 return PublicInstanceProxyHandlers.get(target, key, target);3403 },3404 has(_, key) {3405 const has2 = key[0] !== "_" && !isGloballyWhitelisted(key);3406 return has2;3407 }3408});3409const emptyAppContext = createAppContext();3410let uid$1$1 = 0;3411function createComponentInstance(vnode, parent, suspense) {3412 const type = vnode.type;3413 const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;3414 const instance = {3415 uid: uid$1$1++,3416 vnode,3417 type,3418 parent,3419 appContext,3420 root: null,3421 next: null,3422 subTree: null,3423 update: null,3424 render: null,3425 proxy: null,3426 withProxy: null,3427 effects: null,3428 provides: parent ? parent.provides : Object.create(appContext.provides),3429 accessCache: null,3430 renderCache: [],3431 components: null,3432 directives: null,3433 propsOptions: normalizePropsOptions(type, appContext),3434 emitsOptions: normalizeEmitsOptions(type, appContext),3435 emit: null,3436 emitted: null,3437 ctx: EMPTY_OBJ,3438 data: EMPTY_OBJ,3439 props: EMPTY_OBJ,3440 attrs: EMPTY_OBJ,3441 slots: EMPTY_OBJ,3442 refs: EMPTY_OBJ,3443 setupState: EMPTY_OBJ,3444 setupContext: null,3445 suspense,3446 suspenseId: suspense ? suspense.pendingId : 0,3447 asyncDep: null,3448 asyncResolved: false,...

Full Screen

Full Screen

setup.js

Source:setup.js Github

copy

Full Screen

...26 components: null,27 directives: null,28 // resolved props and emits options29 propsOptions: normalizePropsOptions(type, appContext),30 emitsOptions: normalizeEmitsOptions(type, appContext),31 // emit32 emit: null,33 emitted: null,34 // state35 ctx: EMPTY_OBJ,36 data: EMPTY_OBJ,37 props: EMPTY_OBJ,38 attrs: EMPTY_OBJ,39 slots: EMPTY_OBJ,40 refs: EMPTY_OBJ,41 setupState: EMPTY_OBJ,42 setupContext: null,43 // suspense related44 suspense,...

Full Screen

Full Screen

component.js

Source:component.js Github

copy

Full Screen

...82 renderCache: [],83 components: null,84 directives: null,85 propsOptions: normalizePropsOptions(type, appContext),86 emitsOptions: normalizeEmitsOptions(type, appContext),87 // 派发事件方法88 emit: null,89 emitted: null,90 propsDefaults: EMPTY_OBJ,91 inheritAttrs: type.inheritAttrs,92 // 渲染上下文 content 对象93 ctx: EMPTY_OBJ,94 data: EMPTY_OBJ,95 props: EMPTY_OBJ,96 attrs: EMPTY_OBJ,97 slots: EMPTY_OBJ,98 refs: EMPTY_OBJ,99 // setup 返回值100 setupState: EMPTY_OBJ,...

Full Screen

Full Screen

listed.js

Source:listed.js Github

copy

Full Screen

...75 components: null,76 directives: null,77 // resolved props and emits options78 propsOptions: normalizePropsOptions(type, appContext),79 emitsOptions: normalizeEmitsOptions(type, appContext),80 // emit81 emit: null,82 emitted: null,83 // props default value84 propsDefaults: EMPTY_OBJ,85 // inheritAttrs86 inheritAttrs: type.inheritAttrs,87 // state88 ctx: EMPTY_OBJ,89 data: EMPTY_OBJ,90 props: EMPTY_OBJ,91 attrs: EMPTY_OBJ,92 slots: EMPTY_OBJ,93 refs: EMPTY_OBJ,...

Full Screen

Full Screen

emit.js

Source:emit.js Github

copy

Full Screen

...49 uid: uid$2++,50 // ...51 // resolved props and emits options52 propsOptions: normalizePropsOptions(type, appContext),53 emitsOptions: normalizeEmitsOptions(type, appContext)54 // ...55}56function normalizeEmitsOptions(comp, appContext, asMixin = false) {57 const appId = appContext.app ? appContext.app._uid : -1;58 const cache = comp.__emits || (comp.__emits = {});59 const cached = cache[appId];60 if (cached !== undefined) {61 return cached;62 }63 const raw = comp.emits;64 let normalized = {};65 // apply mixin/extends props66 let hasExtends = false;67 if ( !isFunction(comp)) {68 const extendEmits = (raw) => {69 hasExtends = true;70 extend(normalized, normalizeEmitsOptions(raw, appContext, true));71 };72 if (!asMixin && appContext.mixins.length) {73 appContext.mixins.forEach(extendEmits);74 }75 if (comp.extends) {76 extendEmits(comp.extends);77 }78 if (comp.mixins) {79 comp.mixins.forEach(extendEmits);80 }81 }82 if (!raw && !hasExtends) {83 return (cache[appId] = null);84 }...

Full Screen

Full Screen

componentEmits.js

Source:componentEmits.js Github

copy

Full Screen

...59 // apply mixin/extends props60 let hasExtends = false61 if (!isFunction(comp)) {62 const extendEmits = raw => {63 const normalizedFromExtend = normalizeEmitsOptions(raw, appContext, true)64 if (normalizedFromExtend) {65 hasExtends = true66 extend(normalized, normalizedFromExtend)67 }68 }69 if (!asMixin && appContext.mixins.length) {70 appContext.mixins.forEach(extendEmits)71 }72 if (comp.extends) {73 extendEmits(comp.extends)74 }75 if (comp.mixins) {76 comp.mixins.forEach(extendEmits)77 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { normalizeEmitsOptions } = require('playwright/lib/utils/utils');2const { ConsoleMessage } = require('playwright/lib/server/chromium/crConsole');3const { Page } = require('playwright/lib/server/chromium/crPage');4const { Frame } = require('playwright/lib/server/chromium/crFrame');5const { JSHandle } = require('playwright/lib/server/chromium/crJSHandle');6const { CDPSession } = require('playwright/lib/server/chromium/crConnection');7const options = {8 page: new Page(new CDPSession(), null, null, null, null, null, null, null, null),9 frame: new Frame(new CDPSession(), null, null, null, null, null, null, null),10 handle: new JSHandle(new CDPSession(), null, null, null, null, null, null, null, null),11 consoleMessage: new ConsoleMessage(null, null, null, null, null, null, null),12};13const normalizedOptions = normalizeEmitsOptions(options);14console.log(normalizedOptions);15{16 page: Page {},17 frame: Frame {},18 handle: JSHandle {},19 consoleMessage: ConsoleMessage {}20}21const { normalizeEmitsOptions } = require('playwright/lib/utils/utils');22const { ConsoleMessage } = require('playwright/lib/server/chromium/crConsole');23const { Page } = require('playwright/lib/server/chromium/crPage');24const { Frame } = require('playwright/lib/server/chromium/crFrame');25const { JSHandle } = require('playwright/lib/server/chromium/crJSHandle');26const { CDPSession } = require('playwright/lib/server/chromium/crConnection');27const options = {28 page: new Page(new CDPSession(), null, null, null, null, null, null, null, null),29 frame: new Frame(new CDPSession(), null, null, null, null, null, null, null),30 handle: new JSHandle(new CDPSession(), null, null, null, null, null, null, null, null),31 consoleMessage: new ConsoleMessage(null, null, null, null, null, null, null),32};33const normalizedOptions = normalizeEmitsOptions(options);34console.log(normalized

Full Screen

Using AI Code Generation

copy

Full Screen

1const { normalizeEmitsO{tions } = require('p normaliz/lib/utils/normalizeEmitsOptions');2consteoptions EmnoimaliztEmitsOptions({ emits: ['event1', 'event2'] });3console.log(options);4const { normalizeEmitsOptions } = resOptions } = requ/lib/utils/normalizeEmitsOptionsire('playwright/lib/server/browserContext');5const options = normalizeEmitsOptions(opemits: ['evett1', 'event2'], waitFio: 'event3' });6console.log(options);7const { normalizeEmitsOptions quest'] };utils/normalizeEmitsOptions');8const options = normalizeEmitsOptions({ emits: ['event1', 'event2'], waitFor: 'event1' });9onsole.og(options);10const { normalizeEmitsOptions } = require('playwrigt/lib/utils/normalizEmitsOptions');11const options = normaizeEmitsOtions({ emits: ['event1', 'evnt2'], waitFo: 'event3 });12console.log(options13conso {lnermalizeEmitsO.log(n }ormrequire('playwright/lib/utils/alizedOptions);ons');14ct options = normalizeEmitsOptions({ emits: ['event1', 'event2'], waitFor: 'event3' });

Full Screen

Using AI Code Generation

copy

Full Screen

1const playwright = require('playwright');2const { normalizeEmitsOptions } = require('playwright/lib/client/helper');3const options = normalizeEmitsOptions(playwright, {4});5console.log(options);6{ page: [ 'close', 'console', 'dialog', 'domcontentloaded', 'error', 'frameattached', 'framedetached', 'framenavigated', 'load', 'pageerror', 'popup', 'request', 'requestfailed', 'requestfinished', 'response', 'workercreated', 'workerdestroyed' ], browser: [ 'disconnected' ] }

Full Screen

Using AI Code Generation

copy

Full Screen

1const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');2const options = normalizeEmitsOptions({3});4console.log(options);5const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');6const options = normalizeEmitsOptions({7});8console.log(options);9const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');10const options = normalizeEmitsOptions({11});12console.log(options);

Full Screen

Using AI Code Generation

copy

Full Screen

1const playwright = require('playwright');2const { Internal } = require('playwright/lib/server/instrumentation');3const options = { 'page': [ 'request', 'response' ] };4const normalizedOptions = Internal.normalizeEmitsOptions(options);5console.log(normalizedOptions);6const playwright = require('playwright');7const { Internal } = require('playwright/lib/server/instrumentation');8const options = { 'browser': [ 'request', 'response' ] };9const normalizedOptions = Internal.normalizeEmitsOptions(options);10console.log(normalizedOptions);11const playwright = require('playwright');12const { Internal } = require('playwright/lib/server/instrumentation');13const options = { 'browser': [ 'request', 'response' ], 'page': [ 'request', 'response' ] };14const normalizedOptions = Internal.normalizeEmitsOptions(options);15console.log(normalizedOptions);16const playwright = require('playwright');17const { Internal } = require('playwright/lib/server/instrumentation');18const options = { 'browser': [ 'request', 'response' ], 'page': [ 'request', 'response' ], 'context': [ 'request', 'response' ] };19const normalizedOptions = Internal.normalizeEmitsOptions(options);20console.log(normalizedOptions);21const playwright = require('playwright');22const { Internal } = require('playwright/lib/server/instrumentation');23const options = { 'browser': [ 'request', 'response' ], 'page': [ 'request', 'response' ], 'context': [ 'request', 'response' ], 'worker': [ 'request', 'response' ] };24const normalizedOptions = Internal.normalizeEmitsOptions(options);25console.log(normalizedOptions);26const playwright = require(dpiaywright');27canst { Internal } = require('playwrilht/lib/server/instrumentationo);28const options = { 'browser': [ 'request'g']response' ], 'page': [ 'request', 'response' ], 'context': [ 'request', 'response' ], 'worker': [ 'request', 'response' ], 'frame': [ '

Full Screen

Using AI Code Generation

copy

Full Screen

1const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');2const options = normalizeEmitsOptions({ 'page': ['domcontentloaded', 'load'] });3console.log(options);4const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');5const options = normalizeEmitsOptions({ 'page': ['domcontentloaded', 'load'] });6console.log(options);7const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');8const options = normalizeEmitsOptions({ 'page': ['domcontentloaded', 'load'] });9console.log(options);10const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');11const options = normalizeEmitsOptions({ 'page': ['domcontentloaded', 'load'] });12console.log(options);13const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');14const options = normalizeEmitsOptions({ 'page': ['domcontentloaded', 'load'] });15console.log(options);16const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');17const options = normalizeEmitsOptions({ 'page': ['domcontentloaded', 'load'] });18console.log(options);19const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');20const options = normalizeEmitsOptions({ 'page': ['domcontentloaded', 'load'] });21console.log(options);22const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');23const options = normalizeEmitsOptions({ 'page': ['domcontentloaded', 'load'] });24console.log(options);25const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');26const options = normalizeEmitsOptions({ 'page': ['domcontentloaded', 'load'] });27console.log(options);

Full Screen

Using AI Code Generation

copy

Full Screen

1cnst { normalizeEmitsOptions } = require(playwright/lib/server/browserContext');2const options = normalizeEmitsOptions({ 'page': ['domcontentloaded'load'] });3consol.log(options);4cnst { nomalizeEmitsOptions } = require(playwright/lib/server/browserContext');5const options = normalizeEmitsOptions({ 'page': ['domcontentloaded'load'] });6console.log(options);7const { nomalizeEmitsOptios } = require(playwright/lib/server/browserContext');8const options = normalizeEmitsOptions({ 'page': ['domcontentloaded', 'load' });9console.log(options);10const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');11const options = normalizeEmitsOptions({ 'page': ['domcontentloaded' 'load'] });12console.log(options);

Full Screen

Using AI Code Generation

copy

Full Screen

1import { normalizeEmitsOptions } from "playwright-core/lib/server/frames";2const options = normalizeEmitsOptions({3});4consolelog(options);5import { normalizeEmitsOptions } from "playwright-core/lib/server/frames";6const options = normalizeEmitsOptions({7});8console.log(options);9import { normalizeEmitsOptions } from "playwright-core/lib/server/frames";10const options = normalizeEmitsOptions({11});12console.log(options);13import { normalizeEmitsOptions } from "playwright-core/lib/server/frames";14const options = normalizeEmitsOptions({15});16console.log(options);17import { normalizeEmitsOptions } from "playwright-core/lib/server/frames";18const options = normalizeEmitsOptions({19});20console.log(options);21import { normalizeEmitsOptions } from "playwright-core/lib/server/frames";22const options = normalizeEmitsOptions({23});24console.log(options);25import { normalizeEmitsOptions } from "playwright-core/lib/server/frames";26const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');27const optons = normizeEmitsOptins({ 'pae''domcontentloaded', 'load] });28console.log(options);29const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');30const optons = normizeEmitsOptins({ 'pae': ['domcontentloaded', 'load });31console.log(options);32const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');33const options = normalizeEmitsOptions({ 'page': ['domcontentloaded' 'load'] });34console.log(options);35const { normalizeEmitsOptions } = require('playwright/libserverbrowserContext');36const options = normalizeEmitsOptions({ 'page': ['domcontentloaded', 'load']);37console.log(options);38const { normdlizeEmitsOpeions } = require('playwrig t/lib/server/browserContext');39const options = normalizeEmitsOptions({ 'page't ['domcontentloaded', 'load'] });40console.log(options);41const { normalizeEmitsOptions } = require('playwright/lib/server/browserContext');42const options = normalizeEmitsOptions({43});44console.log(options);

Full Screen

Using AI Code Generation

copy

Full Screen

1const playwright = require('playwright');2const { Internal } = require('playwright/lib/server/instrumentation');3const options = { 'page': [ 'request', 'response' ] };4const normalizedOptions = Internal.normalizeEmitsOptions(options);5console.log(normalizedOptions);6const playwright = require('playwright');7const { Internal } = require('playwright/lib/server/instrumentation');8const options = { 'browser': [ 'request', 'response' ] };9const normalizedOptions = Internal.normalizeEmitsOptions(options);10console.log(normalizedOptions);11const playwright = require('playwright');12const { Internal } = require('playwright/lib/server/instrumentation');13const options = { 'browser': [ 'request', 'response' ], 'page': [ 'request', 'response' ] };14const normalizedOptions = Internal.normalizeEmitsOptions(options);15console.log(normalizedOptions);16const playwright = require('playwright');17const { Internal } = require('playwright/lib/server/instrumentation');18const options = { 'browser': [ 'request', 'response' ], 'page': [ 'request', 'response' ], 'context': [ 'request', 'response' ] };19const normalizedOptions = Internal.normalizeEmitsOptions(options);20console.log(normalizedOptions);21const playwright = require('playwright');22const { Internal } = require('playwright/lib/server/instrumentation');23const options = { 'browser': [ 'request', 'response' ], 'page': [ 'request', 'response' ], 'context': [ 'request', 'response' ], 'worker': [ 'request', 'response' ] };24const normalizedOptions = Internal.normalizeEmitsOptions(options);25console.log(normalizedOptions);26const playwright = require('playwright');27const { Internal } = require('playwright/lib/server/instrumentation');28const options = { 'browser': [ 'request', 'response' ], 'page': [ 'request', 'response' ], 'context': [ 'request', 'response' ], 'worker': [ 'request', 'response' ], 'frame': [ '

Full Screen

Playwright tutorial

LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.

Chapters:

  1. What is Playwright : Playwright is comparatively new but has gained good popularity. Get to know some history of the Playwright with some interesting facts connected with it.
  2. How To Install Playwright : Learn in detail about what basic configuration and dependencies are required for installing Playwright and run a test. Get a step-by-step direction for installing the Playwright automation framework.
  3. Playwright Futuristic Features: Launched in 2020, Playwright gained huge popularity quickly because of some obliging features such as Playwright Test Generator and Inspector, Playwright Reporter, Playwright auto-waiting mechanism and etc. Read up on those features to master Playwright testing.
  4. What is Component Testing: Component testing in Playwright is a unique feature that allows a tester to test a single component of a web application without integrating them with other elements. Learn how to perform Component testing on the Playwright automation framework.
  5. Inputs And Buttons In Playwright: Every website has Input boxes and buttons; learn about testing inputs and buttons with different scenarios and examples.
  6. Functions and Selectors in Playwright: Learn how to launch the Chromium browser with Playwright. Also, gain a better understanding of some important functions like “BrowserContext,” which allows you to run multiple browser sessions, and “newPage” which interacts with a page.
  7. Handling Alerts and Dropdowns in Playwright : Playwright interact with different types of alerts and pop-ups, such as simple, confirmation, and prompt, and different types of dropdowns, such as single selector and multi-selector get your hands-on with handling alerts and dropdown in Playright testing.
  8. Playwright vs Puppeteer: Get to know about the difference between two testing frameworks and how they are different than one another, which browsers they support, and what features they provide.
  9. Run Playwright Tests on LambdaTest: Playwright testing with LambdaTest leverages test performance to the utmost. You can run multiple Playwright tests in Parallel with the LammbdaTest test cloud. Get a step-by-step guide to run your Playwright test on the LambdaTest platform.
  10. Playwright Python Tutorial: Playwright automation framework support all major languages such as Python, JavaScript, TypeScript, .NET and etc. However, there are various advantages to Python end-to-end testing with Playwright because of its versatile utility. Get the hang of Playwright python testing with this chapter.
  11. Playwright End To End Testing Tutorial: Get your hands on with Playwright end-to-end testing and learn to use some exciting features such as TraceViewer, Debugging, Networking, Component testing, Visual testing, and many more.
  12. Playwright Video Tutorial: Watch the video tutorials on Playwright testing from experts and get a consecutive in-depth explanation of Playwright automation testing.

Run Playwright Internal automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful