@vue/composition-api
Advanced tools
Comparing version 1.0.0-beta.1 to 1.0.0-beta.2
@@ -0,4 +1,27 @@ | ||
<a name="1.0.0-beta.2"></a> | ||
# [1.0.0-beta.2](https://github.com/vuejs/composition-api/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2020-07-05) | ||
### Bug Fixes | ||
* prevent multiple plugins get installed ([#427](https://github.com/vuejs/composition-api/issues/427)) ([94d4d87](https://github.com/vuejs/composition-api/commit/94d4d87)) | ||
* remove "browser" field in package.json ([#424](https://github.com/vuejs/composition-api/issues/424)) ([4ebeda4](https://github.com/vuejs/composition-api/commit/4ebeda4)) | ||
* toRaw typo ([#429](https://github.com/vuejs/composition-api/issues/429)) ([9468f72](https://github.com/vuejs/composition-api/commit/9468f72)) | ||
### Features | ||
* add customRef ([#423](https://github.com/vuejs/composition-api/issues/423)) ([a8686bb](https://github.com/vuejs/composition-api/commit/a8686bb)) | ||
* add useCSSModule api ([#420](https://github.com/vuejs/composition-api/issues/420)) ([1ceac1d](https://github.com/vuejs/composition-api/commit/1ceac1d)) | ||
<a name="1.0.0-beta.1"></a> | ||
# [1.0.0-beta.1](https://github.com/vuejs/composition-api/compare/v0.6.7...v1.0.0-beta.1) (2020-06-30) | ||
## BREAKING CHANGES | ||
* change umd exported name to `VueCompositionAPI` ([#399](https://github.com/vuejs/composition-api/issues/399)) | ||
* rename `createElement` to `h` ([#400](https://github.com/vuejs/composition-api/issues/400)) | ||
* drop `createComponent` ([#389](https://github.com/vuejs/composition-api/issues/389)) | ||
* match dist file naming with vue-next ([#413](https://github.com/vuejs/composition-api/issues/413)) | ||
@@ -5,0 +28,0 @@ ### Bug Fixes |
@@ -138,20 +138,6 @@ import Vue$1, { VueConstructor, ComponentOptions, VNode, CreateElement } from 'vue'; | ||
interface App { | ||
config: VueConstructor$1['config']; | ||
use: VueConstructor$1['use']; | ||
mixin: VueConstructor$1['mixin']; | ||
component: VueConstructor$1['component']; | ||
directive: VueConstructor$1['directive']; | ||
mount: Vue$1['$mount']; | ||
unmount: Vue$1['$destroy']; | ||
} | ||
declare function createApp(rootComponent: any, rootProps?: any): App; | ||
declare const Plugin: { | ||
install: (Vue: VueConstructor) => void; | ||
}; | ||
declare type NextTick = Vue$1['$nextTick']; | ||
declare const nextTick: NextTick; | ||
declare const createElement: CreateElement; | ||
declare function getCurrentInstance(): ComponentInstance | null; | ||
interface Option<T> { | ||
@@ -241,2 +227,7 @@ get: () => T; | ||
declare function toRefs<T extends Data = Data>(obj: T): ToRefs<T>; | ||
declare type CustomRefFactory<T> = (track: () => void, trigger: () => void) => { | ||
get: () => T; | ||
set: (value: T) => void; | ||
}; | ||
declare function customRef<T>(factory: CustomRefFactory<T>): Ref<T>; | ||
declare function toRef<T extends object, K extends keyof T>(object: T, key: K): Ref<T[K]>; | ||
@@ -249,2 +240,3 @@ declare function shallowRef<T>(value: T): T extends Ref ? T : Ref<T>; | ||
declare function shallowReactive<T extends object = any>(obj: T): T; | ||
declare function markReactive(target: any, shallow?: boolean): void; | ||
/** | ||
@@ -313,2 +305,22 @@ * Make obj reactivity | ||
declare const useCSSModule: (name?: string) => Record<string, string>; | ||
interface App { | ||
config: VueConstructor$1['config']; | ||
use: VueConstructor$1['use']; | ||
mixin: VueConstructor$1['mixin']; | ||
component: VueConstructor$1['component']; | ||
directive: VueConstructor$1['directive']; | ||
mount: Vue$1['$mount']; | ||
unmount: Vue$1['$destroy']; | ||
} | ||
declare function createApp(rootComponent: any, rootProps?: any): App; | ||
declare type NextTick = Vue$1['$nextTick']; | ||
declare const nextTick: NextTick; | ||
declare const createElement: CreateElement; | ||
declare function getCurrentInstance(): ComponentInstance | null; | ||
declare module 'vue/types/options' { | ||
@@ -319,7 +331,4 @@ interface ComponentOptions<V extends Vue$1> { | ||
} | ||
declare const VueCompositionAPI: { | ||
install: (Vue: VueConstructor) => void; | ||
}; | ||
export default VueCompositionAPI; | ||
export { ComponentRenderProxy, ComputedRef, FlushMode, InjectionKey, PropOptions, PropType, Ref, SetupContext, UnwrapRef, VueWatcher, WatchCallback, WatchEffect, WatchOptions, WatchOptionsBase, WatchSource, WatchStopHandle, WritableComputedRef, computed, createApp, defineComponent, getCurrentInstance, createElement as h, inject, isReactive, isRef, markRaw, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onServerPrefetch, onUnmounted, onUpdated, provide, reactive, ref, set, shallowReactive, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, watch, watchEffect }; | ||
export default Plugin; | ||
export { ComponentRenderProxy, ComputedRef, FlushMode, InjectionKey, PropOptions, PropType, Ref, SetupContext, UnwrapRef, VueWatcher, WatchCallback, WatchEffect, WatchOptions, WatchOptionsBase, WatchSource, WatchStopHandle, WritableComputedRef, computed, createApp, customRef, defineComponent, getCurrentInstance, createElement as h, inject, isReactive, isRef, markRaw, markReactive, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onServerPrefetch, onUnmounted, onUpdated, provide, reactive, ref, set, shallowReactive, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useCSSModule, watch, watchEffect }; |
@@ -69,79 +69,30 @@ 'use strict'; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
function __values(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
var vueConstructor = null; | ||
var currentInstance = null; | ||
var PluginInstalledFlag = '__composition_api_installed__'; | ||
function isPluginInstalled() { | ||
return !!vueConstructor; | ||
} | ||
function __read(o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
function isVueRegistered(Vue) { | ||
return hasOwn(Vue, PluginInstalledFlag); | ||
} | ||
function __spread() { | ||
for (var ar = [], i = 0; i < arguments.length; i++) | ||
ar = ar.concat(__read(arguments[i])); | ||
return ar; | ||
} | ||
var currentVue = null; | ||
var currentVM = null; | ||
function getCurrentVue() { | ||
function getVueConstructor() { | ||
{ | ||
assert(currentVue, "must call Vue.use(VueCompositionAPI) before using any function."); | ||
assert(vueConstructor, "must call Vue.use(VueCompositionAPI) before using any function."); | ||
} | ||
return currentVue; | ||
return vueConstructor; | ||
} | ||
function setCurrentVue(vue) { | ||
currentVue = vue; | ||
function setVueConstructor(Vue) { | ||
vueConstructor = Vue; | ||
Object.defineProperty(Vue, PluginInstalledFlag, { | ||
configurable: true, | ||
writable: true, | ||
value: true, | ||
}); | ||
} | ||
function getCurrentInstance() { | ||
return currentVM; | ||
return currentInstance; | ||
} | ||
function setCurrentVM(vm) { | ||
currentVM = vm; | ||
function setCurrentInstance(vm) { | ||
currentInstance = vm; | ||
} | ||
@@ -167,3 +118,4 @@ | ||
function isComponentInstance(obj) { | ||
return currentVue && obj instanceof currentVue; | ||
var Vue = getVueConstructor(); | ||
return Vue && obj instanceof Vue; | ||
} | ||
@@ -208,12 +160,73 @@ function createSlotProxy(vm, slotName) { | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
function __values(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
} | ||
function __read(o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
} | ||
function __spread() { | ||
for (var ar = [], i = 0; i < arguments.length; i++) | ||
ar = ar.concat(__read(arguments[i])); | ||
return ar; | ||
} | ||
function createSymbol(name) { | ||
return hasSymbol ? Symbol.for(name) : name; | ||
} | ||
var WatcherPreFlushQueueKey = createSymbol('vfa.key.preFlushQueue'); | ||
var WatcherPostFlushQueueKey = createSymbol('vfa.key.postFlushQueue'); | ||
var AccessControlIdentifierKey = createSymbol('vfa.key.accessControlIdentifier'); | ||
var ReactiveIdentifierKey = createSymbol('vfa.key.reactiveIdentifier'); | ||
var RawIdentifierKey = createSymbol('vfa.key.rawIdentifierKey'); | ||
var WatcherPreFlushQueueKey = createSymbol('composition-api.preFlushQueue'); | ||
var WatcherPostFlushQueueKey = createSymbol('composition-api.postFlushQueue'); | ||
var AccessControlIdentifierKey = createSymbol('composition-api.accessControlIdentifier'); | ||
var ReactiveIdentifierKey = createSymbol('composition-api.reactiveIdentifier'); | ||
var RawIdentifierKey = createSymbol('composition-api.rawIdentifierKey'); | ||
// must be a string, symbol key is ignored in reactive | ||
var RefKey = 'vfa.key.refKey'; | ||
var RefKey = 'composition-api.refKey'; | ||
@@ -265,2 +278,8 @@ var RefImpl = /** @class */ (function () { | ||
} | ||
function customRef(factory) { | ||
var version = ref(0); | ||
return createRef(factory(function () { return void version.value; }, function () { | ||
++version.value; | ||
})); | ||
} | ||
function toRef(object, key) { | ||
@@ -382,3 +401,3 @@ var v = object[key]; | ||
function observe(obj) { | ||
var Vue = getCurrentVue(); | ||
var Vue = getVueConstructor(); | ||
var observed; | ||
@@ -528,3 +547,3 @@ if (Vue.observable) { | ||
function toRaw(observed) { | ||
if (isRaw(observe) || !Object.isExtensible(observed)) { | ||
if (isRaw(observed) || !Object.isExtensible(observed)) { | ||
return observed; | ||
@@ -555,3 +574,3 @@ } | ||
function set(target, key, val) { | ||
var Vue = getCurrentVue(); | ||
var Vue = getVueConstructor(); | ||
var _a = Vue.util, warn = _a.warn, defineReactive = _a.defineReactive; | ||
@@ -589,67 +608,2 @@ if ( (isUndef(target) || isPrimitive(target))) { | ||
/** | ||
* Helper that recursively merges two data objects together. | ||
*/ | ||
function mergeData(from, to) { | ||
if (!from) | ||
return to; | ||
if (!to) | ||
return from; | ||
var key; | ||
var toVal; | ||
var fromVal; | ||
var keys = hasSymbol ? Reflect.ownKeys(from) : Object.keys(from); | ||
for (var i = 0; i < keys.length; i++) { | ||
key = keys[i]; | ||
// in case the object is already observed... | ||
if (key === '__ob__') | ||
continue; | ||
toVal = to[key]; | ||
fromVal = from[key]; | ||
if (!hasOwn(to, key)) { | ||
to[key] = fromVal; | ||
} | ||
else if (toVal !== fromVal && | ||
isPlainObject(toVal) && | ||
!isRef(toVal) && | ||
isPlainObject(fromVal) && | ||
!isRef(fromVal)) { | ||
mergeData(fromVal, toVal); | ||
} | ||
} | ||
return to; | ||
} | ||
function install(Vue, _install) { | ||
if (currentVue && currentVue === Vue) { | ||
{ | ||
assert(false, 'already installed. Vue.use(VueCompositionAPI) should be called only once.'); | ||
} | ||
return; | ||
} | ||
{ | ||
if (!Vue.version.startsWith('2.')) { | ||
assert(false, "@vue/composition-api only works with Vue 2, v" + Vue.version + " found."); | ||
} | ||
} | ||
Vue.config.optionMergeStrategies.setup = function (parent, child) { | ||
return function mergedSetupFn(props, context) { | ||
return mergeData(typeof parent === 'function' ? parent(props, context) || {} : undefined, typeof child === 'function' ? child(props, context) || {} : undefined); | ||
}; | ||
}; | ||
setCurrentVue(Vue); | ||
_install(Vue); | ||
} | ||
function set$1(vm, key, value) { | ||
var state = (vm.__secret_vfa_state__ = vm.__secret_vfa_state__ || {}); | ||
state[key] = value; | ||
} | ||
function get(vm, key) { | ||
return (vm.__secret_vfa_state__ || {})[key]; | ||
} | ||
var vmStateManager = { | ||
set: set$1, | ||
get: get, | ||
}; | ||
function unwrapRefProxy(value, map) { | ||
@@ -676,3 +630,6 @@ var e_1, _a; | ||
if (value.__ob__) { | ||
Object.defineProperty(obj, '__ob__', value.__ob__); | ||
Object.defineProperty(obj, '__ob__', { | ||
enumerable: false, | ||
value: value.__ob__, | ||
}); | ||
} | ||
@@ -711,321 +668,2 @@ var _loop_1 = function (k) { | ||
function asVmProperty(vm, propName, propValue) { | ||
var props = vm.$options.props; | ||
if (!(propName in vm) && !(props && hasOwn(props, propName))) { | ||
proxy(vm, propName, { | ||
get: function () { return propValue.value; }, | ||
set: function (val) { | ||
propValue.value = val; | ||
}, | ||
}); | ||
{ | ||
// expose binding to Vue Devtool as a data property | ||
// delay this until state has been resolved to prevent repeated works | ||
vm.$nextTick(function () { | ||
proxy(vm._data, propName, { | ||
get: function () { return propValue.value; }, | ||
set: function (val) { | ||
propValue.value = val; | ||
}, | ||
}); | ||
}); | ||
} | ||
} | ||
else { | ||
if (props && hasOwn(props, propName)) { | ||
warn("The setup binding property \"" + propName + "\" is already declared as a prop.", vm); | ||
} | ||
else { | ||
warn("The setup binding property \"" + propName + "\" is already declared.", vm); | ||
} | ||
} | ||
} | ||
function updateTemplateRef(vm) { | ||
var rawBindings = vmStateManager.get(vm, 'rawBindings') || {}; | ||
if (!rawBindings || !Object.keys(rawBindings).length) | ||
return; | ||
var refs = vm.$refs; | ||
var oldRefKeys = vmStateManager.get(vm, 'refs') || []; | ||
for (var index = 0; index < oldRefKeys.length; index++) { | ||
var key = oldRefKeys[index]; | ||
var setupValue = rawBindings[key]; | ||
if (!refs[key] && setupValue && isRef(setupValue)) { | ||
setupValue.value = null; | ||
} | ||
} | ||
var newKeys = Object.keys(refs); | ||
var validNewKeys = []; | ||
for (var index = 0; index < newKeys.length; index++) { | ||
var key = newKeys[index]; | ||
var setupValue = rawBindings[key]; | ||
if (refs[key] && setupValue && isRef(setupValue)) { | ||
setupValue.value = refs[key]; | ||
validNewKeys.push(key); | ||
} | ||
} | ||
vmStateManager.set(vm, 'refs', validNewKeys); | ||
} | ||
function resolveScopedSlots(vm, slotsProxy) { | ||
var parentVode = vm.$options._parentVnode; | ||
if (!parentVode) | ||
return; | ||
var prevSlots = vmStateManager.get(vm, 'slots') || []; | ||
var curSlots = resolveSlots(parentVode.data.scopedSlots, vm.$slots); | ||
// remove staled slots | ||
for (var index = 0; index < prevSlots.length; index++) { | ||
var key = prevSlots[index]; | ||
if (!curSlots[key]) { | ||
delete slotsProxy[key]; | ||
} | ||
} | ||
// proxy fresh slots | ||
var slotNames = Object.keys(curSlots); | ||
for (var index = 0; index < slotNames.length; index++) { | ||
var key = slotNames[index]; | ||
if (!slotsProxy[key]) { | ||
slotsProxy[key] = createSlotProxy(vm, key); | ||
} | ||
} | ||
vmStateManager.set(vm, 'slots', slotNames); | ||
} | ||
function activateCurrentInstance(vm, fn, onError) { | ||
var preVm = getCurrentInstance(); | ||
setCurrentVM(vm); | ||
try { | ||
return fn(vm); | ||
} | ||
catch (err) { | ||
if (onError) { | ||
onError(err); | ||
} | ||
else { | ||
throw err; | ||
} | ||
} | ||
finally { | ||
setCurrentVM(preVm); | ||
} | ||
} | ||
function mixin(Vue) { | ||
Vue.mixin({ | ||
beforeCreate: functionApiInit, | ||
mounted: function () { | ||
updateTemplateRef(this); | ||
}, | ||
updated: function () { | ||
updateTemplateRef(this); | ||
}, | ||
}); | ||
/** | ||
* Vuex init hook, injected into each instances init hooks list. | ||
*/ | ||
function functionApiInit() { | ||
var vm = this; | ||
var $options = vm.$options; | ||
var setup = $options.setup, render = $options.render; | ||
if (render) { | ||
// keep currentInstance accessible for createElement | ||
$options.render = function () { | ||
var _this = this; | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return activateCurrentInstance(vm, function () { return render.apply(_this, args); }); | ||
}; | ||
} | ||
if (!setup) { | ||
return; | ||
} | ||
if (typeof setup !== 'function') { | ||
{ | ||
warn('The "setup" option should be a function that returns a object in component definitions.', vm); | ||
} | ||
return; | ||
} | ||
var data = $options.data; | ||
// wrapper the data option, so we can invoke setup before data get resolved | ||
$options.data = function wrappedData() { | ||
initSetup(vm, vm.$props); | ||
return typeof data === 'function' | ||
? data.call(vm, vm) | ||
: data || {}; | ||
}; | ||
} | ||
function initSetup(vm, props) { | ||
if (props === void 0) { props = {}; } | ||
var setup = vm.$options.setup; | ||
var ctx = createSetupContext(vm); | ||
// mark props as reactive | ||
markReactive(props); | ||
// resolve scopedSlots and slots to functions | ||
resolveScopedSlots(vm, ctx.slots); | ||
var binding; | ||
activateCurrentInstance(vm, function () { | ||
binding = setup(props, ctx); | ||
}); | ||
if (!binding) | ||
return; | ||
if (isFunction(binding)) { | ||
// keep typescript happy with the binding type. | ||
var bindingFunc_1 = binding; | ||
// keep currentInstance accessible for createElement | ||
vm.$options.render = function () { | ||
resolveScopedSlots(vm, ctx.slots); | ||
return activateCurrentInstance(vm, function () { return bindingFunc_1(); }); | ||
}; | ||
return; | ||
} | ||
if (isPlainObject(binding)) { | ||
var bindingObj_1 = binding; | ||
vmStateManager.set(vm, 'rawBindings', binding); | ||
Object.keys(binding).forEach(function (name) { | ||
var bindingValue = bindingObj_1[name]; | ||
// only make primitive value reactive | ||
if (!isRef(bindingValue)) { | ||
if (isReactive(bindingValue)) { | ||
bindingValue = ref(bindingValue); | ||
} | ||
else { | ||
// bind function to the vm, this will make `this` = vm | ||
if (isFunction(bindingValue)) { | ||
bindingValue = bindingValue.bind(vm); | ||
} | ||
// unwrap all ref properties | ||
var unwrapped = unwrapRefProxy(bindingValue); | ||
// mark the object as reactive | ||
markReactive(unwrapped); | ||
// a non-reactive should not don't get reactivity | ||
bindingValue = ref(markRaw(unwrapped)); | ||
} | ||
} | ||
asVmProperty(vm, name, bindingValue); | ||
}); | ||
return; | ||
} | ||
{ | ||
assert(false, "\"setup\" must return a \"Object\" or a \"Function\", got \"" + Object.prototype.toString | ||
.call(binding) | ||
.slice(8, -1) + "\""); | ||
} | ||
} | ||
function createSetupContext(vm) { | ||
var ctx = { | ||
slots: {}, | ||
}; | ||
var props = [ | ||
'root', | ||
'parent', | ||
'refs', | ||
'attrs', | ||
'listeners', | ||
'isServer', | ||
'ssrContext', | ||
]; | ||
var methodReturnVoid = ['emit']; | ||
props.forEach(function (key) { | ||
var _a; | ||
var targetKey; | ||
var srcKey; | ||
if (Array.isArray(key)) { | ||
_a = __read(key, 2), targetKey = _a[0], srcKey = _a[1]; | ||
} | ||
else { | ||
targetKey = srcKey = key; | ||
} | ||
srcKey = "$" + srcKey; | ||
proxy(ctx, targetKey, { | ||
get: function () { return vm[srcKey]; }, | ||
set: function () { | ||
warn("Cannot assign to '" + targetKey + "' because it is a read-only property", vm); | ||
}, | ||
}); | ||
}); | ||
methodReturnVoid.forEach(function (key) { | ||
var srcKey = "$" + key; | ||
proxy(ctx, key, { | ||
get: function () { | ||
return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var fn = vm[srcKey]; | ||
fn.apply(vm, args); | ||
}; | ||
}, | ||
}); | ||
}); | ||
return ctx; | ||
} | ||
} | ||
function createApp(rootComponent, rootProps) { | ||
if (rootProps === void 0) { rootProps = undefined; } | ||
var V = getCurrentVue(); | ||
var mountedVM = undefined; | ||
return { | ||
config: V.config, | ||
use: V.use.bind(V), | ||
mixin: V.mixin.bind(V), | ||
component: V.component.bind(V), | ||
directive: V.directive.bind(V), | ||
mount: function (el, hydrating) { | ||
if (!mountedVM) { | ||
mountedVM = new V(__assign({ propsData: rootProps }, rootComponent)); | ||
mountedVM.$mount(el, hydrating); | ||
return mountedVM; | ||
} | ||
else { | ||
{ | ||
warn("App has already been mounted.\n" + | ||
"If you want to remount the same app, move your app creation logic " + | ||
"into a factory function and create fresh app instances for each " + | ||
"mount - e.g. `const createMyApp = () => createApp(App)`"); | ||
} | ||
return mountedVM; | ||
} | ||
}, | ||
unmount: function () { | ||
if (mountedVM) { | ||
mountedVM.$destroy(); | ||
mountedVM = undefined; | ||
} | ||
else { | ||
warn("Cannot unmount an app that is not mounted."); | ||
} | ||
}, | ||
}; | ||
} | ||
var nextTick = function nextTick() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return currentVue === null || currentVue === void 0 ? void 0 : currentVue.nextTick.apply(this, args); | ||
}; | ||
var fallbackCreateElement; | ||
var createElement = function createElement() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
if (!currentVM) { | ||
warn('`createElement()` has been called outside of render function.'); | ||
if (!fallbackCreateElement) { | ||
fallbackCreateElement = defineComponentInstance(getCurrentVue()) | ||
.$createElement; | ||
} | ||
return fallbackCreateElement.apply(fallbackCreateElement, args); | ||
} | ||
return currentVM.$createElement.apply(currentVM, args); | ||
}; | ||
// implementation, close to no-op | ||
function defineComponent(options) { | ||
return options; | ||
} | ||
var genName = function (name) { return "on" + (name[0].toUpperCase() + name.slice(1)); }; | ||
@@ -1036,3 +674,3 @@ function createLifeCycle(lifeCyclehook) { | ||
if (vm) { | ||
injectHookOption(getCurrentVue(), vm, lifeCyclehook, callback); | ||
injectHookOption(getVueConstructor(), vm, lifeCyclehook, callback); | ||
} | ||
@@ -1053,3 +691,3 @@ }; | ||
var preVm = getCurrentInstance(); | ||
setCurrentVM(vm); | ||
setCurrentInstance(vm); | ||
try { | ||
@@ -1059,3 +697,3 @@ return fn.apply(void 0, __spread(args)); | ||
finally { | ||
setCurrentVM(preVm); | ||
setCurrentInstance(preVm); | ||
} | ||
@@ -1110,3 +748,3 @@ }; | ||
if (!fallbackVM) { | ||
fallbackVM = defineComponentInstance(getCurrentVue()); | ||
fallbackVM = defineComponentInstance(getVueConstructor()); | ||
} | ||
@@ -1334,3 +972,3 @@ vm = fallbackVM; | ||
} | ||
var computedHost = defineComponentInstance(getCurrentVue(), { | ||
var computedHost = defineComponentInstance(getVueConstructor(), { | ||
computed: { | ||
@@ -1393,3 +1031,3 @@ $$state: { | ||
else { | ||
if (defaultValue === undefined && "development" !== 'production') { | ||
if (defaultValue === undefined && true) { | ||
warn("Injection \"" + String(key) + "\" not found", vm); | ||
@@ -1405,8 +1043,414 @@ } | ||
var VueCompositionAPI = { | ||
install: function (Vue) { return install(Vue, mixin); }, | ||
var EMPTY_OBJ = Object.freeze({}) | ||
; | ||
var useCSSModule = function (name) { | ||
if (name === void 0) { name = '$style'; } | ||
var instance = getCurrentInstance(); | ||
if (!instance) { | ||
warn("useCSSModule must be called inside setup()"); | ||
return EMPTY_OBJ; | ||
} | ||
var mod = instance[name]; | ||
if (!mod) { | ||
warn("Current instance does not have CSS module named \"" + name + "\"."); | ||
return EMPTY_OBJ; | ||
} | ||
return mod; | ||
}; | ||
function createApp(rootComponent, rootProps) { | ||
if (rootProps === void 0) { rootProps = undefined; } | ||
var V = getVueConstructor(); | ||
var mountedVM = undefined; | ||
return { | ||
config: V.config, | ||
use: V.use.bind(V), | ||
mixin: V.mixin.bind(V), | ||
component: V.component.bind(V), | ||
directive: V.directive.bind(V), | ||
mount: function (el, hydrating) { | ||
if (!mountedVM) { | ||
mountedVM = new V(__assign({ propsData: rootProps }, rootComponent)); | ||
mountedVM.$mount(el, hydrating); | ||
return mountedVM; | ||
} | ||
else { | ||
{ | ||
warn("App has already been mounted.\n" + | ||
"If you want to remount the same app, move your app creation logic " + | ||
"into a factory function and create fresh app instances for each " + | ||
"mount - e.g. `const createMyApp = () => createApp(App)`"); | ||
} | ||
return mountedVM; | ||
} | ||
}, | ||
unmount: function () { | ||
if (mountedVM) { | ||
mountedVM.$destroy(); | ||
mountedVM = undefined; | ||
} | ||
else { | ||
warn("Cannot unmount an app that is not mounted."); | ||
} | ||
}, | ||
}; | ||
} | ||
var nextTick = function nextTick() { | ||
var _a; | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return (_a = getVueConstructor()) === null || _a === void 0 ? void 0 : _a.nextTick.apply(this, args); | ||
}; | ||
var fallbackCreateElement; | ||
var createElement = function createElement() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var instance = getCurrentInstance(); | ||
if (!instance) { | ||
warn('`createElement()` has been called outside of render function.'); | ||
if (!fallbackCreateElement) { | ||
fallbackCreateElement = defineComponentInstance(getVueConstructor()) | ||
.$createElement; | ||
} | ||
return fallbackCreateElement.apply(fallbackCreateElement, args); | ||
} | ||
return instance.$createElement.apply(instance, args); | ||
}; | ||
function set$1(vm, key, value) { | ||
var state = (vm.__composition_api_state__ = | ||
vm.__composition_api_state__ || {}); | ||
state[key] = value; | ||
} | ||
function get(vm, key) { | ||
return (vm.__composition_api_state__ || {})[key]; | ||
} | ||
var vmStateManager = { | ||
set: set$1, | ||
get: get, | ||
}; | ||
function asVmProperty(vm, propName, propValue) { | ||
var props = vm.$options.props; | ||
if (!(propName in vm) && !(props && hasOwn(props, propName))) { | ||
proxy(vm, propName, { | ||
get: function () { return propValue.value; }, | ||
set: function (val) { | ||
propValue.value = val; | ||
}, | ||
}); | ||
{ | ||
// expose binding to Vue Devtool as a data property | ||
// delay this until state has been resolved to prevent repeated works | ||
vm.$nextTick(function () { | ||
proxy(vm._data, propName, { | ||
get: function () { return propValue.value; }, | ||
set: function (val) { | ||
propValue.value = val; | ||
}, | ||
}); | ||
}); | ||
} | ||
} | ||
else { | ||
if (props && hasOwn(props, propName)) { | ||
warn("The setup binding property \"" + propName + "\" is already declared as a prop.", vm); | ||
} | ||
else { | ||
warn("The setup binding property \"" + propName + "\" is already declared.", vm); | ||
} | ||
} | ||
} | ||
function updateTemplateRef(vm) { | ||
var rawBindings = vmStateManager.get(vm, 'rawBindings') || {}; | ||
if (!rawBindings || !Object.keys(rawBindings).length) | ||
return; | ||
var refs = vm.$refs; | ||
var oldRefKeys = vmStateManager.get(vm, 'refs') || []; | ||
for (var index = 0; index < oldRefKeys.length; index++) { | ||
var key = oldRefKeys[index]; | ||
var setupValue = rawBindings[key]; | ||
if (!refs[key] && setupValue && isRef(setupValue)) { | ||
setupValue.value = null; | ||
} | ||
} | ||
var newKeys = Object.keys(refs); | ||
var validNewKeys = []; | ||
for (var index = 0; index < newKeys.length; index++) { | ||
var key = newKeys[index]; | ||
var setupValue = rawBindings[key]; | ||
if (refs[key] && setupValue && isRef(setupValue)) { | ||
setupValue.value = refs[key]; | ||
validNewKeys.push(key); | ||
} | ||
} | ||
vmStateManager.set(vm, 'refs', validNewKeys); | ||
} | ||
function resolveScopedSlots(vm, slotsProxy) { | ||
var parentVNode = vm.$options._parentVnode; | ||
if (!parentVNode) | ||
return; | ||
var prevSlots = vmStateManager.get(vm, 'slots') || []; | ||
var curSlots = resolveSlots(parentVNode.data.scopedSlots, vm.$slots); | ||
// remove staled slots | ||
for (var index = 0; index < prevSlots.length; index++) { | ||
var key = prevSlots[index]; | ||
if (!curSlots[key]) { | ||
delete slotsProxy[key]; | ||
} | ||
} | ||
// proxy fresh slots | ||
var slotNames = Object.keys(curSlots); | ||
for (var index = 0; index < slotNames.length; index++) { | ||
var key = slotNames[index]; | ||
if (!slotsProxy[key]) { | ||
slotsProxy[key] = createSlotProxy(vm, key); | ||
} | ||
} | ||
vmStateManager.set(vm, 'slots', slotNames); | ||
} | ||
function activateCurrentInstance(vm, fn, onError) { | ||
var preVm = getCurrentInstance(); | ||
setCurrentInstance(vm); | ||
try { | ||
return fn(vm); | ||
} | ||
catch (err) { | ||
if (onError) { | ||
onError(err); | ||
} | ||
else { | ||
throw err; | ||
} | ||
} | ||
finally { | ||
setCurrentInstance(preVm); | ||
} | ||
} | ||
function mixin(Vue) { | ||
Vue.mixin({ | ||
beforeCreate: functionApiInit, | ||
mounted: function () { | ||
updateTemplateRef(this); | ||
}, | ||
updated: function () { | ||
updateTemplateRef(this); | ||
}, | ||
}); | ||
/** | ||
* Vuex init hook, injected into each instances init hooks list. | ||
*/ | ||
function functionApiInit() { | ||
var vm = this; | ||
var $options = vm.$options; | ||
var setup = $options.setup, render = $options.render; | ||
if (render) { | ||
// keep currentInstance accessible for createElement | ||
$options.render = function () { | ||
var _this = this; | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return activateCurrentInstance(vm, function () { return render.apply(_this, args); }); | ||
}; | ||
} | ||
if (!setup) { | ||
return; | ||
} | ||
if (typeof setup !== 'function') { | ||
{ | ||
warn('The "setup" option should be a function that returns a object in component definitions.', vm); | ||
} | ||
return; | ||
} | ||
var data = $options.data; | ||
// wrapper the data option, so we can invoke setup before data get resolved | ||
$options.data = function wrappedData() { | ||
initSetup(vm, vm.$props); | ||
return typeof data === 'function' | ||
? data.call(vm, vm) | ||
: data || {}; | ||
}; | ||
} | ||
function initSetup(vm, props) { | ||
if (props === void 0) { props = {}; } | ||
var setup = vm.$options.setup; | ||
var ctx = createSetupContext(vm); | ||
// mark props as reactive | ||
markReactive(props); | ||
// resolve scopedSlots and slots to functions | ||
resolveScopedSlots(vm, ctx.slots); | ||
var binding; | ||
activateCurrentInstance(vm, function () { | ||
binding = setup(props, ctx); | ||
}); | ||
if (!binding) | ||
return; | ||
if (isFunction(binding)) { | ||
// keep typescript happy with the binding type. | ||
var bindingFunc_1 = binding; | ||
// keep currentInstance accessible for createElement | ||
vm.$options.render = function () { | ||
resolveScopedSlots(vm, ctx.slots); | ||
return activateCurrentInstance(vm, function () { return bindingFunc_1(); }); | ||
}; | ||
return; | ||
} | ||
if (isPlainObject(binding)) { | ||
var bindingObj_1 = binding; | ||
vmStateManager.set(vm, 'rawBindings', binding); | ||
Object.keys(binding).forEach(function (name) { | ||
var bindingValue = bindingObj_1[name]; | ||
// only make primitive value reactive | ||
if (!isRef(bindingValue)) { | ||
if (isReactive(bindingValue)) { | ||
bindingValue = ref(bindingValue); | ||
} | ||
else { | ||
// bind function to the vm, this will make `this` = vm | ||
if (isFunction(bindingValue)) { | ||
bindingValue = bindingValue.bind(vm); | ||
} | ||
// unwrap all ref properties | ||
var unwrapped = unwrapRefProxy(bindingValue); | ||
// mark the object as reactive | ||
markReactive(unwrapped); | ||
// a non-reactive should not don't get reactivity | ||
bindingValue = ref(markRaw(unwrapped)); | ||
} | ||
} | ||
asVmProperty(vm, name, bindingValue); | ||
}); | ||
return; | ||
} | ||
{ | ||
assert(false, "\"setup\" must return a \"Object\" or a \"Function\", got \"" + Object.prototype.toString | ||
.call(binding) | ||
.slice(8, -1) + "\""); | ||
} | ||
} | ||
function createSetupContext(vm) { | ||
var ctx = { | ||
slots: {}, | ||
}; | ||
var props = [ | ||
'root', | ||
'parent', | ||
'refs', | ||
'attrs', | ||
'listeners', | ||
'isServer', | ||
'ssrContext', | ||
]; | ||
var methodReturnVoid = ['emit']; | ||
props.forEach(function (key) { | ||
var _a; | ||
var targetKey; | ||
var srcKey; | ||
if (Array.isArray(key)) { | ||
_a = __read(key, 2), targetKey = _a[0], srcKey = _a[1]; | ||
} | ||
else { | ||
targetKey = srcKey = key; | ||
} | ||
srcKey = "$" + srcKey; | ||
proxy(ctx, targetKey, { | ||
get: function () { return vm[srcKey]; }, | ||
set: function () { | ||
warn("Cannot assign to '" + targetKey + "' because it is a read-only property", vm); | ||
}, | ||
}); | ||
}); | ||
methodReturnVoid.forEach(function (key) { | ||
var srcKey = "$" + key; | ||
proxy(ctx, key, { | ||
get: function () { | ||
return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var fn = vm[srcKey]; | ||
fn.apply(vm, args); | ||
}; | ||
}, | ||
}); | ||
}); | ||
return ctx; | ||
} | ||
} | ||
/** | ||
* Helper that recursively merges two data objects together. | ||
*/ | ||
function mergeData(from, to) { | ||
if (!from) | ||
return to; | ||
if (!to) | ||
return from; | ||
var key; | ||
var toVal; | ||
var fromVal; | ||
var keys = hasSymbol ? Reflect.ownKeys(from) : Object.keys(from); | ||
for (var i = 0; i < keys.length; i++) { | ||
key = keys[i]; | ||
// in case the object is already observed... | ||
if (key === '__ob__') | ||
continue; | ||
toVal = to[key]; | ||
fromVal = from[key]; | ||
if (!hasOwn(to, key)) { | ||
to[key] = fromVal; | ||
} | ||
else if (toVal !== fromVal && | ||
isPlainObject(toVal) && | ||
!isRef(toVal) && | ||
isPlainObject(fromVal) && | ||
!isRef(fromVal)) { | ||
mergeData(fromVal, toVal); | ||
} | ||
} | ||
return to; | ||
} | ||
function install(Vue) { | ||
if (isPluginInstalled() || isVueRegistered(Vue)) { | ||
{ | ||
assert(false, 'already installed. Vue.use(VueCompositionAPI) should be called only once.'); | ||
} | ||
return; | ||
} | ||
{ | ||
if (!Vue.version.startsWith('2.')) { | ||
assert(false, "only works with Vue 2, v" + Vue.version + " found."); | ||
} | ||
} | ||
Vue.config.optionMergeStrategies.setup = function (parent, child) { | ||
return function mergedSetupFn(props, context) { | ||
return mergeData(typeof parent === 'function' ? parent(props, context) || {} : undefined, typeof child === 'function' ? child(props, context) || {} : undefined); | ||
}; | ||
}; | ||
setVueConstructor(Vue); | ||
mixin(Vue); | ||
} | ||
var Plugin = { | ||
install: function (Vue) { return install(Vue); }, | ||
}; | ||
// implementation, close to no-op | ||
function defineComponent(options) { | ||
return options; | ||
} | ||
// auto install when using CDN | ||
if (typeof window !== 'undefined' && window.Vue) { | ||
window.Vue.use(VueCompositionAPI); | ||
window.Vue.use(Plugin); | ||
} | ||
@@ -1416,3 +1460,4 @@ | ||
exports.createApp = createApp; | ||
exports.default = VueCompositionAPI; | ||
exports.customRef = customRef; | ||
exports.default = Plugin; | ||
exports.defineComponent = defineComponent; | ||
@@ -1425,2 +1470,3 @@ exports.getCurrentInstance = getCurrentInstance; | ||
exports.markRaw = markRaw; | ||
exports.markReactive = markReactive; | ||
exports.nextTick = nextTick; | ||
@@ -1448,3 +1494,4 @@ exports.onActivated = onActivated; | ||
exports.unref = unref; | ||
exports.useCSSModule = useCSSModule; | ||
exports.watch = watch; | ||
exports.watchEffect = watchEffect; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("vue"))&&"object"==typeof e&&"default"in e?e.default:e;function n(e){return"function"==typeof e&&/native code/.test(e.toString())}var r="undefined"!=typeof Symbol&&n(Symbol)&&"undefined"!=typeof Reflect&&n(Reflect.ownKeys),o=function(e){return e},i={enumerable:!0,configurable:!0,get:o,set:o};function u(e,t,n){var r=n.get,u=n.set;i.get=r||o,i.set=u||o,Object.defineProperty(e,t,i)}function f(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function a(e,t){return Object.hasOwnProperty.call(e,t)}function c(e){return Array.isArray(e)}function s(e){return"[object Object]"===function(e){return Object.prototype.toString.call(e)}(e)}function l(e){return"function"==typeof e}function v(e,n){t.util.warn(e,n)} | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("vue"))&&"object"==typeof e&&"default"in e?e.default:e;function n(e){return"function"==typeof e&&/native code/.test(e.toString())}var r="undefined"!=typeof Symbol&&n(Symbol)&&"undefined"!=typeof Reflect&&n(Reflect.ownKeys),o=function(e){return e},i={enumerable:!0,configurable:!0,get:o,set:o};function u(e,t,n){var r=n.get,u=n.set;i.get=r||o,i.set=u||o,Object.defineProperty(e,t,i)}function a(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function f(e,t){return Object.hasOwnProperty.call(e,t)}function c(e){return Array.isArray(e)}function s(e){return"[object Object]"===function(e){return Object.prototype.toString.call(e)}(e)}function l(e){return"function"==typeof e}function p(e,n){t.util.warn(e,n)}var v=null,d=null;function y(){return v}function b(){return d}function g(e){d=e}function h(e){return b()}function _(e,t){void 0===t&&(t={});var n=e.config.silent;e.config.silent=!0;var r=new e(t);return e.config.silent=n,r}function m(e){var t=y();return t&&e instanceof t}function x(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.$scopedSlots[t]?e.$scopedSlots[t].apply(e,n):p("slots."+t+'() got called outside of the "render()" scope',e)}} | ||
/*! ***************************************************************************** | ||
@@ -16,2 +16,2 @@ Copyright (c) Microsoft Corporation. | ||
***************************************************************************** */ | ||
var p=function(){return(p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function d(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e}var g=null,h=null;function _(){return g}function x(){return h}function m(e){h=e}function w(e){return x()}function O(e,t){void 0===t&&(t={});var n=e.config.silent;e.config.silent=!0;var r=new e(t);return e.config.silent=n,r}function j(e){return g&&e instanceof g}function $(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.$scopedSlots[t]?e.$scopedSlots[t].apply(e,n):v("slots."+t+'() got called outside of the "render()" scope',e)}}function k(e){return r?Symbol.for(e):e}var S=k("vfa.key.preFlushQueue"),E=k("vfa.key.postFlushQueue"),P=k("vfa.key.accessControlIdentifier"),R=k("vfa.key.reactiveIdentifier"),A=k("vfa.key.rawIdentifierKey"),C="vfa.key.refKey",M=function(e){u(this,"value",{get:e.get,set:e.set})};function U(e){return Object.seal(new M(e))}function I(e){var t;if(B(e))return e;var n=G(((t={})[C]=e,t));return U({get:function(){return n[C]},set:function(e){return n[C]=e}})}function B(e){return e instanceof M}function D(e,t){var n=e[t];return B(n)?n:U({get:function(){return e[t]},set:function(n){return e[t]=n}})}var z={},F={},K={};function T(e){return a(e,A)&&e[A]===K}function V(e){return Object.isExtensible(e)&&a(e,R)&&e[R]===F}function Q(e){if(!(!s(e)||T(e)||Array.isArray(e)||B(e)||j(e)||a(e,P)&&e[P]===z)){Object.isExtensible(e)&&f(e,P,z);for(var t=Object.keys(e),n=0;n<t.length;n++)q(e,t[n])}}function q(e,t,n){if("__ob__"!==t){var r,o,i=Object.getOwnPropertyDescriptor(e,t);if(i){if(!1===i.configurable)return;r=i.get,o=i.set,r&&!o||2!==arguments.length||(n=e[t])}Q(n),Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var o=r?r.call(e):n;return t!==C&&B(o)?o.value:o},set:function(i){if(!r||o){var u=r?r.call(e):n;t!==C&&B(u)&&!B(i)?u.value=i:o?o.call(e,i):n=i,Q(i)}}})}}function J(e){var t,n=_();n.observable?t=n.observable(e):t=O(n,{data:{$$state:e}})._data.$$state;return t}function N(e){var t,n;if(!s(e)||V(e)||T(e)||!Object.isExtensible(e))return e;var r=J({});W(r,!0),Q(r);var o=r.__ob__,i=function(t){var n,i,f=e[t],a=Object.getOwnPropertyDescriptor(e,t);if(a){if(!1===a.configurable)return"continue";n=a.get,i=a.set,n&&!i||2!==u.length||(f=e[t])}Object.defineProperty(r,t,{enumerable:!0,configurable:!0,get:function(){var t=n?n.call(e):f;return o.dep.depend(),t},set:function(t){n&&!i||(i?i.call(e,t):f=t,o.dep.notify())}})},u=arguments;try{for(var f=d(Object.keys(e)),a=f.next();!a.done;a=f.next()){var c=a.value;i(c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}return r}function W(e,t){if(void 0===t&&(t=!1),!(!s(e)||T(e)||Array.isArray(e)||B(e)||j(e)||a(e,R)&&e[R]===F||(Object.isExtensible(e)&&f(e,R,F),t)))for(var n=Object.keys(e),r=0;r<n.length;r++)W(e[n[r]])}function G(e){if(!s(e)||V(e)||T(e)||!Object.isExtensible(e))return e;var t=J(e);return W(e),Q(t),t}function H(e){return s(e)&&Object.isExtensible(e)?(f(e,"__ob__",J({}).__ob__),f(e,A,K),e):e}function L(e,t){g&&g===e||(e.config.optionMergeStrategies.setup=function(e,t){return function(n,o){return function e(t,n){if(!t)return n;if(!n)return t;for(var o,i,u,f=r?Reflect.ownKeys(t):Object.keys(t),c=0;c<f.length;c++)"__ob__"!==(o=f[c])&&(i=n[o],u=t[o],a(n,o)?i!==u&&s(i)&&!B(i)&&s(u)&&!B(u)&&e(u,i):n[o]=u);return n}("function"==typeof e?e(n,o)||{}:void 0,"function"==typeof t?t(n,o)||{}:void 0)}},g=e,t(e))}var X={set:function(e,t,n){(e.__secret_vfa_state__=e.__secret_vfa_state__||{})[t]=n},get:function(e,t){return(e.__secret_vfa_state__||{})[t]}};function Y(e){var t=X.get(e,"rawBindings")||{};if(t&&Object.keys(t).length){for(var n=e.$refs,r=X.get(e,"refs")||[],o=0;o<r.length;o++){var i=t[a=r[o]];!n[a]&&i&&B(i)&&(i.value=null)}var u=Object.keys(n),f=[];for(o=0;o<u.length;o++){var a;i=t[a=u[o]];n[a]&&i&&B(i)&&(i.value=n[a],f.push(a))}X.set(e,"refs",f)}}function Z(e,t){var n=e.$options._parentVnode;if(n){for(var r=X.get(e,"slots")||[],o=function(e,t){var n;if(e){if(e._normalized)return e._normalized;for(var r in n={},e)e[r]&&"$"!==r[0]&&(n[r]=!0)}else n={};for(var r in t)r in n||(n[r]=!0);return n}(n.data.scopedSlots,e.$slots),i=0;i<r.length;i++){o[f=r[i]]||delete t[f]}var u=Object.keys(o);for(i=0;i<u.length;i++){var f;t[f=u[i]]||(t[f]=$(e,f))}X.set(e,"slots",u)}}function ee(e,t,n){var r=x();m(e);try{return t(e)}catch(e){if(!n)throw e;n(e)}finally{m(r)}}function te(e){e.mixin({beforeCreate:function(){var e=this,t=e.$options,n=t.setup,r=t.render;r&&(t.render=function(){for(var t=this,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return ee(e,(function(){return r.apply(t,n)}))});if(!n)return;if("function"!=typeof n)return;var o=t.data;t.data=function(){return function(e,t){void 0===t&&(t={});var n,r=e.$options.setup,o=function(e){var t={slots:{}};return["root","parent","refs","attrs","listeners","isServer","ssrContext"].forEach((function(n){var r,o,i;Array.isArray(n)?(r=y(n,2),o=r[0],i=r[1]):o=i=n,i="$"+i,u(t,o,{get:function(){return e[i]},set:function(){v("Cannot assign to '"+o+"' because it is a read-only property",e)}})})),["emit"].forEach((function(n){var r="$"+n;u(t,n,{get:function(){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=e[r];o.apply(e,t)}}})})),t}(e);if(W(t),Z(e,o.slots),ee(e,(function(){n=r(t,o)})),!n)return;if(l(n)){var i=n;return void(e.$options.render=function(){return Z(e,o.slots),ee(e,(function(){return i()}))})}if(s(n)){var f=n;X.set(e,"rawBindings",n),Object.keys(n).forEach((function(t){var n=f[t];if(!B(n))if(V(n))n=I(n);else{l(n)&&(n=n.bind(e));var r=function e(t,n){var r,o;if(void 0===n&&(n=new WeakMap),n.has(t))return n.get(t);if(l(t)||c(t)||V(t)||!s(t)||!Object.isExtensible(t)||B(t)||T(t))return t;var i={};n.set(t,i),Object.getOwnPropertySymbols(t).forEach((function(e){return i[e]=t[e]})),t.__ob__&&Object.defineProperty(i,"__ob__",t.__ob__);var f=function(r){var o=t[r];if(!o||T(o))i[r]=o;else if(B(o)){u(i,r,{get:function(){return o.value},set:function(e){return o.value=e}})}else i[r]=e(o,n)};try{for(var a=d(Object.keys(t)),v=a.next();!v.done;v=a.next()){f(v.value)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}(n);W(r),n=I(H(r))}!function(e,t,n){var r=e.$options.props;t in e||r&&a(r,t)||u(e,t,{get:function(){return n.value},set:function(e){n.value=e}})}(e,t,n)}))}}(e,e.$props),"function"==typeof o?o.call(e,e):o||{}}},mounted:function(){Y(this)},updated:function(){Y(this)}})}var ne;function re(e){return function(t){var n,r=w(((n=e)[0].toUpperCase(),n.slice(1)));r&&function(e,t,n,r){var o=t.$options,i=e.config.optionMergeStrategies[n];o[n]=i(o[n],function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=x();m(e);try{return t.apply(void 0,b(n))}finally{m(o)}}}(t,r))}(_(),r,e,t)}}var oe,ie=re("beforeMount"),ue=re("mounted"),fe=re("beforeUpdate"),ae=re("updated"),ce=re("beforeDestroy"),se=re("destroyed"),le=re("errorCaptured"),ve=re("activated"),pe=re("deactivated"),de=re("serverPrefetch");function ye(){he(this,S)}function be(){he(this,E)}function ge(){var e=x();return e?function(e){return void 0!==e[S]}(e)||function(e){e[S]=[],e[E]=[],e.$on("hook:beforeUpdate",ye),e.$on("hook:updated",be)}(e):(oe||(oe=O(_())),e=oe),e}function he(e,t){for(var n=e[t],r=0;r<n.length;r++)n[r]();n.length=0}function _e(e,t,n){var r=function(){e.$nextTick((function(){e[S].length&&he(e,S),e[E].length&&he(e,E)}))};switch(n){case"pre":r(),e[S].push(t);break;case"post":r(),e[E].push(t);break;default:!function(e,t){if(!e)throw new Error("[vue-composition-api] "+t)}(!1,'flush must be one of ["post", "pre", "sync"], but got '+n)}}function xe(e,t){var n=e.teardown;e.teardown=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.apply(e,r),t()}}function me(e,t,n,r){var i,u=r.flush,f="sync"===u,a=function(e){i=function(){try{e()}catch(e){!function(e,t,n){if("undefined"==typeof window||"undefined"==typeof console)throw e;console.error(e)}(e)}}},c=function(){i&&(i(),i=null)},s=function(t){return f||e===oe?t:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return _e(e,(function(){t.apply(void 0,b(n))}),u)}};if(null===n){var p=!1,d=function(e,t,n,r){var o=e._watchers.length;return e.$watch(t,n,{immediate:r.immediateInvokeCallback,deep:r.deep,lazy:r.noRun,sync:r.sync,before:r.before}),e._watchers[o]}(e,(function(){if(!p)try{p=!0,t(a)}finally{p=!1}}),o,{deep:r.deep||!1,sync:f,before:c});xe(d,c),d.lazy=!1;var y=d.get.bind(d);return d.get=s(y),function(){d.teardown()}}var g,h=r.deep;Array.isArray(t)?g=function(){return t.map((function(e){return B(e)?e.value:e()}))}:B(t)?g=function(){return t.value}:V(t)?(g=function(){return t},h=!0):l(t)?g=t:(g=o,v("Invalid watch source: "+JSON.stringify(t)+".\n A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.",e));var _=function(e,t){c(),n(e,t,a)},x=s(_);if(r.immediate){var m=x,w=function(e,t){w=m,_(e,t)};x=function(e,t){w(e,t)}}var O=e.$watch(g,x,{immediate:r.immediate,deep:h,sync:f});return xe(e._watchers[e._watchers.length-1],c),function(){O()}}var we={};var Oe={install:function(e){return L(e,te)}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(Oe),exports.computed=function(e){var t,n,r=x();"function"==typeof e?t=e:(t=e.get,n=e.set);var o=O(_(),{computed:{$$state:{get:t,set:n}}});return r&&r.$on("hook:destroyed",(function(){return o.$destroy()})),U({get:function(){return o.$$state},set:function(e){o.$$state=e}})},exports.createApp=function(e,t){void 0===t&&(t=void 0);var n=_(),r=void 0;return{config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),directive:n.directive.bind(n),mount:function(o,i){return r||((r=new n(p({propsData:t},e))).$mount(o,i),r)},unmount:function(){r&&(r.$destroy(),r=void 0)}}},exports.default=Oe,exports.defineComponent=function(e){return e},exports.getCurrentInstance=x,exports.h=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return h?h.$createElement.apply(h,e):(v("`createElement()` has been called outside of render function."),ne||(ne=O(_()).$createElement),ne.apply(ne,e))},exports.inject=function(e,t){if(!e)return t;var n=x();if(n){var r=function(e,t){for(var n=t;n;){if(n._provided&&a(n._provided,e))return n._provided[e];n=n.$parent}return we}(e,n);return r!==we?r:t}v("inject() can only be used inside setup() or functional components.")},exports.isReactive=V,exports.isRef=B,exports.markRaw=H,exports.nextTick=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return null==g?void 0:g.nextTick.apply(this,e)},exports.onActivated=ve,exports.onBeforeMount=ie,exports.onBeforeUnmount=ce,exports.onBeforeUpdate=fe,exports.onDeactivated=pe,exports.onErrorCaptured=le,exports.onMounted=ue,exports.onServerPrefetch=de,exports.onUnmounted=se,exports.onUpdated=ae,exports.provide=function(e,t){var n=w();if(n){if(!n._provided){var r={};Object.defineProperty(n,"_provided",{get:function(){return r},set:function(e){return Object.assign(r,e)}})}n._provided[e]=t}},exports.reactive=G,exports.ref=I,exports.set=function(e,t,n){var r=_().util,o=(r.warn,r.defineReactive);if(c(e)&&function(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var i=e.__ob__;return e._isVue||i&&i.vmCount?n:i?(o(i.value,t,n),q(e,t,n),W(i.value[t]),i.dep.notify(),n):(e[t]=n,n)},exports.shallowReactive=N,exports.shallowRef=function(e){var t;if(B(e))return e;var n=N(((t={})[C]=e,t));return U({get:function(){return n[C]},set:function(e){return n[C]=e}})},exports.toRaw=function(e){return T(J)||!Object.isExtensible(e)?e:e.__ob__.value||e},exports.toRef=D,exports.toRefs=function(e){if(!s(e))return e;var t={};for(var n in e)t[n]=D(e,n);return t},exports.triggerRef=function(e){B(e)&&(e.value=e.value)},exports.unref=function(e){return B(e)?e.value:e},exports.watch=function(e,t,n){var r=null;"function"==typeof t?r=t:(n=t,r=null);var o=function(e){return p({immediate:!1,deep:!1,flush:"post"},e)}(n);return me(ge(),e,r,o)},exports.watchEffect=function(e,t){var n=function(e){return p({immediate:!0,deep:!1,flush:"post"},e)}(t);return me(ge(),e,null,n)}; | ||
var w=function(){return(w=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function O(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function j(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function $(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(j(arguments[t]));return e}function k(e){return r?Symbol.for(e):e}var S=k("composition-api.preFlushQueue"),E=k("composition-api.postFlushQueue"),R=k("composition-api.accessControlIdentifier"),P=k("composition-api.reactiveIdentifier"),A=k("composition-api.rawIdentifierKey"),C="composition-api.refKey",M=function(e){u(this,"value",{get:e.get,set:e.set})};function U(e){return Object.seal(new M(e))}function I(e){var t;if(B(e))return e;var n=G(((t={})[C]=e,t));return U({get:function(){return n[C]},set:function(e){return n[C]=e}})}function B(e){return e instanceof M}function D(e,t){var n=e[t];return B(n)?n:U({get:function(){return e[t]},set:function(n){return e[t]=n}})}var z={},F={},K={};function T(e){return f(e,A)&&e[A]===K}function V(e){return Object.isExtensible(e)&&f(e,P)&&e[P]===F}function Q(e){if(!(!s(e)||T(e)||Array.isArray(e)||B(e)||m(e)||f(e,R)&&e[R]===z)){Object.isExtensible(e)&&a(e,R,z);for(var t=Object.keys(e),n=0;n<t.length;n++)q(e,t[n])}}function q(e,t,n){if("__ob__"!==t){var r,o,i=Object.getOwnPropertyDescriptor(e,t);if(i){if(!1===i.configurable)return;r=i.get,o=i.set,r&&!o||2!==arguments.length||(n=e[t])}Q(n),Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var o=r?r.call(e):n;return t!==C&&B(o)?o.value:o},set:function(i){if(!r||o){var u=r?r.call(e):n;t!==C&&B(u)&&!B(i)?u.value=i:o?o.call(e,i):n=i,Q(i)}}})}}function J(e){var t,n=y();n.observable?t=n.observable(e):t=_(n,{data:{$$state:e}})._data.$$state;return t}function N(e){var t,n;if(!s(e)||V(e)||T(e)||!Object.isExtensible(e))return e;var r=J({});W(r,!0),Q(r);var o=r.__ob__,i=function(t){var n,i,a=e[t],f=Object.getOwnPropertyDescriptor(e,t);if(f){if(!1===f.configurable)return"continue";n=f.get,i=f.set,n&&!i||2!==u.length||(a=e[t])}Object.defineProperty(r,t,{enumerable:!0,configurable:!0,get:function(){var t=n?n.call(e):a;return o.dep.depend(),t},set:function(t){n&&!i||(i?i.call(e,t):a=t,o.dep.notify())}})},u=arguments;try{for(var a=O(Object.keys(e)),f=a.next();!f.done;f=a.next()){var c=f.value;i(c)}}catch(e){t={error:e}}finally{try{f&&!f.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r}function W(e,t){if(void 0===t&&(t=!1),!(!s(e)||T(e)||Array.isArray(e)||B(e)||m(e)||f(e,P)&&e[P]===F||(Object.isExtensible(e)&&a(e,P,F),t)))for(var n=Object.keys(e),r=0;r<n.length;r++)W(e[n[r]])}function G(e){if(!s(e)||V(e)||T(e)||!Object.isExtensible(e))return e;var t=J(e);return W(e),Q(t),t}function H(e){return s(e)&&Object.isExtensible(e)?(a(e,"__ob__",J({}).__ob__),a(e,A,K),e):e}function L(e){return function(t){var n,r=h(((n=e)[0].toUpperCase(),n.slice(1)));r&&function(e,t,n,r){var o=t.$options,i=e.config.optionMergeStrategies[n];o[n]=i(o[n],function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=b();g(e);try{return t.apply(void 0,$(n))}finally{g(o)}}}(t,r))}(y(),r,e,t)}}var X,Y=L("beforeMount"),Z=L("mounted"),ee=L("beforeUpdate"),te=L("updated"),ne=L("beforeDestroy"),re=L("destroyed"),oe=L("errorCaptured"),ie=L("activated"),ue=L("deactivated"),ae=L("serverPrefetch");function fe(){le(this,S)}function ce(){le(this,E)}function se(){var e=b();return e?function(e){return void 0!==e[S]}(e)||function(e){e[S]=[],e[E]=[],e.$on("hook:beforeUpdate",fe),e.$on("hook:updated",ce)}(e):(X||(X=_(y())),e=X),e}function le(e,t){for(var n=e[t],r=0;r<n.length;r++)n[r]();n.length=0}function pe(e,t,n){var r=function(){e.$nextTick((function(){e[S].length&&le(e,S),e[E].length&&le(e,E)}))};switch(n){case"pre":r(),e[S].push(t);break;case"post":r(),e[E].push(t);break;default:!function(e,t){if(!e)throw new Error("[vue-composition-api] "+t)}(!1,'flush must be one of ["post", "pre", "sync"], but got '+n)}}function ve(e,t){var n=e.teardown;e.teardown=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.apply(e,r),t()}}function de(e,t,n,r){var i,u=r.flush,a="sync"===u,f=function(e){i=function(){try{e()}catch(e){!function(e,t,n){if("undefined"==typeof window||"undefined"==typeof console)throw e;console.error(e)}(e)}}},c=function(){i&&(i(),i=null)},s=function(t){return a||e===X?t:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return pe(e,(function(){t.apply(void 0,$(n))}),u)}};if(null===n){var v=!1,d=function(e,t,n,r){var o=e._watchers.length;return e.$watch(t,n,{immediate:r.immediateInvokeCallback,deep:r.deep,lazy:r.noRun,sync:r.sync,before:r.before}),e._watchers[o]}(e,(function(){if(!v)try{v=!0,t(f)}finally{v=!1}}),o,{deep:r.deep||!1,sync:a,before:c});ve(d,c),d.lazy=!1;var y=d.get.bind(d);return d.get=s(y),function(){d.teardown()}}var b,g=r.deep;Array.isArray(t)?b=function(){return t.map((function(e){return B(e)?e.value:e()}))}:B(t)?b=function(){return t.value}:V(t)?(b=function(){return t},g=!0):l(t)?b=t:(b=o,p("Invalid watch source: "+JSON.stringify(t)+".\n A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.",e));var h=function(e,t){c(),n(e,t,f)},_=s(h);if(r.immediate){var m=_,x=function(e,t){x=m,h(e,t)};_=function(e,t){x(e,t)}}var w=e.$watch(b,_,{immediate:r.immediate,deep:g,sync:a});return ve(e._watchers[e._watchers.length-1],c),function(){w()}}var ye={};var be={};var ge;var he={set:function(e,t,n){(e.__composition_api_state__=e.__composition_api_state__||{})[t]=n},get:function(e,t){return(e.__composition_api_state__||{})[t]}};function _e(e){var t=he.get(e,"rawBindings")||{};if(t&&Object.keys(t).length){for(var n=e.$refs,r=he.get(e,"refs")||[],o=0;o<r.length;o++){var i=t[f=r[o]];!n[f]&&i&&B(i)&&(i.value=null)}var u=Object.keys(n),a=[];for(o=0;o<u.length;o++){var f;i=t[f=u[o]];n[f]&&i&&B(i)&&(i.value=n[f],a.push(f))}he.set(e,"refs",a)}}function me(e,t){var n=e.$options._parentVnode;if(n){for(var r=he.get(e,"slots")||[],o=function(e,t){var n;if(e){if(e._normalized)return e._normalized;for(var r in n={},e)e[r]&&"$"!==r[0]&&(n[r]=!0)}else n={};for(var r in t)r in n||(n[r]=!0);return n}(n.data.scopedSlots,e.$slots),i=0;i<r.length;i++){o[a=r[i]]||delete t[a]}var u=Object.keys(o);for(i=0;i<u.length;i++){var a;t[a=u[i]]||(t[a]=x(e,a))}he.set(e,"slots",u)}}function xe(e,t,n){var r=b();g(e);try{return t(e)}catch(e){if(!n)throw e;n(e)}finally{g(r)}}function we(e){e.mixin({beforeCreate:function(){var e=this,t=e.$options,n=t.setup,r=t.render;r&&(t.render=function(){for(var t=this,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return xe(e,(function(){return r.apply(t,n)}))});if(!n)return;if("function"!=typeof n)return;var o=t.data;t.data=function(){return function(e,t){void 0===t&&(t={});var n,r=e.$options.setup,o=function(e){var t={slots:{}};return["root","parent","refs","attrs","listeners","isServer","ssrContext"].forEach((function(n){var r,o,i;Array.isArray(n)?(r=j(n,2),o=r[0],i=r[1]):o=i=n,i="$"+i,u(t,o,{get:function(){return e[i]},set:function(){p("Cannot assign to '"+o+"' because it is a read-only property",e)}})})),["emit"].forEach((function(n){var r="$"+n;u(t,n,{get:function(){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=e[r];o.apply(e,t)}}})})),t}(e);if(W(t),me(e,o.slots),xe(e,(function(){n=r(t,o)})),!n)return;if(l(n)){var i=n;return void(e.$options.render=function(){return me(e,o.slots),xe(e,(function(){return i()}))})}if(s(n)){var a=n;he.set(e,"rawBindings",n),Object.keys(n).forEach((function(t){var n=a[t];if(!B(n))if(V(n))n=I(n);else{l(n)&&(n=n.bind(e));var r=function e(t,n){var r,o;if(void 0===n&&(n=new WeakMap),n.has(t))return n.get(t);if(l(t)||c(t)||V(t)||!s(t)||!Object.isExtensible(t)||B(t)||T(t))return t;var i={};n.set(t,i),Object.getOwnPropertySymbols(t).forEach((function(e){return i[e]=t[e]})),t.__ob__&&Object.defineProperty(i,"__ob__",{enumerable:!1,value:t.__ob__});var a=function(r){var o=t[r];if(!o||T(o))i[r]=o;else if(B(o)){u(i,r,{get:function(){return o.value},set:function(e){return o.value=e}})}else i[r]=e(o,n)};try{for(var f=O(Object.keys(t)),p=f.next();!p.done;p=f.next()){a(p.value)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}return i}(n);W(r),n=I(H(r))}!function(e,t,n){var r=e.$options.props;t in e||r&&f(r,t)||u(e,t,{get:function(){return n.value},set:function(e){n.value=e}})}(e,t,n)}))}}(e,e.$props),"function"==typeof o?o.call(e,e):o||{}}},mounted:function(){_e(this)},updated:function(){_e(this)}})}function Oe(e){v||function(e){return f(e,"__composition_api_installed__")}(e)||(e.config.optionMergeStrategies.setup=function(e,t){return function(n,o){return function e(t,n){if(!t)return n;if(!n)return t;for(var o,i,u,a=r?Reflect.ownKeys(t):Object.keys(t),c=0;c<a.length;c++)"__ob__"!==(o=a[c])&&(i=n[o],u=t[o],f(n,o)?i!==u&&s(i)&&!B(i)&&s(u)&&!B(u)&&e(u,i):n[o]=u);return n}("function"==typeof e?e(n,o)||{}:void 0,"function"==typeof t?t(n,o)||{}:void 0)}},function(e){v=e,Object.defineProperty(e,"__composition_api_installed__",{configurable:!0,writable:!0,value:!0})}(e),we(e))}var je={install:function(e){return Oe(e)}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(je),exports.computed=function(e){var t,n,r=b();"function"==typeof e?t=e:(t=e.get,n=e.set);var o=_(y(),{computed:{$$state:{get:t,set:n}}});return r&&r.$on("hook:destroyed",(function(){return o.$destroy()})),U({get:function(){return o.$$state},set:function(e){o.$$state=e}})},exports.createApp=function(e,t){void 0===t&&(t=void 0);var n=y(),r=void 0;return{config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),directive:n.directive.bind(n),mount:function(o,i){return r||((r=new n(w({propsData:t},e))).$mount(o,i),r)},unmount:function(){r&&(r.$destroy(),r=void 0)}}},exports.customRef=function(e){var t=I(0);return U(e((function(){t.value}),(function(){++t.value})))},exports.default=je,exports.defineComponent=function(e){return e},exports.getCurrentInstance=b,exports.h=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=b();return n?n.$createElement.apply(n,e):(p("`createElement()` has been called outside of render function."),ge||(ge=_(y()).$createElement),ge.apply(ge,e))},exports.inject=function(e,t){if(!e)return t;var n=b();if(n){var r=function(e,t){for(var n=t;n;){if(n._provided&&f(n._provided,e))return n._provided[e];n=n.$parent}return ye}(e,n);return r!==ye?r:t}p("inject() can only be used inside setup() or functional components.")},exports.isReactive=V,exports.isRef=B,exports.markRaw=H,exports.markReactive=W,exports.nextTick=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return null===(e=y())||void 0===e?void 0:e.nextTick.apply(this,t)},exports.onActivated=ie,exports.onBeforeMount=Y,exports.onBeforeUnmount=ne,exports.onBeforeUpdate=ee,exports.onDeactivated=ue,exports.onErrorCaptured=oe,exports.onMounted=Z,exports.onServerPrefetch=ae,exports.onUnmounted=re,exports.onUpdated=te,exports.provide=function(e,t){var n=h();if(n){if(!n._provided){var r={};Object.defineProperty(n,"_provided",{get:function(){return r},set:function(e){return Object.assign(r,e)}})}n._provided[e]=t}},exports.reactive=G,exports.ref=I,exports.set=function(e,t,n){var r=y().util,o=(r.warn,r.defineReactive);if(c(e)&&function(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var i=e.__ob__;return e._isVue||i&&i.vmCount?n:i?(o(i.value,t,n),q(e,t,n),W(i.value[t]),i.dep.notify(),n):(e[t]=n,n)},exports.shallowReactive=N,exports.shallowRef=function(e){var t;if(B(e))return e;var n=N(((t={})[C]=e,t));return U({get:function(){return n[C]},set:function(e){return n[C]=e}})},exports.toRaw=function(e){return T(e)||!Object.isExtensible(e)?e:e.__ob__.value||e},exports.toRef=D,exports.toRefs=function(e){if(!s(e))return e;var t={};for(var n in e)t[n]=D(e,n);return t},exports.triggerRef=function(e){B(e)&&(e.value=e.value)},exports.unref=function(e){return B(e)?e.value:e},exports.useCSSModule=function(e){void 0===e&&(e="$style");var t=b();if(!t)return be;var n=t[e];return n||be},exports.watch=function(e,t,n){var r=null;"function"==typeof t?r=t:(n=t,r=null);var o=function(e){return w({immediate:!1,deep:!1,flush:"post"},e)}(n);return de(se(),e,r,o)},exports.watchEffect=function(e,t){var n=function(e){return w({immediate:!0,deep:!1,flush:"post"},e)}(t);return de(se(),e,null,n)}; |
@@ -52,3 +52,3 @@ import Vue from 'vue'; | ||
function logError(err, vm, info) { | ||
if (("development" !== 'production')) { | ||
if ((process.env.NODE_ENV !== 'production')) { | ||
warn("Error in " + info + ": \"" + err.toString() + "\"", vm); | ||
@@ -64,79 +64,30 @@ } | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
function __values(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
var vueConstructor = null; | ||
var currentInstance = null; | ||
var PluginInstalledFlag = '__composition_api_installed__'; | ||
function isPluginInstalled() { | ||
return !!vueConstructor; | ||
} | ||
function __read(o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
function isVueRegistered(Vue) { | ||
return hasOwn(Vue, PluginInstalledFlag); | ||
} | ||
function __spread() { | ||
for (var ar = [], i = 0; i < arguments.length; i++) | ||
ar = ar.concat(__read(arguments[i])); | ||
return ar; | ||
} | ||
var currentVue = null; | ||
var currentVM = null; | ||
function getCurrentVue() { | ||
if (("development" !== 'production')) { | ||
assert(currentVue, "must call Vue.use(VueCompositionAPI) before using any function."); | ||
function getVueConstructor() { | ||
if ((process.env.NODE_ENV !== 'production')) { | ||
assert(vueConstructor, "must call Vue.use(VueCompositionAPI) before using any function."); | ||
} | ||
return currentVue; | ||
return vueConstructor; | ||
} | ||
function setCurrentVue(vue) { | ||
currentVue = vue; | ||
function setVueConstructor(Vue) { | ||
vueConstructor = Vue; | ||
Object.defineProperty(Vue, PluginInstalledFlag, { | ||
configurable: true, | ||
writable: true, | ||
value: true, | ||
}); | ||
} | ||
function getCurrentInstance() { | ||
return currentVM; | ||
return currentInstance; | ||
} | ||
function setCurrentVM(vm) { | ||
currentVM = vm; | ||
function setCurrentInstance(vm) { | ||
currentInstance = vm; | ||
} | ||
@@ -146,3 +97,3 @@ | ||
var vm = getCurrentInstance(); | ||
if (("development" !== 'production') && !vm) { | ||
if ((process.env.NODE_ENV !== 'production') && !vm) { | ||
warn(hook + " is called when there is no active component instance to be " + | ||
@@ -163,3 +114,4 @@ "associated with. " + | ||
function isComponentInstance(obj) { | ||
return currentVue && obj instanceof currentVue; | ||
var Vue = getVueConstructor(); | ||
return Vue && obj instanceof Vue; | ||
} | ||
@@ -204,12 +156,73 @@ function createSlotProxy(vm, slotName) { | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
function __values(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
} | ||
function __read(o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
} | ||
function __spread() { | ||
for (var ar = [], i = 0; i < arguments.length; i++) | ||
ar = ar.concat(__read(arguments[i])); | ||
return ar; | ||
} | ||
function createSymbol(name) { | ||
return hasSymbol ? Symbol.for(name) : name; | ||
} | ||
var WatcherPreFlushQueueKey = createSymbol('vfa.key.preFlushQueue'); | ||
var WatcherPostFlushQueueKey = createSymbol('vfa.key.postFlushQueue'); | ||
var AccessControlIdentifierKey = createSymbol('vfa.key.accessControlIdentifier'); | ||
var ReactiveIdentifierKey = createSymbol('vfa.key.reactiveIdentifier'); | ||
var RawIdentifierKey = createSymbol('vfa.key.rawIdentifierKey'); | ||
var WatcherPreFlushQueueKey = createSymbol('composition-api.preFlushQueue'); | ||
var WatcherPostFlushQueueKey = createSymbol('composition-api.postFlushQueue'); | ||
var AccessControlIdentifierKey = createSymbol('composition-api.accessControlIdentifier'); | ||
var ReactiveIdentifierKey = createSymbol('composition-api.reactiveIdentifier'); | ||
var RawIdentifierKey = createSymbol('composition-api.rawIdentifierKey'); | ||
// must be a string, symbol key is ignored in reactive | ||
var RefKey = 'vfa.key.refKey'; | ||
var RefKey = 'composition-api.refKey'; | ||
@@ -252,3 +265,3 @@ var RefImpl = /** @class */ (function () { | ||
return obj; | ||
if (("development" !== 'production') && !isReactive(obj)) { | ||
if ((process.env.NODE_ENV !== 'production') && !isReactive(obj)) { | ||
warn("toRefs() expects a reactive object but received a plain one."); | ||
@@ -262,2 +275,8 @@ } | ||
} | ||
function customRef(factory) { | ||
var version = ref(0); | ||
return createRef(factory(function () { return void version.value; }, function () { | ||
++version.value; | ||
})); | ||
} | ||
function toRef(object, key) { | ||
@@ -379,3 +398,3 @@ var v = object[key]; | ||
function observe(obj) { | ||
var Vue = getCurrentVue(); | ||
var Vue = getVueConstructor(); | ||
var observed; | ||
@@ -397,3 +416,3 @@ if (Vue.observable) { | ||
var e_1, _a; | ||
if (("development" !== 'production') && !obj) { | ||
if ((process.env.NODE_ENV !== 'production') && !obj) { | ||
warn('"shallowReactive()" is called without provide an "object".'); | ||
@@ -495,3 +514,3 @@ // @ts-ignore | ||
function reactive(obj) { | ||
if (("development" !== 'production') && !obj) { | ||
if ((process.env.NODE_ENV !== 'production') && !obj) { | ||
warn('"reactive()" is called without provide an "object".'); | ||
@@ -527,3 +546,3 @@ // @ts-ignore | ||
function toRaw(observed) { | ||
if (isRaw(observe) || !Object.isExtensible(observed)) { | ||
if (isRaw(observed) || !Object.isExtensible(observed)) { | ||
return observed; | ||
@@ -554,5 +573,5 @@ } | ||
function set(target, key, val) { | ||
var Vue = getCurrentVue(); | ||
var Vue = getVueConstructor(); | ||
var _a = Vue.util, warn = _a.warn, defineReactive = _a.defineReactive; | ||
if (("development" !== 'production') && (isUndef(target) || isPrimitive(target))) { | ||
if ((process.env.NODE_ENV !== 'production') && (isUndef(target) || isPrimitive(target))) { | ||
warn("Cannot set reactive property on undefined, null, or primitive value: " + target); | ||
@@ -571,3 +590,3 @@ } | ||
if (target._isVue || (ob && ob.vmCount)) { | ||
("development" !== 'production') && | ||
(process.env.NODE_ENV !== 'production') && | ||
warn('Avoid adding reactive properties to a Vue instance or its root $data ' + | ||
@@ -589,67 +608,2 @@ 'at runtime - declare it upfront in the data option.'); | ||
/** | ||
* Helper that recursively merges two data objects together. | ||
*/ | ||
function mergeData(from, to) { | ||
if (!from) | ||
return to; | ||
if (!to) | ||
return from; | ||
var key; | ||
var toVal; | ||
var fromVal; | ||
var keys = hasSymbol ? Reflect.ownKeys(from) : Object.keys(from); | ||
for (var i = 0; i < keys.length; i++) { | ||
key = keys[i]; | ||
// in case the object is already observed... | ||
if (key === '__ob__') | ||
continue; | ||
toVal = to[key]; | ||
fromVal = from[key]; | ||
if (!hasOwn(to, key)) { | ||
to[key] = fromVal; | ||
} | ||
else if (toVal !== fromVal && | ||
isPlainObject(toVal) && | ||
!isRef(toVal) && | ||
isPlainObject(fromVal) && | ||
!isRef(fromVal)) { | ||
mergeData(fromVal, toVal); | ||
} | ||
} | ||
return to; | ||
} | ||
function install(Vue, _install) { | ||
if (currentVue && currentVue === Vue) { | ||
if (("development" !== 'production')) { | ||
assert(false, 'already installed. Vue.use(VueCompositionAPI) should be called only once.'); | ||
} | ||
return; | ||
} | ||
if (("development" !== 'production')) { | ||
if (!Vue.version.startsWith('2.')) { | ||
assert(false, "@vue/composition-api only works with Vue 2, v" + Vue.version + " found."); | ||
} | ||
} | ||
Vue.config.optionMergeStrategies.setup = function (parent, child) { | ||
return function mergedSetupFn(props, context) { | ||
return mergeData(typeof parent === 'function' ? parent(props, context) || {} : undefined, typeof child === 'function' ? child(props, context) || {} : undefined); | ||
}; | ||
}; | ||
setCurrentVue(Vue); | ||
_install(Vue); | ||
} | ||
function set$1(vm, key, value) { | ||
var state = (vm.__secret_vfa_state__ = vm.__secret_vfa_state__ || {}); | ||
state[key] = value; | ||
} | ||
function get(vm, key) { | ||
return (vm.__secret_vfa_state__ || {})[key]; | ||
} | ||
var vmStateManager = { | ||
set: set$1, | ||
get: get, | ||
}; | ||
function unwrapRefProxy(value, map) { | ||
@@ -676,3 +630,6 @@ var e_1, _a; | ||
if (value.__ob__) { | ||
Object.defineProperty(obj, '__ob__', value.__ob__); | ||
Object.defineProperty(obj, '__ob__', { | ||
enumerable: false, | ||
value: value.__ob__, | ||
}); | ||
} | ||
@@ -711,321 +668,2 @@ var _loop_1 = function (k) { | ||
function asVmProperty(vm, propName, propValue) { | ||
var props = vm.$options.props; | ||
if (!(propName in vm) && !(props && hasOwn(props, propName))) { | ||
proxy(vm, propName, { | ||
get: function () { return propValue.value; }, | ||
set: function (val) { | ||
propValue.value = val; | ||
}, | ||
}); | ||
if (("development" !== 'production')) { | ||
// expose binding to Vue Devtool as a data property | ||
// delay this until state has been resolved to prevent repeated works | ||
vm.$nextTick(function () { | ||
proxy(vm._data, propName, { | ||
get: function () { return propValue.value; }, | ||
set: function (val) { | ||
propValue.value = val; | ||
}, | ||
}); | ||
}); | ||
} | ||
} | ||
else if (("development" !== 'production')) { | ||
if (props && hasOwn(props, propName)) { | ||
warn("The setup binding property \"" + propName + "\" is already declared as a prop.", vm); | ||
} | ||
else { | ||
warn("The setup binding property \"" + propName + "\" is already declared.", vm); | ||
} | ||
} | ||
} | ||
function updateTemplateRef(vm) { | ||
var rawBindings = vmStateManager.get(vm, 'rawBindings') || {}; | ||
if (!rawBindings || !Object.keys(rawBindings).length) | ||
return; | ||
var refs = vm.$refs; | ||
var oldRefKeys = vmStateManager.get(vm, 'refs') || []; | ||
for (var index = 0; index < oldRefKeys.length; index++) { | ||
var key = oldRefKeys[index]; | ||
var setupValue = rawBindings[key]; | ||
if (!refs[key] && setupValue && isRef(setupValue)) { | ||
setupValue.value = null; | ||
} | ||
} | ||
var newKeys = Object.keys(refs); | ||
var validNewKeys = []; | ||
for (var index = 0; index < newKeys.length; index++) { | ||
var key = newKeys[index]; | ||
var setupValue = rawBindings[key]; | ||
if (refs[key] && setupValue && isRef(setupValue)) { | ||
setupValue.value = refs[key]; | ||
validNewKeys.push(key); | ||
} | ||
} | ||
vmStateManager.set(vm, 'refs', validNewKeys); | ||
} | ||
function resolveScopedSlots(vm, slotsProxy) { | ||
var parentVode = vm.$options._parentVnode; | ||
if (!parentVode) | ||
return; | ||
var prevSlots = vmStateManager.get(vm, 'slots') || []; | ||
var curSlots = resolveSlots(parentVode.data.scopedSlots, vm.$slots); | ||
// remove staled slots | ||
for (var index = 0; index < prevSlots.length; index++) { | ||
var key = prevSlots[index]; | ||
if (!curSlots[key]) { | ||
delete slotsProxy[key]; | ||
} | ||
} | ||
// proxy fresh slots | ||
var slotNames = Object.keys(curSlots); | ||
for (var index = 0; index < slotNames.length; index++) { | ||
var key = slotNames[index]; | ||
if (!slotsProxy[key]) { | ||
slotsProxy[key] = createSlotProxy(vm, key); | ||
} | ||
} | ||
vmStateManager.set(vm, 'slots', slotNames); | ||
} | ||
function activateCurrentInstance(vm, fn, onError) { | ||
var preVm = getCurrentInstance(); | ||
setCurrentVM(vm); | ||
try { | ||
return fn(vm); | ||
} | ||
catch (err) { | ||
if (onError) { | ||
onError(err); | ||
} | ||
else { | ||
throw err; | ||
} | ||
} | ||
finally { | ||
setCurrentVM(preVm); | ||
} | ||
} | ||
function mixin(Vue) { | ||
Vue.mixin({ | ||
beforeCreate: functionApiInit, | ||
mounted: function () { | ||
updateTemplateRef(this); | ||
}, | ||
updated: function () { | ||
updateTemplateRef(this); | ||
}, | ||
}); | ||
/** | ||
* Vuex init hook, injected into each instances init hooks list. | ||
*/ | ||
function functionApiInit() { | ||
var vm = this; | ||
var $options = vm.$options; | ||
var setup = $options.setup, render = $options.render; | ||
if (render) { | ||
// keep currentInstance accessible for createElement | ||
$options.render = function () { | ||
var _this = this; | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return activateCurrentInstance(vm, function () { return render.apply(_this, args); }); | ||
}; | ||
} | ||
if (!setup) { | ||
return; | ||
} | ||
if (typeof setup !== 'function') { | ||
if (("development" !== 'production')) { | ||
warn('The "setup" option should be a function that returns a object in component definitions.', vm); | ||
} | ||
return; | ||
} | ||
var data = $options.data; | ||
// wrapper the data option, so we can invoke setup before data get resolved | ||
$options.data = function wrappedData() { | ||
initSetup(vm, vm.$props); | ||
return typeof data === 'function' | ||
? data.call(vm, vm) | ||
: data || {}; | ||
}; | ||
} | ||
function initSetup(vm, props) { | ||
if (props === void 0) { props = {}; } | ||
var setup = vm.$options.setup; | ||
var ctx = createSetupContext(vm); | ||
// mark props as reactive | ||
markReactive(props); | ||
// resolve scopedSlots and slots to functions | ||
resolveScopedSlots(vm, ctx.slots); | ||
var binding; | ||
activateCurrentInstance(vm, function () { | ||
binding = setup(props, ctx); | ||
}); | ||
if (!binding) | ||
return; | ||
if (isFunction(binding)) { | ||
// keep typescript happy with the binding type. | ||
var bindingFunc_1 = binding; | ||
// keep currentInstance accessible for createElement | ||
vm.$options.render = function () { | ||
resolveScopedSlots(vm, ctx.slots); | ||
return activateCurrentInstance(vm, function () { return bindingFunc_1(); }); | ||
}; | ||
return; | ||
} | ||
if (isPlainObject(binding)) { | ||
var bindingObj_1 = binding; | ||
vmStateManager.set(vm, 'rawBindings', binding); | ||
Object.keys(binding).forEach(function (name) { | ||
var bindingValue = bindingObj_1[name]; | ||
// only make primitive value reactive | ||
if (!isRef(bindingValue)) { | ||
if (isReactive(bindingValue)) { | ||
bindingValue = ref(bindingValue); | ||
} | ||
else { | ||
// bind function to the vm, this will make `this` = vm | ||
if (isFunction(bindingValue)) { | ||
bindingValue = bindingValue.bind(vm); | ||
} | ||
// unwrap all ref properties | ||
var unwrapped = unwrapRefProxy(bindingValue); | ||
// mark the object as reactive | ||
markReactive(unwrapped); | ||
// a non-reactive should not don't get reactivity | ||
bindingValue = ref(markRaw(unwrapped)); | ||
} | ||
} | ||
asVmProperty(vm, name, bindingValue); | ||
}); | ||
return; | ||
} | ||
if (("development" !== 'production')) { | ||
assert(false, "\"setup\" must return a \"Object\" or a \"Function\", got \"" + Object.prototype.toString | ||
.call(binding) | ||
.slice(8, -1) + "\""); | ||
} | ||
} | ||
function createSetupContext(vm) { | ||
var ctx = { | ||
slots: {}, | ||
}; | ||
var props = [ | ||
'root', | ||
'parent', | ||
'refs', | ||
'attrs', | ||
'listeners', | ||
'isServer', | ||
'ssrContext', | ||
]; | ||
var methodReturnVoid = ['emit']; | ||
props.forEach(function (key) { | ||
var _a; | ||
var targetKey; | ||
var srcKey; | ||
if (Array.isArray(key)) { | ||
_a = __read(key, 2), targetKey = _a[0], srcKey = _a[1]; | ||
} | ||
else { | ||
targetKey = srcKey = key; | ||
} | ||
srcKey = "$" + srcKey; | ||
proxy(ctx, targetKey, { | ||
get: function () { return vm[srcKey]; }, | ||
set: function () { | ||
warn("Cannot assign to '" + targetKey + "' because it is a read-only property", vm); | ||
}, | ||
}); | ||
}); | ||
methodReturnVoid.forEach(function (key) { | ||
var srcKey = "$" + key; | ||
proxy(ctx, key, { | ||
get: function () { | ||
return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var fn = vm[srcKey]; | ||
fn.apply(vm, args); | ||
}; | ||
}, | ||
}); | ||
}); | ||
return ctx; | ||
} | ||
} | ||
function createApp(rootComponent, rootProps) { | ||
if (rootProps === void 0) { rootProps = undefined; } | ||
var V = getCurrentVue(); | ||
var mountedVM = undefined; | ||
return { | ||
config: V.config, | ||
use: V.use.bind(V), | ||
mixin: V.mixin.bind(V), | ||
component: V.component.bind(V), | ||
directive: V.directive.bind(V), | ||
mount: function (el, hydrating) { | ||
if (!mountedVM) { | ||
mountedVM = new V(__assign({ propsData: rootProps }, rootComponent)); | ||
mountedVM.$mount(el, hydrating); | ||
return mountedVM; | ||
} | ||
else { | ||
if (("development" !== 'production')) { | ||
warn("App has already been mounted.\n" + | ||
"If you want to remount the same app, move your app creation logic " + | ||
"into a factory function and create fresh app instances for each " + | ||
"mount - e.g. `const createMyApp = () => createApp(App)`"); | ||
} | ||
return mountedVM; | ||
} | ||
}, | ||
unmount: function () { | ||
if (mountedVM) { | ||
mountedVM.$destroy(); | ||
mountedVM = undefined; | ||
} | ||
else if (("development" !== 'production')) { | ||
warn("Cannot unmount an app that is not mounted."); | ||
} | ||
}, | ||
}; | ||
} | ||
var nextTick = function nextTick() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return currentVue === null || currentVue === void 0 ? void 0 : currentVue.nextTick.apply(this, args); | ||
}; | ||
var fallbackCreateElement; | ||
var createElement = function createElement() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
if (!currentVM) { | ||
warn('`createElement()` has been called outside of render function.'); | ||
if (!fallbackCreateElement) { | ||
fallbackCreateElement = defineComponentInstance(getCurrentVue()) | ||
.$createElement; | ||
} | ||
return fallbackCreateElement.apply(fallbackCreateElement, args); | ||
} | ||
return currentVM.$createElement.apply(currentVM, args); | ||
}; | ||
// implementation, close to no-op | ||
function defineComponent(options) { | ||
return options; | ||
} | ||
var genName = function (name) { return "on" + (name[0].toUpperCase() + name.slice(1)); }; | ||
@@ -1036,3 +674,3 @@ function createLifeCycle(lifeCyclehook) { | ||
if (vm) { | ||
injectHookOption(getCurrentVue(), vm, lifeCyclehook, callback); | ||
injectHookOption(getVueConstructor(), vm, lifeCyclehook, callback); | ||
} | ||
@@ -1053,3 +691,3 @@ }; | ||
var preVm = getCurrentInstance(); | ||
setCurrentVM(vm); | ||
setCurrentInstance(vm); | ||
try { | ||
@@ -1059,3 +697,3 @@ return fn.apply(void 0, __spread(args)); | ||
finally { | ||
setCurrentVM(preVm); | ||
setCurrentInstance(preVm); | ||
} | ||
@@ -1110,3 +748,3 @@ }; | ||
if (!fallbackVM) { | ||
fallbackVM = defineComponentInstance(getCurrentVue()); | ||
fallbackVM = defineComponentInstance(getVueConstructor()); | ||
} | ||
@@ -1310,3 +948,3 @@ vm = fallbackVM; | ||
// effect watch | ||
if (("development" !== 'production')) { | ||
if ((process.env.NODE_ENV !== 'production')) { | ||
warn("`watch(fn, options?)` signature has been moved to a separate API. " + | ||
@@ -1335,3 +973,3 @@ "Use `watchEffect(fn, options?)` instead. `watch` now only " + | ||
} | ||
var computedHost = defineComponentInstance(getCurrentVue(), { | ||
var computedHost = defineComponentInstance(getVueConstructor(), { | ||
computed: { | ||
@@ -1348,3 +986,3 @@ $$state: { | ||
set: function (v) { | ||
if (("development" !== 'production') && !set) { | ||
if ((process.env.NODE_ENV !== 'production') && !set) { | ||
warn('Computed property was assigned to but it has no setter.', vm); | ||
@@ -1395,3 +1033,3 @@ return; | ||
else { | ||
if (defaultValue === undefined && "development" !== 'production') { | ||
if (defaultValue === undefined && (process.env.NODE_ENV !== 'production')) { | ||
warn("Injection \"" + String(key) + "\" not found", vm); | ||
@@ -1407,11 +1045,421 @@ } | ||
var VueCompositionAPI = { | ||
install: function (Vue) { return install(Vue, mixin); }, | ||
var EMPTY_OBJ = (process.env.NODE_ENV !== 'production') | ||
? Object.freeze({}) | ||
: {}; | ||
var useCSSModule = function (name) { | ||
if (name === void 0) { name = '$style'; } | ||
var instance = getCurrentInstance(); | ||
if (!instance) { | ||
(process.env.NODE_ENV !== 'production') && warn("useCSSModule must be called inside setup()"); | ||
return EMPTY_OBJ; | ||
} | ||
var mod = instance[name]; | ||
if (!mod) { | ||
(process.env.NODE_ENV !== 'production') && | ||
warn("Current instance does not have CSS module named \"" + name + "\"."); | ||
return EMPTY_OBJ; | ||
} | ||
return mod; | ||
}; | ||
function createApp(rootComponent, rootProps) { | ||
if (rootProps === void 0) { rootProps = undefined; } | ||
var V = getVueConstructor(); | ||
var mountedVM = undefined; | ||
return { | ||
config: V.config, | ||
use: V.use.bind(V), | ||
mixin: V.mixin.bind(V), | ||
component: V.component.bind(V), | ||
directive: V.directive.bind(V), | ||
mount: function (el, hydrating) { | ||
if (!mountedVM) { | ||
mountedVM = new V(__assign({ propsData: rootProps }, rootComponent)); | ||
mountedVM.$mount(el, hydrating); | ||
return mountedVM; | ||
} | ||
else { | ||
if ((process.env.NODE_ENV !== 'production')) { | ||
warn("App has already been mounted.\n" + | ||
"If you want to remount the same app, move your app creation logic " + | ||
"into a factory function and create fresh app instances for each " + | ||
"mount - e.g. `const createMyApp = () => createApp(App)`"); | ||
} | ||
return mountedVM; | ||
} | ||
}, | ||
unmount: function () { | ||
if (mountedVM) { | ||
mountedVM.$destroy(); | ||
mountedVM = undefined; | ||
} | ||
else if ((process.env.NODE_ENV !== 'production')) { | ||
warn("Cannot unmount an app that is not mounted."); | ||
} | ||
}, | ||
}; | ||
} | ||
var nextTick = function nextTick() { | ||
var _a; | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return (_a = getVueConstructor()) === null || _a === void 0 ? void 0 : _a.nextTick.apply(this, args); | ||
}; | ||
var fallbackCreateElement; | ||
var createElement = function createElement() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var instance = getCurrentInstance(); | ||
if (!instance) { | ||
warn('`createElement()` has been called outside of render function.'); | ||
if (!fallbackCreateElement) { | ||
fallbackCreateElement = defineComponentInstance(getVueConstructor()) | ||
.$createElement; | ||
} | ||
return fallbackCreateElement.apply(fallbackCreateElement, args); | ||
} | ||
return instance.$createElement.apply(instance, args); | ||
}; | ||
function set$1(vm, key, value) { | ||
var state = (vm.__composition_api_state__ = | ||
vm.__composition_api_state__ || {}); | ||
state[key] = value; | ||
} | ||
function get(vm, key) { | ||
return (vm.__composition_api_state__ || {})[key]; | ||
} | ||
var vmStateManager = { | ||
set: set$1, | ||
get: get, | ||
}; | ||
function asVmProperty(vm, propName, propValue) { | ||
var props = vm.$options.props; | ||
if (!(propName in vm) && !(props && hasOwn(props, propName))) { | ||
proxy(vm, propName, { | ||
get: function () { return propValue.value; }, | ||
set: function (val) { | ||
propValue.value = val; | ||
}, | ||
}); | ||
if ((process.env.NODE_ENV !== 'production')) { | ||
// expose binding to Vue Devtool as a data property | ||
// delay this until state has been resolved to prevent repeated works | ||
vm.$nextTick(function () { | ||
proxy(vm._data, propName, { | ||
get: function () { return propValue.value; }, | ||
set: function (val) { | ||
propValue.value = val; | ||
}, | ||
}); | ||
}); | ||
} | ||
} | ||
else if ((process.env.NODE_ENV !== 'production')) { | ||
if (props && hasOwn(props, propName)) { | ||
warn("The setup binding property \"" + propName + "\" is already declared as a prop.", vm); | ||
} | ||
else { | ||
warn("The setup binding property \"" + propName + "\" is already declared.", vm); | ||
} | ||
} | ||
} | ||
function updateTemplateRef(vm) { | ||
var rawBindings = vmStateManager.get(vm, 'rawBindings') || {}; | ||
if (!rawBindings || !Object.keys(rawBindings).length) | ||
return; | ||
var refs = vm.$refs; | ||
var oldRefKeys = vmStateManager.get(vm, 'refs') || []; | ||
for (var index = 0; index < oldRefKeys.length; index++) { | ||
var key = oldRefKeys[index]; | ||
var setupValue = rawBindings[key]; | ||
if (!refs[key] && setupValue && isRef(setupValue)) { | ||
setupValue.value = null; | ||
} | ||
} | ||
var newKeys = Object.keys(refs); | ||
var validNewKeys = []; | ||
for (var index = 0; index < newKeys.length; index++) { | ||
var key = newKeys[index]; | ||
var setupValue = rawBindings[key]; | ||
if (refs[key] && setupValue && isRef(setupValue)) { | ||
setupValue.value = refs[key]; | ||
validNewKeys.push(key); | ||
} | ||
} | ||
vmStateManager.set(vm, 'refs', validNewKeys); | ||
} | ||
function resolveScopedSlots(vm, slotsProxy) { | ||
var parentVNode = vm.$options._parentVnode; | ||
if (!parentVNode) | ||
return; | ||
var prevSlots = vmStateManager.get(vm, 'slots') || []; | ||
var curSlots = resolveSlots(parentVNode.data.scopedSlots, vm.$slots); | ||
// remove staled slots | ||
for (var index = 0; index < prevSlots.length; index++) { | ||
var key = prevSlots[index]; | ||
if (!curSlots[key]) { | ||
delete slotsProxy[key]; | ||
} | ||
} | ||
// proxy fresh slots | ||
var slotNames = Object.keys(curSlots); | ||
for (var index = 0; index < slotNames.length; index++) { | ||
var key = slotNames[index]; | ||
if (!slotsProxy[key]) { | ||
slotsProxy[key] = createSlotProxy(vm, key); | ||
} | ||
} | ||
vmStateManager.set(vm, 'slots', slotNames); | ||
} | ||
function activateCurrentInstance(vm, fn, onError) { | ||
var preVm = getCurrentInstance(); | ||
setCurrentInstance(vm); | ||
try { | ||
return fn(vm); | ||
} | ||
catch (err) { | ||
if (onError) { | ||
onError(err); | ||
} | ||
else { | ||
throw err; | ||
} | ||
} | ||
finally { | ||
setCurrentInstance(preVm); | ||
} | ||
} | ||
function mixin(Vue) { | ||
Vue.mixin({ | ||
beforeCreate: functionApiInit, | ||
mounted: function () { | ||
updateTemplateRef(this); | ||
}, | ||
updated: function () { | ||
updateTemplateRef(this); | ||
}, | ||
}); | ||
/** | ||
* Vuex init hook, injected into each instances init hooks list. | ||
*/ | ||
function functionApiInit() { | ||
var vm = this; | ||
var $options = vm.$options; | ||
var setup = $options.setup, render = $options.render; | ||
if (render) { | ||
// keep currentInstance accessible for createElement | ||
$options.render = function () { | ||
var _this = this; | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return activateCurrentInstance(vm, function () { return render.apply(_this, args); }); | ||
}; | ||
} | ||
if (!setup) { | ||
return; | ||
} | ||
if (typeof setup !== 'function') { | ||
if ((process.env.NODE_ENV !== 'production')) { | ||
warn('The "setup" option should be a function that returns a object in component definitions.', vm); | ||
} | ||
return; | ||
} | ||
var data = $options.data; | ||
// wrapper the data option, so we can invoke setup before data get resolved | ||
$options.data = function wrappedData() { | ||
initSetup(vm, vm.$props); | ||
return typeof data === 'function' | ||
? data.call(vm, vm) | ||
: data || {}; | ||
}; | ||
} | ||
function initSetup(vm, props) { | ||
if (props === void 0) { props = {}; } | ||
var setup = vm.$options.setup; | ||
var ctx = createSetupContext(vm); | ||
// mark props as reactive | ||
markReactive(props); | ||
// resolve scopedSlots and slots to functions | ||
resolveScopedSlots(vm, ctx.slots); | ||
var binding; | ||
activateCurrentInstance(vm, function () { | ||
binding = setup(props, ctx); | ||
}); | ||
if (!binding) | ||
return; | ||
if (isFunction(binding)) { | ||
// keep typescript happy with the binding type. | ||
var bindingFunc_1 = binding; | ||
// keep currentInstance accessible for createElement | ||
vm.$options.render = function () { | ||
resolveScopedSlots(vm, ctx.slots); | ||
return activateCurrentInstance(vm, function () { return bindingFunc_1(); }); | ||
}; | ||
return; | ||
} | ||
if (isPlainObject(binding)) { | ||
var bindingObj_1 = binding; | ||
vmStateManager.set(vm, 'rawBindings', binding); | ||
Object.keys(binding).forEach(function (name) { | ||
var bindingValue = bindingObj_1[name]; | ||
// only make primitive value reactive | ||
if (!isRef(bindingValue)) { | ||
if (isReactive(bindingValue)) { | ||
bindingValue = ref(bindingValue); | ||
} | ||
else { | ||
// bind function to the vm, this will make `this` = vm | ||
if (isFunction(bindingValue)) { | ||
bindingValue = bindingValue.bind(vm); | ||
} | ||
// unwrap all ref properties | ||
var unwrapped = unwrapRefProxy(bindingValue); | ||
// mark the object as reactive | ||
markReactive(unwrapped); | ||
// a non-reactive should not don't get reactivity | ||
bindingValue = ref(markRaw(unwrapped)); | ||
} | ||
} | ||
asVmProperty(vm, name, bindingValue); | ||
}); | ||
return; | ||
} | ||
if ((process.env.NODE_ENV !== 'production')) { | ||
assert(false, "\"setup\" must return a \"Object\" or a \"Function\", got \"" + Object.prototype.toString | ||
.call(binding) | ||
.slice(8, -1) + "\""); | ||
} | ||
} | ||
function createSetupContext(vm) { | ||
var ctx = { | ||
slots: {}, | ||
}; | ||
var props = [ | ||
'root', | ||
'parent', | ||
'refs', | ||
'attrs', | ||
'listeners', | ||
'isServer', | ||
'ssrContext', | ||
]; | ||
var methodReturnVoid = ['emit']; | ||
props.forEach(function (key) { | ||
var _a; | ||
var targetKey; | ||
var srcKey; | ||
if (Array.isArray(key)) { | ||
_a = __read(key, 2), targetKey = _a[0], srcKey = _a[1]; | ||
} | ||
else { | ||
targetKey = srcKey = key; | ||
} | ||
srcKey = "$" + srcKey; | ||
proxy(ctx, targetKey, { | ||
get: function () { return vm[srcKey]; }, | ||
set: function () { | ||
warn("Cannot assign to '" + targetKey + "' because it is a read-only property", vm); | ||
}, | ||
}); | ||
}); | ||
methodReturnVoid.forEach(function (key) { | ||
var srcKey = "$" + key; | ||
proxy(ctx, key, { | ||
get: function () { | ||
return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var fn = vm[srcKey]; | ||
fn.apply(vm, args); | ||
}; | ||
}, | ||
}); | ||
}); | ||
if (process.env.NODE_ENV === 'test') { | ||
ctx._vm = vm; | ||
} | ||
return ctx; | ||
} | ||
} | ||
/** | ||
* Helper that recursively merges two data objects together. | ||
*/ | ||
function mergeData(from, to) { | ||
if (!from) | ||
return to; | ||
if (!to) | ||
return from; | ||
var key; | ||
var toVal; | ||
var fromVal; | ||
var keys = hasSymbol ? Reflect.ownKeys(from) : Object.keys(from); | ||
for (var i = 0; i < keys.length; i++) { | ||
key = keys[i]; | ||
// in case the object is already observed... | ||
if (key === '__ob__') | ||
continue; | ||
toVal = to[key]; | ||
fromVal = from[key]; | ||
if (!hasOwn(to, key)) { | ||
to[key] = fromVal; | ||
} | ||
else if (toVal !== fromVal && | ||
isPlainObject(toVal) && | ||
!isRef(toVal) && | ||
isPlainObject(fromVal) && | ||
!isRef(fromVal)) { | ||
mergeData(fromVal, toVal); | ||
} | ||
} | ||
return to; | ||
} | ||
function install(Vue) { | ||
if (isPluginInstalled() || isVueRegistered(Vue)) { | ||
if ((process.env.NODE_ENV !== 'production')) { | ||
assert(false, 'already installed. Vue.use(VueCompositionAPI) should be called only once.'); | ||
} | ||
return; | ||
} | ||
if ((process.env.NODE_ENV !== 'production')) { | ||
if (!Vue.version.startsWith('2.')) { | ||
assert(false, "only works with Vue 2, v" + Vue.version + " found."); | ||
} | ||
} | ||
Vue.config.optionMergeStrategies.setup = function (parent, child) { | ||
return function mergedSetupFn(props, context) { | ||
return mergeData(typeof parent === 'function' ? parent(props, context) || {} : undefined, typeof child === 'function' ? child(props, context) || {} : undefined); | ||
}; | ||
}; | ||
setVueConstructor(Vue); | ||
mixin(Vue); | ||
} | ||
var Plugin = { | ||
install: function (Vue) { return install(Vue); }, | ||
}; | ||
// implementation, close to no-op | ||
function defineComponent(options) { | ||
return options; | ||
} | ||
// auto install when using CDN | ||
if (typeof window !== 'undefined' && window.Vue) { | ||
window.Vue.use(VueCompositionAPI); | ||
window.Vue.use(Plugin); | ||
} | ||
export default VueCompositionAPI; | ||
export { computed, createApp, defineComponent, getCurrentInstance, createElement as h, inject, isReactive, isRef, markRaw, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onServerPrefetch, onUnmounted, onUpdated, provide, reactive, ref, set, shallowReactive, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, watch, watchEffect }; | ||
export default Plugin; | ||
export { computed, createApp, customRef, defineComponent, getCurrentInstance, createElement as h, inject, isReactive, isRef, markRaw, markReactive, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onServerPrefetch, onUnmounted, onUpdated, provide, reactive, ref, set, shallowReactive, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useCSSModule, watch, watchEffect }; |
@@ -69,79 +69,30 @@ (function (global, factory) { | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
function __values(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
var vueConstructor = null; | ||
var currentInstance = null; | ||
var PluginInstalledFlag = '__composition_api_installed__'; | ||
function isPluginInstalled() { | ||
return !!vueConstructor; | ||
} | ||
function __read(o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
function isVueRegistered(Vue) { | ||
return hasOwn(Vue, PluginInstalledFlag); | ||
} | ||
function __spread() { | ||
for (var ar = [], i = 0; i < arguments.length; i++) | ||
ar = ar.concat(__read(arguments[i])); | ||
return ar; | ||
} | ||
var currentVue = null; | ||
var currentVM = null; | ||
function getCurrentVue() { | ||
function getVueConstructor() { | ||
{ | ||
assert(currentVue, "must call Vue.use(VueCompositionAPI) before using any function."); | ||
assert(vueConstructor, "must call Vue.use(VueCompositionAPI) before using any function."); | ||
} | ||
return currentVue; | ||
return vueConstructor; | ||
} | ||
function setCurrentVue(vue) { | ||
currentVue = vue; | ||
function setVueConstructor(Vue) { | ||
vueConstructor = Vue; | ||
Object.defineProperty(Vue, PluginInstalledFlag, { | ||
configurable: true, | ||
writable: true, | ||
value: true, | ||
}); | ||
} | ||
function getCurrentInstance() { | ||
return currentVM; | ||
return currentInstance; | ||
} | ||
function setCurrentVM(vm) { | ||
currentVM = vm; | ||
function setCurrentInstance(vm) { | ||
currentInstance = vm; | ||
} | ||
@@ -167,3 +118,4 @@ | ||
function isComponentInstance(obj) { | ||
return currentVue && obj instanceof currentVue; | ||
var Vue = getVueConstructor(); | ||
return Vue && obj instanceof Vue; | ||
} | ||
@@ -208,12 +160,73 @@ function createSlotProxy(vm, slotName) { | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
function __values(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
} | ||
function __read(o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
} | ||
function __spread() { | ||
for (var ar = [], i = 0; i < arguments.length; i++) | ||
ar = ar.concat(__read(arguments[i])); | ||
return ar; | ||
} | ||
function createSymbol(name) { | ||
return hasSymbol ? Symbol.for(name) : name; | ||
} | ||
var WatcherPreFlushQueueKey = createSymbol('vfa.key.preFlushQueue'); | ||
var WatcherPostFlushQueueKey = createSymbol('vfa.key.postFlushQueue'); | ||
var AccessControlIdentifierKey = createSymbol('vfa.key.accessControlIdentifier'); | ||
var ReactiveIdentifierKey = createSymbol('vfa.key.reactiveIdentifier'); | ||
var RawIdentifierKey = createSymbol('vfa.key.rawIdentifierKey'); | ||
var WatcherPreFlushQueueKey = createSymbol('composition-api.preFlushQueue'); | ||
var WatcherPostFlushQueueKey = createSymbol('composition-api.postFlushQueue'); | ||
var AccessControlIdentifierKey = createSymbol('composition-api.accessControlIdentifier'); | ||
var ReactiveIdentifierKey = createSymbol('composition-api.reactiveIdentifier'); | ||
var RawIdentifierKey = createSymbol('composition-api.rawIdentifierKey'); | ||
// must be a string, symbol key is ignored in reactive | ||
var RefKey = 'vfa.key.refKey'; | ||
var RefKey = 'composition-api.refKey'; | ||
@@ -265,2 +278,8 @@ var RefImpl = /** @class */ (function () { | ||
} | ||
function customRef(factory) { | ||
var version = ref(0); | ||
return createRef(factory(function () { return void version.value; }, function () { | ||
++version.value; | ||
})); | ||
} | ||
function toRef(object, key) { | ||
@@ -382,3 +401,3 @@ var v = object[key]; | ||
function observe(obj) { | ||
var Vue = getCurrentVue(); | ||
var Vue = getVueConstructor(); | ||
var observed; | ||
@@ -528,3 +547,3 @@ if (Vue.observable) { | ||
function toRaw(observed) { | ||
if (isRaw(observe) || !Object.isExtensible(observed)) { | ||
if (isRaw(observed) || !Object.isExtensible(observed)) { | ||
return observed; | ||
@@ -555,3 +574,3 @@ } | ||
function set(target, key, val) { | ||
var Vue = getCurrentVue(); | ||
var Vue = getVueConstructor(); | ||
var _a = Vue.util, warn = _a.warn, defineReactive = _a.defineReactive; | ||
@@ -589,67 +608,2 @@ if ( (isUndef(target) || isPrimitive(target))) { | ||
/** | ||
* Helper that recursively merges two data objects together. | ||
*/ | ||
function mergeData(from, to) { | ||
if (!from) | ||
return to; | ||
if (!to) | ||
return from; | ||
var key; | ||
var toVal; | ||
var fromVal; | ||
var keys = hasSymbol ? Reflect.ownKeys(from) : Object.keys(from); | ||
for (var i = 0; i < keys.length; i++) { | ||
key = keys[i]; | ||
// in case the object is already observed... | ||
if (key === '__ob__') | ||
continue; | ||
toVal = to[key]; | ||
fromVal = from[key]; | ||
if (!hasOwn(to, key)) { | ||
to[key] = fromVal; | ||
} | ||
else if (toVal !== fromVal && | ||
isPlainObject(toVal) && | ||
!isRef(toVal) && | ||
isPlainObject(fromVal) && | ||
!isRef(fromVal)) { | ||
mergeData(fromVal, toVal); | ||
} | ||
} | ||
return to; | ||
} | ||
function install(Vue, _install) { | ||
if (currentVue && currentVue === Vue) { | ||
{ | ||
assert(false, 'already installed. Vue.use(VueCompositionAPI) should be called only once.'); | ||
} | ||
return; | ||
} | ||
{ | ||
if (!Vue.version.startsWith('2.')) { | ||
assert(false, "@vue/composition-api only works with Vue 2, v" + Vue.version + " found."); | ||
} | ||
} | ||
Vue.config.optionMergeStrategies.setup = function (parent, child) { | ||
return function mergedSetupFn(props, context) { | ||
return mergeData(typeof parent === 'function' ? parent(props, context) || {} : undefined, typeof child === 'function' ? child(props, context) || {} : undefined); | ||
}; | ||
}; | ||
setCurrentVue(Vue); | ||
_install(Vue); | ||
} | ||
function set$1(vm, key, value) { | ||
var state = (vm.__secret_vfa_state__ = vm.__secret_vfa_state__ || {}); | ||
state[key] = value; | ||
} | ||
function get(vm, key) { | ||
return (vm.__secret_vfa_state__ || {})[key]; | ||
} | ||
var vmStateManager = { | ||
set: set$1, | ||
get: get, | ||
}; | ||
function unwrapRefProxy(value, map) { | ||
@@ -676,3 +630,6 @@ var e_1, _a; | ||
if (value.__ob__) { | ||
Object.defineProperty(obj, '__ob__', value.__ob__); | ||
Object.defineProperty(obj, '__ob__', { | ||
enumerable: false, | ||
value: value.__ob__, | ||
}); | ||
} | ||
@@ -711,321 +668,2 @@ var _loop_1 = function (k) { | ||
function asVmProperty(vm, propName, propValue) { | ||
var props = vm.$options.props; | ||
if (!(propName in vm) && !(props && hasOwn(props, propName))) { | ||
proxy(vm, propName, { | ||
get: function () { return propValue.value; }, | ||
set: function (val) { | ||
propValue.value = val; | ||
}, | ||
}); | ||
{ | ||
// expose binding to Vue Devtool as a data property | ||
// delay this until state has been resolved to prevent repeated works | ||
vm.$nextTick(function () { | ||
proxy(vm._data, propName, { | ||
get: function () { return propValue.value; }, | ||
set: function (val) { | ||
propValue.value = val; | ||
}, | ||
}); | ||
}); | ||
} | ||
} | ||
else { | ||
if (props && hasOwn(props, propName)) { | ||
warn("The setup binding property \"" + propName + "\" is already declared as a prop.", vm); | ||
} | ||
else { | ||
warn("The setup binding property \"" + propName + "\" is already declared.", vm); | ||
} | ||
} | ||
} | ||
function updateTemplateRef(vm) { | ||
var rawBindings = vmStateManager.get(vm, 'rawBindings') || {}; | ||
if (!rawBindings || !Object.keys(rawBindings).length) | ||
return; | ||
var refs = vm.$refs; | ||
var oldRefKeys = vmStateManager.get(vm, 'refs') || []; | ||
for (var index = 0; index < oldRefKeys.length; index++) { | ||
var key = oldRefKeys[index]; | ||
var setupValue = rawBindings[key]; | ||
if (!refs[key] && setupValue && isRef(setupValue)) { | ||
setupValue.value = null; | ||
} | ||
} | ||
var newKeys = Object.keys(refs); | ||
var validNewKeys = []; | ||
for (var index = 0; index < newKeys.length; index++) { | ||
var key = newKeys[index]; | ||
var setupValue = rawBindings[key]; | ||
if (refs[key] && setupValue && isRef(setupValue)) { | ||
setupValue.value = refs[key]; | ||
validNewKeys.push(key); | ||
} | ||
} | ||
vmStateManager.set(vm, 'refs', validNewKeys); | ||
} | ||
function resolveScopedSlots(vm, slotsProxy) { | ||
var parentVode = vm.$options._parentVnode; | ||
if (!parentVode) | ||
return; | ||
var prevSlots = vmStateManager.get(vm, 'slots') || []; | ||
var curSlots = resolveSlots(parentVode.data.scopedSlots, vm.$slots); | ||
// remove staled slots | ||
for (var index = 0; index < prevSlots.length; index++) { | ||
var key = prevSlots[index]; | ||
if (!curSlots[key]) { | ||
delete slotsProxy[key]; | ||
} | ||
} | ||
// proxy fresh slots | ||
var slotNames = Object.keys(curSlots); | ||
for (var index = 0; index < slotNames.length; index++) { | ||
var key = slotNames[index]; | ||
if (!slotsProxy[key]) { | ||
slotsProxy[key] = createSlotProxy(vm, key); | ||
} | ||
} | ||
vmStateManager.set(vm, 'slots', slotNames); | ||
} | ||
function activateCurrentInstance(vm, fn, onError) { | ||
var preVm = getCurrentInstance(); | ||
setCurrentVM(vm); | ||
try { | ||
return fn(vm); | ||
} | ||
catch (err) { | ||
if (onError) { | ||
onError(err); | ||
} | ||
else { | ||
throw err; | ||
} | ||
} | ||
finally { | ||
setCurrentVM(preVm); | ||
} | ||
} | ||
function mixin(Vue) { | ||
Vue.mixin({ | ||
beforeCreate: functionApiInit, | ||
mounted: function () { | ||
updateTemplateRef(this); | ||
}, | ||
updated: function () { | ||
updateTemplateRef(this); | ||
}, | ||
}); | ||
/** | ||
* Vuex init hook, injected into each instances init hooks list. | ||
*/ | ||
function functionApiInit() { | ||
var vm = this; | ||
var $options = vm.$options; | ||
var setup = $options.setup, render = $options.render; | ||
if (render) { | ||
// keep currentInstance accessible for createElement | ||
$options.render = function () { | ||
var _this = this; | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return activateCurrentInstance(vm, function () { return render.apply(_this, args); }); | ||
}; | ||
} | ||
if (!setup) { | ||
return; | ||
} | ||
if (typeof setup !== 'function') { | ||
{ | ||
warn('The "setup" option should be a function that returns a object in component definitions.', vm); | ||
} | ||
return; | ||
} | ||
var data = $options.data; | ||
// wrapper the data option, so we can invoke setup before data get resolved | ||
$options.data = function wrappedData() { | ||
initSetup(vm, vm.$props); | ||
return typeof data === 'function' | ||
? data.call(vm, vm) | ||
: data || {}; | ||
}; | ||
} | ||
function initSetup(vm, props) { | ||
if (props === void 0) { props = {}; } | ||
var setup = vm.$options.setup; | ||
var ctx = createSetupContext(vm); | ||
// mark props as reactive | ||
markReactive(props); | ||
// resolve scopedSlots and slots to functions | ||
resolveScopedSlots(vm, ctx.slots); | ||
var binding; | ||
activateCurrentInstance(vm, function () { | ||
binding = setup(props, ctx); | ||
}); | ||
if (!binding) | ||
return; | ||
if (isFunction(binding)) { | ||
// keep typescript happy with the binding type. | ||
var bindingFunc_1 = binding; | ||
// keep currentInstance accessible for createElement | ||
vm.$options.render = function () { | ||
resolveScopedSlots(vm, ctx.slots); | ||
return activateCurrentInstance(vm, function () { return bindingFunc_1(); }); | ||
}; | ||
return; | ||
} | ||
if (isPlainObject(binding)) { | ||
var bindingObj_1 = binding; | ||
vmStateManager.set(vm, 'rawBindings', binding); | ||
Object.keys(binding).forEach(function (name) { | ||
var bindingValue = bindingObj_1[name]; | ||
// only make primitive value reactive | ||
if (!isRef(bindingValue)) { | ||
if (isReactive(bindingValue)) { | ||
bindingValue = ref(bindingValue); | ||
} | ||
else { | ||
// bind function to the vm, this will make `this` = vm | ||
if (isFunction(bindingValue)) { | ||
bindingValue = bindingValue.bind(vm); | ||
} | ||
// unwrap all ref properties | ||
var unwrapped = unwrapRefProxy(bindingValue); | ||
// mark the object as reactive | ||
markReactive(unwrapped); | ||
// a non-reactive should not don't get reactivity | ||
bindingValue = ref(markRaw(unwrapped)); | ||
} | ||
} | ||
asVmProperty(vm, name, bindingValue); | ||
}); | ||
return; | ||
} | ||
{ | ||
assert(false, "\"setup\" must return a \"Object\" or a \"Function\", got \"" + Object.prototype.toString | ||
.call(binding) | ||
.slice(8, -1) + "\""); | ||
} | ||
} | ||
function createSetupContext(vm) { | ||
var ctx = { | ||
slots: {}, | ||
}; | ||
var props = [ | ||
'root', | ||
'parent', | ||
'refs', | ||
'attrs', | ||
'listeners', | ||
'isServer', | ||
'ssrContext', | ||
]; | ||
var methodReturnVoid = ['emit']; | ||
props.forEach(function (key) { | ||
var _a; | ||
var targetKey; | ||
var srcKey; | ||
if (Array.isArray(key)) { | ||
_a = __read(key, 2), targetKey = _a[0], srcKey = _a[1]; | ||
} | ||
else { | ||
targetKey = srcKey = key; | ||
} | ||
srcKey = "$" + srcKey; | ||
proxy(ctx, targetKey, { | ||
get: function () { return vm[srcKey]; }, | ||
set: function () { | ||
warn("Cannot assign to '" + targetKey + "' because it is a read-only property", vm); | ||
}, | ||
}); | ||
}); | ||
methodReturnVoid.forEach(function (key) { | ||
var srcKey = "$" + key; | ||
proxy(ctx, key, { | ||
get: function () { | ||
return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var fn = vm[srcKey]; | ||
fn.apply(vm, args); | ||
}; | ||
}, | ||
}); | ||
}); | ||
return ctx; | ||
} | ||
} | ||
function createApp(rootComponent, rootProps) { | ||
if (rootProps === void 0) { rootProps = undefined; } | ||
var V = getCurrentVue(); | ||
var mountedVM = undefined; | ||
return { | ||
config: V.config, | ||
use: V.use.bind(V), | ||
mixin: V.mixin.bind(V), | ||
component: V.component.bind(V), | ||
directive: V.directive.bind(V), | ||
mount: function (el, hydrating) { | ||
if (!mountedVM) { | ||
mountedVM = new V(__assign({ propsData: rootProps }, rootComponent)); | ||
mountedVM.$mount(el, hydrating); | ||
return mountedVM; | ||
} | ||
else { | ||
{ | ||
warn("App has already been mounted.\n" + | ||
"If you want to remount the same app, move your app creation logic " + | ||
"into a factory function and create fresh app instances for each " + | ||
"mount - e.g. `const createMyApp = () => createApp(App)`"); | ||
} | ||
return mountedVM; | ||
} | ||
}, | ||
unmount: function () { | ||
if (mountedVM) { | ||
mountedVM.$destroy(); | ||
mountedVM = undefined; | ||
} | ||
else { | ||
warn("Cannot unmount an app that is not mounted."); | ||
} | ||
}, | ||
}; | ||
} | ||
var nextTick = function nextTick() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return currentVue === null || currentVue === void 0 ? void 0 : currentVue.nextTick.apply(this, args); | ||
}; | ||
var fallbackCreateElement; | ||
var createElement = function createElement() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
if (!currentVM) { | ||
warn('`createElement()` has been called outside of render function.'); | ||
if (!fallbackCreateElement) { | ||
fallbackCreateElement = defineComponentInstance(getCurrentVue()) | ||
.$createElement; | ||
} | ||
return fallbackCreateElement.apply(fallbackCreateElement, args); | ||
} | ||
return currentVM.$createElement.apply(currentVM, args); | ||
}; | ||
// implementation, close to no-op | ||
function defineComponent(options) { | ||
return options; | ||
} | ||
var genName = function (name) { return "on" + (name[0].toUpperCase() + name.slice(1)); }; | ||
@@ -1036,3 +674,3 @@ function createLifeCycle(lifeCyclehook) { | ||
if (vm) { | ||
injectHookOption(getCurrentVue(), vm, lifeCyclehook, callback); | ||
injectHookOption(getVueConstructor(), vm, lifeCyclehook, callback); | ||
} | ||
@@ -1053,3 +691,3 @@ }; | ||
var preVm = getCurrentInstance(); | ||
setCurrentVM(vm); | ||
setCurrentInstance(vm); | ||
try { | ||
@@ -1059,3 +697,3 @@ return fn.apply(void 0, __spread(args)); | ||
finally { | ||
setCurrentVM(preVm); | ||
setCurrentInstance(preVm); | ||
} | ||
@@ -1110,3 +748,3 @@ }; | ||
if (!fallbackVM) { | ||
fallbackVM = defineComponentInstance(getCurrentVue()); | ||
fallbackVM = defineComponentInstance(getVueConstructor()); | ||
} | ||
@@ -1334,3 +972,3 @@ vm = fallbackVM; | ||
} | ||
var computedHost = defineComponentInstance(getCurrentVue(), { | ||
var computedHost = defineComponentInstance(getVueConstructor(), { | ||
computed: { | ||
@@ -1393,3 +1031,3 @@ $$state: { | ||
else { | ||
if (defaultValue === undefined && "development" !== 'production') { | ||
if (defaultValue === undefined && true) { | ||
warn("Injection \"" + String(key) + "\" not found", vm); | ||
@@ -1405,8 +1043,414 @@ } | ||
var VueCompositionAPI = { | ||
install: function (Vue) { return install(Vue, mixin); }, | ||
var EMPTY_OBJ = Object.freeze({}) | ||
; | ||
var useCSSModule = function (name) { | ||
if (name === void 0) { name = '$style'; } | ||
var instance = getCurrentInstance(); | ||
if (!instance) { | ||
warn("useCSSModule must be called inside setup()"); | ||
return EMPTY_OBJ; | ||
} | ||
var mod = instance[name]; | ||
if (!mod) { | ||
warn("Current instance does not have CSS module named \"" + name + "\"."); | ||
return EMPTY_OBJ; | ||
} | ||
return mod; | ||
}; | ||
function createApp(rootComponent, rootProps) { | ||
if (rootProps === void 0) { rootProps = undefined; } | ||
var V = getVueConstructor(); | ||
var mountedVM = undefined; | ||
return { | ||
config: V.config, | ||
use: V.use.bind(V), | ||
mixin: V.mixin.bind(V), | ||
component: V.component.bind(V), | ||
directive: V.directive.bind(V), | ||
mount: function (el, hydrating) { | ||
if (!mountedVM) { | ||
mountedVM = new V(__assign({ propsData: rootProps }, rootComponent)); | ||
mountedVM.$mount(el, hydrating); | ||
return mountedVM; | ||
} | ||
else { | ||
{ | ||
warn("App has already been mounted.\n" + | ||
"If you want to remount the same app, move your app creation logic " + | ||
"into a factory function and create fresh app instances for each " + | ||
"mount - e.g. `const createMyApp = () => createApp(App)`"); | ||
} | ||
return mountedVM; | ||
} | ||
}, | ||
unmount: function () { | ||
if (mountedVM) { | ||
mountedVM.$destroy(); | ||
mountedVM = undefined; | ||
} | ||
else { | ||
warn("Cannot unmount an app that is not mounted."); | ||
} | ||
}, | ||
}; | ||
} | ||
var nextTick = function nextTick() { | ||
var _a; | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return (_a = getVueConstructor()) === null || _a === void 0 ? void 0 : _a.nextTick.apply(this, args); | ||
}; | ||
var fallbackCreateElement; | ||
var createElement = function createElement() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var instance = getCurrentInstance(); | ||
if (!instance) { | ||
warn('`createElement()` has been called outside of render function.'); | ||
if (!fallbackCreateElement) { | ||
fallbackCreateElement = defineComponentInstance(getVueConstructor()) | ||
.$createElement; | ||
} | ||
return fallbackCreateElement.apply(fallbackCreateElement, args); | ||
} | ||
return instance.$createElement.apply(instance, args); | ||
}; | ||
function set$1(vm, key, value) { | ||
var state = (vm.__composition_api_state__ = | ||
vm.__composition_api_state__ || {}); | ||
state[key] = value; | ||
} | ||
function get(vm, key) { | ||
return (vm.__composition_api_state__ || {})[key]; | ||
} | ||
var vmStateManager = { | ||
set: set$1, | ||
get: get, | ||
}; | ||
function asVmProperty(vm, propName, propValue) { | ||
var props = vm.$options.props; | ||
if (!(propName in vm) && !(props && hasOwn(props, propName))) { | ||
proxy(vm, propName, { | ||
get: function () { return propValue.value; }, | ||
set: function (val) { | ||
propValue.value = val; | ||
}, | ||
}); | ||
{ | ||
// expose binding to Vue Devtool as a data property | ||
// delay this until state has been resolved to prevent repeated works | ||
vm.$nextTick(function () { | ||
proxy(vm._data, propName, { | ||
get: function () { return propValue.value; }, | ||
set: function (val) { | ||
propValue.value = val; | ||
}, | ||
}); | ||
}); | ||
} | ||
} | ||
else { | ||
if (props && hasOwn(props, propName)) { | ||
warn("The setup binding property \"" + propName + "\" is already declared as a prop.", vm); | ||
} | ||
else { | ||
warn("The setup binding property \"" + propName + "\" is already declared.", vm); | ||
} | ||
} | ||
} | ||
function updateTemplateRef(vm) { | ||
var rawBindings = vmStateManager.get(vm, 'rawBindings') || {}; | ||
if (!rawBindings || !Object.keys(rawBindings).length) | ||
return; | ||
var refs = vm.$refs; | ||
var oldRefKeys = vmStateManager.get(vm, 'refs') || []; | ||
for (var index = 0; index < oldRefKeys.length; index++) { | ||
var key = oldRefKeys[index]; | ||
var setupValue = rawBindings[key]; | ||
if (!refs[key] && setupValue && isRef(setupValue)) { | ||
setupValue.value = null; | ||
} | ||
} | ||
var newKeys = Object.keys(refs); | ||
var validNewKeys = []; | ||
for (var index = 0; index < newKeys.length; index++) { | ||
var key = newKeys[index]; | ||
var setupValue = rawBindings[key]; | ||
if (refs[key] && setupValue && isRef(setupValue)) { | ||
setupValue.value = refs[key]; | ||
validNewKeys.push(key); | ||
} | ||
} | ||
vmStateManager.set(vm, 'refs', validNewKeys); | ||
} | ||
function resolveScopedSlots(vm, slotsProxy) { | ||
var parentVNode = vm.$options._parentVnode; | ||
if (!parentVNode) | ||
return; | ||
var prevSlots = vmStateManager.get(vm, 'slots') || []; | ||
var curSlots = resolveSlots(parentVNode.data.scopedSlots, vm.$slots); | ||
// remove staled slots | ||
for (var index = 0; index < prevSlots.length; index++) { | ||
var key = prevSlots[index]; | ||
if (!curSlots[key]) { | ||
delete slotsProxy[key]; | ||
} | ||
} | ||
// proxy fresh slots | ||
var slotNames = Object.keys(curSlots); | ||
for (var index = 0; index < slotNames.length; index++) { | ||
var key = slotNames[index]; | ||
if (!slotsProxy[key]) { | ||
slotsProxy[key] = createSlotProxy(vm, key); | ||
} | ||
} | ||
vmStateManager.set(vm, 'slots', slotNames); | ||
} | ||
function activateCurrentInstance(vm, fn, onError) { | ||
var preVm = getCurrentInstance(); | ||
setCurrentInstance(vm); | ||
try { | ||
return fn(vm); | ||
} | ||
catch (err) { | ||
if (onError) { | ||
onError(err); | ||
} | ||
else { | ||
throw err; | ||
} | ||
} | ||
finally { | ||
setCurrentInstance(preVm); | ||
} | ||
} | ||
function mixin(Vue) { | ||
Vue.mixin({ | ||
beforeCreate: functionApiInit, | ||
mounted: function () { | ||
updateTemplateRef(this); | ||
}, | ||
updated: function () { | ||
updateTemplateRef(this); | ||
}, | ||
}); | ||
/** | ||
* Vuex init hook, injected into each instances init hooks list. | ||
*/ | ||
function functionApiInit() { | ||
var vm = this; | ||
var $options = vm.$options; | ||
var setup = $options.setup, render = $options.render; | ||
if (render) { | ||
// keep currentInstance accessible for createElement | ||
$options.render = function () { | ||
var _this = this; | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return activateCurrentInstance(vm, function () { return render.apply(_this, args); }); | ||
}; | ||
} | ||
if (!setup) { | ||
return; | ||
} | ||
if (typeof setup !== 'function') { | ||
{ | ||
warn('The "setup" option should be a function that returns a object in component definitions.', vm); | ||
} | ||
return; | ||
} | ||
var data = $options.data; | ||
// wrapper the data option, so we can invoke setup before data get resolved | ||
$options.data = function wrappedData() { | ||
initSetup(vm, vm.$props); | ||
return typeof data === 'function' | ||
? data.call(vm, vm) | ||
: data || {}; | ||
}; | ||
} | ||
function initSetup(vm, props) { | ||
if (props === void 0) { props = {}; } | ||
var setup = vm.$options.setup; | ||
var ctx = createSetupContext(vm); | ||
// mark props as reactive | ||
markReactive(props); | ||
// resolve scopedSlots and slots to functions | ||
resolveScopedSlots(vm, ctx.slots); | ||
var binding; | ||
activateCurrentInstance(vm, function () { | ||
binding = setup(props, ctx); | ||
}); | ||
if (!binding) | ||
return; | ||
if (isFunction(binding)) { | ||
// keep typescript happy with the binding type. | ||
var bindingFunc_1 = binding; | ||
// keep currentInstance accessible for createElement | ||
vm.$options.render = function () { | ||
resolveScopedSlots(vm, ctx.slots); | ||
return activateCurrentInstance(vm, function () { return bindingFunc_1(); }); | ||
}; | ||
return; | ||
} | ||
if (isPlainObject(binding)) { | ||
var bindingObj_1 = binding; | ||
vmStateManager.set(vm, 'rawBindings', binding); | ||
Object.keys(binding).forEach(function (name) { | ||
var bindingValue = bindingObj_1[name]; | ||
// only make primitive value reactive | ||
if (!isRef(bindingValue)) { | ||
if (isReactive(bindingValue)) { | ||
bindingValue = ref(bindingValue); | ||
} | ||
else { | ||
// bind function to the vm, this will make `this` = vm | ||
if (isFunction(bindingValue)) { | ||
bindingValue = bindingValue.bind(vm); | ||
} | ||
// unwrap all ref properties | ||
var unwrapped = unwrapRefProxy(bindingValue); | ||
// mark the object as reactive | ||
markReactive(unwrapped); | ||
// a non-reactive should not don't get reactivity | ||
bindingValue = ref(markRaw(unwrapped)); | ||
} | ||
} | ||
asVmProperty(vm, name, bindingValue); | ||
}); | ||
return; | ||
} | ||
{ | ||
assert(false, "\"setup\" must return a \"Object\" or a \"Function\", got \"" + Object.prototype.toString | ||
.call(binding) | ||
.slice(8, -1) + "\""); | ||
} | ||
} | ||
function createSetupContext(vm) { | ||
var ctx = { | ||
slots: {}, | ||
}; | ||
var props = [ | ||
'root', | ||
'parent', | ||
'refs', | ||
'attrs', | ||
'listeners', | ||
'isServer', | ||
'ssrContext', | ||
]; | ||
var methodReturnVoid = ['emit']; | ||
props.forEach(function (key) { | ||
var _a; | ||
var targetKey; | ||
var srcKey; | ||
if (Array.isArray(key)) { | ||
_a = __read(key, 2), targetKey = _a[0], srcKey = _a[1]; | ||
} | ||
else { | ||
targetKey = srcKey = key; | ||
} | ||
srcKey = "$" + srcKey; | ||
proxy(ctx, targetKey, { | ||
get: function () { return vm[srcKey]; }, | ||
set: function () { | ||
warn("Cannot assign to '" + targetKey + "' because it is a read-only property", vm); | ||
}, | ||
}); | ||
}); | ||
methodReturnVoid.forEach(function (key) { | ||
var srcKey = "$" + key; | ||
proxy(ctx, key, { | ||
get: function () { | ||
return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var fn = vm[srcKey]; | ||
fn.apply(vm, args); | ||
}; | ||
}, | ||
}); | ||
}); | ||
return ctx; | ||
} | ||
} | ||
/** | ||
* Helper that recursively merges two data objects together. | ||
*/ | ||
function mergeData(from, to) { | ||
if (!from) | ||
return to; | ||
if (!to) | ||
return from; | ||
var key; | ||
var toVal; | ||
var fromVal; | ||
var keys = hasSymbol ? Reflect.ownKeys(from) : Object.keys(from); | ||
for (var i = 0; i < keys.length; i++) { | ||
key = keys[i]; | ||
// in case the object is already observed... | ||
if (key === '__ob__') | ||
continue; | ||
toVal = to[key]; | ||
fromVal = from[key]; | ||
if (!hasOwn(to, key)) { | ||
to[key] = fromVal; | ||
} | ||
else if (toVal !== fromVal && | ||
isPlainObject(toVal) && | ||
!isRef(toVal) && | ||
isPlainObject(fromVal) && | ||
!isRef(fromVal)) { | ||
mergeData(fromVal, toVal); | ||
} | ||
} | ||
return to; | ||
} | ||
function install(Vue) { | ||
if (isPluginInstalled() || isVueRegistered(Vue)) { | ||
{ | ||
assert(false, 'already installed. Vue.use(VueCompositionAPI) should be called only once.'); | ||
} | ||
return; | ||
} | ||
{ | ||
if (!Vue.version.startsWith('2.')) { | ||
assert(false, "only works with Vue 2, v" + Vue.version + " found."); | ||
} | ||
} | ||
Vue.config.optionMergeStrategies.setup = function (parent, child) { | ||
return function mergedSetupFn(props, context) { | ||
return mergeData(typeof parent === 'function' ? parent(props, context) || {} : undefined, typeof child === 'function' ? child(props, context) || {} : undefined); | ||
}; | ||
}; | ||
setVueConstructor(Vue); | ||
mixin(Vue); | ||
} | ||
var Plugin = { | ||
install: function (Vue) { return install(Vue); }, | ||
}; | ||
// implementation, close to no-op | ||
function defineComponent(options) { | ||
return options; | ||
} | ||
// auto install when using CDN | ||
if (typeof window !== 'undefined' && window.Vue) { | ||
window.Vue.use(VueCompositionAPI); | ||
window.Vue.use(Plugin); | ||
} | ||
@@ -1416,3 +1460,4 @@ | ||
exports.createApp = createApp; | ||
exports.default = VueCompositionAPI; | ||
exports.customRef = customRef; | ||
exports.default = Plugin; | ||
exports.defineComponent = defineComponent; | ||
@@ -1425,2 +1470,3 @@ exports.getCurrentInstance = getCurrentInstance; | ||
exports.markRaw = markRaw; | ||
exports.markReactive = markReactive; | ||
exports.nextTick = nextTick; | ||
@@ -1448,2 +1494,3 @@ exports.onActivated = onActivated; | ||
exports.unref = unref; | ||
exports.useCSSModule = useCSSModule; | ||
exports.watch = watch; | ||
@@ -1450,0 +1497,0 @@ exports.watchEffect = watchEffect; |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],n):n((e=e||self).VueCompositionAPI={},e.Vue)}(this,(function(e,n){"use strict";n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;function t(e){return"function"==typeof e&&/native code/.test(e.toString())}var r="undefined"!=typeof Symbol&&t(Symbol)&&"undefined"!=typeof Reflect&&t(Reflect.ownKeys),o=function(e){return e},i={enumerable:!0,configurable:!0,get:o,set:o};function u(e,n,t){var r=t.get,u=t.set;i.get=r||o,i.set=u||o,Object.defineProperty(e,n,i)}function f(e,n,t,r){Object.defineProperty(e,n,{value:t,enumerable:!!r,writable:!0,configurable:!0})}function a(e,n){return Object.hasOwnProperty.call(e,n)}function c(e){return Array.isArray(e)}function s(e){return"[object Object]"===function(e){return Object.prototype.toString.call(e)}(e)}function l(e){return"function"==typeof e}function v(e,t){n.util.warn(e,t)} | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],n):n((e=e||self).VueCompositionAPI={},e.Vue)}(this,(function(e,n){"use strict";n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;function t(e){return"function"==typeof e&&/native code/.test(e.toString())}var r="undefined"!=typeof Symbol&&t(Symbol)&&"undefined"!=typeof Reflect&&t(Reflect.ownKeys),o=function(e){return e},i={enumerable:!0,configurable:!0,get:o,set:o};function u(e,n,t){var r=t.get,u=t.set;i.get=r||o,i.set=u||o,Object.defineProperty(e,n,i)}function f(e,n,t,r){Object.defineProperty(e,n,{value:t,enumerable:!!r,writable:!0,configurable:!0})}function a(e,n){return Object.hasOwnProperty.call(e,n)}function c(e){return Array.isArray(e)}function s(e){return"[object Object]"===function(e){return Object.prototype.toString.call(e)}(e)}function l(e){return"function"==typeof e}function v(e,t){n.util.warn(e,t)}var p=null,d=null;function y(){return p}function b(){return d}function h(e){d=e}function g(e){return b()}function _(e,n){void 0===n&&(n={});var t=e.config.silent;e.config.silent=!0;var r=new e(n);return e.config.silent=t,r}function m(e){var n=y();return n&&e instanceof n}function w(e,n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.$scopedSlots[n]?e.$scopedSlots[n].apply(e,t):v("slots."+n+'() got called outside of the "render()" scope',e)}} | ||
/*! ***************************************************************************** | ||
@@ -16,2 +16,2 @@ Copyright (c) Microsoft Corporation. | ||
***************************************************************************** */ | ||
var d=function(){return(d=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function p(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,i=t.call(e),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function b(){for(var e=[],n=0;n<arguments.length;n++)e=e.concat(y(arguments[n]));return e}var h=null,g=null;function _(){return h}function m(){return g}function w(e){g=e}function O(e){return m()}function j(e,n){void 0===n&&(n={});var t=e.config.silent;e.config.silent=!0;var r=new e(n);return e.config.silent=t,r}function $(e){return h&&e instanceof h}function k(e,n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.$scopedSlots[n]?e.$scopedSlots[n].apply(e,t):v("slots."+n+'() got called outside of the "render()" scope',e)}}function x(e){return r?Symbol.for(e):e}var S=x("vfa.key.preFlushQueue"),E=x("vfa.key.postFlushQueue"),P=x("vfa.key.accessControlIdentifier"),A=x("vfa.key.reactiveIdentifier"),R=x("vfa.key.rawIdentifierKey"),C="vfa.key.refKey",M=function(e){u(this,"value",{get:e.get,set:e.set})};function I(e){return Object.seal(new M(e))}function U(e){var n;if(V(e))return e;var t=G(((n={})[C]=e,n));return I({get:function(){return t[C]},set:function(e){return t[C]=e}})}function V(e){return e instanceof M}function B(e,n){var t=e[n];return V(t)?t:I({get:function(){return e[n]},set:function(t){return e[n]=t}})}var D={},z={},F={};function K(e){return a(e,R)&&e[R]===F}function T(e){return Object.isExtensible(e)&&a(e,A)&&e[A]===z}function Q(e){if(!(!s(e)||K(e)||Array.isArray(e)||V(e)||$(e)||a(e,P)&&e[P]===D)){Object.isExtensible(e)&&f(e,P,D);for(var n=Object.keys(e),t=0;t<n.length;t++)q(e,n[t])}}function q(e,n,t){if("__ob__"!==n){var r,o,i=Object.getOwnPropertyDescriptor(e,n);if(i){if(!1===i.configurable)return;r=i.get,o=i.set,r&&!o||2!==arguments.length||(t=e[n])}Q(t),Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:function(){var o=r?r.call(e):t;return n!==C&&V(o)?o.value:o},set:function(i){if(!r||o){var u=r?r.call(e):t;n!==C&&V(u)&&!V(i)?u.value=i:o?o.call(e,i):t=i,Q(i)}}})}}function J(e){var n,t=_();t.observable?n=t.observable(e):n=j(t,{data:{$$state:e}})._data.$$state;return n}function N(e){var n,t;if(!s(e)||T(e)||K(e)||!Object.isExtensible(e))return e;var r=J({});W(r,!0),Q(r);var o=r.__ob__,i=function(n){var t,i,f=e[n],a=Object.getOwnPropertyDescriptor(e,n);if(a){if(!1===a.configurable)return"continue";t=a.get,i=a.set,t&&!i||2!==u.length||(f=e[n])}Object.defineProperty(r,n,{enumerable:!0,configurable:!0,get:function(){var n=t?t.call(e):f;return o.dep.depend(),n},set:function(n){t&&!i||(i?i.call(e,n):f=n,o.dep.notify())}})},u=arguments;try{for(var f=p(Object.keys(e)),a=f.next();!a.done;a=f.next()){var c=a.value;i(c)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(t=f.return)&&t.call(f)}finally{if(n)throw n.error}}return r}function W(e,n){if(void 0===n&&(n=!1),!(!s(e)||K(e)||Array.isArray(e)||V(e)||$(e)||a(e,A)&&e[A]===z||(Object.isExtensible(e)&&f(e,A,z),n)))for(var t=Object.keys(e),r=0;r<t.length;r++)W(e[t[r]])}function G(e){if(!s(e)||T(e)||K(e)||!Object.isExtensible(e))return e;var n=J(e);return W(e),Q(n),n}function H(e){return s(e)&&Object.isExtensible(e)?(f(e,"__ob__",J({}).__ob__),f(e,R,F),e):e}function L(e,n){h&&h===e||(e.config.optionMergeStrategies.setup=function(e,n){return function(t,o){return function e(n,t){if(!n)return t;if(!t)return n;for(var o,i,u,f=r?Reflect.ownKeys(n):Object.keys(n),c=0;c<f.length;c++)"__ob__"!==(o=f[c])&&(i=t[o],u=n[o],a(t,o)?i!==u&&s(i)&&!V(i)&&s(u)&&!V(u)&&e(u,i):t[o]=u);return t}("function"==typeof e?e(t,o)||{}:void 0,"function"==typeof n?n(t,o)||{}:void 0)}},h=e,n(e))}var X={set:function(e,n,t){(e.__secret_vfa_state__=e.__secret_vfa_state__||{})[n]=t},get:function(e,n){return(e.__secret_vfa_state__||{})[n]}};function Y(e){var n=X.get(e,"rawBindings")||{};if(n&&Object.keys(n).length){for(var t=e.$refs,r=X.get(e,"refs")||[],o=0;o<r.length;o++){var i=n[a=r[o]];!t[a]&&i&&V(i)&&(i.value=null)}var u=Object.keys(t),f=[];for(o=0;o<u.length;o++){var a;i=n[a=u[o]];t[a]&&i&&V(i)&&(i.value=t[a],f.push(a))}X.set(e,"refs",f)}}function Z(e,n){var t=e.$options._parentVnode;if(t){for(var r=X.get(e,"slots")||[],o=function(e,n){var t;if(e){if(e._normalized)return e._normalized;for(var r in t={},e)e[r]&&"$"!==r[0]&&(t[r]=!0)}else t={};for(var r in n)r in t||(t[r]=!0);return t}(t.data.scopedSlots,e.$slots),i=0;i<r.length;i++){o[f=r[i]]||delete n[f]}var u=Object.keys(o);for(i=0;i<u.length;i++){var f;n[f=u[i]]||(n[f]=k(e,f))}X.set(e,"slots",u)}}function ee(e,n,t){var r=m();w(e);try{return n(e)}catch(e){if(!t)throw e;t(e)}finally{w(r)}}function ne(e){e.mixin({beforeCreate:function(){var e=this,n=e.$options,t=n.setup,r=n.render;r&&(n.render=function(){for(var n=this,t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return ee(e,(function(){return r.apply(n,t)}))});if(!t)return;if("function"!=typeof t)return;var o=n.data;n.data=function(){return function(e,n){void 0===n&&(n={});var t,r=e.$options.setup,o=function(e){var n={slots:{}};return["root","parent","refs","attrs","listeners","isServer","ssrContext"].forEach((function(t){var r,o,i;Array.isArray(t)?(r=y(t,2),o=r[0],i=r[1]):o=i=t,i="$"+i,u(n,o,{get:function(){return e[i]},set:function(){v("Cannot assign to '"+o+"' because it is a read-only property",e)}})})),["emit"].forEach((function(t){var r="$"+t;u(n,t,{get:function(){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var o=e[r];o.apply(e,n)}}})})),n}(e);if(W(n),Z(e,o.slots),ee(e,(function(){t=r(n,o)})),!t)return;if(l(t)){var i=t;return void(e.$options.render=function(){return Z(e,o.slots),ee(e,(function(){return i()}))})}if(s(t)){var f=t;X.set(e,"rawBindings",t),Object.keys(t).forEach((function(n){var t=f[n];if(!V(t))if(T(t))t=U(t);else{l(t)&&(t=t.bind(e));var r=function e(n,t){var r,o;if(void 0===t&&(t=new WeakMap),t.has(n))return t.get(n);if(l(n)||c(n)||T(n)||!s(n)||!Object.isExtensible(n)||V(n)||K(n))return n;var i={};t.set(n,i),Object.getOwnPropertySymbols(n).forEach((function(e){return i[e]=n[e]})),n.__ob__&&Object.defineProperty(i,"__ob__",n.__ob__);var f=function(r){var o=n[r];if(!o||K(o))i[r]=o;else if(V(o)){u(i,r,{get:function(){return o.value},set:function(e){return o.value=e}})}else i[r]=e(o,t)};try{for(var a=p(Object.keys(n)),v=a.next();!v.done;v=a.next()){f(v.value)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}(t);W(r),t=U(H(r))}!function(e,n,t){var r=e.$options.props;n in e||r&&a(r,n)||u(e,n,{get:function(){return t.value},set:function(e){t.value=e}})}(e,n,t)}))}}(e,e.$props),"function"==typeof o?o.call(e,e):o||{}}},mounted:function(){Y(this)},updated:function(){Y(this)}})}var te;function re(e){return function(n){var t,r=O(((t=e)[0].toUpperCase(),t.slice(1)));r&&function(e,n,t,r){var o=n.$options,i=e.config.optionMergeStrategies[t];o[t]=i(o[t],function(e,n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=m();w(e);try{return n.apply(void 0,b(t))}finally{w(o)}}}(n,r))}(_(),r,e,n)}}var oe,ie=re("beforeMount"),ue=re("mounted"),fe=re("beforeUpdate"),ae=re("updated"),ce=re("beforeDestroy"),se=re("destroyed"),le=re("errorCaptured"),ve=re("activated"),de=re("deactivated"),pe=re("serverPrefetch");function ye(){ge(this,S)}function be(){ge(this,E)}function he(){var e=m();return e?function(e){return void 0!==e[S]}(e)||function(e){e[S]=[],e[E]=[],e.$on("hook:beforeUpdate",ye),e.$on("hook:updated",be)}(e):(oe||(oe=j(_())),e=oe),e}function ge(e,n){for(var t=e[n],r=0;r<t.length;r++)t[r]();t.length=0}function _e(e,n,t){var r=function(){e.$nextTick((function(){e[S].length&&ge(e,S),e[E].length&&ge(e,E)}))};switch(t){case"pre":r(),e[S].push(n);break;case"post":r(),e[E].push(n);break;default:!function(e,n){if(!e)throw new Error("[vue-composition-api] "+n)}(!1,'flush must be one of ["post", "pre", "sync"], but got '+t)}}function me(e,n){var t=e.teardown;e.teardown=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];t.apply(e,r),n()}}function we(e,n,t,r){var i,u=r.flush,f="sync"===u,a=function(e){i=function(){try{e()}catch(e){!function(e,n,t){if("undefined"==typeof window||"undefined"==typeof console)throw e;console.error(e)}(e)}}},c=function(){i&&(i(),i=null)},s=function(n){return f||e===oe?n:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return _e(e,(function(){n.apply(void 0,b(t))}),u)}};if(null===t){var d=!1,p=function(e,n,t,r){var o=e._watchers.length;return e.$watch(n,t,{immediate:r.immediateInvokeCallback,deep:r.deep,lazy:r.noRun,sync:r.sync,before:r.before}),e._watchers[o]}(e,(function(){if(!d)try{d=!0,n(a)}finally{d=!1}}),o,{deep:r.deep||!1,sync:f,before:c});me(p,c),p.lazy=!1;var y=p.get.bind(p);return p.get=s(y),function(){p.teardown()}}var h,g=r.deep;Array.isArray(n)?h=function(){return n.map((function(e){return V(e)?e.value:e()}))}:V(n)?h=function(){return n.value}:T(n)?(h=function(){return n},g=!0):l(n)?h=n:(h=o,v("Invalid watch source: "+JSON.stringify(n)+".\n A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.",e));var _=function(e,n){c(),t(e,n,a)},m=s(_);if(r.immediate){var w=m,O=function(e,n){O=w,_(e,n)};m=function(e,n){O(e,n)}}var j=e.$watch(h,m,{immediate:r.immediate,deep:g,sync:f});return me(e._watchers[e._watchers.length-1],c),function(){j()}}var Oe={};var je={install:function(e){return L(e,ne)}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(je),e.computed=function(e){var n,t,r=m();"function"==typeof e?n=e:(n=e.get,t=e.set);var o=j(_(),{computed:{$$state:{get:n,set:t}}});return r&&r.$on("hook:destroyed",(function(){return o.$destroy()})),I({get:function(){return o.$$state},set:function(e){o.$$state=e}})},e.createApp=function(e,n){void 0===n&&(n=void 0);var t=_(),r=void 0;return{config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),directive:t.directive.bind(t),mount:function(o,i){return r||((r=new t(d({propsData:n},e))).$mount(o,i),r)},unmount:function(){r&&(r.$destroy(),r=void 0)}}},e.default=je,e.defineComponent=function(e){return e},e.getCurrentInstance=m,e.h=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return g?g.$createElement.apply(g,e):(v("`createElement()` has been called outside of render function."),te||(te=j(_()).$createElement),te.apply(te,e))},e.inject=function(e,n){if(!e)return n;var t=m();if(t){var r=function(e,n){for(var t=n;t;){if(t._provided&&a(t._provided,e))return t._provided[e];t=t.$parent}return Oe}(e,t);return r!==Oe?r:n}v("inject() can only be used inside setup() or functional components.")},e.isReactive=T,e.isRef=V,e.markRaw=H,e.nextTick=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return null==h?void 0:h.nextTick.apply(this,e)},e.onActivated=ve,e.onBeforeMount=ie,e.onBeforeUnmount=ce,e.onBeforeUpdate=fe,e.onDeactivated=de,e.onErrorCaptured=le,e.onMounted=ue,e.onServerPrefetch=pe,e.onUnmounted=se,e.onUpdated=ae,e.provide=function(e,n){var t=O();if(t){if(!t._provided){var r={};Object.defineProperty(t,"_provided",{get:function(){return r},set:function(e){return Object.assign(r,e)}})}t._provided[e]=n}},e.reactive=G,e.ref=U,e.set=function(e,n,t){var r=_().util,o=(r.warn,r.defineReactive);if(c(e)&&function(e){var n=parseFloat(String(e));return n>=0&&Math.floor(n)===n&&isFinite(e)}(n))return e.length=Math.max(e.length,n),e.splice(n,1,t),t;if(n in e&&!(n in Object.prototype))return e[n]=t,t;var i=e.__ob__;return e._isVue||i&&i.vmCount?t:i?(o(i.value,n,t),q(e,n,t),W(i.value[n]),i.dep.notify(),t):(e[n]=t,t)},e.shallowReactive=N,e.shallowRef=function(e){var n;if(V(e))return e;var t=N(((n={})[C]=e,n));return I({get:function(){return t[C]},set:function(e){return t[C]=e}})},e.toRaw=function(e){return K(J)||!Object.isExtensible(e)?e:e.__ob__.value||e},e.toRef=B,e.toRefs=function(e){if(!s(e))return e;var n={};for(var t in e)n[t]=B(e,t);return n},e.triggerRef=function(e){V(e)&&(e.value=e.value)},e.unref=function(e){return V(e)?e.value:e},e.watch=function(e,n,t){var r=null;"function"==typeof n?r=n:(t=n,r=null);var o=function(e){return d({immediate:!1,deep:!1,flush:"post"},e)}(t);return we(he(),e,r,o)},e.watchEffect=function(e,n){var t=function(e){return d({immediate:!0,deep:!1,flush:"post"},e)}(n);return we(he(),e,null,t)},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
var O=function(){return(O=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function j(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function $(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,i=t.call(e),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function x(){for(var e=[],n=0;n<arguments.length;n++)e=e.concat($(arguments[n]));return e}function k(e){return r?Symbol.for(e):e}var S=k("composition-api.preFlushQueue"),E=k("composition-api.postFlushQueue"),P=k("composition-api.accessControlIdentifier"),R=k("composition-api.reactiveIdentifier"),A=k("composition-api.rawIdentifierKey"),C="composition-api.refKey",M=function(e){u(this,"value",{get:e.get,set:e.set})};function I(e){return Object.seal(new M(e))}function U(e){var n;if(V(e))return e;var t=G(((n={})[C]=e,n));return I({get:function(){return t[C]},set:function(e){return t[C]=e}})}function V(e){return e instanceof M}function B(e,n){var t=e[n];return V(t)?t:I({get:function(){return e[n]},set:function(t){return e[n]=t}})}var D={},z={},F={};function K(e){return a(e,A)&&e[A]===F}function T(e){return Object.isExtensible(e)&&a(e,R)&&e[R]===z}function Q(e){if(!(!s(e)||K(e)||Array.isArray(e)||V(e)||m(e)||a(e,P)&&e[P]===D)){Object.isExtensible(e)&&f(e,P,D);for(var n=Object.keys(e),t=0;t<n.length;t++)q(e,n[t])}}function q(e,n,t){if("__ob__"!==n){var r,o,i=Object.getOwnPropertyDescriptor(e,n);if(i){if(!1===i.configurable)return;r=i.get,o=i.set,r&&!o||2!==arguments.length||(t=e[n])}Q(t),Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:function(){var o=r?r.call(e):t;return n!==C&&V(o)?o.value:o},set:function(i){if(!r||o){var u=r?r.call(e):t;n!==C&&V(u)&&!V(i)?u.value=i:o?o.call(e,i):t=i,Q(i)}}})}}function J(e){var n,t=y();t.observable?n=t.observable(e):n=_(t,{data:{$$state:e}})._data.$$state;return n}function N(e){var n,t;if(!s(e)||T(e)||K(e)||!Object.isExtensible(e))return e;var r=J({});W(r,!0),Q(r);var o=r.__ob__,i=function(n){var t,i,f=e[n],a=Object.getOwnPropertyDescriptor(e,n);if(a){if(!1===a.configurable)return"continue";t=a.get,i=a.set,t&&!i||2!==u.length||(f=e[n])}Object.defineProperty(r,n,{enumerable:!0,configurable:!0,get:function(){var n=t?t.call(e):f;return o.dep.depend(),n},set:function(n){t&&!i||(i?i.call(e,n):f=n,o.dep.notify())}})},u=arguments;try{for(var f=j(Object.keys(e)),a=f.next();!a.done;a=f.next()){var c=a.value;i(c)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(t=f.return)&&t.call(f)}finally{if(n)throw n.error}}return r}function W(e,n){if(void 0===n&&(n=!1),!(!s(e)||K(e)||Array.isArray(e)||V(e)||m(e)||a(e,R)&&e[R]===z||(Object.isExtensible(e)&&f(e,R,z),n)))for(var t=Object.keys(e),r=0;r<t.length;r++)W(e[t[r]])}function G(e){if(!s(e)||T(e)||K(e)||!Object.isExtensible(e))return e;var n=J(e);return W(e),Q(n),n}function H(e){return s(e)&&Object.isExtensible(e)?(f(e,"__ob__",J({}).__ob__),f(e,A,F),e):e}function L(e){return function(n){var t,r=g(((t=e)[0].toUpperCase(),t.slice(1)));r&&function(e,n,t,r){var o=n.$options,i=e.config.optionMergeStrategies[t];o[t]=i(o[t],function(e,n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=b();h(e);try{return n.apply(void 0,x(t))}finally{h(o)}}}(n,r))}(y(),r,e,n)}}var X,Y=L("beforeMount"),Z=L("mounted"),ee=L("beforeUpdate"),ne=L("updated"),te=L("beforeDestroy"),re=L("destroyed"),oe=L("errorCaptured"),ie=L("activated"),ue=L("deactivated"),fe=L("serverPrefetch");function ae(){le(this,S)}function ce(){le(this,E)}function se(){var e=b();return e?function(e){return void 0!==e[S]}(e)||function(e){e[S]=[],e[E]=[],e.$on("hook:beforeUpdate",ae),e.$on("hook:updated",ce)}(e):(X||(X=_(y())),e=X),e}function le(e,n){for(var t=e[n],r=0;r<t.length;r++)t[r]();t.length=0}function ve(e,n,t){var r=function(){e.$nextTick((function(){e[S].length&&le(e,S),e[E].length&&le(e,E)}))};switch(t){case"pre":r(),e[S].push(n);break;case"post":r(),e[E].push(n);break;default:!function(e,n){if(!e)throw new Error("[vue-composition-api] "+n)}(!1,'flush must be one of ["post", "pre", "sync"], but got '+t)}}function pe(e,n){var t=e.teardown;e.teardown=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];t.apply(e,r),n()}}function de(e,n,t,r){var i,u=r.flush,f="sync"===u,a=function(e){i=function(){try{e()}catch(e){!function(e,n,t){if("undefined"==typeof window||"undefined"==typeof console)throw e;console.error(e)}(e)}}},c=function(){i&&(i(),i=null)},s=function(n){return f||e===X?n:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return ve(e,(function(){n.apply(void 0,x(t))}),u)}};if(null===t){var p=!1,d=function(e,n,t,r){var o=e._watchers.length;return e.$watch(n,t,{immediate:r.immediateInvokeCallback,deep:r.deep,lazy:r.noRun,sync:r.sync,before:r.before}),e._watchers[o]}(e,(function(){if(!p)try{p=!0,n(a)}finally{p=!1}}),o,{deep:r.deep||!1,sync:f,before:c});pe(d,c),d.lazy=!1;var y=d.get.bind(d);return d.get=s(y),function(){d.teardown()}}var b,h=r.deep;Array.isArray(n)?b=function(){return n.map((function(e){return V(e)?e.value:e()}))}:V(n)?b=function(){return n.value}:T(n)?(b=function(){return n},h=!0):l(n)?b=n:(b=o,v("Invalid watch source: "+JSON.stringify(n)+".\n A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.",e));var g=function(e,n){c(),t(e,n,a)},_=s(g);if(r.immediate){var m=_,w=function(e,n){w=m,g(e,n)};_=function(e,n){w(e,n)}}var O=e.$watch(b,_,{immediate:r.immediate,deep:h,sync:f});return pe(e._watchers[e._watchers.length-1],c),function(){O()}}var ye={};var be={};var he;var ge={set:function(e,n,t){(e.__composition_api_state__=e.__composition_api_state__||{})[n]=t},get:function(e,n){return(e.__composition_api_state__||{})[n]}};function _e(e){var n=ge.get(e,"rawBindings")||{};if(n&&Object.keys(n).length){for(var t=e.$refs,r=ge.get(e,"refs")||[],o=0;o<r.length;o++){var i=n[a=r[o]];!t[a]&&i&&V(i)&&(i.value=null)}var u=Object.keys(t),f=[];for(o=0;o<u.length;o++){var a;i=n[a=u[o]];t[a]&&i&&V(i)&&(i.value=t[a],f.push(a))}ge.set(e,"refs",f)}}function me(e,n){var t=e.$options._parentVnode;if(t){for(var r=ge.get(e,"slots")||[],o=function(e,n){var t;if(e){if(e._normalized)return e._normalized;for(var r in t={},e)e[r]&&"$"!==r[0]&&(t[r]=!0)}else t={};for(var r in n)r in t||(t[r]=!0);return t}(t.data.scopedSlots,e.$slots),i=0;i<r.length;i++){o[f=r[i]]||delete n[f]}var u=Object.keys(o);for(i=0;i<u.length;i++){var f;n[f=u[i]]||(n[f]=w(e,f))}ge.set(e,"slots",u)}}function we(e,n,t){var r=b();h(e);try{return n(e)}catch(e){if(!t)throw e;t(e)}finally{h(r)}}function Oe(e){e.mixin({beforeCreate:function(){var e=this,n=e.$options,t=n.setup,r=n.render;r&&(n.render=function(){for(var n=this,t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return we(e,(function(){return r.apply(n,t)}))});if(!t)return;if("function"!=typeof t)return;var o=n.data;n.data=function(){return function(e,n){void 0===n&&(n={});var t,r=e.$options.setup,o=function(e){var n={slots:{}};return["root","parent","refs","attrs","listeners","isServer","ssrContext"].forEach((function(t){var r,o,i;Array.isArray(t)?(r=$(t,2),o=r[0],i=r[1]):o=i=t,i="$"+i,u(n,o,{get:function(){return e[i]},set:function(){v("Cannot assign to '"+o+"' because it is a read-only property",e)}})})),["emit"].forEach((function(t){var r="$"+t;u(n,t,{get:function(){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var o=e[r];o.apply(e,n)}}})})),n}(e);if(W(n),me(e,o.slots),we(e,(function(){t=r(n,o)})),!t)return;if(l(t)){var i=t;return void(e.$options.render=function(){return me(e,o.slots),we(e,(function(){return i()}))})}if(s(t)){var f=t;ge.set(e,"rawBindings",t),Object.keys(t).forEach((function(n){var t=f[n];if(!V(t))if(T(t))t=U(t);else{l(t)&&(t=t.bind(e));var r=function e(n,t){var r,o;if(void 0===t&&(t=new WeakMap),t.has(n))return t.get(n);if(l(n)||c(n)||T(n)||!s(n)||!Object.isExtensible(n)||V(n)||K(n))return n;var i={};t.set(n,i),Object.getOwnPropertySymbols(n).forEach((function(e){return i[e]=n[e]})),n.__ob__&&Object.defineProperty(i,"__ob__",{enumerable:!1,value:n.__ob__});var f=function(r){var o=n[r];if(!o||K(o))i[r]=o;else if(V(o)){u(i,r,{get:function(){return o.value},set:function(e){return o.value=e}})}else i[r]=e(o,t)};try{for(var a=j(Object.keys(n)),v=a.next();!v.done;v=a.next()){f(v.value)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}(t);W(r),t=U(H(r))}!function(e,n,t){var r=e.$options.props;n in e||r&&a(r,n)||u(e,n,{get:function(){return t.value},set:function(e){t.value=e}})}(e,n,t)}))}}(e,e.$props),"function"==typeof o?o.call(e,e):o||{}}},mounted:function(){_e(this)},updated:function(){_e(this)}})}function je(e){p||function(e){return a(e,"__composition_api_installed__")}(e)||(e.config.optionMergeStrategies.setup=function(e,n){return function(t,o){return function e(n,t){if(!n)return t;if(!t)return n;for(var o,i,u,f=r?Reflect.ownKeys(n):Object.keys(n),c=0;c<f.length;c++)"__ob__"!==(o=f[c])&&(i=t[o],u=n[o],a(t,o)?i!==u&&s(i)&&!V(i)&&s(u)&&!V(u)&&e(u,i):t[o]=u);return t}("function"==typeof e?e(t,o)||{}:void 0,"function"==typeof n?n(t,o)||{}:void 0)}},function(e){p=e,Object.defineProperty(e,"__composition_api_installed__",{configurable:!0,writable:!0,value:!0})}(e),Oe(e))}var $e={install:function(e){return je(e)}};"undefined"!=typeof window&&window.Vue&&window.Vue.use($e),e.computed=function(e){var n,t,r=b();"function"==typeof e?n=e:(n=e.get,t=e.set);var o=_(y(),{computed:{$$state:{get:n,set:t}}});return r&&r.$on("hook:destroyed",(function(){return o.$destroy()})),I({get:function(){return o.$$state},set:function(e){o.$$state=e}})},e.createApp=function(e,n){void 0===n&&(n=void 0);var t=y(),r=void 0;return{config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),directive:t.directive.bind(t),mount:function(o,i){return r||((r=new t(O({propsData:n},e))).$mount(o,i),r)},unmount:function(){r&&(r.$destroy(),r=void 0)}}},e.customRef=function(e){var n=U(0);return I(e((function(){n.value}),(function(){++n.value})))},e.default=$e,e.defineComponent=function(e){return e},e.getCurrentInstance=b,e.h=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=b();return t?t.$createElement.apply(t,e):(v("`createElement()` has been called outside of render function."),he||(he=_(y()).$createElement),he.apply(he,e))},e.inject=function(e,n){if(!e)return n;var t=b();if(t){var r=function(e,n){for(var t=n;t;){if(t._provided&&a(t._provided,e))return t._provided[e];t=t.$parent}return ye}(e,t);return r!==ye?r:n}v("inject() can only be used inside setup() or functional components.")},e.isReactive=T,e.isRef=V,e.markRaw=H,e.markReactive=W,e.nextTick=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return null===(e=y())||void 0===e?void 0:e.nextTick.apply(this,n)},e.onActivated=ie,e.onBeforeMount=Y,e.onBeforeUnmount=te,e.onBeforeUpdate=ee,e.onDeactivated=ue,e.onErrorCaptured=oe,e.onMounted=Z,e.onServerPrefetch=fe,e.onUnmounted=re,e.onUpdated=ne,e.provide=function(e,n){var t=g();if(t){if(!t._provided){var r={};Object.defineProperty(t,"_provided",{get:function(){return r},set:function(e){return Object.assign(r,e)}})}t._provided[e]=n}},e.reactive=G,e.ref=U,e.set=function(e,n,t){var r=y().util,o=(r.warn,r.defineReactive);if(c(e)&&function(e){var n=parseFloat(String(e));return n>=0&&Math.floor(n)===n&&isFinite(e)}(n))return e.length=Math.max(e.length,n),e.splice(n,1,t),t;if(n in e&&!(n in Object.prototype))return e[n]=t,t;var i=e.__ob__;return e._isVue||i&&i.vmCount?t:i?(o(i.value,n,t),q(e,n,t),W(i.value[n]),i.dep.notify(),t):(e[n]=t,t)},e.shallowReactive=N,e.shallowRef=function(e){var n;if(V(e))return e;var t=N(((n={})[C]=e,n));return I({get:function(){return t[C]},set:function(e){return t[C]=e}})},e.toRaw=function(e){return K(e)||!Object.isExtensible(e)?e:e.__ob__.value||e},e.toRef=B,e.toRefs=function(e){if(!s(e))return e;var n={};for(var t in e)n[t]=B(e,t);return n},e.triggerRef=function(e){V(e)&&(e.value=e.value)},e.unref=function(e){return V(e)?e.value:e},e.useCSSModule=function(e){void 0===e&&(e="$style");var n=b();if(!n)return be;var t=n[e];return t||be},e.watch=function(e,n,t){var r=null;"function"==typeof n?r=n:(t=n,r=null);var o=function(e){return O({immediate:!1,deep:!1,flush:"post"},e)}(t);return de(se(),e,r,o)},e.watchEffect=function(e,n){var t=function(e){return O({immediate:!0,deep:!1,flush:"post"},e)}(n);return de(se(),e,null,t)},Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "@vue/composition-api", | ||
"version": "1.0.0-beta.1", | ||
"version": "1.0.0-beta.2", | ||
"description": "Provide logic composition capabilities for Vue.", | ||
@@ -16,3 +16,2 @@ "keywords": [ | ||
"module": "dist/vue-composition-api.esm.js", | ||
"browser": "dist/vue-composition-api.prod.js", | ||
"unpkg": "dist/vue-composition-ap.prod.js", | ||
@@ -19,0 +18,0 @@ "jsdelivr": "dist/vue-composition-api.prod.js", |
@@ -43,3 +43,3 @@ # @vue/composition-api | ||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@vue/composition-api@1.0.0-beta.1"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@vue/composition-api@1.0.0-beta.2"></script> | ||
``` | ||
@@ -403,3 +403,2 @@ <!--cdn-links-end--> | ||
- `onRenderTriggered` | ||
- `customRef` | ||
- `isProxy` | ||
@@ -406,0 +405,0 @@ - `isReadonly` |
@@ -45,3 +45,3 @@ # @vue/composition-api | ||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@vue/composition-api@1.0.0-beta.1"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@vue/composition-api@1.0.0-beta.2"></script> | ||
``` | ||
@@ -48,0 +48,0 @@ <!--cdn-links-end--> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
222443
4752
0
433
24