mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
- Add LoraManagerDemoNode to node mappings for Vue widget demonstration - Update .gitignore to exclude Vue widget development artifacts (node_modules, .vite, dist) - Implement automatic Vue widget build check in development mode with fallback handling - Maintain pytest compatibility with proper import error handling
11673 lines
417 KiB
JavaScript
11673 lines
417 KiB
JavaScript
import { app } from "../../../scripts/app.js";
|
|
/**
|
|
* @vue/shared v3.5.26
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/
|
|
// @__NO_SIDE_EFFECTS__
|
|
function makeMap(str) {
|
|
const map = /* @__PURE__ */ Object.create(null);
|
|
for (const key of str.split(",")) map[key] = 1;
|
|
return (val) => val in map;
|
|
}
|
|
const EMPTY_OBJ = {};
|
|
const EMPTY_ARR = [];
|
|
const NOOP = () => {
|
|
};
|
|
const NO = () => false;
|
|
const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
|
|
(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
|
|
const isModelListener = (key) => key.startsWith("onUpdate:");
|
|
const extend = Object.assign;
|
|
const remove = (arr, el) => {
|
|
const i2 = arr.indexOf(el);
|
|
if (i2 > -1) {
|
|
arr.splice(i2, 1);
|
|
}
|
|
};
|
|
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
const isArray = Array.isArray;
|
|
const isMap = (val) => toTypeString(val) === "[object Map]";
|
|
const isSet = (val) => toTypeString(val) === "[object Set]";
|
|
const isFunction = (val) => typeof val === "function";
|
|
const isString = (val) => typeof val === "string";
|
|
const isSymbol = (val) => typeof val === "symbol";
|
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
const isPromise = (val) => {
|
|
return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
|
|
};
|
|
const objectToString = Object.prototype.toString;
|
|
const toTypeString = (value) => objectToString.call(value);
|
|
const toRawType = (value) => {
|
|
return toTypeString(value).slice(8, -1);
|
|
};
|
|
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
const isReservedProp = /* @__PURE__ */ makeMap(
|
|
// the leading comma is intentional so empty string "" is also included
|
|
",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
|
|
);
|
|
const cacheStringFunction = (fn) => {
|
|
const cache = /* @__PURE__ */ Object.create(null);
|
|
return ((str) => {
|
|
const hit = cache[str];
|
|
return hit || (cache[str] = fn(str));
|
|
});
|
|
};
|
|
const camelizeRE = /-\w/g;
|
|
const camelize = cacheStringFunction(
|
|
(str) => {
|
|
return str.replace(camelizeRE, (c2) => c2.slice(1).toUpperCase());
|
|
}
|
|
);
|
|
const hyphenateRE = /\B([A-Z])/g;
|
|
const hyphenate = cacheStringFunction(
|
|
(str) => str.replace(hyphenateRE, "-$1").toLowerCase()
|
|
);
|
|
const capitalize = cacheStringFunction((str) => {
|
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
});
|
|
const toHandlerKey = cacheStringFunction(
|
|
(str) => {
|
|
const s2 = str ? `on${capitalize(str)}` : ``;
|
|
return s2;
|
|
}
|
|
);
|
|
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
const invokeArrayFns = (fns, ...arg) => {
|
|
for (let i2 = 0; i2 < fns.length; i2++) {
|
|
fns[i2](...arg);
|
|
}
|
|
};
|
|
const def = (obj, key, value, writable = false) => {
|
|
Object.defineProperty(obj, key, {
|
|
configurable: true,
|
|
enumerable: false,
|
|
writable,
|
|
value
|
|
});
|
|
};
|
|
const looseToNumber = (val) => {
|
|
const n = parseFloat(val);
|
|
return isNaN(n) ? val : n;
|
|
};
|
|
let _globalThis;
|
|
const getGlobalThis = () => {
|
|
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
|
|
};
|
|
function normalizeStyle(value) {
|
|
if (isArray(value)) {
|
|
const res = {};
|
|
for (let i2 = 0; i2 < value.length; i2++) {
|
|
const item = value[i2];
|
|
const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
|
|
if (normalized) {
|
|
for (const key in normalized) {
|
|
res[key] = normalized[key];
|
|
}
|
|
}
|
|
}
|
|
return res;
|
|
} else if (isString(value) || isObject(value)) {
|
|
return value;
|
|
}
|
|
}
|
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
const propertyDelimiterRE = /:([^]+)/;
|
|
const styleCommentRE = /\/\*[^]*?\*\//g;
|
|
function parseStringStyle(cssText) {
|
|
const ret = {};
|
|
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
if (item) {
|
|
const tmp = item.split(propertyDelimiterRE);
|
|
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
}
|
|
});
|
|
return ret;
|
|
}
|
|
function normalizeClass(value) {
|
|
let res = "";
|
|
if (isString(value)) {
|
|
res = value;
|
|
} else if (isArray(value)) {
|
|
for (let i2 = 0; i2 < value.length; i2++) {
|
|
const normalized = normalizeClass(value[i2]);
|
|
if (normalized) {
|
|
res += normalized + " ";
|
|
}
|
|
}
|
|
} else if (isObject(value)) {
|
|
for (const name in value) {
|
|
if (value[name]) {
|
|
res += name + " ";
|
|
}
|
|
}
|
|
}
|
|
return res.trim();
|
|
}
|
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
|
|
function includeBooleanAttr(value) {
|
|
return !!value || value === "";
|
|
}
|
|
const isRef$1 = (val) => {
|
|
return !!(val && val["__v_isRef"] === true);
|
|
};
|
|
const toDisplayString = (val) => {
|
|
return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
|
|
};
|
|
const replacer = (_key, val) => {
|
|
if (isRef$1(val)) {
|
|
return replacer(_key, val.value);
|
|
} else if (isMap(val)) {
|
|
return {
|
|
[`Map(${val.size})`]: [...val.entries()].reduce(
|
|
(entries, [key, val2], i2) => {
|
|
entries[stringifySymbol(key, i2) + " =>"] = val2;
|
|
return entries;
|
|
},
|
|
{}
|
|
)
|
|
};
|
|
} else if (isSet(val)) {
|
|
return {
|
|
[`Set(${val.size})`]: [...val.values()].map((v2) => stringifySymbol(v2))
|
|
};
|
|
} else if (isSymbol(val)) {
|
|
return stringifySymbol(val);
|
|
} else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
|
|
return String(val);
|
|
}
|
|
return val;
|
|
};
|
|
const stringifySymbol = (v2, i2 = "") => {
|
|
var _a;
|
|
return (
|
|
// Symbol.description in es2019+ so we need to cast here to pass
|
|
// the lib: es2016 check
|
|
isSymbol(v2) ? `Symbol(${(_a = v2.description) != null ? _a : i2})` : v2
|
|
);
|
|
};
|
|
/**
|
|
* @vue/reactivity v3.5.26
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/
|
|
let activeEffectScope;
|
|
class EffectScope {
|
|
constructor(detached = false) {
|
|
this.detached = detached;
|
|
this._active = true;
|
|
this._on = 0;
|
|
this.effects = [];
|
|
this.cleanups = [];
|
|
this._isPaused = false;
|
|
this.parent = activeEffectScope;
|
|
if (!detached && activeEffectScope) {
|
|
this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
|
|
this
|
|
) - 1;
|
|
}
|
|
}
|
|
get active() {
|
|
return this._active;
|
|
}
|
|
pause() {
|
|
if (this._active) {
|
|
this._isPaused = true;
|
|
let i2, l2;
|
|
if (this.scopes) {
|
|
for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) {
|
|
this.scopes[i2].pause();
|
|
}
|
|
}
|
|
for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) {
|
|
this.effects[i2].pause();
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* Resumes the effect scope, including all child scopes and effects.
|
|
*/
|
|
resume() {
|
|
if (this._active) {
|
|
if (this._isPaused) {
|
|
this._isPaused = false;
|
|
let i2, l2;
|
|
if (this.scopes) {
|
|
for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) {
|
|
this.scopes[i2].resume();
|
|
}
|
|
}
|
|
for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) {
|
|
this.effects[i2].resume();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
run(fn) {
|
|
if (this._active) {
|
|
const currentEffectScope = activeEffectScope;
|
|
try {
|
|
activeEffectScope = this;
|
|
return fn();
|
|
} finally {
|
|
activeEffectScope = currentEffectScope;
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* This should only be called on non-detached scopes
|
|
* @internal
|
|
*/
|
|
on() {
|
|
if (++this._on === 1) {
|
|
this.prevScope = activeEffectScope;
|
|
activeEffectScope = this;
|
|
}
|
|
}
|
|
/**
|
|
* This should only be called on non-detached scopes
|
|
* @internal
|
|
*/
|
|
off() {
|
|
if (this._on > 0 && --this._on === 0) {
|
|
activeEffectScope = this.prevScope;
|
|
this.prevScope = void 0;
|
|
}
|
|
}
|
|
stop(fromParent) {
|
|
if (this._active) {
|
|
this._active = false;
|
|
let i2, l2;
|
|
for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) {
|
|
this.effects[i2].stop();
|
|
}
|
|
this.effects.length = 0;
|
|
for (i2 = 0, l2 = this.cleanups.length; i2 < l2; i2++) {
|
|
this.cleanups[i2]();
|
|
}
|
|
this.cleanups.length = 0;
|
|
if (this.scopes) {
|
|
for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) {
|
|
this.scopes[i2].stop(true);
|
|
}
|
|
this.scopes.length = 0;
|
|
}
|
|
if (!this.detached && this.parent && !fromParent) {
|
|
const last = this.parent.scopes.pop();
|
|
if (last && last !== this) {
|
|
this.parent.scopes[this.index] = last;
|
|
last.index = this.index;
|
|
}
|
|
}
|
|
this.parent = void 0;
|
|
}
|
|
}
|
|
}
|
|
function getCurrentScope() {
|
|
return activeEffectScope;
|
|
}
|
|
let activeSub;
|
|
const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
|
|
class ReactiveEffect {
|
|
constructor(fn) {
|
|
this.fn = fn;
|
|
this.deps = void 0;
|
|
this.depsTail = void 0;
|
|
this.flags = 1 | 4;
|
|
this.next = void 0;
|
|
this.cleanup = void 0;
|
|
this.scheduler = void 0;
|
|
if (activeEffectScope && activeEffectScope.active) {
|
|
activeEffectScope.effects.push(this);
|
|
}
|
|
}
|
|
pause() {
|
|
this.flags |= 64;
|
|
}
|
|
resume() {
|
|
if (this.flags & 64) {
|
|
this.flags &= -65;
|
|
if (pausedQueueEffects.has(this)) {
|
|
pausedQueueEffects.delete(this);
|
|
this.trigger();
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* @internal
|
|
*/
|
|
notify() {
|
|
if (this.flags & 2 && !(this.flags & 32)) {
|
|
return;
|
|
}
|
|
if (!(this.flags & 8)) {
|
|
batch(this);
|
|
}
|
|
}
|
|
run() {
|
|
if (!(this.flags & 1)) {
|
|
return this.fn();
|
|
}
|
|
this.flags |= 2;
|
|
cleanupEffect(this);
|
|
prepareDeps(this);
|
|
const prevEffect = activeSub;
|
|
const prevShouldTrack = shouldTrack;
|
|
activeSub = this;
|
|
shouldTrack = true;
|
|
try {
|
|
return this.fn();
|
|
} finally {
|
|
cleanupDeps(this);
|
|
activeSub = prevEffect;
|
|
shouldTrack = prevShouldTrack;
|
|
this.flags &= -3;
|
|
}
|
|
}
|
|
stop() {
|
|
if (this.flags & 1) {
|
|
for (let link = this.deps; link; link = link.nextDep) {
|
|
removeSub(link);
|
|
}
|
|
this.deps = this.depsTail = void 0;
|
|
cleanupEffect(this);
|
|
this.onStop && this.onStop();
|
|
this.flags &= -2;
|
|
}
|
|
}
|
|
trigger() {
|
|
if (this.flags & 64) {
|
|
pausedQueueEffects.add(this);
|
|
} else if (this.scheduler) {
|
|
this.scheduler();
|
|
} else {
|
|
this.runIfDirty();
|
|
}
|
|
}
|
|
/**
|
|
* @internal
|
|
*/
|
|
runIfDirty() {
|
|
if (isDirty(this)) {
|
|
this.run();
|
|
}
|
|
}
|
|
get dirty() {
|
|
return isDirty(this);
|
|
}
|
|
}
|
|
let batchDepth = 0;
|
|
let batchedSub;
|
|
let batchedComputed;
|
|
function batch(sub, isComputed = false) {
|
|
sub.flags |= 8;
|
|
if (isComputed) {
|
|
sub.next = batchedComputed;
|
|
batchedComputed = sub;
|
|
return;
|
|
}
|
|
sub.next = batchedSub;
|
|
batchedSub = sub;
|
|
}
|
|
function startBatch() {
|
|
batchDepth++;
|
|
}
|
|
function endBatch() {
|
|
if (--batchDepth > 0) {
|
|
return;
|
|
}
|
|
if (batchedComputed) {
|
|
let e = batchedComputed;
|
|
batchedComputed = void 0;
|
|
while (e) {
|
|
const next = e.next;
|
|
e.next = void 0;
|
|
e.flags &= -9;
|
|
e = next;
|
|
}
|
|
}
|
|
let error;
|
|
while (batchedSub) {
|
|
let e = batchedSub;
|
|
batchedSub = void 0;
|
|
while (e) {
|
|
const next = e.next;
|
|
e.next = void 0;
|
|
e.flags &= -9;
|
|
if (e.flags & 1) {
|
|
try {
|
|
;
|
|
e.trigger();
|
|
} catch (err) {
|
|
if (!error) error = err;
|
|
}
|
|
}
|
|
e = next;
|
|
}
|
|
}
|
|
if (error) throw error;
|
|
}
|
|
function prepareDeps(sub) {
|
|
for (let link = sub.deps; link; link = link.nextDep) {
|
|
link.version = -1;
|
|
link.prevActiveLink = link.dep.activeLink;
|
|
link.dep.activeLink = link;
|
|
}
|
|
}
|
|
function cleanupDeps(sub) {
|
|
let head;
|
|
let tail = sub.depsTail;
|
|
let link = tail;
|
|
while (link) {
|
|
const prev = link.prevDep;
|
|
if (link.version === -1) {
|
|
if (link === tail) tail = prev;
|
|
removeSub(link);
|
|
removeDep(link);
|
|
} else {
|
|
head = link;
|
|
}
|
|
link.dep.activeLink = link.prevActiveLink;
|
|
link.prevActiveLink = void 0;
|
|
link = prev;
|
|
}
|
|
sub.deps = head;
|
|
sub.depsTail = tail;
|
|
}
|
|
function isDirty(sub) {
|
|
for (let link = sub.deps; link; link = link.nextDep) {
|
|
if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
|
|
return true;
|
|
}
|
|
}
|
|
if (sub._dirty) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function refreshComputed(computed2) {
|
|
if (computed2.flags & 4 && !(computed2.flags & 16)) {
|
|
return;
|
|
}
|
|
computed2.flags &= -17;
|
|
if (computed2.globalVersion === globalVersion) {
|
|
return;
|
|
}
|
|
computed2.globalVersion = globalVersion;
|
|
if (!computed2.isSSR && computed2.flags & 128 && (!computed2.deps && !computed2._dirty || !isDirty(computed2))) {
|
|
return;
|
|
}
|
|
computed2.flags |= 2;
|
|
const dep = computed2.dep;
|
|
const prevSub = activeSub;
|
|
const prevShouldTrack = shouldTrack;
|
|
activeSub = computed2;
|
|
shouldTrack = true;
|
|
try {
|
|
prepareDeps(computed2);
|
|
const value = computed2.fn(computed2._value);
|
|
if (dep.version === 0 || hasChanged(value, computed2._value)) {
|
|
computed2.flags |= 128;
|
|
computed2._value = value;
|
|
dep.version++;
|
|
}
|
|
} catch (err) {
|
|
dep.version++;
|
|
throw err;
|
|
} finally {
|
|
activeSub = prevSub;
|
|
shouldTrack = prevShouldTrack;
|
|
cleanupDeps(computed2);
|
|
computed2.flags &= -3;
|
|
}
|
|
}
|
|
function removeSub(link, soft = false) {
|
|
const { dep, prevSub, nextSub } = link;
|
|
if (prevSub) {
|
|
prevSub.nextSub = nextSub;
|
|
link.prevSub = void 0;
|
|
}
|
|
if (nextSub) {
|
|
nextSub.prevSub = prevSub;
|
|
link.nextSub = void 0;
|
|
}
|
|
if (dep.subs === link) {
|
|
dep.subs = prevSub;
|
|
if (!prevSub && dep.computed) {
|
|
dep.computed.flags &= -5;
|
|
for (let l2 = dep.computed.deps; l2; l2 = l2.nextDep) {
|
|
removeSub(l2, true);
|
|
}
|
|
}
|
|
}
|
|
if (!soft && !--dep.sc && dep.map) {
|
|
dep.map.delete(dep.key);
|
|
}
|
|
}
|
|
function removeDep(link) {
|
|
const { prevDep, nextDep } = link;
|
|
if (prevDep) {
|
|
prevDep.nextDep = nextDep;
|
|
link.prevDep = void 0;
|
|
}
|
|
if (nextDep) {
|
|
nextDep.prevDep = prevDep;
|
|
link.nextDep = void 0;
|
|
}
|
|
}
|
|
let shouldTrack = true;
|
|
const trackStack = [];
|
|
function pauseTracking() {
|
|
trackStack.push(shouldTrack);
|
|
shouldTrack = false;
|
|
}
|
|
function resetTracking() {
|
|
const last = trackStack.pop();
|
|
shouldTrack = last === void 0 ? true : last;
|
|
}
|
|
function cleanupEffect(e) {
|
|
const { cleanup } = e;
|
|
e.cleanup = void 0;
|
|
if (cleanup) {
|
|
const prevSub = activeSub;
|
|
activeSub = void 0;
|
|
try {
|
|
cleanup();
|
|
} finally {
|
|
activeSub = prevSub;
|
|
}
|
|
}
|
|
}
|
|
let globalVersion = 0;
|
|
class Link {
|
|
constructor(sub, dep) {
|
|
this.sub = sub;
|
|
this.dep = dep;
|
|
this.version = dep.version;
|
|
this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
|
|
}
|
|
}
|
|
class Dep {
|
|
// TODO isolatedDeclarations "__v_skip"
|
|
constructor(computed2) {
|
|
this.computed = computed2;
|
|
this.version = 0;
|
|
this.activeLink = void 0;
|
|
this.subs = void 0;
|
|
this.map = void 0;
|
|
this.key = void 0;
|
|
this.sc = 0;
|
|
this.__v_skip = true;
|
|
}
|
|
track(debugInfo) {
|
|
if (!activeSub || !shouldTrack || activeSub === this.computed) {
|
|
return;
|
|
}
|
|
let link = this.activeLink;
|
|
if (link === void 0 || link.sub !== activeSub) {
|
|
link = this.activeLink = new Link(activeSub, this);
|
|
if (!activeSub.deps) {
|
|
activeSub.deps = activeSub.depsTail = link;
|
|
} else {
|
|
link.prevDep = activeSub.depsTail;
|
|
activeSub.depsTail.nextDep = link;
|
|
activeSub.depsTail = link;
|
|
}
|
|
addSub(link);
|
|
} else if (link.version === -1) {
|
|
link.version = this.version;
|
|
if (link.nextDep) {
|
|
const next = link.nextDep;
|
|
next.prevDep = link.prevDep;
|
|
if (link.prevDep) {
|
|
link.prevDep.nextDep = next;
|
|
}
|
|
link.prevDep = activeSub.depsTail;
|
|
link.nextDep = void 0;
|
|
activeSub.depsTail.nextDep = link;
|
|
activeSub.depsTail = link;
|
|
if (activeSub.deps === link) {
|
|
activeSub.deps = next;
|
|
}
|
|
}
|
|
}
|
|
return link;
|
|
}
|
|
trigger(debugInfo) {
|
|
this.version++;
|
|
globalVersion++;
|
|
this.notify(debugInfo);
|
|
}
|
|
notify(debugInfo) {
|
|
startBatch();
|
|
try {
|
|
if (false) ;
|
|
for (let link = this.subs; link; link = link.prevSub) {
|
|
if (link.sub.notify()) {
|
|
;
|
|
link.sub.dep.notify();
|
|
}
|
|
}
|
|
} finally {
|
|
endBatch();
|
|
}
|
|
}
|
|
}
|
|
function addSub(link) {
|
|
link.dep.sc++;
|
|
if (link.sub.flags & 4) {
|
|
const computed2 = link.dep.computed;
|
|
if (computed2 && !link.dep.subs) {
|
|
computed2.flags |= 4 | 16;
|
|
for (let l2 = computed2.deps; l2; l2 = l2.nextDep) {
|
|
addSub(l2);
|
|
}
|
|
}
|
|
const currentTail = link.dep.subs;
|
|
if (currentTail !== link) {
|
|
link.prevSub = currentTail;
|
|
if (currentTail) currentTail.nextSub = link;
|
|
}
|
|
link.dep.subs = link;
|
|
}
|
|
}
|
|
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
const ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
""
|
|
);
|
|
const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
""
|
|
);
|
|
const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
""
|
|
);
|
|
function track(target, type, key) {
|
|
if (shouldTrack && activeSub) {
|
|
let depsMap = targetMap.get(target);
|
|
if (!depsMap) {
|
|
targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
|
|
}
|
|
let dep = depsMap.get(key);
|
|
if (!dep) {
|
|
depsMap.set(key, dep = new Dep());
|
|
dep.map = depsMap;
|
|
dep.key = key;
|
|
}
|
|
{
|
|
dep.track();
|
|
}
|
|
}
|
|
}
|
|
function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
const depsMap = targetMap.get(target);
|
|
if (!depsMap) {
|
|
globalVersion++;
|
|
return;
|
|
}
|
|
const run = (dep) => {
|
|
if (dep) {
|
|
{
|
|
dep.trigger();
|
|
}
|
|
}
|
|
};
|
|
startBatch();
|
|
if (type === "clear") {
|
|
depsMap.forEach(run);
|
|
} else {
|
|
const targetIsArray = isArray(target);
|
|
const isArrayIndex = targetIsArray && isIntegerKey(key);
|
|
if (targetIsArray && key === "length") {
|
|
const newLength = Number(newValue);
|
|
depsMap.forEach((dep, key2) => {
|
|
if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
|
|
run(dep);
|
|
}
|
|
});
|
|
} else {
|
|
if (key !== void 0 || depsMap.has(void 0)) {
|
|
run(depsMap.get(key));
|
|
}
|
|
if (isArrayIndex) {
|
|
run(depsMap.get(ARRAY_ITERATE_KEY));
|
|
}
|
|
switch (type) {
|
|
case "add":
|
|
if (!targetIsArray) {
|
|
run(depsMap.get(ITERATE_KEY));
|
|
if (isMap(target)) {
|
|
run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
}
|
|
} else if (isArrayIndex) {
|
|
run(depsMap.get("length"));
|
|
}
|
|
break;
|
|
case "delete":
|
|
if (!targetIsArray) {
|
|
run(depsMap.get(ITERATE_KEY));
|
|
if (isMap(target)) {
|
|
run(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
}
|
|
}
|
|
break;
|
|
case "set":
|
|
if (isMap(target)) {
|
|
run(depsMap.get(ITERATE_KEY));
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
endBatch();
|
|
}
|
|
function reactiveReadArray(array) {
|
|
const raw = toRaw(array);
|
|
if (raw === array) return raw;
|
|
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
return isShallow(array) ? raw : raw.map(toReactive);
|
|
}
|
|
function shallowReadArray(arr) {
|
|
track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
|
|
return arr;
|
|
}
|
|
function toWrapped(target, item) {
|
|
if (isReadonly(target)) {
|
|
return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
|
|
}
|
|
return toReactive(item);
|
|
}
|
|
const arrayInstrumentations = {
|
|
__proto__: null,
|
|
[Symbol.iterator]() {
|
|
return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
|
|
},
|
|
concat(...args) {
|
|
return reactiveReadArray(this).concat(
|
|
...args.map((x) => isArray(x) ? reactiveReadArray(x) : x)
|
|
);
|
|
},
|
|
entries() {
|
|
return iterator(this, "entries", (value) => {
|
|
value[1] = toWrapped(this, value[1]);
|
|
return value;
|
|
});
|
|
},
|
|
every(fn, thisArg) {
|
|
return apply(this, "every", fn, thisArg, void 0, arguments);
|
|
},
|
|
filter(fn, thisArg) {
|
|
return apply(
|
|
this,
|
|
"filter",
|
|
fn,
|
|
thisArg,
|
|
(v2) => v2.map((item) => toWrapped(this, item)),
|
|
arguments
|
|
);
|
|
},
|
|
find(fn, thisArg) {
|
|
return apply(
|
|
this,
|
|
"find",
|
|
fn,
|
|
thisArg,
|
|
(item) => toWrapped(this, item),
|
|
arguments
|
|
);
|
|
},
|
|
findIndex(fn, thisArg) {
|
|
return apply(this, "findIndex", fn, thisArg, void 0, arguments);
|
|
},
|
|
findLast(fn, thisArg) {
|
|
return apply(
|
|
this,
|
|
"findLast",
|
|
fn,
|
|
thisArg,
|
|
(item) => toWrapped(this, item),
|
|
arguments
|
|
);
|
|
},
|
|
findLastIndex(fn, thisArg) {
|
|
return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
|
|
},
|
|
// flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
|
|
forEach(fn, thisArg) {
|
|
return apply(this, "forEach", fn, thisArg, void 0, arguments);
|
|
},
|
|
includes(...args) {
|
|
return searchProxy(this, "includes", args);
|
|
},
|
|
indexOf(...args) {
|
|
return searchProxy(this, "indexOf", args);
|
|
},
|
|
join(separator) {
|
|
return reactiveReadArray(this).join(separator);
|
|
},
|
|
// keys() iterator only reads `length`, no optimization required
|
|
lastIndexOf(...args) {
|
|
return searchProxy(this, "lastIndexOf", args);
|
|
},
|
|
map(fn, thisArg) {
|
|
return apply(this, "map", fn, thisArg, void 0, arguments);
|
|
},
|
|
pop() {
|
|
return noTracking(this, "pop");
|
|
},
|
|
push(...args) {
|
|
return noTracking(this, "push", args);
|
|
},
|
|
reduce(fn, ...args) {
|
|
return reduce(this, "reduce", fn, args);
|
|
},
|
|
reduceRight(fn, ...args) {
|
|
return reduce(this, "reduceRight", fn, args);
|
|
},
|
|
shift() {
|
|
return noTracking(this, "shift");
|
|
},
|
|
// slice could use ARRAY_ITERATE but also seems to beg for range tracking
|
|
some(fn, thisArg) {
|
|
return apply(this, "some", fn, thisArg, void 0, arguments);
|
|
},
|
|
splice(...args) {
|
|
return noTracking(this, "splice", args);
|
|
},
|
|
toReversed() {
|
|
return reactiveReadArray(this).toReversed();
|
|
},
|
|
toSorted(comparer) {
|
|
return reactiveReadArray(this).toSorted(comparer);
|
|
},
|
|
toSpliced(...args) {
|
|
return reactiveReadArray(this).toSpliced(...args);
|
|
},
|
|
unshift(...args) {
|
|
return noTracking(this, "unshift", args);
|
|
},
|
|
values() {
|
|
return iterator(this, "values", (item) => toWrapped(this, item));
|
|
}
|
|
};
|
|
function iterator(self2, method, wrapValue) {
|
|
const arr = shallowReadArray(self2);
|
|
const iter = arr[method]();
|
|
if (arr !== self2 && !isShallow(self2)) {
|
|
iter._next = iter.next;
|
|
iter.next = () => {
|
|
const result = iter._next();
|
|
if (!result.done) {
|
|
result.value = wrapValue(result.value);
|
|
}
|
|
return result;
|
|
};
|
|
}
|
|
return iter;
|
|
}
|
|
const arrayProto = Array.prototype;
|
|
function apply(self2, method, fn, thisArg, wrappedRetFn, args) {
|
|
const arr = shallowReadArray(self2);
|
|
const needsWrap = arr !== self2 && !isShallow(self2);
|
|
const methodFn = arr[method];
|
|
if (methodFn !== arrayProto[method]) {
|
|
const result2 = methodFn.apply(self2, args);
|
|
return needsWrap ? toReactive(result2) : result2;
|
|
}
|
|
let wrappedFn = fn;
|
|
if (arr !== self2) {
|
|
if (needsWrap) {
|
|
wrappedFn = function(item, index) {
|
|
return fn.call(this, toWrapped(self2, item), index, self2);
|
|
};
|
|
} else if (fn.length > 2) {
|
|
wrappedFn = function(item, index) {
|
|
return fn.call(this, item, index, self2);
|
|
};
|
|
}
|
|
}
|
|
const result = methodFn.call(arr, wrappedFn, thisArg);
|
|
return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
|
|
}
|
|
function reduce(self2, method, fn, args) {
|
|
const arr = shallowReadArray(self2);
|
|
let wrappedFn = fn;
|
|
if (arr !== self2) {
|
|
if (!isShallow(self2)) {
|
|
wrappedFn = function(acc, item, index) {
|
|
return fn.call(this, acc, toWrapped(self2, item), index, self2);
|
|
};
|
|
} else if (fn.length > 3) {
|
|
wrappedFn = function(acc, item, index) {
|
|
return fn.call(this, acc, item, index, self2);
|
|
};
|
|
}
|
|
}
|
|
return arr[method](wrappedFn, ...args);
|
|
}
|
|
function searchProxy(self2, method, args) {
|
|
const arr = toRaw(self2);
|
|
track(arr, "iterate", ARRAY_ITERATE_KEY);
|
|
const res = arr[method](...args);
|
|
if ((res === -1 || res === false) && isProxy(args[0])) {
|
|
args[0] = toRaw(args[0]);
|
|
return arr[method](...args);
|
|
}
|
|
return res;
|
|
}
|
|
function noTracking(self2, method, args = []) {
|
|
pauseTracking();
|
|
startBatch();
|
|
const res = toRaw(self2)[method].apply(self2, args);
|
|
endBatch();
|
|
resetTracking();
|
|
return res;
|
|
}
|
|
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
const builtInSymbols = new Set(
|
|
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
|
|
);
|
|
function hasOwnProperty(key) {
|
|
if (!isSymbol(key)) key = String(key);
|
|
const obj = toRaw(this);
|
|
track(obj, "has", key);
|
|
return obj.hasOwnProperty(key);
|
|
}
|
|
class BaseReactiveHandler {
|
|
constructor(_isReadonly = false, _isShallow = false) {
|
|
this._isReadonly = _isReadonly;
|
|
this._isShallow = _isShallow;
|
|
}
|
|
get(target, key, receiver) {
|
|
if (key === "__v_skip") return target["__v_skip"];
|
|
const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
|
|
if (key === "__v_isReactive") {
|
|
return !isReadonly2;
|
|
} else if (key === "__v_isReadonly") {
|
|
return isReadonly2;
|
|
} else if (key === "__v_isShallow") {
|
|
return isShallow2;
|
|
} else if (key === "__v_raw") {
|
|
if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
|
|
// this means the receiver is a user proxy of the reactive proxy
|
|
Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
|
|
return target;
|
|
}
|
|
return;
|
|
}
|
|
const targetIsArray = isArray(target);
|
|
if (!isReadonly2) {
|
|
let fn;
|
|
if (targetIsArray && (fn = arrayInstrumentations[key])) {
|
|
return fn;
|
|
}
|
|
if (key === "hasOwnProperty") {
|
|
return hasOwnProperty;
|
|
}
|
|
}
|
|
const res = Reflect.get(
|
|
target,
|
|
key,
|
|
// if this is a proxy wrapping a ref, return methods using the raw ref
|
|
// as receiver so that we don't have to call `toRaw` on the ref in all
|
|
// its class methods
|
|
isRef(target) ? target : receiver
|
|
);
|
|
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
|
|
return res;
|
|
}
|
|
if (!isReadonly2) {
|
|
track(target, "get", key);
|
|
}
|
|
if (isShallow2) {
|
|
return res;
|
|
}
|
|
if (isRef(res)) {
|
|
const value = targetIsArray && isIntegerKey(key) ? res : res.value;
|
|
return isReadonly2 && isObject(value) ? readonly(value) : value;
|
|
}
|
|
if (isObject(res)) {
|
|
return isReadonly2 ? readonly(res) : reactive(res);
|
|
}
|
|
return res;
|
|
}
|
|
}
|
|
class MutableReactiveHandler extends BaseReactiveHandler {
|
|
constructor(isShallow2 = false) {
|
|
super(false, isShallow2);
|
|
}
|
|
set(target, key, value, receiver) {
|
|
let oldValue = target[key];
|
|
const isArrayWithIntegerKey = isArray(target) && isIntegerKey(key);
|
|
if (!this._isShallow) {
|
|
const isOldValueReadonly = isReadonly(oldValue);
|
|
if (!isShallow(value) && !isReadonly(value)) {
|
|
oldValue = toRaw(oldValue);
|
|
value = toRaw(value);
|
|
}
|
|
if (!isArrayWithIntegerKey && isRef(oldValue) && !isRef(value)) {
|
|
if (isOldValueReadonly) {
|
|
return true;
|
|
} else {
|
|
oldValue.value = value;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
|
|
const result = Reflect.set(
|
|
target,
|
|
key,
|
|
value,
|
|
isRef(target) ? target : receiver
|
|
);
|
|
if (target === toRaw(receiver)) {
|
|
if (!hadKey) {
|
|
trigger(target, "add", key, value);
|
|
} else if (hasChanged(value, oldValue)) {
|
|
trigger(target, "set", key, value);
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
deleteProperty(target, key) {
|
|
const hadKey = hasOwn(target, key);
|
|
target[key];
|
|
const result = Reflect.deleteProperty(target, key);
|
|
if (result && hadKey) {
|
|
trigger(target, "delete", key, void 0);
|
|
}
|
|
return result;
|
|
}
|
|
has(target, key) {
|
|
const result = Reflect.has(target, key);
|
|
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
track(target, "has", key);
|
|
}
|
|
return result;
|
|
}
|
|
ownKeys(target) {
|
|
track(
|
|
target,
|
|
"iterate",
|
|
isArray(target) ? "length" : ITERATE_KEY
|
|
);
|
|
return Reflect.ownKeys(target);
|
|
}
|
|
}
|
|
class ReadonlyReactiveHandler extends BaseReactiveHandler {
|
|
constructor(isShallow2 = false) {
|
|
super(true, isShallow2);
|
|
}
|
|
set(target, key) {
|
|
return true;
|
|
}
|
|
deleteProperty(target, key) {
|
|
return true;
|
|
}
|
|
}
|
|
const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
|
|
const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
|
|
const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
|
|
const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
|
|
const toShallow = (value) => value;
|
|
const getProto = (v2) => Reflect.getPrototypeOf(v2);
|
|
function createIterableMethod(method, isReadonly2, isShallow2) {
|
|
return function(...args) {
|
|
const target = this["__v_raw"];
|
|
const rawTarget = toRaw(target);
|
|
const targetIsMap = isMap(rawTarget);
|
|
const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
|
|
const isKeyOnly = method === "keys" && targetIsMap;
|
|
const innerIterator = target[method](...args);
|
|
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
!isReadonly2 && track(
|
|
rawTarget,
|
|
"iterate",
|
|
isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
|
|
);
|
|
return {
|
|
// iterator protocol
|
|
next() {
|
|
const { value, done } = innerIterator.next();
|
|
return done ? { value, done } : {
|
|
value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
|
|
done
|
|
};
|
|
},
|
|
// iterable protocol
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
};
|
|
};
|
|
}
|
|
function createReadonlyMethod(type) {
|
|
return function(...args) {
|
|
return type === "delete" ? false : type === "clear" ? void 0 : this;
|
|
};
|
|
}
|
|
function createInstrumentations(readonly2, shallow) {
|
|
const instrumentations = {
|
|
get(key) {
|
|
const target = this["__v_raw"];
|
|
const rawTarget = toRaw(target);
|
|
const rawKey = toRaw(key);
|
|
if (!readonly2) {
|
|
if (hasChanged(key, rawKey)) {
|
|
track(rawTarget, "get", key);
|
|
}
|
|
track(rawTarget, "get", rawKey);
|
|
}
|
|
const { has } = getProto(rawTarget);
|
|
const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive;
|
|
if (has.call(rawTarget, key)) {
|
|
return wrap(target.get(key));
|
|
} else if (has.call(rawTarget, rawKey)) {
|
|
return wrap(target.get(rawKey));
|
|
} else if (target !== rawTarget) {
|
|
target.get(key);
|
|
}
|
|
},
|
|
get size() {
|
|
const target = this["__v_raw"];
|
|
!readonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
|
|
return target.size;
|
|
},
|
|
has(key) {
|
|
const target = this["__v_raw"];
|
|
const rawTarget = toRaw(target);
|
|
const rawKey = toRaw(key);
|
|
if (!readonly2) {
|
|
if (hasChanged(key, rawKey)) {
|
|
track(rawTarget, "has", key);
|
|
}
|
|
track(rawTarget, "has", rawKey);
|
|
}
|
|
return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
|
|
},
|
|
forEach(callback, thisArg) {
|
|
const observed = this;
|
|
const target = observed["__v_raw"];
|
|
const rawTarget = toRaw(target);
|
|
const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive;
|
|
!readonly2 && track(rawTarget, "iterate", ITERATE_KEY);
|
|
return target.forEach((value, key) => {
|
|
return callback.call(thisArg, wrap(value), wrap(key), observed);
|
|
});
|
|
}
|
|
};
|
|
extend(
|
|
instrumentations,
|
|
readonly2 ? {
|
|
add: createReadonlyMethod("add"),
|
|
set: createReadonlyMethod("set"),
|
|
delete: createReadonlyMethod("delete"),
|
|
clear: createReadonlyMethod("clear")
|
|
} : {
|
|
add(value) {
|
|
if (!shallow && !isShallow(value) && !isReadonly(value)) {
|
|
value = toRaw(value);
|
|
}
|
|
const target = toRaw(this);
|
|
const proto = getProto(target);
|
|
const hadKey = proto.has.call(target, value);
|
|
if (!hadKey) {
|
|
target.add(value);
|
|
trigger(target, "add", value, value);
|
|
}
|
|
return this;
|
|
},
|
|
set(key, value) {
|
|
if (!shallow && !isShallow(value) && !isReadonly(value)) {
|
|
value = toRaw(value);
|
|
}
|
|
const target = toRaw(this);
|
|
const { has, get } = getProto(target);
|
|
let hadKey = has.call(target, key);
|
|
if (!hadKey) {
|
|
key = toRaw(key);
|
|
hadKey = has.call(target, key);
|
|
}
|
|
const oldValue = get.call(target, key);
|
|
target.set(key, value);
|
|
if (!hadKey) {
|
|
trigger(target, "add", key, value);
|
|
} else if (hasChanged(value, oldValue)) {
|
|
trigger(target, "set", key, value);
|
|
}
|
|
return this;
|
|
},
|
|
delete(key) {
|
|
const target = toRaw(this);
|
|
const { has, get } = getProto(target);
|
|
let hadKey = has.call(target, key);
|
|
if (!hadKey) {
|
|
key = toRaw(key);
|
|
hadKey = has.call(target, key);
|
|
}
|
|
get ? get.call(target, key) : void 0;
|
|
const result = target.delete(key);
|
|
if (hadKey) {
|
|
trigger(target, "delete", key, void 0);
|
|
}
|
|
return result;
|
|
},
|
|
clear() {
|
|
const target = toRaw(this);
|
|
const hadItems = target.size !== 0;
|
|
const result = target.clear();
|
|
if (hadItems) {
|
|
trigger(
|
|
target,
|
|
"clear",
|
|
void 0,
|
|
void 0
|
|
);
|
|
}
|
|
return result;
|
|
}
|
|
}
|
|
);
|
|
const iteratorMethods = [
|
|
"keys",
|
|
"values",
|
|
"entries",
|
|
Symbol.iterator
|
|
];
|
|
iteratorMethods.forEach((method) => {
|
|
instrumentations[method] = createIterableMethod(method, readonly2, shallow);
|
|
});
|
|
return instrumentations;
|
|
}
|
|
function createInstrumentationGetter(isReadonly2, shallow) {
|
|
const instrumentations = createInstrumentations(isReadonly2, shallow);
|
|
return (target, key, receiver) => {
|
|
if (key === "__v_isReactive") {
|
|
return !isReadonly2;
|
|
} else if (key === "__v_isReadonly") {
|
|
return isReadonly2;
|
|
} else if (key === "__v_raw") {
|
|
return target;
|
|
}
|
|
return Reflect.get(
|
|
hasOwn(instrumentations, key) && key in target ? instrumentations : target,
|
|
key,
|
|
receiver
|
|
);
|
|
};
|
|
}
|
|
const mutableCollectionHandlers = {
|
|
get: /* @__PURE__ */ createInstrumentationGetter(false, false)
|
|
};
|
|
const shallowCollectionHandlers = {
|
|
get: /* @__PURE__ */ createInstrumentationGetter(false, true)
|
|
};
|
|
const readonlyCollectionHandlers = {
|
|
get: /* @__PURE__ */ createInstrumentationGetter(true, false)
|
|
};
|
|
const shallowReadonlyCollectionHandlers = {
|
|
get: /* @__PURE__ */ createInstrumentationGetter(true, true)
|
|
};
|
|
const reactiveMap = /* @__PURE__ */ new WeakMap();
|
|
const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
|
|
const readonlyMap = /* @__PURE__ */ new WeakMap();
|
|
const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
|
|
function targetTypeMap(rawType) {
|
|
switch (rawType) {
|
|
case "Object":
|
|
case "Array":
|
|
return 1;
|
|
case "Map":
|
|
case "Set":
|
|
case "WeakMap":
|
|
case "WeakSet":
|
|
return 2;
|
|
default:
|
|
return 0;
|
|
}
|
|
}
|
|
function getTargetType(value) {
|
|
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
}
|
|
function reactive(target) {
|
|
if (isReadonly(target)) {
|
|
return target;
|
|
}
|
|
return createReactiveObject(
|
|
target,
|
|
false,
|
|
mutableHandlers,
|
|
mutableCollectionHandlers,
|
|
reactiveMap
|
|
);
|
|
}
|
|
function shallowReactive(target) {
|
|
return createReactiveObject(
|
|
target,
|
|
false,
|
|
shallowReactiveHandlers,
|
|
shallowCollectionHandlers,
|
|
shallowReactiveMap
|
|
);
|
|
}
|
|
function readonly(target) {
|
|
return createReactiveObject(
|
|
target,
|
|
true,
|
|
readonlyHandlers,
|
|
readonlyCollectionHandlers,
|
|
readonlyMap
|
|
);
|
|
}
|
|
function shallowReadonly(target) {
|
|
return createReactiveObject(
|
|
target,
|
|
true,
|
|
shallowReadonlyHandlers,
|
|
shallowReadonlyCollectionHandlers,
|
|
shallowReadonlyMap
|
|
);
|
|
}
|
|
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
if (!isObject(target)) {
|
|
return target;
|
|
}
|
|
if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
|
|
return target;
|
|
}
|
|
const targetType = getTargetType(target);
|
|
if (targetType === 0) {
|
|
return target;
|
|
}
|
|
const existingProxy = proxyMap.get(target);
|
|
if (existingProxy) {
|
|
return existingProxy;
|
|
}
|
|
const proxy = new Proxy(
|
|
target,
|
|
targetType === 2 ? collectionHandlers : baseHandlers
|
|
);
|
|
proxyMap.set(target, proxy);
|
|
return proxy;
|
|
}
|
|
function isReactive(value) {
|
|
if (isReadonly(value)) {
|
|
return isReactive(value["__v_raw"]);
|
|
}
|
|
return !!(value && value["__v_isReactive"]);
|
|
}
|
|
function isReadonly(value) {
|
|
return !!(value && value["__v_isReadonly"]);
|
|
}
|
|
function isShallow(value) {
|
|
return !!(value && value["__v_isShallow"]);
|
|
}
|
|
function isProxy(value) {
|
|
return value ? !!value["__v_raw"] : false;
|
|
}
|
|
function toRaw(observed) {
|
|
const raw = observed && observed["__v_raw"];
|
|
return raw ? toRaw(raw) : observed;
|
|
}
|
|
function markRaw(value) {
|
|
if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
|
|
def(value, "__v_skip", true);
|
|
}
|
|
return value;
|
|
}
|
|
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
const toReadonly = (value) => isObject(value) ? readonly(value) : value;
|
|
function isRef(r) {
|
|
return r ? r["__v_isRef"] === true : false;
|
|
}
|
|
function ref(value) {
|
|
return createRef(value, false);
|
|
}
|
|
function createRef(rawValue, shallow) {
|
|
if (isRef(rawValue)) {
|
|
return rawValue;
|
|
}
|
|
return new RefImpl(rawValue, shallow);
|
|
}
|
|
class RefImpl {
|
|
constructor(value, isShallow2) {
|
|
this.dep = new Dep();
|
|
this["__v_isRef"] = true;
|
|
this["__v_isShallow"] = false;
|
|
this._rawValue = isShallow2 ? value : toRaw(value);
|
|
this._value = isShallow2 ? value : toReactive(value);
|
|
this["__v_isShallow"] = isShallow2;
|
|
}
|
|
get value() {
|
|
{
|
|
this.dep.track();
|
|
}
|
|
return this._value;
|
|
}
|
|
set value(newValue) {
|
|
const oldValue = this._rawValue;
|
|
const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
|
|
newValue = useDirectValue ? newValue : toRaw(newValue);
|
|
if (hasChanged(newValue, oldValue)) {
|
|
this._rawValue = newValue;
|
|
this._value = useDirectValue ? newValue : toReactive(newValue);
|
|
{
|
|
this.dep.trigger();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function unref(ref2) {
|
|
return isRef(ref2) ? ref2.value : ref2;
|
|
}
|
|
const shallowUnwrapHandlers = {
|
|
get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
|
|
set: (target, key, value, receiver) => {
|
|
const oldValue = target[key];
|
|
if (isRef(oldValue) && !isRef(value)) {
|
|
oldValue.value = value;
|
|
return true;
|
|
} else {
|
|
return Reflect.set(target, key, value, receiver);
|
|
}
|
|
}
|
|
};
|
|
function proxyRefs(objectWithRefs) {
|
|
return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
|
|
}
|
|
class ComputedRefImpl {
|
|
constructor(fn, setter, isSSR) {
|
|
this.fn = fn;
|
|
this.setter = setter;
|
|
this._value = void 0;
|
|
this.dep = new Dep(this);
|
|
this.__v_isRef = true;
|
|
this.deps = void 0;
|
|
this.depsTail = void 0;
|
|
this.flags = 16;
|
|
this.globalVersion = globalVersion - 1;
|
|
this.next = void 0;
|
|
this.effect = this;
|
|
this["__v_isReadonly"] = !setter;
|
|
this.isSSR = isSSR;
|
|
}
|
|
/**
|
|
* @internal
|
|
*/
|
|
notify() {
|
|
this.flags |= 16;
|
|
if (!(this.flags & 8) && // avoid infinite self recursion
|
|
activeSub !== this) {
|
|
batch(this, true);
|
|
return true;
|
|
}
|
|
}
|
|
get value() {
|
|
const link = this.dep.track();
|
|
refreshComputed(this);
|
|
if (link) {
|
|
link.version = this.dep.version;
|
|
}
|
|
return this._value;
|
|
}
|
|
set value(newValue) {
|
|
if (this.setter) {
|
|
this.setter(newValue);
|
|
}
|
|
}
|
|
}
|
|
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
let getter;
|
|
let setter;
|
|
if (isFunction(getterOrOptions)) {
|
|
getter = getterOrOptions;
|
|
} else {
|
|
getter = getterOrOptions.get;
|
|
setter = getterOrOptions.set;
|
|
}
|
|
const cRef = new ComputedRefImpl(getter, setter, isSSR);
|
|
return cRef;
|
|
}
|
|
const INITIAL_WATCHER_VALUE = {};
|
|
const cleanupMap = /* @__PURE__ */ new WeakMap();
|
|
let activeWatcher = void 0;
|
|
function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
|
|
if (owner) {
|
|
let cleanups = cleanupMap.get(owner);
|
|
if (!cleanups) cleanupMap.set(owner, cleanups = []);
|
|
cleanups.push(cleanupFn);
|
|
}
|
|
}
|
|
function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
const { immediate, deep, once, scheduler, augmentJob, call } = options;
|
|
const reactiveGetter = (source2) => {
|
|
if (deep) return source2;
|
|
if (isShallow(source2) || deep === false || deep === 0)
|
|
return traverse(source2, 1);
|
|
return traverse(source2);
|
|
};
|
|
let effect2;
|
|
let getter;
|
|
let cleanup;
|
|
let boundCleanup;
|
|
let forceTrigger = false;
|
|
let isMultiSource = false;
|
|
if (isRef(source)) {
|
|
getter = () => source.value;
|
|
forceTrigger = isShallow(source);
|
|
} else if (isReactive(source)) {
|
|
getter = () => reactiveGetter(source);
|
|
forceTrigger = true;
|
|
} else if (isArray(source)) {
|
|
isMultiSource = true;
|
|
forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2));
|
|
getter = () => source.map((s2) => {
|
|
if (isRef(s2)) {
|
|
return s2.value;
|
|
} else if (isReactive(s2)) {
|
|
return reactiveGetter(s2);
|
|
} else if (isFunction(s2)) {
|
|
return call ? call(s2, 2) : s2();
|
|
} else ;
|
|
});
|
|
} else if (isFunction(source)) {
|
|
if (cb) {
|
|
getter = call ? () => call(source, 2) : source;
|
|
} else {
|
|
getter = () => {
|
|
if (cleanup) {
|
|
pauseTracking();
|
|
try {
|
|
cleanup();
|
|
} finally {
|
|
resetTracking();
|
|
}
|
|
}
|
|
const currentEffect = activeWatcher;
|
|
activeWatcher = effect2;
|
|
try {
|
|
return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
|
|
} finally {
|
|
activeWatcher = currentEffect;
|
|
}
|
|
};
|
|
}
|
|
} else {
|
|
getter = NOOP;
|
|
}
|
|
if (cb && deep) {
|
|
const baseGetter = getter;
|
|
const depth = deep === true ? Infinity : deep;
|
|
getter = () => traverse(baseGetter(), depth);
|
|
}
|
|
const scope = getCurrentScope();
|
|
const watchHandle = () => {
|
|
effect2.stop();
|
|
if (scope && scope.active) {
|
|
remove(scope.effects, effect2);
|
|
}
|
|
};
|
|
if (once && cb) {
|
|
const _cb = cb;
|
|
cb = (...args) => {
|
|
_cb(...args);
|
|
watchHandle();
|
|
};
|
|
}
|
|
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
const job = (immediateFirstRun) => {
|
|
if (!(effect2.flags & 1) || !effect2.dirty && !immediateFirstRun) {
|
|
return;
|
|
}
|
|
if (cb) {
|
|
const newValue = effect2.run();
|
|
if (deep || forceTrigger || (isMultiSource ? newValue.some((v2, i2) => hasChanged(v2, oldValue[i2])) : hasChanged(newValue, oldValue))) {
|
|
if (cleanup) {
|
|
cleanup();
|
|
}
|
|
const currentWatcher = activeWatcher;
|
|
activeWatcher = effect2;
|
|
try {
|
|
const args = [
|
|
newValue,
|
|
// pass undefined as the old value when it's changed for the first time
|
|
oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
|
|
boundCleanup
|
|
];
|
|
oldValue = newValue;
|
|
call ? call(cb, 3, args) : (
|
|
// @ts-expect-error
|
|
cb(...args)
|
|
);
|
|
} finally {
|
|
activeWatcher = currentWatcher;
|
|
}
|
|
}
|
|
} else {
|
|
effect2.run();
|
|
}
|
|
};
|
|
if (augmentJob) {
|
|
augmentJob(job);
|
|
}
|
|
effect2 = new ReactiveEffect(getter);
|
|
effect2.scheduler = scheduler ? () => scheduler(job, false) : job;
|
|
boundCleanup = (fn) => onWatcherCleanup(fn, false, effect2);
|
|
cleanup = effect2.onStop = () => {
|
|
const cleanups = cleanupMap.get(effect2);
|
|
if (cleanups) {
|
|
if (call) {
|
|
call(cleanups, 4);
|
|
} else {
|
|
for (const cleanup2 of cleanups) cleanup2();
|
|
}
|
|
cleanupMap.delete(effect2);
|
|
}
|
|
};
|
|
if (cb) {
|
|
if (immediate) {
|
|
job(true);
|
|
} else {
|
|
oldValue = effect2.run();
|
|
}
|
|
} else if (scheduler) {
|
|
scheduler(job.bind(null, true), true);
|
|
} else {
|
|
effect2.run();
|
|
}
|
|
watchHandle.pause = effect2.pause.bind(effect2);
|
|
watchHandle.resume = effect2.resume.bind(effect2);
|
|
watchHandle.stop = watchHandle;
|
|
return watchHandle;
|
|
}
|
|
function traverse(value, depth = Infinity, seen) {
|
|
if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
|
|
return value;
|
|
}
|
|
seen = seen || /* @__PURE__ */ new Map();
|
|
if ((seen.get(value) || 0) >= depth) {
|
|
return value;
|
|
}
|
|
seen.set(value, depth);
|
|
depth--;
|
|
if (isRef(value)) {
|
|
traverse(value.value, depth, seen);
|
|
} else if (isArray(value)) {
|
|
for (let i2 = 0; i2 < value.length; i2++) {
|
|
traverse(value[i2], depth, seen);
|
|
}
|
|
} else if (isSet(value) || isMap(value)) {
|
|
value.forEach((v2) => {
|
|
traverse(v2, depth, seen);
|
|
});
|
|
} else if (isPlainObject(value)) {
|
|
for (const key in value) {
|
|
traverse(value[key], depth, seen);
|
|
}
|
|
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
if (Object.prototype.propertyIsEnumerable.call(value, key)) {
|
|
traverse(value[key], depth, seen);
|
|
}
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
/**
|
|
* @vue/runtime-core v3.5.26
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/
|
|
const stack = [];
|
|
let isWarning = false;
|
|
function warn$1(msg, ...args) {
|
|
if (isWarning) return;
|
|
isWarning = true;
|
|
pauseTracking();
|
|
const instance = stack.length ? stack[stack.length - 1].component : null;
|
|
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
const trace = getComponentTrace();
|
|
if (appWarnHandler) {
|
|
callWithErrorHandling(
|
|
appWarnHandler,
|
|
instance,
|
|
11,
|
|
[
|
|
// eslint-disable-next-line no-restricted-syntax
|
|
msg + args.map((a2) => {
|
|
var _a, _b;
|
|
return (_b = (_a = a2.toString) == null ? void 0 : _a.call(a2)) != null ? _b : JSON.stringify(a2);
|
|
}).join(""),
|
|
instance && instance.proxy,
|
|
trace.map(
|
|
({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
|
|
).join("\n"),
|
|
trace
|
|
]
|
|
);
|
|
} else {
|
|
const warnArgs = [`[Vue warn]: ${msg}`, ...args];
|
|
if (trace.length && // avoid spamming console during tests
|
|
true) {
|
|
warnArgs.push(`
|
|
`, ...formatTrace(trace));
|
|
}
|
|
console.warn(...warnArgs);
|
|
}
|
|
resetTracking();
|
|
isWarning = false;
|
|
}
|
|
function getComponentTrace() {
|
|
let currentVNode = stack[stack.length - 1];
|
|
if (!currentVNode) {
|
|
return [];
|
|
}
|
|
const normalizedStack = [];
|
|
while (currentVNode) {
|
|
const last = normalizedStack[0];
|
|
if (last && last.vnode === currentVNode) {
|
|
last.recurseCount++;
|
|
} else {
|
|
normalizedStack.push({
|
|
vnode: currentVNode,
|
|
recurseCount: 0
|
|
});
|
|
}
|
|
const parentInstance = currentVNode.component && currentVNode.component.parent;
|
|
currentVNode = parentInstance && parentInstance.vnode;
|
|
}
|
|
return normalizedStack;
|
|
}
|
|
function formatTrace(trace) {
|
|
const logs = [];
|
|
trace.forEach((entry, i2) => {
|
|
logs.push(...i2 === 0 ? [] : [`
|
|
`], ...formatTraceEntry(entry));
|
|
});
|
|
return logs;
|
|
}
|
|
function formatTraceEntry({ vnode, recurseCount }) {
|
|
const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
|
|
const isRoot = vnode.component ? vnode.component.parent == null : false;
|
|
const open = ` at <${formatComponentName(
|
|
vnode.component,
|
|
vnode.type,
|
|
isRoot
|
|
)}`;
|
|
const close = `>` + postfix;
|
|
return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
|
|
}
|
|
function formatProps(props) {
|
|
const res = [];
|
|
const keys = Object.keys(props);
|
|
keys.slice(0, 3).forEach((key) => {
|
|
res.push(...formatProp(key, props[key]));
|
|
});
|
|
if (keys.length > 3) {
|
|
res.push(` ...`);
|
|
}
|
|
return res;
|
|
}
|
|
function formatProp(key, value, raw) {
|
|
if (isString(value)) {
|
|
value = JSON.stringify(value);
|
|
return raw ? value : [`${key}=${value}`];
|
|
} else if (typeof value === "number" || typeof value === "boolean" || value == null) {
|
|
return raw ? value : [`${key}=${value}`];
|
|
} else if (isRef(value)) {
|
|
value = formatProp(key, toRaw(value.value), true);
|
|
return raw ? value : [`${key}=Ref<`, value, `>`];
|
|
} else if (isFunction(value)) {
|
|
return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
|
|
} else {
|
|
value = toRaw(value);
|
|
return raw ? value : [`${key}=`, value];
|
|
}
|
|
}
|
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
try {
|
|
return args ? fn(...args) : fn();
|
|
} catch (err) {
|
|
handleError(err, instance, type);
|
|
}
|
|
}
|
|
function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
if (isFunction(fn)) {
|
|
const res = callWithErrorHandling(fn, instance, type, args);
|
|
if (res && isPromise(res)) {
|
|
res.catch((err) => {
|
|
handleError(err, instance, type);
|
|
});
|
|
}
|
|
return res;
|
|
}
|
|
if (isArray(fn)) {
|
|
const values = [];
|
|
for (let i2 = 0; i2 < fn.length; i2++) {
|
|
values.push(callWithAsyncErrorHandling(fn[i2], instance, type, args));
|
|
}
|
|
return values;
|
|
}
|
|
}
|
|
function handleError(err, instance, type, throwInDev = true) {
|
|
const contextVNode = instance ? instance.vnode : null;
|
|
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
|
|
if (instance) {
|
|
let cur = instance.parent;
|
|
const exposedInstance = instance.proxy;
|
|
const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
|
|
while (cur) {
|
|
const errorCapturedHooks = cur.ec;
|
|
if (errorCapturedHooks) {
|
|
for (let i2 = 0; i2 < errorCapturedHooks.length; i2++) {
|
|
if (errorCapturedHooks[i2](err, exposedInstance, errorInfo) === false) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
cur = cur.parent;
|
|
}
|
|
if (errorHandler) {
|
|
pauseTracking();
|
|
callWithErrorHandling(errorHandler, null, 10, [
|
|
err,
|
|
exposedInstance,
|
|
errorInfo
|
|
]);
|
|
resetTracking();
|
|
return;
|
|
}
|
|
}
|
|
logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
|
|
}
|
|
function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
|
|
if (throwInProd) {
|
|
throw err;
|
|
} else {
|
|
console.error(err);
|
|
}
|
|
}
|
|
const queue = [];
|
|
let flushIndex = -1;
|
|
const pendingPostFlushCbs = [];
|
|
let activePostFlushCbs = null;
|
|
let postFlushIndex = 0;
|
|
const resolvedPromise = /* @__PURE__ */ Promise.resolve();
|
|
let currentFlushPromise = null;
|
|
function nextTick(fn) {
|
|
const p2 = currentFlushPromise || resolvedPromise;
|
|
return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
|
|
}
|
|
function findInsertionIndex(id) {
|
|
let start = flushIndex + 1;
|
|
let end = queue.length;
|
|
while (start < end) {
|
|
const middle = start + end >>> 1;
|
|
const middleJob = queue[middle];
|
|
const middleJobId = getId(middleJob);
|
|
if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
|
|
start = middle + 1;
|
|
} else {
|
|
end = middle;
|
|
}
|
|
}
|
|
return start;
|
|
}
|
|
function queueJob(job) {
|
|
if (!(job.flags & 1)) {
|
|
const jobId = getId(job);
|
|
const lastJob = queue[queue.length - 1];
|
|
if (!lastJob || // fast path when the job id is larger than the tail
|
|
!(job.flags & 2) && jobId >= getId(lastJob)) {
|
|
queue.push(job);
|
|
} else {
|
|
queue.splice(findInsertionIndex(jobId), 0, job);
|
|
}
|
|
job.flags |= 1;
|
|
queueFlush();
|
|
}
|
|
}
|
|
function queueFlush() {
|
|
if (!currentFlushPromise) {
|
|
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
}
|
|
}
|
|
function queuePostFlushCb(cb) {
|
|
if (!isArray(cb)) {
|
|
if (activePostFlushCbs && cb.id === -1) {
|
|
activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
|
|
} else if (!(cb.flags & 1)) {
|
|
pendingPostFlushCbs.push(cb);
|
|
cb.flags |= 1;
|
|
}
|
|
} else {
|
|
pendingPostFlushCbs.push(...cb);
|
|
}
|
|
queueFlush();
|
|
}
|
|
function flushPreFlushCbs(instance, seen, i2 = flushIndex + 1) {
|
|
for (; i2 < queue.length; i2++) {
|
|
const cb = queue[i2];
|
|
if (cb && cb.flags & 2) {
|
|
if (instance && cb.id !== instance.uid) {
|
|
continue;
|
|
}
|
|
queue.splice(i2, 1);
|
|
i2--;
|
|
if (cb.flags & 4) {
|
|
cb.flags &= -2;
|
|
}
|
|
cb();
|
|
if (!(cb.flags & 4)) {
|
|
cb.flags &= -2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function flushPostFlushCbs(seen) {
|
|
if (pendingPostFlushCbs.length) {
|
|
const deduped = [...new Set(pendingPostFlushCbs)].sort(
|
|
(a2, b2) => getId(a2) - getId(b2)
|
|
);
|
|
pendingPostFlushCbs.length = 0;
|
|
if (activePostFlushCbs) {
|
|
activePostFlushCbs.push(...deduped);
|
|
return;
|
|
}
|
|
activePostFlushCbs = deduped;
|
|
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
const cb = activePostFlushCbs[postFlushIndex];
|
|
if (cb.flags & 4) {
|
|
cb.flags &= -2;
|
|
}
|
|
if (!(cb.flags & 8)) cb();
|
|
cb.flags &= -2;
|
|
}
|
|
activePostFlushCbs = null;
|
|
postFlushIndex = 0;
|
|
}
|
|
}
|
|
const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
|
|
function flushJobs(seen) {
|
|
try {
|
|
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
const job = queue[flushIndex];
|
|
if (job && !(job.flags & 8)) {
|
|
if (false) ;
|
|
if (job.flags & 4) {
|
|
job.flags &= ~1;
|
|
}
|
|
callWithErrorHandling(
|
|
job,
|
|
job.i,
|
|
job.i ? 15 : 14
|
|
);
|
|
if (!(job.flags & 4)) {
|
|
job.flags &= ~1;
|
|
}
|
|
}
|
|
}
|
|
} finally {
|
|
for (; flushIndex < queue.length; flushIndex++) {
|
|
const job = queue[flushIndex];
|
|
if (job) {
|
|
job.flags &= -2;
|
|
}
|
|
}
|
|
flushIndex = -1;
|
|
queue.length = 0;
|
|
flushPostFlushCbs();
|
|
currentFlushPromise = null;
|
|
if (queue.length || pendingPostFlushCbs.length) {
|
|
flushJobs();
|
|
}
|
|
}
|
|
}
|
|
let currentRenderingInstance = null;
|
|
let currentScopeId = null;
|
|
function setCurrentRenderingInstance(instance) {
|
|
const prev = currentRenderingInstance;
|
|
currentRenderingInstance = instance;
|
|
currentScopeId = instance && instance.type.__scopeId || null;
|
|
return prev;
|
|
}
|
|
function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
if (!ctx) return fn;
|
|
if (fn._n) {
|
|
return fn;
|
|
}
|
|
const renderFnWithContext = (...args) => {
|
|
if (renderFnWithContext._d) {
|
|
setBlockTracking(-1);
|
|
}
|
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
let res;
|
|
try {
|
|
res = fn(...args);
|
|
} finally {
|
|
setCurrentRenderingInstance(prevInstance);
|
|
if (renderFnWithContext._d) {
|
|
setBlockTracking(1);
|
|
}
|
|
}
|
|
return res;
|
|
};
|
|
renderFnWithContext._n = true;
|
|
renderFnWithContext._c = true;
|
|
renderFnWithContext._d = true;
|
|
return renderFnWithContext;
|
|
}
|
|
function withDirectives(vnode, directives) {
|
|
if (currentRenderingInstance === null) {
|
|
return vnode;
|
|
}
|
|
const instance = getComponentPublicInstance(currentRenderingInstance);
|
|
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
for (let i2 = 0; i2 < directives.length; i2++) {
|
|
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i2];
|
|
if (dir) {
|
|
if (isFunction(dir)) {
|
|
dir = {
|
|
mounted: dir,
|
|
updated: dir
|
|
};
|
|
}
|
|
if (dir.deep) {
|
|
traverse(value);
|
|
}
|
|
bindings.push({
|
|
dir,
|
|
instance,
|
|
value,
|
|
oldValue: void 0,
|
|
arg,
|
|
modifiers
|
|
});
|
|
}
|
|
}
|
|
return vnode;
|
|
}
|
|
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
const bindings = vnode.dirs;
|
|
const oldBindings = prevVNode && prevVNode.dirs;
|
|
for (let i2 = 0; i2 < bindings.length; i2++) {
|
|
const binding = bindings[i2];
|
|
if (oldBindings) {
|
|
binding.oldValue = oldBindings[i2].value;
|
|
}
|
|
let hook = binding.dir[name];
|
|
if (hook) {
|
|
pauseTracking();
|
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
vnode.el,
|
|
binding,
|
|
vnode,
|
|
prevVNode
|
|
]);
|
|
resetTracking();
|
|
}
|
|
}
|
|
}
|
|
function provide(key, value) {
|
|
if (currentInstance) {
|
|
let provides = currentInstance.provides;
|
|
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
if (parentProvides === provides) {
|
|
provides = currentInstance.provides = Object.create(parentProvides);
|
|
}
|
|
provides[key] = value;
|
|
}
|
|
}
|
|
function inject(key, defaultValue2, treatDefaultAsFactory = false) {
|
|
const instance = getCurrentInstance();
|
|
if (instance || currentApp) {
|
|
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
|
|
if (provides && key in provides) {
|
|
return provides[key];
|
|
} else if (arguments.length > 1) {
|
|
return treatDefaultAsFactory && isFunction(defaultValue2) ? defaultValue2.call(instance && instance.proxy) : defaultValue2;
|
|
} else ;
|
|
}
|
|
}
|
|
const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
|
|
const useSSRContext = () => {
|
|
{
|
|
const ctx = inject(ssrContextKey);
|
|
return ctx;
|
|
}
|
|
};
|
|
function watch(source, cb, options) {
|
|
return doWatch(source, cb, options);
|
|
}
|
|
function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
const { immediate, deep, flush, once } = options;
|
|
const baseWatchOptions = extend({}, options);
|
|
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
let ssrCleanup;
|
|
if (isInSSRComponentSetup) {
|
|
if (flush === "sync") {
|
|
const ctx = useSSRContext();
|
|
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
} else if (!runsImmediately) {
|
|
const watchStopHandle = () => {
|
|
};
|
|
watchStopHandle.stop = NOOP;
|
|
watchStopHandle.resume = NOOP;
|
|
watchStopHandle.pause = NOOP;
|
|
return watchStopHandle;
|
|
}
|
|
}
|
|
const instance = currentInstance;
|
|
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
let isPre = false;
|
|
if (flush === "post") {
|
|
baseWatchOptions.scheduler = (job) => {
|
|
queuePostRenderEffect(job, instance && instance.suspense);
|
|
};
|
|
} else if (flush !== "sync") {
|
|
isPre = true;
|
|
baseWatchOptions.scheduler = (job, isFirstRun) => {
|
|
if (isFirstRun) {
|
|
job();
|
|
} else {
|
|
queueJob(job);
|
|
}
|
|
};
|
|
}
|
|
baseWatchOptions.augmentJob = (job) => {
|
|
if (cb) {
|
|
job.flags |= 4;
|
|
}
|
|
if (isPre) {
|
|
job.flags |= 2;
|
|
if (instance) {
|
|
job.id = instance.uid;
|
|
job.i = instance;
|
|
}
|
|
}
|
|
};
|
|
const watchHandle = watch$1(source, cb, baseWatchOptions);
|
|
if (isInSSRComponentSetup) {
|
|
if (ssrCleanup) {
|
|
ssrCleanup.push(watchHandle);
|
|
} else if (runsImmediately) {
|
|
watchHandle();
|
|
}
|
|
}
|
|
return watchHandle;
|
|
}
|
|
function instanceWatch(source, value, options) {
|
|
const publicThis = this.proxy;
|
|
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
let cb;
|
|
if (isFunction(value)) {
|
|
cb = value;
|
|
} else {
|
|
cb = value.handler;
|
|
options = value;
|
|
}
|
|
const reset = setCurrentInstance(this);
|
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
reset();
|
|
return res;
|
|
}
|
|
function createPathGetter(ctx, path) {
|
|
const segments = path.split(".");
|
|
return () => {
|
|
let cur = ctx;
|
|
for (let i2 = 0; i2 < segments.length && cur; i2++) {
|
|
cur = cur[segments[i2]];
|
|
}
|
|
return cur;
|
|
};
|
|
}
|
|
const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
|
|
const isTeleport = (type) => type.__isTeleport;
|
|
const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
|
|
function setTransitionHooks(vnode, hooks) {
|
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
vnode.transition = hooks;
|
|
setTransitionHooks(vnode.component.subTree, hooks);
|
|
} else if (vnode.shapeFlag & 128) {
|
|
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
} else {
|
|
vnode.transition = hooks;
|
|
}
|
|
}
|
|
// @__NO_SIDE_EFFECTS__
|
|
function defineComponent(options, extraOptions) {
|
|
return isFunction(options) ? (
|
|
// #8236: extend call and options.name access are considered side-effects
|
|
// by Rollup, so we have to wrap it in a pure-annotated IIFE.
|
|
/* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
|
|
) : options;
|
|
}
|
|
function useId() {
|
|
const i2 = getCurrentInstance();
|
|
if (i2) {
|
|
return (i2.appContext.config.idPrefix || "v") + "-" + i2.ids[0] + i2.ids[1]++;
|
|
}
|
|
return "";
|
|
}
|
|
function markAsyncBoundary(instance) {
|
|
instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
|
|
}
|
|
const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
|
|
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
if (isArray(rawRef)) {
|
|
rawRef.forEach(
|
|
(r, i2) => setRef(
|
|
r,
|
|
oldRawRef && (isArray(oldRawRef) ? oldRawRef[i2] : oldRawRef),
|
|
parentSuspense,
|
|
vnode,
|
|
isUnmount
|
|
)
|
|
);
|
|
return;
|
|
}
|
|
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
|
|
setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
|
|
}
|
|
return;
|
|
}
|
|
const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
|
|
const value = isUnmount ? null : refValue;
|
|
const { i: owner, r: ref3 } = rawRef;
|
|
const oldRef = oldRawRef && oldRawRef.r;
|
|
const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
const setupState = owner.setupState;
|
|
const rawSetupState = toRaw(setupState);
|
|
const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
|
|
return hasOwn(rawSetupState, key);
|
|
};
|
|
if (oldRef != null && oldRef !== ref3) {
|
|
invalidatePendingSetRef(oldRawRef);
|
|
if (isString(oldRef)) {
|
|
refs[oldRef] = null;
|
|
if (canSetSetupRef(oldRef)) {
|
|
setupState[oldRef] = null;
|
|
}
|
|
} else if (isRef(oldRef)) {
|
|
{
|
|
oldRef.value = null;
|
|
}
|
|
const oldRawRefAtom = oldRawRef;
|
|
if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
|
|
}
|
|
}
|
|
if (isFunction(ref3)) {
|
|
callWithErrorHandling(ref3, owner, 12, [value, refs]);
|
|
} else {
|
|
const _isString = isString(ref3);
|
|
const _isRef = isRef(ref3);
|
|
if (_isString || _isRef) {
|
|
const doSet = () => {
|
|
if (rawRef.f) {
|
|
const existing = _isString ? canSetSetupRef(ref3) ? setupState[ref3] : refs[ref3] : ref3.value;
|
|
if (isUnmount) {
|
|
isArray(existing) && remove(existing, refValue);
|
|
} else {
|
|
if (!isArray(existing)) {
|
|
if (_isString) {
|
|
refs[ref3] = [refValue];
|
|
if (canSetSetupRef(ref3)) {
|
|
setupState[ref3] = refs[ref3];
|
|
}
|
|
} else {
|
|
const newVal = [refValue];
|
|
{
|
|
ref3.value = newVal;
|
|
}
|
|
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
}
|
|
} else if (!existing.includes(refValue)) {
|
|
existing.push(refValue);
|
|
}
|
|
}
|
|
} else if (_isString) {
|
|
refs[ref3] = value;
|
|
if (canSetSetupRef(ref3)) {
|
|
setupState[ref3] = value;
|
|
}
|
|
} else if (_isRef) {
|
|
{
|
|
ref3.value = value;
|
|
}
|
|
if (rawRef.k) refs[rawRef.k] = value;
|
|
} else ;
|
|
};
|
|
if (value) {
|
|
const job = () => {
|
|
doSet();
|
|
pendingSetRefMap.delete(rawRef);
|
|
};
|
|
job.id = -1;
|
|
pendingSetRefMap.set(rawRef, job);
|
|
queuePostRenderEffect(job, parentSuspense);
|
|
} else {
|
|
invalidatePendingSetRef(rawRef);
|
|
doSet();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function invalidatePendingSetRef(rawRef) {
|
|
const pendingSetRef = pendingSetRefMap.get(rawRef);
|
|
if (pendingSetRef) {
|
|
pendingSetRef.flags |= 8;
|
|
pendingSetRefMap.delete(rawRef);
|
|
}
|
|
}
|
|
getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
const isAsyncWrapper = (i2) => !!i2.type.__asyncLoader;
|
|
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
function onActivated(hook, target) {
|
|
registerKeepAliveHook(hook, "a", target);
|
|
}
|
|
function onDeactivated(hook, target) {
|
|
registerKeepAliveHook(hook, "da", target);
|
|
}
|
|
function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
const wrappedHook = hook.__wdc || (hook.__wdc = () => {
|
|
let current = target;
|
|
while (current) {
|
|
if (current.isDeactivated) {
|
|
return;
|
|
}
|
|
current = current.parent;
|
|
}
|
|
return hook();
|
|
});
|
|
injectHook(type, wrappedHook, target);
|
|
if (target) {
|
|
let current = target.parent;
|
|
while (current && current.parent) {
|
|
if (isKeepAlive(current.parent.vnode)) {
|
|
injectToKeepAliveRoot(wrappedHook, type, target, current);
|
|
}
|
|
current = current.parent;
|
|
}
|
|
}
|
|
}
|
|
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
const injected = injectHook(
|
|
type,
|
|
hook,
|
|
keepAliveRoot,
|
|
true
|
|
/* prepend */
|
|
);
|
|
onUnmounted(() => {
|
|
remove(keepAliveRoot[type], injected);
|
|
}, target);
|
|
}
|
|
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
if (target) {
|
|
const hooks = target[type] || (target[type] = []);
|
|
const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
|
|
pauseTracking();
|
|
const reset = setCurrentInstance(target);
|
|
const res = callWithAsyncErrorHandling(hook, target, type, args);
|
|
reset();
|
|
resetTracking();
|
|
return res;
|
|
});
|
|
if (prepend) {
|
|
hooks.unshift(wrappedHook);
|
|
} else {
|
|
hooks.push(wrappedHook);
|
|
}
|
|
return wrappedHook;
|
|
}
|
|
}
|
|
const createHook = (lifecycle) => (hook, target = currentInstance) => {
|
|
if (!isInSSRComponentSetup || lifecycle === "sp") {
|
|
injectHook(lifecycle, (...args) => hook(...args), target);
|
|
}
|
|
};
|
|
const onBeforeMount = createHook("bm");
|
|
const onMounted = createHook("m");
|
|
const onBeforeUpdate = createHook(
|
|
"bu"
|
|
);
|
|
const onUpdated = createHook("u");
|
|
const onBeforeUnmount = createHook(
|
|
"bum"
|
|
);
|
|
const onUnmounted = createHook("um");
|
|
const onServerPrefetch = createHook(
|
|
"sp"
|
|
);
|
|
const onRenderTriggered = createHook("rtg");
|
|
const onRenderTracked = createHook("rtc");
|
|
function onErrorCaptured(hook, target = currentInstance) {
|
|
injectHook("ec", hook, target);
|
|
}
|
|
const COMPONENTS = "components";
|
|
const DIRECTIVES = "directives";
|
|
function resolveComponent(name, maybeSelfReference) {
|
|
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
}
|
|
const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
|
|
function resolveDynamicComponent(component) {
|
|
if (isString(component)) {
|
|
return resolveAsset(COMPONENTS, component, false) || component;
|
|
} else {
|
|
return component || NULL_DYNAMIC_COMPONENT;
|
|
}
|
|
}
|
|
function resolveDirective(name) {
|
|
return resolveAsset(DIRECTIVES, name);
|
|
}
|
|
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
const instance = currentRenderingInstance || currentInstance;
|
|
if (instance) {
|
|
const Component = instance.type;
|
|
if (type === COMPONENTS) {
|
|
const selfName = getComponentName(
|
|
Component,
|
|
false
|
|
);
|
|
if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
|
|
return Component;
|
|
}
|
|
}
|
|
const res = (
|
|
// local registration
|
|
// check instance[type] first which is resolved for options API
|
|
resolve(instance[type] || Component[type], name) || // global registration
|
|
resolve(instance.appContext[type], name)
|
|
);
|
|
if (!res && maybeSelfReference) {
|
|
return Component;
|
|
}
|
|
return res;
|
|
}
|
|
}
|
|
function resolve(registry, name) {
|
|
return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
|
|
}
|
|
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
|
const hasProps = Object.keys(props).length > 0;
|
|
if (name !== "default") props.name = name;
|
|
return openBlock(), createBlock(
|
|
Fragment,
|
|
null,
|
|
[createVNode("slot", props, fallback && fallback())],
|
|
hasProps ? -2 : 64
|
|
);
|
|
}
|
|
let slot = slots[name];
|
|
if (slot && slot._c) {
|
|
slot._d = false;
|
|
}
|
|
openBlock();
|
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
// key attached in the `createSlots` helper, respect that
|
|
validSlotContent && validSlotContent.key;
|
|
const rendered = createBlock(
|
|
Fragment,
|
|
{
|
|
key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
(!validSlotContent && fallback ? "_fb" : "")
|
|
},
|
|
validSlotContent || (fallback ? fallback() : []),
|
|
validSlotContent && slots._ === 1 ? 64 : -2
|
|
);
|
|
if (rendered.scopeId) {
|
|
rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
}
|
|
if (slot && slot._c) {
|
|
slot._d = true;
|
|
}
|
|
return rendered;
|
|
}
|
|
function ensureValidVNode(vnodes) {
|
|
return vnodes.some((child) => {
|
|
if (!isVNode(child)) return true;
|
|
if (child.type === Comment) return false;
|
|
if (child.type === Fragment && !ensureValidVNode(child.children))
|
|
return false;
|
|
return true;
|
|
}) ? vnodes : null;
|
|
}
|
|
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
const ret = {};
|
|
for (const key in obj) {
|
|
ret[/[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
|
|
}
|
|
return ret;
|
|
}
|
|
const getPublicInstance = (i2) => {
|
|
if (!i2) return null;
|
|
if (isStatefulComponent(i2)) return getComponentPublicInstance(i2);
|
|
return getPublicInstance(i2.parent);
|
|
};
|
|
const publicPropertiesMap = (
|
|
// Move PURE marker to new line to workaround compiler discarding it
|
|
// due to type annotation
|
|
/* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
|
|
$: (i2) => i2,
|
|
$el: (i2) => i2.vnode.el,
|
|
$data: (i2) => i2.data,
|
|
$props: (i2) => i2.props,
|
|
$attrs: (i2) => i2.attrs,
|
|
$slots: (i2) => i2.slots,
|
|
$refs: (i2) => i2.refs,
|
|
$parent: (i2) => getPublicInstance(i2.parent),
|
|
$root: (i2) => getPublicInstance(i2.root),
|
|
$host: (i2) => i2.ce,
|
|
$emit: (i2) => i2.emit,
|
|
$options: (i2) => resolveMergedOptions(i2),
|
|
$forceUpdate: (i2) => i2.f || (i2.f = () => {
|
|
queueJob(i2.update);
|
|
}),
|
|
$nextTick: (i2) => i2.n || (i2.n = nextTick.bind(i2.proxy)),
|
|
$watch: (i2) => instanceWatch.bind(i2)
|
|
})
|
|
);
|
|
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
const PublicInstanceProxyHandlers = {
|
|
get({ _: instance }, key) {
|
|
if (key === "__v_skip") {
|
|
return true;
|
|
}
|
|
const { ctx, setupState, data: data3, props, accessCache, type, appContext } = instance;
|
|
if (key[0] !== "$") {
|
|
const n = accessCache[key];
|
|
if (n !== void 0) {
|
|
switch (n) {
|
|
case 1:
|
|
return setupState[key];
|
|
case 2:
|
|
return data3[key];
|
|
case 4:
|
|
return ctx[key];
|
|
case 3:
|
|
return props[key];
|
|
}
|
|
} else if (hasSetupBinding(setupState, key)) {
|
|
accessCache[key] = 1;
|
|
return setupState[key];
|
|
} else if (data3 !== EMPTY_OBJ && hasOwn(data3, key)) {
|
|
accessCache[key] = 2;
|
|
return data3[key];
|
|
} else if (hasOwn(props, key)) {
|
|
accessCache[key] = 3;
|
|
return props[key];
|
|
} else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
accessCache[key] = 4;
|
|
return ctx[key];
|
|
} else if (shouldCacheAccess) {
|
|
accessCache[key] = 0;
|
|
}
|
|
}
|
|
const publicGetter = publicPropertiesMap[key];
|
|
let cssModule, globalProperties;
|
|
if (publicGetter) {
|
|
if (key === "$attrs") {
|
|
track(instance.attrs, "get", "");
|
|
}
|
|
return publicGetter(instance);
|
|
} else if (
|
|
// css module (injected by vue-loader)
|
|
(cssModule = type.__cssModules) && (cssModule = cssModule[key])
|
|
) {
|
|
return cssModule;
|
|
} else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
|
accessCache[key] = 4;
|
|
return ctx[key];
|
|
} else if (
|
|
// global properties
|
|
globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
|
|
) {
|
|
{
|
|
return globalProperties[key];
|
|
}
|
|
} else ;
|
|
},
|
|
set({ _: instance }, key, value) {
|
|
const { data: data3, setupState, ctx } = instance;
|
|
if (hasSetupBinding(setupState, key)) {
|
|
setupState[key] = value;
|
|
return true;
|
|
} else if (data3 !== EMPTY_OBJ && hasOwn(data3, key)) {
|
|
data3[key] = value;
|
|
return true;
|
|
} else if (hasOwn(instance.props, key)) {
|
|
return false;
|
|
}
|
|
if (key[0] === "$" && key.slice(1) in instance) {
|
|
return false;
|
|
} else {
|
|
{
|
|
ctx[key] = value;
|
|
}
|
|
}
|
|
return true;
|
|
},
|
|
has({
|
|
_: { data: data3, setupState, accessCache, ctx, appContext, props, type }
|
|
}, key) {
|
|
let cssModules;
|
|
return !!(accessCache[key] || data3 !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data3, key) || hasSetupBinding(setupState, key) || hasOwn(props, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
|
|
},
|
|
defineProperty(target, key, descriptor) {
|
|
if (descriptor.get != null) {
|
|
target._.accessCache[key] = 0;
|
|
} else if (hasOwn(descriptor, "value")) {
|
|
this.set(target, key, descriptor.value, null);
|
|
}
|
|
return Reflect.defineProperty(target, key, descriptor);
|
|
}
|
|
};
|
|
function normalizePropsOrEmits(props) {
|
|
return isArray(props) ? props.reduce(
|
|
(normalized, p2) => (normalized[p2] = null, normalized),
|
|
{}
|
|
) : props;
|
|
}
|
|
let shouldCacheAccess = true;
|
|
function applyOptions(instance) {
|
|
const options = resolveMergedOptions(instance);
|
|
const publicThis = instance.proxy;
|
|
const ctx = instance.ctx;
|
|
shouldCacheAccess = false;
|
|
if (options.beforeCreate) {
|
|
callHook(options.beforeCreate, instance, "bc");
|
|
}
|
|
const {
|
|
// state
|
|
data: dataOptions,
|
|
computed: computedOptions,
|
|
methods,
|
|
watch: watchOptions,
|
|
provide: provideOptions,
|
|
inject: injectOptions,
|
|
// lifecycle
|
|
created: created3,
|
|
beforeMount: beforeMount2,
|
|
mounted: mounted3,
|
|
beforeUpdate: beforeUpdate2,
|
|
updated: updated2,
|
|
activated,
|
|
deactivated,
|
|
beforeDestroy,
|
|
beforeUnmount: beforeUnmount2,
|
|
destroyed,
|
|
unmounted: unmounted3,
|
|
render: render2,
|
|
renderTracked,
|
|
renderTriggered,
|
|
errorCaptured,
|
|
serverPrefetch,
|
|
// public API
|
|
expose,
|
|
inheritAttrs,
|
|
// assets
|
|
components,
|
|
directives,
|
|
filters
|
|
} = options;
|
|
const checkDuplicateProperties = null;
|
|
if (injectOptions) {
|
|
resolveInjections(injectOptions, ctx, checkDuplicateProperties);
|
|
}
|
|
if (methods) {
|
|
for (const key in methods) {
|
|
const methodHandler = methods[key];
|
|
if (isFunction(methodHandler)) {
|
|
{
|
|
ctx[key] = methodHandler.bind(publicThis);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (dataOptions) {
|
|
const data3 = dataOptions.call(publicThis, publicThis);
|
|
if (!isObject(data3)) ;
|
|
else {
|
|
instance.data = reactive(data3);
|
|
}
|
|
}
|
|
shouldCacheAccess = true;
|
|
if (computedOptions) {
|
|
for (const key in computedOptions) {
|
|
const opt = computedOptions[key];
|
|
const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
|
|
const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : NOOP;
|
|
const c2 = computed({
|
|
get,
|
|
set
|
|
});
|
|
Object.defineProperty(ctx, key, {
|
|
enumerable: true,
|
|
configurable: true,
|
|
get: () => c2.value,
|
|
set: (v2) => c2.value = v2
|
|
});
|
|
}
|
|
}
|
|
if (watchOptions) {
|
|
for (const key in watchOptions) {
|
|
createWatcher(watchOptions[key], ctx, publicThis, key);
|
|
}
|
|
}
|
|
if (provideOptions) {
|
|
const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
|
|
Reflect.ownKeys(provides).forEach((key) => {
|
|
provide(key, provides[key]);
|
|
});
|
|
}
|
|
if (created3) {
|
|
callHook(created3, instance, "c");
|
|
}
|
|
function registerLifecycleHook(register, hook) {
|
|
if (isArray(hook)) {
|
|
hook.forEach((_hook3) => register(_hook3.bind(publicThis)));
|
|
} else if (hook) {
|
|
register(hook.bind(publicThis));
|
|
}
|
|
}
|
|
registerLifecycleHook(onBeforeMount, beforeMount2);
|
|
registerLifecycleHook(onMounted, mounted3);
|
|
registerLifecycleHook(onBeforeUpdate, beforeUpdate2);
|
|
registerLifecycleHook(onUpdated, updated2);
|
|
registerLifecycleHook(onActivated, activated);
|
|
registerLifecycleHook(onDeactivated, deactivated);
|
|
registerLifecycleHook(onErrorCaptured, errorCaptured);
|
|
registerLifecycleHook(onRenderTracked, renderTracked);
|
|
registerLifecycleHook(onRenderTriggered, renderTriggered);
|
|
registerLifecycleHook(onBeforeUnmount, beforeUnmount2);
|
|
registerLifecycleHook(onUnmounted, unmounted3);
|
|
registerLifecycleHook(onServerPrefetch, serverPrefetch);
|
|
if (isArray(expose)) {
|
|
if (expose.length) {
|
|
const exposed = instance.exposed || (instance.exposed = {});
|
|
expose.forEach((key) => {
|
|
Object.defineProperty(exposed, key, {
|
|
get: () => publicThis[key],
|
|
set: (val) => publicThis[key] = val,
|
|
enumerable: true
|
|
});
|
|
});
|
|
} else if (!instance.exposed) {
|
|
instance.exposed = {};
|
|
}
|
|
}
|
|
if (render2 && instance.render === NOOP) {
|
|
instance.render = render2;
|
|
}
|
|
if (inheritAttrs != null) {
|
|
instance.inheritAttrs = inheritAttrs;
|
|
}
|
|
if (components) instance.components = components;
|
|
if (directives) instance.directives = directives;
|
|
if (serverPrefetch) {
|
|
markAsyncBoundary(instance);
|
|
}
|
|
}
|
|
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
|
|
if (isArray(injectOptions)) {
|
|
injectOptions = normalizeInject(injectOptions);
|
|
}
|
|
for (const key in injectOptions) {
|
|
const opt = injectOptions[key];
|
|
let injected;
|
|
if (isObject(opt)) {
|
|
if ("default" in opt) {
|
|
injected = inject(
|
|
opt.from || key,
|
|
opt.default,
|
|
true
|
|
);
|
|
} else {
|
|
injected = inject(opt.from || key);
|
|
}
|
|
} else {
|
|
injected = inject(opt);
|
|
}
|
|
if (isRef(injected)) {
|
|
Object.defineProperty(ctx, key, {
|
|
enumerable: true,
|
|
configurable: true,
|
|
get: () => injected.value,
|
|
set: (v2) => injected.value = v2
|
|
});
|
|
} else {
|
|
ctx[key] = injected;
|
|
}
|
|
}
|
|
}
|
|
function callHook(hook, instance, type) {
|
|
callWithAsyncErrorHandling(
|
|
isArray(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy),
|
|
instance,
|
|
type
|
|
);
|
|
}
|
|
function createWatcher(raw, ctx, publicThis, key) {
|
|
let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
|
|
if (isString(raw)) {
|
|
const handler9 = ctx[raw];
|
|
if (isFunction(handler9)) {
|
|
{
|
|
watch(getter, handler9);
|
|
}
|
|
}
|
|
} else if (isFunction(raw)) {
|
|
{
|
|
watch(getter, raw.bind(publicThis));
|
|
}
|
|
} else if (isObject(raw)) {
|
|
if (isArray(raw)) {
|
|
raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
} else {
|
|
const handler9 = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
if (isFunction(handler9)) {
|
|
watch(getter, handler9, raw);
|
|
}
|
|
}
|
|
} else ;
|
|
}
|
|
function resolveMergedOptions(instance) {
|
|
const base = instance.type;
|
|
const { mixins, extends: extendsOptions } = base;
|
|
const {
|
|
mixins: globalMixins,
|
|
optionsCache: cache,
|
|
config: { optionMergeStrategies }
|
|
} = instance.appContext;
|
|
const cached = cache.get(base);
|
|
let resolved;
|
|
if (cached) {
|
|
resolved = cached;
|
|
} else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
{
|
|
resolved = base;
|
|
}
|
|
} else {
|
|
resolved = {};
|
|
if (globalMixins.length) {
|
|
globalMixins.forEach(
|
|
(m2) => mergeOptions(resolved, m2, optionMergeStrategies, true)
|
|
);
|
|
}
|
|
mergeOptions(resolved, base, optionMergeStrategies);
|
|
}
|
|
if (isObject(base)) {
|
|
cache.set(base, resolved);
|
|
}
|
|
return resolved;
|
|
}
|
|
function mergeOptions(to, from, strats, asMixin = false) {
|
|
const { mixins, extends: extendsOptions } = from;
|
|
if (extendsOptions) {
|
|
mergeOptions(to, extendsOptions, strats, true);
|
|
}
|
|
if (mixins) {
|
|
mixins.forEach(
|
|
(m2) => mergeOptions(to, m2, strats, true)
|
|
);
|
|
}
|
|
for (const key in from) {
|
|
if (asMixin && key === "expose") ;
|
|
else {
|
|
const strat = internalOptionMergeStrats[key] || strats && strats[key];
|
|
to[key] = strat ? strat(to[key], from[key]) : from[key];
|
|
}
|
|
}
|
|
return to;
|
|
}
|
|
const internalOptionMergeStrats = {
|
|
data: mergeDataFn,
|
|
props: mergeEmitsOrPropsOptions,
|
|
emits: mergeEmitsOrPropsOptions,
|
|
// objects
|
|
methods: mergeObjectOptions,
|
|
computed: mergeObjectOptions,
|
|
// lifecycle
|
|
beforeCreate: mergeAsArray,
|
|
created: mergeAsArray,
|
|
beforeMount: mergeAsArray,
|
|
mounted: mergeAsArray,
|
|
beforeUpdate: mergeAsArray,
|
|
updated: mergeAsArray,
|
|
beforeDestroy: mergeAsArray,
|
|
beforeUnmount: mergeAsArray,
|
|
destroyed: mergeAsArray,
|
|
unmounted: mergeAsArray,
|
|
activated: mergeAsArray,
|
|
deactivated: mergeAsArray,
|
|
errorCaptured: mergeAsArray,
|
|
serverPrefetch: mergeAsArray,
|
|
// assets
|
|
components: mergeObjectOptions,
|
|
directives: mergeObjectOptions,
|
|
// watch
|
|
watch: mergeWatchOptions,
|
|
// provide / inject
|
|
provide: mergeDataFn,
|
|
inject: mergeInject
|
|
};
|
|
function mergeDataFn(to, from) {
|
|
if (!from) {
|
|
return to;
|
|
}
|
|
if (!to) {
|
|
return from;
|
|
}
|
|
return function mergedDataFn() {
|
|
return extend(
|
|
isFunction(to) ? to.call(this, this) : to,
|
|
isFunction(from) ? from.call(this, this) : from
|
|
);
|
|
};
|
|
}
|
|
function mergeInject(to, from) {
|
|
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
|
|
}
|
|
function normalizeInject(raw) {
|
|
if (isArray(raw)) {
|
|
const res = {};
|
|
for (let i2 = 0; i2 < raw.length; i2++) {
|
|
res[raw[i2]] = raw[i2];
|
|
}
|
|
return res;
|
|
}
|
|
return raw;
|
|
}
|
|
function mergeAsArray(to, from) {
|
|
return to ? [...new Set([].concat(to, from))] : from;
|
|
}
|
|
function mergeObjectOptions(to, from) {
|
|
return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
|
|
}
|
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
if (to) {
|
|
if (isArray(to) && isArray(from)) {
|
|
return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
}
|
|
return extend(
|
|
/* @__PURE__ */ Object.create(null),
|
|
normalizePropsOrEmits(to),
|
|
normalizePropsOrEmits(from != null ? from : {})
|
|
);
|
|
} else {
|
|
return from;
|
|
}
|
|
}
|
|
function mergeWatchOptions(to, from) {
|
|
if (!to) return from;
|
|
if (!from) return to;
|
|
const merged = extend(/* @__PURE__ */ Object.create(null), to);
|
|
for (const key in from) {
|
|
merged[key] = mergeAsArray(to[key], from[key]);
|
|
}
|
|
return merged;
|
|
}
|
|
function createAppContext() {
|
|
return {
|
|
app: null,
|
|
config: {
|
|
isNativeTag: NO,
|
|
performance: false,
|
|
globalProperties: {},
|
|
optionMergeStrategies: {},
|
|
errorHandler: void 0,
|
|
warnHandler: void 0,
|
|
compilerOptions: {}
|
|
},
|
|
mixins: [],
|
|
components: {},
|
|
directives: {},
|
|
provides: /* @__PURE__ */ Object.create(null),
|
|
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
};
|
|
}
|
|
let uid$1 = 0;
|
|
function createAppAPI(render2, hydrate) {
|
|
return function createApp2(rootComponent, rootProps = null) {
|
|
if (!isFunction(rootComponent)) {
|
|
rootComponent = extend({}, rootComponent);
|
|
}
|
|
if (rootProps != null && !isObject(rootProps)) {
|
|
rootProps = null;
|
|
}
|
|
const context = createAppContext();
|
|
const installedPlugins = /* @__PURE__ */ new WeakSet();
|
|
const pluginCleanupFns = [];
|
|
let isMounted = false;
|
|
const app2 = context.app = {
|
|
_uid: uid$1++,
|
|
_component: rootComponent,
|
|
_props: rootProps,
|
|
_container: null,
|
|
_context: context,
|
|
_instance: null,
|
|
version,
|
|
get config() {
|
|
return context.config;
|
|
},
|
|
set config(v2) {
|
|
},
|
|
use(plugin, ...options) {
|
|
if (installedPlugins.has(plugin)) ;
|
|
else if (plugin && isFunction(plugin.install)) {
|
|
installedPlugins.add(plugin);
|
|
plugin.install(app2, ...options);
|
|
} else if (isFunction(plugin)) {
|
|
installedPlugins.add(plugin);
|
|
plugin(app2, ...options);
|
|
} else ;
|
|
return app2;
|
|
},
|
|
mixin(mixin) {
|
|
{
|
|
if (!context.mixins.includes(mixin)) {
|
|
context.mixins.push(mixin);
|
|
}
|
|
}
|
|
return app2;
|
|
},
|
|
component(name, component) {
|
|
if (!component) {
|
|
return context.components[name];
|
|
}
|
|
context.components[name] = component;
|
|
return app2;
|
|
},
|
|
directive(name, directive) {
|
|
if (!directive) {
|
|
return context.directives[name];
|
|
}
|
|
context.directives[name] = directive;
|
|
return app2;
|
|
},
|
|
mount(rootContainer, isHydrate, namespace) {
|
|
if (!isMounted) {
|
|
const vnode = app2._ceVNode || createVNode(rootComponent, rootProps);
|
|
vnode.appContext = context;
|
|
if (namespace === true) {
|
|
namespace = "svg";
|
|
} else if (namespace === false) {
|
|
namespace = void 0;
|
|
}
|
|
{
|
|
render2(vnode, rootContainer, namespace);
|
|
}
|
|
isMounted = true;
|
|
app2._container = rootContainer;
|
|
rootContainer.__vue_app__ = app2;
|
|
return getComponentPublicInstance(vnode.component);
|
|
}
|
|
},
|
|
onUnmount(cleanupFn) {
|
|
pluginCleanupFns.push(cleanupFn);
|
|
},
|
|
unmount() {
|
|
if (isMounted) {
|
|
callWithAsyncErrorHandling(
|
|
pluginCleanupFns,
|
|
app2._instance,
|
|
16
|
|
);
|
|
render2(null, app2._container);
|
|
delete app2._container.__vue_app__;
|
|
}
|
|
},
|
|
provide(key, value) {
|
|
context.provides[key] = value;
|
|
return app2;
|
|
},
|
|
runWithContext(fn) {
|
|
const lastApp = currentApp;
|
|
currentApp = app2;
|
|
try {
|
|
return fn();
|
|
} finally {
|
|
currentApp = lastApp;
|
|
}
|
|
}
|
|
};
|
|
return app2;
|
|
};
|
|
}
|
|
let currentApp = null;
|
|
const getModelModifiers = (props, modelName) => {
|
|
return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
|
|
};
|
|
function emit(instance, event, ...rawArgs) {
|
|
if (instance.isUnmounted) return;
|
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
let args = rawArgs;
|
|
const isModelListener2 = event.startsWith("update:");
|
|
const modifiers = isModelListener2 && getModelModifiers(props, event.slice(7));
|
|
if (modifiers) {
|
|
if (modifiers.trim) {
|
|
args = rawArgs.map((a2) => isString(a2) ? a2.trim() : a2);
|
|
}
|
|
if (modifiers.number) {
|
|
args = rawArgs.map(looseToNumber);
|
|
}
|
|
}
|
|
let handlerName;
|
|
let handler9 = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
|
|
props[handlerName = toHandlerKey(camelize(event))];
|
|
if (!handler9 && isModelListener2) {
|
|
handler9 = props[handlerName = toHandlerKey(hyphenate(event))];
|
|
}
|
|
if (handler9) {
|
|
callWithAsyncErrorHandling(
|
|
handler9,
|
|
instance,
|
|
6,
|
|
args
|
|
);
|
|
}
|
|
const onceHandler = props[handlerName + `Once`];
|
|
if (onceHandler) {
|
|
if (!instance.emitted) {
|
|
instance.emitted = {};
|
|
} else if (instance.emitted[handlerName]) {
|
|
return;
|
|
}
|
|
instance.emitted[handlerName] = true;
|
|
callWithAsyncErrorHandling(
|
|
onceHandler,
|
|
instance,
|
|
6,
|
|
args
|
|
);
|
|
}
|
|
}
|
|
const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
|
|
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
|
|
const cached = cache.get(comp);
|
|
if (cached !== void 0) {
|
|
return cached;
|
|
}
|
|
const raw = comp.emits;
|
|
let normalized = {};
|
|
let hasExtends = false;
|
|
if (!isFunction(comp)) {
|
|
const extendEmits = (raw2) => {
|
|
const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
|
|
if (normalizedFromExtend) {
|
|
hasExtends = true;
|
|
extend(normalized, normalizedFromExtend);
|
|
}
|
|
};
|
|
if (!asMixin && appContext.mixins.length) {
|
|
appContext.mixins.forEach(extendEmits);
|
|
}
|
|
if (comp.extends) {
|
|
extendEmits(comp.extends);
|
|
}
|
|
if (comp.mixins) {
|
|
comp.mixins.forEach(extendEmits);
|
|
}
|
|
}
|
|
if (!raw && !hasExtends) {
|
|
if (isObject(comp)) {
|
|
cache.set(comp, null);
|
|
}
|
|
return null;
|
|
}
|
|
if (isArray(raw)) {
|
|
raw.forEach((key) => normalized[key] = null);
|
|
} else {
|
|
extend(normalized, raw);
|
|
}
|
|
if (isObject(comp)) {
|
|
cache.set(comp, normalized);
|
|
}
|
|
return normalized;
|
|
}
|
|
function isEmitListener(options, key) {
|
|
if (!options || !isOn(key)) {
|
|
return false;
|
|
}
|
|
key = key.slice(2).replace(/Once$/, "");
|
|
return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
|
|
}
|
|
function markAttrsAccessed() {
|
|
}
|
|
function renderComponentRoot(instance) {
|
|
const {
|
|
type: Component,
|
|
vnode,
|
|
proxy,
|
|
withProxy,
|
|
propsOptions: [propsOptions],
|
|
slots,
|
|
attrs: attrs3,
|
|
emit: emit2,
|
|
render: render2,
|
|
renderCache,
|
|
props,
|
|
data: data3,
|
|
setupState,
|
|
ctx,
|
|
inheritAttrs
|
|
} = instance;
|
|
const prev = setCurrentRenderingInstance(instance);
|
|
let result;
|
|
let fallthroughAttrs;
|
|
try {
|
|
if (vnode.shapeFlag & 4) {
|
|
const proxyToUse = withProxy || proxy;
|
|
const thisProxy = false ? new Proxy(proxyToUse, {
|
|
get(target, key, receiver) {
|
|
warn$1(
|
|
`Property '${String(
|
|
key
|
|
)}' was accessed via 'this'. Avoid using 'this' in templates.`
|
|
);
|
|
return Reflect.get(target, key, receiver);
|
|
}
|
|
}) : proxyToUse;
|
|
result = normalizeVNode(
|
|
render2.call(
|
|
thisProxy,
|
|
proxyToUse,
|
|
renderCache,
|
|
false ? shallowReadonly(props) : props,
|
|
setupState,
|
|
data3,
|
|
ctx
|
|
)
|
|
);
|
|
fallthroughAttrs = attrs3;
|
|
} else {
|
|
const render22 = Component;
|
|
if (false) ;
|
|
result = normalizeVNode(
|
|
render22.length > 1 ? render22(
|
|
false ? shallowReadonly(props) : props,
|
|
false ? {
|
|
get attrs() {
|
|
markAttrsAccessed();
|
|
return shallowReadonly(attrs3);
|
|
},
|
|
slots,
|
|
emit: emit2
|
|
} : { attrs: attrs3, slots, emit: emit2 }
|
|
) : render22(
|
|
false ? shallowReadonly(props) : props,
|
|
null
|
|
)
|
|
);
|
|
fallthroughAttrs = Component.props ? attrs3 : getFunctionalFallthrough(attrs3);
|
|
}
|
|
} catch (err) {
|
|
blockStack.length = 0;
|
|
handleError(err, instance, 1);
|
|
result = createVNode(Comment);
|
|
}
|
|
let root5 = result;
|
|
if (fallthroughAttrs && inheritAttrs !== false) {
|
|
const keys = Object.keys(fallthroughAttrs);
|
|
const { shapeFlag } = root5;
|
|
if (keys.length) {
|
|
if (shapeFlag & (1 | 6)) {
|
|
if (propsOptions && keys.some(isModelListener)) {
|
|
fallthroughAttrs = filterModelListeners(
|
|
fallthroughAttrs,
|
|
propsOptions
|
|
);
|
|
}
|
|
root5 = cloneVNode(root5, fallthroughAttrs, false, true);
|
|
}
|
|
}
|
|
}
|
|
if (vnode.dirs) {
|
|
root5 = cloneVNode(root5, null, false, true);
|
|
root5.dirs = root5.dirs ? root5.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
}
|
|
if (vnode.transition) {
|
|
setTransitionHooks(root5, vnode.transition);
|
|
}
|
|
{
|
|
result = root5;
|
|
}
|
|
setCurrentRenderingInstance(prev);
|
|
return result;
|
|
}
|
|
const getFunctionalFallthrough = (attrs3) => {
|
|
let res;
|
|
for (const key in attrs3) {
|
|
if (key === "class" || key === "style" || isOn(key)) {
|
|
(res || (res = {}))[key] = attrs3[key];
|
|
}
|
|
}
|
|
return res;
|
|
};
|
|
const filterModelListeners = (attrs3, props) => {
|
|
const res = {};
|
|
for (const key in attrs3) {
|
|
if (!isModelListener(key) || !(key.slice(9) in props)) {
|
|
res[key] = attrs3[key];
|
|
}
|
|
}
|
|
return res;
|
|
};
|
|
function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
|
|
const { props: prevProps, children: prevChildren, component } = prevVNode;
|
|
const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
|
|
const emits = component.emitsOptions;
|
|
if (nextVNode.dirs || nextVNode.transition) {
|
|
return true;
|
|
}
|
|
if (optimized && patchFlag >= 0) {
|
|
if (patchFlag & 1024) {
|
|
return true;
|
|
}
|
|
if (patchFlag & 16) {
|
|
if (!prevProps) {
|
|
return !!nextProps;
|
|
}
|
|
return hasPropsChanged(prevProps, nextProps, emits);
|
|
} else if (patchFlag & 8) {
|
|
const dynamicProps = nextVNode.dynamicProps;
|
|
for (let i2 = 0; i2 < dynamicProps.length; i2++) {
|
|
const key = dynamicProps[i2];
|
|
if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
if (prevChildren || nextChildren) {
|
|
if (!nextChildren || !nextChildren.$stable) {
|
|
return true;
|
|
}
|
|
}
|
|
if (prevProps === nextProps) {
|
|
return false;
|
|
}
|
|
if (!prevProps) {
|
|
return !!nextProps;
|
|
}
|
|
if (!nextProps) {
|
|
return true;
|
|
}
|
|
return hasPropsChanged(prevProps, nextProps, emits);
|
|
}
|
|
return false;
|
|
}
|
|
function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
const nextKeys = Object.keys(nextProps);
|
|
if (nextKeys.length !== Object.keys(prevProps).length) {
|
|
return true;
|
|
}
|
|
for (let i2 = 0; i2 < nextKeys.length; i2++) {
|
|
const key = nextKeys[i2];
|
|
if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function updateHOCHostEl({ vnode, parent }, el) {
|
|
while (parent) {
|
|
const root5 = parent.subTree;
|
|
if (root5.suspense && root5.suspense.activeBranch === vnode) {
|
|
root5.el = vnode.el;
|
|
}
|
|
if (root5 === vnode) {
|
|
(vnode = parent.vnode).el = el;
|
|
parent = parent.parent;
|
|
} else {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
const internalObjectProto = {};
|
|
const createInternalObject = () => Object.create(internalObjectProto);
|
|
const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
|
|
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
const props = {};
|
|
const attrs3 = createInternalObject();
|
|
instance.propsDefaults = /* @__PURE__ */ Object.create(null);
|
|
setFullProps(instance, rawProps, props, attrs3);
|
|
for (const key in instance.propsOptions[0]) {
|
|
if (!(key in props)) {
|
|
props[key] = void 0;
|
|
}
|
|
}
|
|
if (isStateful) {
|
|
instance.props = isSSR ? props : shallowReactive(props);
|
|
} else {
|
|
if (!instance.type.props) {
|
|
instance.props = attrs3;
|
|
} else {
|
|
instance.props = props;
|
|
}
|
|
}
|
|
instance.attrs = attrs3;
|
|
}
|
|
function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
const {
|
|
props,
|
|
attrs: attrs3,
|
|
vnode: { patchFlag }
|
|
} = instance;
|
|
const rawCurrentProps = toRaw(props);
|
|
const [options] = instance.propsOptions;
|
|
let hasAttrsChanged = false;
|
|
if (
|
|
// always force full diff in dev
|
|
// - #1942 if hmr is enabled with sfc component
|
|
// - vite#872 non-sfc component used by sfc component
|
|
(optimized || patchFlag > 0) && !(patchFlag & 16)
|
|
) {
|
|
if (patchFlag & 8) {
|
|
const propsToUpdate = instance.vnode.dynamicProps;
|
|
for (let i2 = 0; i2 < propsToUpdate.length; i2++) {
|
|
let key = propsToUpdate[i2];
|
|
if (isEmitListener(instance.emitsOptions, key)) {
|
|
continue;
|
|
}
|
|
const value = rawProps[key];
|
|
if (options) {
|
|
if (hasOwn(attrs3, key)) {
|
|
if (value !== attrs3[key]) {
|
|
attrs3[key] = value;
|
|
hasAttrsChanged = true;
|
|
}
|
|
} else {
|
|
const camelizedKey = camelize(key);
|
|
props[camelizedKey] = resolvePropValue(
|
|
options,
|
|
rawCurrentProps,
|
|
camelizedKey,
|
|
value,
|
|
instance,
|
|
false
|
|
);
|
|
}
|
|
} else {
|
|
if (value !== attrs3[key]) {
|
|
attrs3[key] = value;
|
|
hasAttrsChanged = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
if (setFullProps(instance, rawProps, props, attrs3)) {
|
|
hasAttrsChanged = true;
|
|
}
|
|
let kebabKey;
|
|
for (const key in rawCurrentProps) {
|
|
if (!rawProps || // for camelCase
|
|
!hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
|
|
// and converted to camelCase (#955)
|
|
((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
|
|
if (options) {
|
|
if (rawPrevProps && // for camelCase
|
|
(rawPrevProps[key] !== void 0 || // for kebab-case
|
|
rawPrevProps[kebabKey] !== void 0)) {
|
|
props[key] = resolvePropValue(
|
|
options,
|
|
rawCurrentProps,
|
|
key,
|
|
void 0,
|
|
instance,
|
|
true
|
|
);
|
|
}
|
|
} else {
|
|
delete props[key];
|
|
}
|
|
}
|
|
}
|
|
if (attrs3 !== rawCurrentProps) {
|
|
for (const key in attrs3) {
|
|
if (!rawProps || !hasOwn(rawProps, key) && true) {
|
|
delete attrs3[key];
|
|
hasAttrsChanged = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (hasAttrsChanged) {
|
|
trigger(instance.attrs, "set", "");
|
|
}
|
|
}
|
|
function setFullProps(instance, rawProps, props, attrs3) {
|
|
const [options, needCastKeys] = instance.propsOptions;
|
|
let hasAttrsChanged = false;
|
|
let rawCastValues;
|
|
if (rawProps) {
|
|
for (let key in rawProps) {
|
|
if (isReservedProp(key)) {
|
|
continue;
|
|
}
|
|
const value = rawProps[key];
|
|
let camelKey;
|
|
if (options && hasOwn(options, camelKey = camelize(key))) {
|
|
if (!needCastKeys || !needCastKeys.includes(camelKey)) {
|
|
props[camelKey] = value;
|
|
} else {
|
|
(rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
}
|
|
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
if (!(key in attrs3) || value !== attrs3[key]) {
|
|
attrs3[key] = value;
|
|
hasAttrsChanged = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (needCastKeys) {
|
|
const rawCurrentProps = toRaw(props);
|
|
const castValues = rawCastValues || EMPTY_OBJ;
|
|
for (let i2 = 0; i2 < needCastKeys.length; i2++) {
|
|
const key = needCastKeys[i2];
|
|
props[key] = resolvePropValue(
|
|
options,
|
|
rawCurrentProps,
|
|
key,
|
|
castValues[key],
|
|
instance,
|
|
!hasOwn(castValues, key)
|
|
);
|
|
}
|
|
}
|
|
return hasAttrsChanged;
|
|
}
|
|
function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
const opt = options[key];
|
|
if (opt != null) {
|
|
const hasDefault = hasOwn(opt, "default");
|
|
if (hasDefault && value === void 0) {
|
|
const defaultValue2 = opt.default;
|
|
if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue2)) {
|
|
const { propsDefaults } = instance;
|
|
if (key in propsDefaults) {
|
|
value = propsDefaults[key];
|
|
} else {
|
|
const reset = setCurrentInstance(instance);
|
|
value = propsDefaults[key] = defaultValue2.call(
|
|
null,
|
|
props
|
|
);
|
|
reset();
|
|
}
|
|
} else {
|
|
value = defaultValue2;
|
|
}
|
|
if (instance.ce) {
|
|
instance.ce._setProp(key, value);
|
|
}
|
|
}
|
|
if (opt[
|
|
0
|
|
/* shouldCast */
|
|
]) {
|
|
if (isAbsent && !hasDefault) {
|
|
value = false;
|
|
} else if (opt[
|
|
1
|
|
/* shouldCastTrue */
|
|
] && (value === "" || value === hyphenate(key))) {
|
|
value = true;
|
|
}
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
const cache = asMixin ? mixinPropsCache : appContext.propsCache;
|
|
const cached = cache.get(comp);
|
|
if (cached) {
|
|
return cached;
|
|
}
|
|
const raw = comp.props;
|
|
const normalized = {};
|
|
const needCastKeys = [];
|
|
let hasExtends = false;
|
|
if (!isFunction(comp)) {
|
|
const extendProps = (raw2) => {
|
|
hasExtends = true;
|
|
const [props, keys] = normalizePropsOptions(raw2, appContext, true);
|
|
extend(normalized, props);
|
|
if (keys) needCastKeys.push(...keys);
|
|
};
|
|
if (!asMixin && appContext.mixins.length) {
|
|
appContext.mixins.forEach(extendProps);
|
|
}
|
|
if (comp.extends) {
|
|
extendProps(comp.extends);
|
|
}
|
|
if (comp.mixins) {
|
|
comp.mixins.forEach(extendProps);
|
|
}
|
|
}
|
|
if (!raw && !hasExtends) {
|
|
if (isObject(comp)) {
|
|
cache.set(comp, EMPTY_ARR);
|
|
}
|
|
return EMPTY_ARR;
|
|
}
|
|
if (isArray(raw)) {
|
|
for (let i2 = 0; i2 < raw.length; i2++) {
|
|
const normalizedKey = camelize(raw[i2]);
|
|
if (validatePropName(normalizedKey)) {
|
|
normalized[normalizedKey] = EMPTY_OBJ;
|
|
}
|
|
}
|
|
} else if (raw) {
|
|
for (const key in raw) {
|
|
const normalizedKey = camelize(key);
|
|
if (validatePropName(normalizedKey)) {
|
|
const opt = raw[key];
|
|
const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
|
|
const propType = prop.type;
|
|
let shouldCast = false;
|
|
let shouldCastTrue = true;
|
|
if (isArray(propType)) {
|
|
for (let index = 0; index < propType.length; ++index) {
|
|
const type = propType[index];
|
|
const typeName = isFunction(type) && type.name;
|
|
if (typeName === "Boolean") {
|
|
shouldCast = true;
|
|
break;
|
|
} else if (typeName === "String") {
|
|
shouldCastTrue = false;
|
|
}
|
|
}
|
|
} else {
|
|
shouldCast = isFunction(propType) && propType.name === "Boolean";
|
|
}
|
|
prop[
|
|
0
|
|
/* shouldCast */
|
|
] = shouldCast;
|
|
prop[
|
|
1
|
|
/* shouldCastTrue */
|
|
] = shouldCastTrue;
|
|
if (shouldCast || hasOwn(prop, "default")) {
|
|
needCastKeys.push(normalizedKey);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const res = [normalized, needCastKeys];
|
|
if (isObject(comp)) {
|
|
cache.set(comp, res);
|
|
}
|
|
return res;
|
|
}
|
|
function validatePropName(key) {
|
|
if (key[0] !== "$" && !isReservedProp(key)) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
|
|
const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
|
const normalizeSlot = (key, rawSlot, ctx) => {
|
|
if (rawSlot._n) {
|
|
return rawSlot;
|
|
}
|
|
const normalized = withCtx((...args) => {
|
|
if (false) ;
|
|
return normalizeSlotValue(rawSlot(...args));
|
|
}, ctx);
|
|
normalized._c = false;
|
|
return normalized;
|
|
};
|
|
const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
const ctx = rawSlots._ctx;
|
|
for (const key in rawSlots) {
|
|
if (isInternalKey(key)) continue;
|
|
const value = rawSlots[key];
|
|
if (isFunction(value)) {
|
|
slots[key] = normalizeSlot(key, value, ctx);
|
|
} else if (value != null) {
|
|
const normalized = normalizeSlotValue(value);
|
|
slots[key] = () => normalized;
|
|
}
|
|
}
|
|
};
|
|
const normalizeVNodeSlots = (instance, children) => {
|
|
const normalized = normalizeSlotValue(children);
|
|
instance.slots.default = () => normalized;
|
|
};
|
|
const assignSlots = (slots, children, optimized) => {
|
|
for (const key in children) {
|
|
if (optimized || !isInternalKey(key)) {
|
|
slots[key] = children[key];
|
|
}
|
|
}
|
|
};
|
|
const initSlots = (instance, children, optimized) => {
|
|
const slots = instance.slots = createInternalObject();
|
|
if (instance.vnode.shapeFlag & 32) {
|
|
const type = children._;
|
|
if (type) {
|
|
assignSlots(slots, children, optimized);
|
|
if (optimized) {
|
|
def(slots, "_", type, true);
|
|
}
|
|
} else {
|
|
normalizeObjectSlots(children, slots);
|
|
}
|
|
} else if (children) {
|
|
normalizeVNodeSlots(instance, children);
|
|
}
|
|
};
|
|
const updateSlots = (instance, children, optimized) => {
|
|
const { vnode, slots } = instance;
|
|
let needDeletionCheck = true;
|
|
let deletionComparisonTarget = EMPTY_OBJ;
|
|
if (vnode.shapeFlag & 32) {
|
|
const type = children._;
|
|
if (type) {
|
|
if (optimized && type === 1) {
|
|
needDeletionCheck = false;
|
|
} else {
|
|
assignSlots(slots, children, optimized);
|
|
}
|
|
} else {
|
|
needDeletionCheck = !children.$stable;
|
|
normalizeObjectSlots(children, slots);
|
|
}
|
|
deletionComparisonTarget = children;
|
|
} else if (children) {
|
|
normalizeVNodeSlots(instance, children);
|
|
deletionComparisonTarget = { default: 1 };
|
|
}
|
|
if (needDeletionCheck) {
|
|
for (const key in slots) {
|
|
if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
|
|
delete slots[key];
|
|
}
|
|
}
|
|
}
|
|
};
|
|
const queuePostRenderEffect = queueEffectWithSuspense;
|
|
function createRenderer(options) {
|
|
return baseCreateRenderer(options);
|
|
}
|
|
function baseCreateRenderer(options, createHydrationFns) {
|
|
const target = getGlobalThis();
|
|
target.__VUE__ = true;
|
|
const {
|
|
insert: hostInsert,
|
|
remove: hostRemove,
|
|
patchProp: hostPatchProp,
|
|
createElement: hostCreateElement,
|
|
createText: hostCreateText,
|
|
createComment: hostCreateComment,
|
|
setText: hostSetText,
|
|
setElementText: hostSetElementText,
|
|
parentNode: hostParentNode,
|
|
nextSibling: hostNextSibling,
|
|
setScopeId: hostSetScopeId = NOOP,
|
|
insertStaticContent: hostInsertStaticContent
|
|
} = options;
|
|
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
|
|
if (n1 === n2) {
|
|
return;
|
|
}
|
|
if (n1 && !isSameVNodeType(n1, n2)) {
|
|
anchor = getNextHostNode(n1);
|
|
unmount(n1, parentComponent, parentSuspense, true);
|
|
n1 = null;
|
|
}
|
|
if (n2.patchFlag === -2) {
|
|
optimized = false;
|
|
n2.dynamicChildren = null;
|
|
}
|
|
const { type, ref: ref3, shapeFlag } = n2;
|
|
switch (type) {
|
|
case Text:
|
|
processText(n1, n2, container, anchor);
|
|
break;
|
|
case Comment:
|
|
processCommentNode(n1, n2, container, anchor);
|
|
break;
|
|
case Static:
|
|
if (n1 == null) {
|
|
mountStaticNode(n2, container, anchor, namespace);
|
|
}
|
|
break;
|
|
case Fragment:
|
|
processFragment(
|
|
n1,
|
|
n2,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
break;
|
|
default:
|
|
if (shapeFlag & 1) {
|
|
processElement(
|
|
n1,
|
|
n2,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
} else if (shapeFlag & 6) {
|
|
processComponent(
|
|
n1,
|
|
n2,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
} else if (shapeFlag & 64) {
|
|
type.process(
|
|
n1,
|
|
n2,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized,
|
|
internals
|
|
);
|
|
} else if (shapeFlag & 128) {
|
|
type.process(
|
|
n1,
|
|
n2,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized,
|
|
internals
|
|
);
|
|
} else ;
|
|
}
|
|
if (ref3 != null && parentComponent) {
|
|
setRef(ref3, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
|
|
} else if (ref3 == null && n1 && n1.ref != null) {
|
|
setRef(n1.ref, null, parentSuspense, n1, true);
|
|
}
|
|
};
|
|
const processText = (n1, n2, container, anchor) => {
|
|
if (n1 == null) {
|
|
hostInsert(
|
|
n2.el = hostCreateText(n2.children),
|
|
container,
|
|
anchor
|
|
);
|
|
} else {
|
|
const el = n2.el = n1.el;
|
|
if (n2.children !== n1.children) {
|
|
{
|
|
hostSetText(el, n2.children);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
const processCommentNode = (n1, n2, container, anchor) => {
|
|
if (n1 == null) {
|
|
hostInsert(
|
|
n2.el = hostCreateComment(n2.children || ""),
|
|
container,
|
|
anchor
|
|
);
|
|
} else {
|
|
n2.el = n1.el;
|
|
}
|
|
};
|
|
const mountStaticNode = (n2, container, anchor, namespace) => {
|
|
[n2.el, n2.anchor] = hostInsertStaticContent(
|
|
n2.children,
|
|
container,
|
|
anchor,
|
|
namespace,
|
|
n2.el,
|
|
n2.anchor
|
|
);
|
|
};
|
|
const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
|
|
let next;
|
|
while (el && el !== anchor) {
|
|
next = hostNextSibling(el);
|
|
hostInsert(el, container, nextSibling);
|
|
el = next;
|
|
}
|
|
hostInsert(anchor, container, nextSibling);
|
|
};
|
|
const removeStaticNode = ({ el, anchor }) => {
|
|
let next;
|
|
while (el && el !== anchor) {
|
|
next = hostNextSibling(el);
|
|
hostRemove(el);
|
|
el = next;
|
|
}
|
|
hostRemove(anchor);
|
|
};
|
|
const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
if (n2.type === "svg") {
|
|
namespace = "svg";
|
|
} else if (n2.type === "math") {
|
|
namespace = "mathml";
|
|
}
|
|
if (n1 == null) {
|
|
mountElement(
|
|
n2,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
} else {
|
|
const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
|
|
try {
|
|
if (customElement) {
|
|
customElement._beginPatch();
|
|
}
|
|
patchElement(
|
|
n1,
|
|
n2,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
} finally {
|
|
if (customElement) {
|
|
customElement._endPatch();
|
|
}
|
|
}
|
|
}
|
|
};
|
|
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
let el;
|
|
let vnodeHook;
|
|
const { props, shapeFlag, transition, dirs } = vnode;
|
|
el = vnode.el = hostCreateElement(
|
|
vnode.type,
|
|
namespace,
|
|
props && props.is,
|
|
props
|
|
);
|
|
if (shapeFlag & 8) {
|
|
hostSetElementText(el, vnode.children);
|
|
} else if (shapeFlag & 16) {
|
|
mountChildren(
|
|
vnode.children,
|
|
el,
|
|
null,
|
|
parentComponent,
|
|
parentSuspense,
|
|
resolveChildrenNamespace(vnode, namespace),
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
}
|
|
if (dirs) {
|
|
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
}
|
|
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
if (props) {
|
|
for (const key in props) {
|
|
if (key !== "value" && !isReservedProp(key)) {
|
|
hostPatchProp(el, key, null, props[key], namespace, parentComponent);
|
|
}
|
|
}
|
|
if ("value" in props) {
|
|
hostPatchProp(el, "value", null, props.value, namespace);
|
|
}
|
|
if (vnodeHook = props.onVnodeBeforeMount) {
|
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
}
|
|
}
|
|
if (dirs) {
|
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
}
|
|
const needCallTransitionHooks = needTransition(parentSuspense, transition);
|
|
if (needCallTransitionHooks) {
|
|
transition.beforeEnter(el);
|
|
}
|
|
hostInsert(el, container, anchor);
|
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
queuePostRenderEffect(() => {
|
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
needCallTransitionHooks && transition.enter(el);
|
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
}, parentSuspense);
|
|
}
|
|
};
|
|
const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
|
|
if (scopeId) {
|
|
hostSetScopeId(el, scopeId);
|
|
}
|
|
if (slotScopeIds) {
|
|
for (let i2 = 0; i2 < slotScopeIds.length; i2++) {
|
|
hostSetScopeId(el, slotScopeIds[i2]);
|
|
}
|
|
}
|
|
if (parentComponent) {
|
|
let subTree = parentComponent.subTree;
|
|
if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
|
|
const parentVNode = parentComponent.vnode;
|
|
setScopeId(
|
|
el,
|
|
parentVNode,
|
|
parentVNode.scopeId,
|
|
parentVNode.slotScopeIds,
|
|
parentComponent.parent
|
|
);
|
|
}
|
|
}
|
|
};
|
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
for (let i2 = start; i2 < children.length; i2++) {
|
|
const child = children[i2] = optimized ? cloneIfMounted(children[i2]) : normalizeVNode(children[i2]);
|
|
patch(
|
|
null,
|
|
child,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
}
|
|
};
|
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
const el = n2.el = n1.el;
|
|
let { patchFlag, dynamicChildren, dirs } = n2;
|
|
patchFlag |= n1.patchFlag & 16;
|
|
const oldProps = n1.props || EMPTY_OBJ;
|
|
const newProps = n2.props || EMPTY_OBJ;
|
|
let vnodeHook;
|
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) {
|
|
invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
}
|
|
if (dirs) {
|
|
invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
}
|
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
|
|
hostSetElementText(el, "");
|
|
}
|
|
if (dynamicChildren) {
|
|
patchBlockChildren(
|
|
n1.dynamicChildren,
|
|
dynamicChildren,
|
|
el,
|
|
parentComponent,
|
|
parentSuspense,
|
|
resolveChildrenNamespace(n2, namespace),
|
|
slotScopeIds
|
|
);
|
|
} else if (!optimized) {
|
|
patchChildren(
|
|
n1,
|
|
n2,
|
|
el,
|
|
null,
|
|
parentComponent,
|
|
parentSuspense,
|
|
resolveChildrenNamespace(n2, namespace),
|
|
slotScopeIds,
|
|
false
|
|
);
|
|
}
|
|
if (patchFlag > 0) {
|
|
if (patchFlag & 16) {
|
|
patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
} else {
|
|
if (patchFlag & 2) {
|
|
if (oldProps.class !== newProps.class) {
|
|
hostPatchProp(el, "class", null, newProps.class, namespace);
|
|
}
|
|
}
|
|
if (patchFlag & 4) {
|
|
hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
|
|
}
|
|
if (patchFlag & 8) {
|
|
const propsToUpdate = n2.dynamicProps;
|
|
for (let i2 = 0; i2 < propsToUpdate.length; i2++) {
|
|
const key = propsToUpdate[i2];
|
|
const prev = oldProps[key];
|
|
const next = newProps[key];
|
|
if (next !== prev || key === "value") {
|
|
hostPatchProp(el, key, prev, next, namespace, parentComponent);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (patchFlag & 1) {
|
|
if (n1.children !== n2.children) {
|
|
hostSetElementText(el, n2.children);
|
|
}
|
|
}
|
|
} else if (!optimized && dynamicChildren == null) {
|
|
patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
}
|
|
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
|
|
queuePostRenderEffect(() => {
|
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
}, parentSuspense);
|
|
}
|
|
};
|
|
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
|
|
for (let i2 = 0; i2 < newChildren.length; i2++) {
|
|
const oldVNode = oldChildren[i2];
|
|
const newVNode = newChildren[i2];
|
|
const container = (
|
|
// oldVNode may be an errored async setup() component inside Suspense
|
|
// which will not have a mounted element
|
|
oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
|
|
// of the Fragment itself so it can move its children.
|
|
(oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
|
|
// which also requires the correct parent container
|
|
!isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
|
|
oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
|
|
// In other cases, the parent container is not actually used so we
|
|
// just pass the block element here to avoid a DOM parentNode call.
|
|
fallbackContainer
|
|
)
|
|
);
|
|
patch(
|
|
oldVNode,
|
|
newVNode,
|
|
container,
|
|
null,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
true
|
|
);
|
|
}
|
|
};
|
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
if (oldProps !== newProps) {
|
|
if (oldProps !== EMPTY_OBJ) {
|
|
for (const key in oldProps) {
|
|
if (!isReservedProp(key) && !(key in newProps)) {
|
|
hostPatchProp(
|
|
el,
|
|
key,
|
|
oldProps[key],
|
|
null,
|
|
namespace,
|
|
parentComponent
|
|
);
|
|
}
|
|
}
|
|
}
|
|
for (const key in newProps) {
|
|
if (isReservedProp(key)) continue;
|
|
const next = newProps[key];
|
|
const prev = oldProps[key];
|
|
if (next !== prev && key !== "value") {
|
|
hostPatchProp(el, key, prev, next, namespace, parentComponent);
|
|
}
|
|
}
|
|
if ("value" in newProps) {
|
|
hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
|
|
}
|
|
}
|
|
};
|
|
const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
|
|
const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
|
|
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
if (fragmentSlotScopeIds) {
|
|
slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
}
|
|
if (n1 == null) {
|
|
hostInsert(fragmentStartAnchor, container, anchor);
|
|
hostInsert(fragmentEndAnchor, container, anchor);
|
|
mountChildren(
|
|
// #10007
|
|
// such fragment like `<></>` will be compiled into
|
|
// a fragment which doesn't have a children.
|
|
// In this case fallback to an empty array
|
|
n2.children || [],
|
|
container,
|
|
fragmentEndAnchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
} else {
|
|
if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
|
|
// of renderSlot() with no valid children
|
|
n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
|
|
patchBlockChildren(
|
|
n1.dynamicChildren,
|
|
dynamicChildren,
|
|
container,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds
|
|
);
|
|
if (
|
|
// #2080 if the stable fragment has a key, it's a <template v-for> that may
|
|
// get moved around. Make sure all root level vnodes inherit el.
|
|
// #2134 or if it's a component root, it may also get moved around
|
|
// as the component is being moved.
|
|
n2.key != null || parentComponent && n2 === parentComponent.subTree
|
|
) {
|
|
traverseStaticChildren(
|
|
n1,
|
|
n2,
|
|
true
|
|
/* shallow */
|
|
);
|
|
}
|
|
} else {
|
|
patchChildren(
|
|
n1,
|
|
n2,
|
|
container,
|
|
fragmentEndAnchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
}
|
|
}
|
|
};
|
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
n2.slotScopeIds = slotScopeIds;
|
|
if (n1 == null) {
|
|
if (n2.shapeFlag & 512) {
|
|
parentComponent.ctx.activate(
|
|
n2,
|
|
container,
|
|
anchor,
|
|
namespace,
|
|
optimized
|
|
);
|
|
} else {
|
|
mountComponent(
|
|
n2,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
optimized
|
|
);
|
|
}
|
|
} else {
|
|
updateComponent(n1, n2, optimized);
|
|
}
|
|
};
|
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
const instance = initialVNode.component = createComponentInstance(
|
|
initialVNode,
|
|
parentComponent,
|
|
parentSuspense
|
|
);
|
|
if (isKeepAlive(initialVNode)) {
|
|
instance.ctx.renderer = internals;
|
|
}
|
|
{
|
|
setupComponent(instance, false, optimized);
|
|
}
|
|
if (instance.asyncDep) {
|
|
parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
|
|
if (!initialVNode.el) {
|
|
const placeholder = instance.subTree = createVNode(Comment);
|
|
processCommentNode(null, placeholder, container, anchor);
|
|
initialVNode.placeholder = placeholder.el;
|
|
}
|
|
} else {
|
|
setupRenderEffect(
|
|
instance,
|
|
initialVNode,
|
|
container,
|
|
anchor,
|
|
parentSuspense,
|
|
namespace,
|
|
optimized
|
|
);
|
|
}
|
|
};
|
|
const updateComponent = (n1, n2, optimized) => {
|
|
const instance = n2.component = n1.component;
|
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
updateComponentPreRender(instance, n2, optimized);
|
|
return;
|
|
} else {
|
|
instance.next = n2;
|
|
instance.update();
|
|
}
|
|
} else {
|
|
n2.el = n1.el;
|
|
instance.vnode = n2;
|
|
}
|
|
};
|
|
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
|
|
const componentUpdateFn = () => {
|
|
if (!instance.isMounted) {
|
|
let vnodeHook;
|
|
const { el, props } = initialVNode;
|
|
const { bm, m: m2, parent, root: root5, type } = instance;
|
|
const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
|
|
toggleRecurse(instance, false);
|
|
if (bm) {
|
|
invokeArrayFns(bm);
|
|
}
|
|
if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
|
|
invokeVNodeHook(vnodeHook, parent, initialVNode);
|
|
}
|
|
toggleRecurse(instance, true);
|
|
{
|
|
if (root5.ce && // @ts-expect-error _def is private
|
|
root5.ce._def.shadowRoot !== false) {
|
|
root5.ce._injectChildStyle(type);
|
|
}
|
|
const subTree = instance.subTree = renderComponentRoot(instance);
|
|
patch(
|
|
null,
|
|
subTree,
|
|
container,
|
|
anchor,
|
|
instance,
|
|
parentSuspense,
|
|
namespace
|
|
);
|
|
initialVNode.el = subTree.el;
|
|
}
|
|
if (m2) {
|
|
queuePostRenderEffect(m2, parentSuspense);
|
|
}
|
|
if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
|
|
const scopedInitialVNode = initialVNode;
|
|
queuePostRenderEffect(
|
|
() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
|
|
parentSuspense
|
|
);
|
|
}
|
|
if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
|
|
instance.a && queuePostRenderEffect(instance.a, parentSuspense);
|
|
}
|
|
instance.isMounted = true;
|
|
initialVNode = container = anchor = null;
|
|
} else {
|
|
let { next, bu, u, parent, vnode } = instance;
|
|
{
|
|
const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
|
|
if (nonHydratedAsyncRoot) {
|
|
if (next) {
|
|
next.el = vnode.el;
|
|
updateComponentPreRender(instance, next, optimized);
|
|
}
|
|
nonHydratedAsyncRoot.asyncDep.then(() => {
|
|
if (!instance.isUnmounted) {
|
|
componentUpdateFn();
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
}
|
|
let originNext = next;
|
|
let vnodeHook;
|
|
toggleRecurse(instance, false);
|
|
if (next) {
|
|
next.el = vnode.el;
|
|
updateComponentPreRender(instance, next, optimized);
|
|
} else {
|
|
next = vnode;
|
|
}
|
|
if (bu) {
|
|
invokeArrayFns(bu);
|
|
}
|
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
|
|
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
}
|
|
toggleRecurse(instance, true);
|
|
const nextTree = renderComponentRoot(instance);
|
|
const prevTree = instance.subTree;
|
|
instance.subTree = nextTree;
|
|
patch(
|
|
prevTree,
|
|
nextTree,
|
|
// parent may have changed if it's in a teleport
|
|
hostParentNode(prevTree.el),
|
|
// anchor may have changed if it's in a fragment
|
|
getNextHostNode(prevTree),
|
|
instance,
|
|
parentSuspense,
|
|
namespace
|
|
);
|
|
next.el = nextTree.el;
|
|
if (originNext === null) {
|
|
updateHOCHostEl(instance, nextTree.el);
|
|
}
|
|
if (u) {
|
|
queuePostRenderEffect(u, parentSuspense);
|
|
}
|
|
if (vnodeHook = next.props && next.props.onVnodeUpdated) {
|
|
queuePostRenderEffect(
|
|
() => invokeVNodeHook(vnodeHook, parent, next, vnode),
|
|
parentSuspense
|
|
);
|
|
}
|
|
}
|
|
};
|
|
instance.scope.on();
|
|
const effect2 = instance.effect = new ReactiveEffect(componentUpdateFn);
|
|
instance.scope.off();
|
|
const update = instance.update = effect2.run.bind(effect2);
|
|
const job = instance.job = effect2.runIfDirty.bind(effect2);
|
|
job.i = instance;
|
|
job.id = instance.uid;
|
|
effect2.scheduler = () => queueJob(job);
|
|
toggleRecurse(instance, true);
|
|
update();
|
|
};
|
|
const updateComponentPreRender = (instance, nextVNode, optimized) => {
|
|
nextVNode.component = instance;
|
|
const prevProps = instance.vnode.props;
|
|
instance.vnode = nextVNode;
|
|
instance.next = null;
|
|
updateProps(instance, nextVNode.props, prevProps, optimized);
|
|
updateSlots(instance, nextVNode.children, optimized);
|
|
pauseTracking();
|
|
flushPreFlushCbs(instance);
|
|
resetTracking();
|
|
};
|
|
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
|
|
const c1 = n1 && n1.children;
|
|
const prevShapeFlag = n1 ? n1.shapeFlag : 0;
|
|
const c2 = n2.children;
|
|
const { patchFlag, shapeFlag } = n2;
|
|
if (patchFlag > 0) {
|
|
if (patchFlag & 128) {
|
|
patchKeyedChildren(
|
|
c1,
|
|
c2,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
return;
|
|
} else if (patchFlag & 256) {
|
|
patchUnkeyedChildren(
|
|
c1,
|
|
c2,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
return;
|
|
}
|
|
}
|
|
if (shapeFlag & 8) {
|
|
if (prevShapeFlag & 16) {
|
|
unmountChildren(c1, parentComponent, parentSuspense);
|
|
}
|
|
if (c2 !== c1) {
|
|
hostSetElementText(container, c2);
|
|
}
|
|
} else {
|
|
if (prevShapeFlag & 16) {
|
|
if (shapeFlag & 16) {
|
|
patchKeyedChildren(
|
|
c1,
|
|
c2,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
} else {
|
|
unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
}
|
|
} else {
|
|
if (prevShapeFlag & 8) {
|
|
hostSetElementText(container, "");
|
|
}
|
|
if (shapeFlag & 16) {
|
|
mountChildren(
|
|
c2,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
c1 = c1 || EMPTY_ARR;
|
|
c2 = c2 || EMPTY_ARR;
|
|
const oldLength = c1.length;
|
|
const newLength = c2.length;
|
|
const commonLength = Math.min(oldLength, newLength);
|
|
let i2;
|
|
for (i2 = 0; i2 < commonLength; i2++) {
|
|
const nextChild = c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]);
|
|
patch(
|
|
c1[i2],
|
|
nextChild,
|
|
container,
|
|
null,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
}
|
|
if (oldLength > newLength) {
|
|
unmountChildren(
|
|
c1,
|
|
parentComponent,
|
|
parentSuspense,
|
|
true,
|
|
false,
|
|
commonLength
|
|
);
|
|
} else {
|
|
mountChildren(
|
|
c2,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized,
|
|
commonLength
|
|
);
|
|
}
|
|
};
|
|
const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
let i2 = 0;
|
|
const l2 = c2.length;
|
|
let e1 = c1.length - 1;
|
|
let e2 = l2 - 1;
|
|
while (i2 <= e1 && i2 <= e2) {
|
|
const n1 = c1[i2];
|
|
const n2 = c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]);
|
|
if (isSameVNodeType(n1, n2)) {
|
|
patch(
|
|
n1,
|
|
n2,
|
|
container,
|
|
null,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
} else {
|
|
break;
|
|
}
|
|
i2++;
|
|
}
|
|
while (i2 <= e1 && i2 <= e2) {
|
|
const n1 = c1[e1];
|
|
const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
|
|
if (isSameVNodeType(n1, n2)) {
|
|
patch(
|
|
n1,
|
|
n2,
|
|
container,
|
|
null,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
} else {
|
|
break;
|
|
}
|
|
e1--;
|
|
e2--;
|
|
}
|
|
if (i2 > e1) {
|
|
if (i2 <= e2) {
|
|
const nextPos = e2 + 1;
|
|
const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
|
|
while (i2 <= e2) {
|
|
patch(
|
|
null,
|
|
c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]),
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
i2++;
|
|
}
|
|
}
|
|
} else if (i2 > e2) {
|
|
while (i2 <= e1) {
|
|
unmount(c1[i2], parentComponent, parentSuspense, true);
|
|
i2++;
|
|
}
|
|
} else {
|
|
const s1 = i2;
|
|
const s2 = i2;
|
|
const keyToNewIndexMap = /* @__PURE__ */ new Map();
|
|
for (i2 = s2; i2 <= e2; i2++) {
|
|
const nextChild = c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]);
|
|
if (nextChild.key != null) {
|
|
keyToNewIndexMap.set(nextChild.key, i2);
|
|
}
|
|
}
|
|
let j;
|
|
let patched = 0;
|
|
const toBePatched = e2 - s2 + 1;
|
|
let moved = false;
|
|
let maxNewIndexSoFar = 0;
|
|
const newIndexToOldIndexMap = new Array(toBePatched);
|
|
for (i2 = 0; i2 < toBePatched; i2++) newIndexToOldIndexMap[i2] = 0;
|
|
for (i2 = s1; i2 <= e1; i2++) {
|
|
const prevChild = c1[i2];
|
|
if (patched >= toBePatched) {
|
|
unmount(prevChild, parentComponent, parentSuspense, true);
|
|
continue;
|
|
}
|
|
let newIndex;
|
|
if (prevChild.key != null) {
|
|
newIndex = keyToNewIndexMap.get(prevChild.key);
|
|
} else {
|
|
for (j = s2; j <= e2; j++) {
|
|
if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
|
|
newIndex = j;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (newIndex === void 0) {
|
|
unmount(prevChild, parentComponent, parentSuspense, true);
|
|
} else {
|
|
newIndexToOldIndexMap[newIndex - s2] = i2 + 1;
|
|
if (newIndex >= maxNewIndexSoFar) {
|
|
maxNewIndexSoFar = newIndex;
|
|
} else {
|
|
moved = true;
|
|
}
|
|
patch(
|
|
prevChild,
|
|
c2[newIndex],
|
|
container,
|
|
null,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
patched++;
|
|
}
|
|
}
|
|
const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
|
|
j = increasingNewIndexSequence.length - 1;
|
|
for (i2 = toBePatched - 1; i2 >= 0; i2--) {
|
|
const nextIndex = s2 + i2;
|
|
const nextChild = c2[nextIndex];
|
|
const anchorVNode = c2[nextIndex + 1];
|
|
const anchor = nextIndex + 1 < l2 ? (
|
|
// #13559, #14173 fallback to el placeholder for unresolved async component
|
|
anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
|
|
) : parentAnchor;
|
|
if (newIndexToOldIndexMap[i2] === 0) {
|
|
patch(
|
|
null,
|
|
nextChild,
|
|
container,
|
|
anchor,
|
|
parentComponent,
|
|
parentSuspense,
|
|
namespace,
|
|
slotScopeIds,
|
|
optimized
|
|
);
|
|
} else if (moved) {
|
|
if (j < 0 || i2 !== increasingNewIndexSequence[j]) {
|
|
move(nextChild, container, anchor, 2);
|
|
} else {
|
|
j--;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
|
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
if (shapeFlag & 6) {
|
|
move(vnode.component.subTree, container, anchor, moveType);
|
|
return;
|
|
}
|
|
if (shapeFlag & 128) {
|
|
vnode.suspense.move(container, anchor, moveType);
|
|
return;
|
|
}
|
|
if (shapeFlag & 64) {
|
|
type.move(vnode, container, anchor, internals);
|
|
return;
|
|
}
|
|
if (type === Fragment) {
|
|
hostInsert(el, container, anchor);
|
|
for (let i2 = 0; i2 < children.length; i2++) {
|
|
move(children[i2], container, anchor, moveType);
|
|
}
|
|
hostInsert(vnode.anchor, container, anchor);
|
|
return;
|
|
}
|
|
if (type === Static) {
|
|
moveStaticNode(vnode, container, anchor);
|
|
return;
|
|
}
|
|
const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
|
|
if (needTransition2) {
|
|
if (moveType === 0) {
|
|
transition.beforeEnter(el);
|
|
hostInsert(el, container, anchor);
|
|
queuePostRenderEffect(() => transition.enter(el), parentSuspense);
|
|
} else {
|
|
const { leave, delayLeave, afterLeave } = transition;
|
|
const remove222 = () => {
|
|
if (vnode.ctx.isUnmounted) {
|
|
hostRemove(el);
|
|
} else {
|
|
hostInsert(el, container, anchor);
|
|
}
|
|
};
|
|
const performLeave = () => {
|
|
if (el._isLeaving) {
|
|
el[leaveCbKey](
|
|
true
|
|
/* cancelled */
|
|
);
|
|
}
|
|
leave(el, () => {
|
|
remove222();
|
|
afterLeave && afterLeave();
|
|
});
|
|
};
|
|
if (delayLeave) {
|
|
delayLeave(el, remove222, performLeave);
|
|
} else {
|
|
performLeave();
|
|
}
|
|
}
|
|
} else {
|
|
hostInsert(el, container, anchor);
|
|
}
|
|
};
|
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
const {
|
|
type,
|
|
props,
|
|
ref: ref3,
|
|
children,
|
|
dynamicChildren,
|
|
shapeFlag,
|
|
patchFlag,
|
|
dirs,
|
|
cacheIndex
|
|
} = vnode;
|
|
if (patchFlag === -2) {
|
|
optimized = false;
|
|
}
|
|
if (ref3 != null) {
|
|
pauseTracking();
|
|
setRef(ref3, null, parentSuspense, vnode, true);
|
|
resetTracking();
|
|
}
|
|
if (cacheIndex != null) {
|
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
}
|
|
if (shapeFlag & 256) {
|
|
parentComponent.ctx.deactivate(vnode);
|
|
return;
|
|
}
|
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
let vnodeHook;
|
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
|
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
}
|
|
if (shapeFlag & 6) {
|
|
unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
} else {
|
|
if (shapeFlag & 128) {
|
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
return;
|
|
}
|
|
if (shouldInvokeDirs) {
|
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
}
|
|
if (shapeFlag & 64) {
|
|
vnode.type.remove(
|
|
vnode,
|
|
parentComponent,
|
|
parentSuspense,
|
|
internals,
|
|
doRemove
|
|
);
|
|
} else if (dynamicChildren && // #5154
|
|
// when v-once is used inside a block, setBlockTracking(-1) marks the
|
|
// parent block with hasOnce: true
|
|
// so that it doesn't take the fast path during unmount - otherwise
|
|
// components nested in v-once are never unmounted.
|
|
!dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
|
|
(type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
|
|
unmountChildren(
|
|
dynamicChildren,
|
|
parentComponent,
|
|
parentSuspense,
|
|
false,
|
|
true
|
|
);
|
|
} else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
|
|
unmountChildren(children, parentComponent, parentSuspense);
|
|
}
|
|
if (doRemove) {
|
|
remove22(vnode);
|
|
}
|
|
}
|
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
|
|
queuePostRenderEffect(() => {
|
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
}, parentSuspense);
|
|
}
|
|
};
|
|
const remove22 = (vnode) => {
|
|
const { type, el, anchor, transition } = vnode;
|
|
if (type === Fragment) {
|
|
{
|
|
removeFragment(el, anchor);
|
|
}
|
|
return;
|
|
}
|
|
if (type === Static) {
|
|
removeStaticNode(vnode);
|
|
return;
|
|
}
|
|
const performRemove = () => {
|
|
hostRemove(el);
|
|
if (transition && !transition.persisted && transition.afterLeave) {
|
|
transition.afterLeave();
|
|
}
|
|
};
|
|
if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
|
|
const { leave, delayLeave } = transition;
|
|
const performLeave = () => leave(el, performRemove);
|
|
if (delayLeave) {
|
|
delayLeave(vnode.el, performRemove, performLeave);
|
|
} else {
|
|
performLeave();
|
|
}
|
|
} else {
|
|
performRemove();
|
|
}
|
|
};
|
|
const removeFragment = (cur, end) => {
|
|
let next;
|
|
while (cur !== end) {
|
|
next = hostNextSibling(cur);
|
|
hostRemove(cur);
|
|
cur = next;
|
|
}
|
|
hostRemove(end);
|
|
};
|
|
const unmountComponent = (instance, parentSuspense, doRemove) => {
|
|
const { bum, scope, job, subTree, um, m: m2, a: a2 } = instance;
|
|
invalidateMount(m2);
|
|
invalidateMount(a2);
|
|
if (bum) {
|
|
invokeArrayFns(bum);
|
|
}
|
|
scope.stop();
|
|
if (job) {
|
|
job.flags |= 8;
|
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
}
|
|
if (um) {
|
|
queuePostRenderEffect(um, parentSuspense);
|
|
}
|
|
queuePostRenderEffect(() => {
|
|
instance.isUnmounted = true;
|
|
}, parentSuspense);
|
|
};
|
|
const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
|
|
for (let i2 = start; i2 < children.length; i2++) {
|
|
unmount(children[i2], parentComponent, parentSuspense, doRemove, optimized);
|
|
}
|
|
};
|
|
const getNextHostNode = (vnode) => {
|
|
if (vnode.shapeFlag & 6) {
|
|
return getNextHostNode(vnode.component.subTree);
|
|
}
|
|
if (vnode.shapeFlag & 128) {
|
|
return vnode.suspense.next();
|
|
}
|
|
const el = hostNextSibling(vnode.anchor || vnode.el);
|
|
const teleportEnd = el && el[TeleportEndKey];
|
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
};
|
|
let isFlushing = false;
|
|
const render2 = (vnode, container, namespace) => {
|
|
let instance;
|
|
if (vnode == null) {
|
|
if (container._vnode) {
|
|
unmount(container._vnode, null, null, true);
|
|
instance = container._vnode.component;
|
|
}
|
|
} else {
|
|
patch(
|
|
container._vnode || null,
|
|
vnode,
|
|
container,
|
|
null,
|
|
null,
|
|
null,
|
|
namespace
|
|
);
|
|
}
|
|
container._vnode = vnode;
|
|
if (!isFlushing) {
|
|
isFlushing = true;
|
|
flushPreFlushCbs(instance);
|
|
flushPostFlushCbs();
|
|
isFlushing = false;
|
|
}
|
|
};
|
|
const internals = {
|
|
p: patch,
|
|
um: unmount,
|
|
m: move,
|
|
r: remove22,
|
|
mt: mountComponent,
|
|
mc: mountChildren,
|
|
pc: patchChildren,
|
|
pbc: patchBlockChildren,
|
|
n: getNextHostNode,
|
|
o: options
|
|
};
|
|
let hydrate;
|
|
return {
|
|
render: render2,
|
|
hydrate,
|
|
createApp: createAppAPI(render2)
|
|
};
|
|
}
|
|
function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
}
|
|
function toggleRecurse({ effect: effect2, job }, allowed) {
|
|
if (allowed) {
|
|
effect2.flags |= 32;
|
|
job.flags |= 4;
|
|
} else {
|
|
effect2.flags &= -33;
|
|
job.flags &= -5;
|
|
}
|
|
}
|
|
function needTransition(parentSuspense, transition) {
|
|
return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
|
|
}
|
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
const ch1 = n1.children;
|
|
const ch2 = n2.children;
|
|
if (isArray(ch1) && isArray(ch2)) {
|
|
for (let i2 = 0; i2 < ch1.length; i2++) {
|
|
const c1 = ch1[i2];
|
|
let c2 = ch2[i2];
|
|
if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
|
|
if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
|
|
c2 = ch2[i2] = cloneIfMounted(ch2[i2]);
|
|
c2.el = c1.el;
|
|
}
|
|
if (!shallow && c2.patchFlag !== -2)
|
|
traverseStaticChildren(c1, c2);
|
|
}
|
|
if (c2.type === Text) {
|
|
if (c2.patchFlag !== -1) {
|
|
c2.el = c1.el;
|
|
} else {
|
|
c2.__elIndex = i2 + // take fragment start anchor into account
|
|
(n1.type === Fragment ? 1 : 0);
|
|
}
|
|
}
|
|
if (c2.type === Comment && !c2.el) {
|
|
c2.el = c1.el;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function getSequence(arr) {
|
|
const p2 = arr.slice();
|
|
const result = [0];
|
|
let i2, j, u, v2, c2;
|
|
const len = arr.length;
|
|
for (i2 = 0; i2 < len; i2++) {
|
|
const arrI = arr[i2];
|
|
if (arrI !== 0) {
|
|
j = result[result.length - 1];
|
|
if (arr[j] < arrI) {
|
|
p2[i2] = j;
|
|
result.push(i2);
|
|
continue;
|
|
}
|
|
u = 0;
|
|
v2 = result.length - 1;
|
|
while (u < v2) {
|
|
c2 = u + v2 >> 1;
|
|
if (arr[result[c2]] < arrI) {
|
|
u = c2 + 1;
|
|
} else {
|
|
v2 = c2;
|
|
}
|
|
}
|
|
if (arrI < arr[result[u]]) {
|
|
if (u > 0) {
|
|
p2[i2] = result[u - 1];
|
|
}
|
|
result[u] = i2;
|
|
}
|
|
}
|
|
}
|
|
u = result.length;
|
|
v2 = result[u - 1];
|
|
while (u-- > 0) {
|
|
result[u] = v2;
|
|
v2 = p2[v2];
|
|
}
|
|
return result;
|
|
}
|
|
function locateNonHydratedAsyncRoot(instance) {
|
|
const subComponent = instance.subTree.component;
|
|
if (subComponent) {
|
|
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
return subComponent;
|
|
} else {
|
|
return locateNonHydratedAsyncRoot(subComponent);
|
|
}
|
|
}
|
|
}
|
|
function invalidateMount(hooks) {
|
|
if (hooks) {
|
|
for (let i2 = 0; i2 < hooks.length; i2++)
|
|
hooks[i2].flags |= 8;
|
|
}
|
|
}
|
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
if (anchorVnode.placeholder) {
|
|
return anchorVnode.placeholder;
|
|
}
|
|
const instance = anchorVnode.component;
|
|
if (instance) {
|
|
return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
}
|
|
return null;
|
|
}
|
|
const isSuspense = (type) => type.__isSuspense;
|
|
function queueEffectWithSuspense(fn, suspense) {
|
|
if (suspense && suspense.pendingBranch) {
|
|
if (isArray(fn)) {
|
|
suspense.effects.push(...fn);
|
|
} else {
|
|
suspense.effects.push(fn);
|
|
}
|
|
} else {
|
|
queuePostFlushCb(fn);
|
|
}
|
|
}
|
|
const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
|
|
const Text = /* @__PURE__ */ Symbol.for("v-txt");
|
|
const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
|
|
const Static = /* @__PURE__ */ Symbol.for("v-stc");
|
|
const blockStack = [];
|
|
let currentBlock = null;
|
|
function openBlock(disableTracking = false) {
|
|
blockStack.push(currentBlock = disableTracking ? null : []);
|
|
}
|
|
function closeBlock() {
|
|
blockStack.pop();
|
|
currentBlock = blockStack[blockStack.length - 1] || null;
|
|
}
|
|
let isBlockTreeEnabled = 1;
|
|
function setBlockTracking(value, inVOnce = false) {
|
|
isBlockTreeEnabled += value;
|
|
if (value < 0 && currentBlock && inVOnce) {
|
|
currentBlock.hasOnce = true;
|
|
}
|
|
}
|
|
function setupBlock(vnode) {
|
|
vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
|
|
closeBlock();
|
|
if (isBlockTreeEnabled > 0 && currentBlock) {
|
|
currentBlock.push(vnode);
|
|
}
|
|
return vnode;
|
|
}
|
|
function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
|
|
return setupBlock(
|
|
createBaseVNode(
|
|
type,
|
|
props,
|
|
children,
|
|
patchFlag,
|
|
dynamicProps,
|
|
shapeFlag,
|
|
true
|
|
)
|
|
);
|
|
}
|
|
function createBlock(type, props, children, patchFlag, dynamicProps) {
|
|
return setupBlock(
|
|
createVNode(
|
|
type,
|
|
props,
|
|
children,
|
|
patchFlag,
|
|
dynamicProps,
|
|
true
|
|
)
|
|
);
|
|
}
|
|
function isVNode(value) {
|
|
return value ? value.__v_isVNode === true : false;
|
|
}
|
|
function isSameVNodeType(n1, n2) {
|
|
return n1.type === n2.type && n1.key === n2.key;
|
|
}
|
|
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
const normalizeRef = ({
|
|
ref: ref3,
|
|
ref_key,
|
|
ref_for
|
|
}) => {
|
|
if (typeof ref3 === "number") {
|
|
ref3 = "" + ref3;
|
|
}
|
|
return ref3 != null ? isString(ref3) || isRef(ref3) || isFunction(ref3) ? { i: currentRenderingInstance, r: ref3, k: ref_key, f: !!ref_for } : ref3 : null;
|
|
};
|
|
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
|
|
const vnode = {
|
|
__v_isVNode: true,
|
|
__v_skip: true,
|
|
type,
|
|
props,
|
|
key: props && normalizeKey(props),
|
|
ref: props && normalizeRef(props),
|
|
scopeId: currentScopeId,
|
|
slotScopeIds: null,
|
|
children,
|
|
component: null,
|
|
suspense: null,
|
|
ssContent: null,
|
|
ssFallback: null,
|
|
dirs: null,
|
|
transition: null,
|
|
el: null,
|
|
anchor: null,
|
|
target: null,
|
|
targetStart: null,
|
|
targetAnchor: null,
|
|
staticCount: 0,
|
|
shapeFlag,
|
|
patchFlag,
|
|
dynamicProps,
|
|
dynamicChildren: null,
|
|
appContext: null,
|
|
ctx: currentRenderingInstance
|
|
};
|
|
if (needFullChildrenNormalization) {
|
|
normalizeChildren(vnode, children);
|
|
if (shapeFlag & 128) {
|
|
type.normalize(vnode);
|
|
}
|
|
} else if (children) {
|
|
vnode.shapeFlag |= isString(children) ? 8 : 16;
|
|
}
|
|
if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
|
|
!isBlockNode && // has current parent block
|
|
currentBlock && // presence of a patch flag indicates this node needs patching on updates.
|
|
// component nodes also should always be patched, because even if the
|
|
// component doesn't need to update, it needs to persist the instance on to
|
|
// the next vnode so that it can be properly unmounted later.
|
|
(vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
|
|
// vnode should not be considered dynamic due to handler caching.
|
|
vnode.patchFlag !== 32) {
|
|
currentBlock.push(vnode);
|
|
}
|
|
return vnode;
|
|
}
|
|
const createVNode = _createVNode;
|
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
type = Comment;
|
|
}
|
|
if (isVNode(type)) {
|
|
const cloned = cloneVNode(
|
|
type,
|
|
props,
|
|
true
|
|
/* mergeRef: true */
|
|
);
|
|
if (children) {
|
|
normalizeChildren(cloned, children);
|
|
}
|
|
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
if (cloned.shapeFlag & 6) {
|
|
currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
} else {
|
|
currentBlock.push(cloned);
|
|
}
|
|
}
|
|
cloned.patchFlag = -2;
|
|
return cloned;
|
|
}
|
|
if (isClassComponent(type)) {
|
|
type = type.__vccOpts;
|
|
}
|
|
if (props) {
|
|
props = guardReactiveProps(props);
|
|
let { class: klass, style: style2 } = props;
|
|
if (klass && !isString(klass)) {
|
|
props.class = normalizeClass(klass);
|
|
}
|
|
if (isObject(style2)) {
|
|
if (isProxy(style2) && !isArray(style2)) {
|
|
style2 = extend({}, style2);
|
|
}
|
|
props.style = normalizeStyle(style2);
|
|
}
|
|
}
|
|
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
|
|
return createBaseVNode(
|
|
type,
|
|
props,
|
|
children,
|
|
patchFlag,
|
|
dynamicProps,
|
|
shapeFlag,
|
|
isBlockNode,
|
|
true
|
|
);
|
|
}
|
|
function guardReactiveProps(props) {
|
|
if (!props) return null;
|
|
return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
|
|
}
|
|
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
|
|
const { props, ref: ref3, patchFlag, children, transition } = vnode;
|
|
const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
|
|
const cloned = {
|
|
__v_isVNode: true,
|
|
__v_skip: true,
|
|
type: vnode.type,
|
|
props: mergedProps,
|
|
key: mergedProps && normalizeKey(mergedProps),
|
|
ref: extraProps && extraProps.ref ? (
|
|
// #2078 in the case of <component :is="vnode" ref="extra"/>
|
|
// if the vnode itself already has a ref, cloneVNode will need to merge
|
|
// the refs so the single vnode can be set on multiple refs
|
|
mergeRef && ref3 ? isArray(ref3) ? ref3.concat(normalizeRef(extraProps)) : [ref3, normalizeRef(extraProps)] : normalizeRef(extraProps)
|
|
) : ref3,
|
|
scopeId: vnode.scopeId,
|
|
slotScopeIds: vnode.slotScopeIds,
|
|
children,
|
|
target: vnode.target,
|
|
targetStart: vnode.targetStart,
|
|
targetAnchor: vnode.targetAnchor,
|
|
staticCount: vnode.staticCount,
|
|
shapeFlag: vnode.shapeFlag,
|
|
// if the vnode is cloned with extra props, we can no longer assume its
|
|
// existing patch flag to be reliable and need to add the FULL_PROPS flag.
|
|
// note: preserve flag for fragments since they use the flag for children
|
|
// fast paths only.
|
|
patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
|
|
dynamicProps: vnode.dynamicProps,
|
|
dynamicChildren: vnode.dynamicChildren,
|
|
appContext: vnode.appContext,
|
|
dirs: vnode.dirs,
|
|
transition,
|
|
// These should technically only be non-null on mounted VNodes. However,
|
|
// they *should* be copied for kept-alive vnodes. So we just always copy
|
|
// them since them being non-null during a mount doesn't affect the logic as
|
|
// they will simply be overwritten.
|
|
component: vnode.component,
|
|
suspense: vnode.suspense,
|
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
placeholder: vnode.placeholder,
|
|
el: vnode.el,
|
|
anchor: vnode.anchor,
|
|
ctx: vnode.ctx,
|
|
ce: vnode.ce
|
|
};
|
|
if (transition && cloneTransition) {
|
|
setTransitionHooks(
|
|
cloned,
|
|
transition.clone(cloned)
|
|
);
|
|
}
|
|
return cloned;
|
|
}
|
|
function createTextVNode(text = " ", flag = 0) {
|
|
return createVNode(Text, null, text, flag);
|
|
}
|
|
function createCommentVNode(text = "", asBlock = false) {
|
|
return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
|
|
}
|
|
function normalizeVNode(child) {
|
|
if (child == null || typeof child === "boolean") {
|
|
return createVNode(Comment);
|
|
} else if (isArray(child)) {
|
|
return createVNode(
|
|
Fragment,
|
|
null,
|
|
// #3666, avoid reference pollution when reusing vnode
|
|
child.slice()
|
|
);
|
|
} else if (isVNode(child)) {
|
|
return cloneIfMounted(child);
|
|
} else {
|
|
return createVNode(Text, null, String(child));
|
|
}
|
|
}
|
|
function cloneIfMounted(child) {
|
|
return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
|
|
}
|
|
function normalizeChildren(vnode, children) {
|
|
let type = 0;
|
|
const { shapeFlag } = vnode;
|
|
if (children == null) {
|
|
children = null;
|
|
} else if (isArray(children)) {
|
|
type = 16;
|
|
} else if (typeof children === "object") {
|
|
if (shapeFlag & (1 | 64)) {
|
|
const slot = children.default;
|
|
if (slot) {
|
|
slot._c && (slot._d = false);
|
|
normalizeChildren(vnode, slot());
|
|
slot._c && (slot._d = true);
|
|
}
|
|
return;
|
|
} else {
|
|
type = 32;
|
|
const slotFlag = children._;
|
|
if (!slotFlag && !isInternalObject(children)) {
|
|
children._ctx = currentRenderingInstance;
|
|
} else if (slotFlag === 3 && currentRenderingInstance) {
|
|
if (currentRenderingInstance.slots._ === 1) {
|
|
children._ = 1;
|
|
} else {
|
|
children._ = 2;
|
|
vnode.patchFlag |= 1024;
|
|
}
|
|
}
|
|
}
|
|
} else if (isFunction(children)) {
|
|
children = { default: children, _ctx: currentRenderingInstance };
|
|
type = 32;
|
|
} else {
|
|
children = String(children);
|
|
if (shapeFlag & 64) {
|
|
type = 16;
|
|
children = [createTextVNode(children)];
|
|
} else {
|
|
type = 8;
|
|
}
|
|
}
|
|
vnode.children = children;
|
|
vnode.shapeFlag |= type;
|
|
}
|
|
function mergeProps(...args) {
|
|
const ret = {};
|
|
for (let i2 = 0; i2 < args.length; i2++) {
|
|
const toMerge = args[i2];
|
|
for (const key in toMerge) {
|
|
if (key === "class") {
|
|
if (ret.class !== toMerge.class) {
|
|
ret.class = normalizeClass([ret.class, toMerge.class]);
|
|
}
|
|
} else if (key === "style") {
|
|
ret.style = normalizeStyle([ret.style, toMerge.style]);
|
|
} else if (isOn(key)) {
|
|
const existing = ret[key];
|
|
const incoming = toMerge[key];
|
|
if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
|
|
ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
}
|
|
} else if (key !== "") {
|
|
ret[key] = toMerge[key];
|
|
}
|
|
}
|
|
}
|
|
return ret;
|
|
}
|
|
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
callWithAsyncErrorHandling(hook, instance, 7, [
|
|
vnode,
|
|
prevVNode
|
|
]);
|
|
}
|
|
const emptyAppContext = createAppContext();
|
|
let uid = 0;
|
|
function createComponentInstance(vnode, parent, suspense) {
|
|
const type = vnode.type;
|
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
const instance = {
|
|
uid: uid++,
|
|
vnode,
|
|
type,
|
|
parent,
|
|
appContext,
|
|
root: null,
|
|
// to be immediately set
|
|
next: null,
|
|
subTree: null,
|
|
// will be set synchronously right after creation
|
|
effect: null,
|
|
update: null,
|
|
// will be set synchronously right after creation
|
|
job: null,
|
|
scope: new EffectScope(
|
|
true
|
|
/* detached */
|
|
),
|
|
render: null,
|
|
proxy: null,
|
|
exposed: null,
|
|
exposeProxy: null,
|
|
withProxy: null,
|
|
provides: parent ? parent.provides : Object.create(appContext.provides),
|
|
ids: parent ? parent.ids : ["", 0, 0],
|
|
accessCache: null,
|
|
renderCache: [],
|
|
// local resolved assets
|
|
components: null,
|
|
directives: null,
|
|
// resolved props and emits options
|
|
propsOptions: normalizePropsOptions(type, appContext),
|
|
emitsOptions: normalizeEmitsOptions(type, appContext),
|
|
// emit
|
|
emit: null,
|
|
// to be set immediately
|
|
emitted: null,
|
|
// props default value
|
|
propsDefaults: EMPTY_OBJ,
|
|
// inheritAttrs
|
|
inheritAttrs: type.inheritAttrs,
|
|
// state
|
|
ctx: EMPTY_OBJ,
|
|
data: EMPTY_OBJ,
|
|
props: EMPTY_OBJ,
|
|
attrs: EMPTY_OBJ,
|
|
slots: EMPTY_OBJ,
|
|
refs: EMPTY_OBJ,
|
|
setupState: EMPTY_OBJ,
|
|
setupContext: null,
|
|
// suspense related
|
|
suspense,
|
|
suspenseId: suspense ? suspense.pendingId : 0,
|
|
asyncDep: null,
|
|
asyncResolved: false,
|
|
// lifecycle hooks
|
|
// not using enums here because it results in computed properties
|
|
isMounted: false,
|
|
isUnmounted: false,
|
|
isDeactivated: false,
|
|
bc: null,
|
|
c: null,
|
|
bm: null,
|
|
m: null,
|
|
bu: null,
|
|
u: null,
|
|
um: null,
|
|
bum: null,
|
|
da: null,
|
|
a: null,
|
|
rtg: null,
|
|
rtc: null,
|
|
ec: null,
|
|
sp: null
|
|
};
|
|
{
|
|
instance.ctx = { _: instance };
|
|
}
|
|
instance.root = parent ? parent.root : instance;
|
|
instance.emit = emit.bind(null, instance);
|
|
if (vnode.ce) {
|
|
vnode.ce(instance);
|
|
}
|
|
return instance;
|
|
}
|
|
let currentInstance = null;
|
|
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
let internalSetCurrentInstance;
|
|
let setInSSRSetupState;
|
|
{
|
|
const g2 = getGlobalThis();
|
|
const registerGlobalSetter = (key, setter) => {
|
|
let setters;
|
|
if (!(setters = g2[key])) setters = g2[key] = [];
|
|
setters.push(setter);
|
|
return (v2) => {
|
|
if (setters.length > 1) setters.forEach((set) => set(v2));
|
|
else setters[0](v2);
|
|
};
|
|
};
|
|
internalSetCurrentInstance = registerGlobalSetter(
|
|
`__VUE_INSTANCE_SETTERS__`,
|
|
(v2) => currentInstance = v2
|
|
);
|
|
setInSSRSetupState = registerGlobalSetter(
|
|
`__VUE_SSR_SETTERS__`,
|
|
(v2) => isInSSRComponentSetup = v2
|
|
);
|
|
}
|
|
const setCurrentInstance = (instance) => {
|
|
const prev = currentInstance;
|
|
internalSetCurrentInstance(instance);
|
|
instance.scope.on();
|
|
return () => {
|
|
instance.scope.off();
|
|
internalSetCurrentInstance(prev);
|
|
};
|
|
};
|
|
const unsetCurrentInstance = () => {
|
|
currentInstance && currentInstance.scope.off();
|
|
internalSetCurrentInstance(null);
|
|
};
|
|
function isStatefulComponent(instance) {
|
|
return instance.vnode.shapeFlag & 4;
|
|
}
|
|
let isInSSRComponentSetup = false;
|
|
function setupComponent(instance, isSSR = false, optimized = false) {
|
|
isSSR && setInSSRSetupState(isSSR);
|
|
const { props, children } = instance.vnode;
|
|
const isStateful = isStatefulComponent(instance);
|
|
initProps(instance, props, isStateful, isSSR);
|
|
initSlots(instance, children, optimized || isSSR);
|
|
const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
|
|
isSSR && setInSSRSetupState(false);
|
|
return setupResult;
|
|
}
|
|
function setupStatefulComponent(instance, isSSR) {
|
|
const Component = instance.type;
|
|
instance.accessCache = /* @__PURE__ */ Object.create(null);
|
|
instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
|
|
const { setup: setup2 } = Component;
|
|
if (setup2) {
|
|
pauseTracking();
|
|
const setupContext = instance.setupContext = setup2.length > 1 ? createSetupContext(instance) : null;
|
|
const reset = setCurrentInstance(instance);
|
|
const setupResult = callWithErrorHandling(
|
|
setup2,
|
|
instance,
|
|
0,
|
|
[
|
|
instance.props,
|
|
setupContext
|
|
]
|
|
);
|
|
const isAsyncSetup = isPromise(setupResult);
|
|
resetTracking();
|
|
reset();
|
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
|
|
markAsyncBoundary(instance);
|
|
}
|
|
if (isAsyncSetup) {
|
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
if (isSSR) {
|
|
return setupResult.then((resolvedResult) => {
|
|
handleSetupResult(instance, resolvedResult);
|
|
}).catch((e) => {
|
|
handleError(e, instance, 0);
|
|
});
|
|
} else {
|
|
instance.asyncDep = setupResult;
|
|
}
|
|
} else {
|
|
handleSetupResult(instance, setupResult);
|
|
}
|
|
} else {
|
|
finishComponentSetup(instance);
|
|
}
|
|
}
|
|
function handleSetupResult(instance, setupResult, isSSR) {
|
|
if (isFunction(setupResult)) {
|
|
if (instance.type.__ssrInlineRender) {
|
|
instance.ssrRender = setupResult;
|
|
} else {
|
|
instance.render = setupResult;
|
|
}
|
|
} else if (isObject(setupResult)) {
|
|
instance.setupState = proxyRefs(setupResult);
|
|
} else ;
|
|
finishComponentSetup(instance);
|
|
}
|
|
function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
const Component = instance.type;
|
|
if (!instance.render) {
|
|
instance.render = Component.render || NOOP;
|
|
}
|
|
{
|
|
const reset = setCurrentInstance(instance);
|
|
pauseTracking();
|
|
try {
|
|
applyOptions(instance);
|
|
} finally {
|
|
resetTracking();
|
|
reset();
|
|
}
|
|
}
|
|
}
|
|
const attrsProxyHandlers = {
|
|
get(target, key) {
|
|
track(target, "get", "");
|
|
return target[key];
|
|
}
|
|
};
|
|
function createSetupContext(instance) {
|
|
const expose = (exposed) => {
|
|
instance.exposed = exposed || {};
|
|
};
|
|
{
|
|
return {
|
|
attrs: new Proxy(instance.attrs, attrsProxyHandlers),
|
|
slots: instance.slots,
|
|
emit: instance.emit,
|
|
expose
|
|
};
|
|
}
|
|
}
|
|
function getComponentPublicInstance(instance) {
|
|
if (instance.exposed) {
|
|
return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
|
|
get(target, key) {
|
|
if (key in target) {
|
|
return target[key];
|
|
} else if (key in publicPropertiesMap) {
|
|
return publicPropertiesMap[key](instance);
|
|
}
|
|
},
|
|
has(target, key) {
|
|
return key in target || key in publicPropertiesMap;
|
|
}
|
|
}));
|
|
} else {
|
|
return instance.proxy;
|
|
}
|
|
}
|
|
const classifyRE = /(?:^|[-_])\w/g;
|
|
const classify = (str) => str.replace(classifyRE, (c2) => c2.toUpperCase()).replace(/[-_]/g, "");
|
|
function getComponentName(Component, includeInferred = true) {
|
|
return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
|
|
}
|
|
function formatComponentName(instance, Component, isRoot = false) {
|
|
let name = getComponentName(Component);
|
|
if (!name && Component.__file) {
|
|
const match = Component.__file.match(/([^/\\]+)\.\w+$/);
|
|
if (match) {
|
|
name = match[1];
|
|
}
|
|
}
|
|
if (!name && instance) {
|
|
const inferFromRegistry = (registry) => {
|
|
for (const key in registry) {
|
|
if (registry[key] === Component) {
|
|
return key;
|
|
}
|
|
}
|
|
};
|
|
name = inferFromRegistry(instance.components) || instance.parent && inferFromRegistry(
|
|
instance.parent.type.components
|
|
) || inferFromRegistry(instance.appContext.components);
|
|
}
|
|
return name ? classify(name) : isRoot ? `App` : `Anonymous`;
|
|
}
|
|
function isClassComponent(value) {
|
|
return isFunction(value) && "__vccOpts" in value;
|
|
}
|
|
const computed = (getterOrOptions, debugOptions) => {
|
|
const c2 = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
return c2;
|
|
};
|
|
const version = "3.5.26";
|
|
/**
|
|
* @vue/runtime-dom v3.5.26
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/
|
|
let policy = void 0;
|
|
const tt$1 = typeof window !== "undefined" && window.trustedTypes;
|
|
if (tt$1) {
|
|
try {
|
|
policy = /* @__PURE__ */ tt$1.createPolicy("vue", {
|
|
createHTML: (val) => val
|
|
});
|
|
} catch (e) {
|
|
}
|
|
}
|
|
const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
|
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
|
|
const doc = typeof document !== "undefined" ? document : null;
|
|
const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
|
|
const nodeOps = {
|
|
insert: (child, parent, anchor) => {
|
|
parent.insertBefore(child, anchor || null);
|
|
},
|
|
remove: (child) => {
|
|
const parent = child.parentNode;
|
|
if (parent) {
|
|
parent.removeChild(child);
|
|
}
|
|
},
|
|
createElement: (tag, namespace, is, props) => {
|
|
const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
|
|
if (tag === "select" && props && props.multiple != null) {
|
|
el.setAttribute("multiple", props.multiple);
|
|
}
|
|
return el;
|
|
},
|
|
createText: (text) => doc.createTextNode(text),
|
|
createComment: (text) => doc.createComment(text),
|
|
setText: (node, text) => {
|
|
node.nodeValue = text;
|
|
},
|
|
setElementText: (el, text) => {
|
|
el.textContent = text;
|
|
},
|
|
parentNode: (node) => node.parentNode,
|
|
nextSibling: (node) => node.nextSibling,
|
|
querySelector: (selector) => doc.querySelector(selector),
|
|
setScopeId(el, id) {
|
|
el.setAttribute(id, "");
|
|
},
|
|
// __UNSAFE__
|
|
// Reason: innerHTML.
|
|
// Static content here can only come from compiled templates.
|
|
// As long as the user only uses trusted templates, this is safe.
|
|
insertStaticContent(content, parent, anchor, namespace, start, end) {
|
|
const before = anchor ? anchor.previousSibling : parent.lastChild;
|
|
if (start && (start === end || start.nextSibling)) {
|
|
while (true) {
|
|
parent.insertBefore(start.cloneNode(true), anchor);
|
|
if (start === end || !(start = start.nextSibling)) break;
|
|
}
|
|
} else {
|
|
templateContainer.innerHTML = unsafeToTrustedHTML(
|
|
namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
|
|
);
|
|
const template = templateContainer.content;
|
|
if (namespace === "svg" || namespace === "mathml") {
|
|
const wrapper = template.firstChild;
|
|
while (wrapper.firstChild) {
|
|
template.appendChild(wrapper.firstChild);
|
|
}
|
|
template.removeChild(wrapper);
|
|
}
|
|
parent.insertBefore(template, anchor);
|
|
}
|
|
return [
|
|
// first
|
|
before ? before.nextSibling : parent.firstChild,
|
|
// last
|
|
anchor ? anchor.previousSibling : parent.lastChild
|
|
];
|
|
}
|
|
};
|
|
const vtcKey = /* @__PURE__ */ Symbol("_vtc");
|
|
function patchClass(el, value, isSVG) {
|
|
const transitionClasses = el[vtcKey];
|
|
if (transitionClasses) {
|
|
value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
|
|
}
|
|
if (value == null) {
|
|
el.removeAttribute("class");
|
|
} else if (isSVG) {
|
|
el.setAttribute("class", value);
|
|
} else {
|
|
el.className = value;
|
|
}
|
|
}
|
|
const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
|
|
const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
|
|
const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("");
|
|
const displayRE = /(?:^|;)\s*display\s*:/;
|
|
function patchStyle(el, prev, next) {
|
|
const style2 = el.style;
|
|
const isCssString = isString(next);
|
|
let hasControlledDisplay = false;
|
|
if (next && !isCssString) {
|
|
if (prev) {
|
|
if (!isString(prev)) {
|
|
for (const key in prev) {
|
|
if (next[key] == null) {
|
|
setStyle(style2, key, "");
|
|
}
|
|
}
|
|
} else {
|
|
for (const prevStyle of prev.split(";")) {
|
|
const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
|
|
if (next[key] == null) {
|
|
setStyle(style2, key, "");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (const key in next) {
|
|
if (key === "display") {
|
|
hasControlledDisplay = true;
|
|
}
|
|
setStyle(style2, key, next[key]);
|
|
}
|
|
} else {
|
|
if (isCssString) {
|
|
if (prev !== next) {
|
|
const cssVarText = style2[CSS_VAR_TEXT];
|
|
if (cssVarText) {
|
|
next += ";" + cssVarText;
|
|
}
|
|
style2.cssText = next;
|
|
hasControlledDisplay = displayRE.test(next);
|
|
}
|
|
} else if (prev) {
|
|
el.removeAttribute("style");
|
|
}
|
|
}
|
|
if (vShowOriginalDisplay in el) {
|
|
el[vShowOriginalDisplay] = hasControlledDisplay ? style2.display : "";
|
|
if (el[vShowHidden]) {
|
|
style2.display = "none";
|
|
}
|
|
}
|
|
}
|
|
const importantRE = /\s*!important$/;
|
|
function setStyle(style2, name, val) {
|
|
if (isArray(val)) {
|
|
val.forEach((v2) => setStyle(style2, name, v2));
|
|
} else {
|
|
if (val == null) val = "";
|
|
if (name.startsWith("--")) {
|
|
style2.setProperty(name, val);
|
|
} else {
|
|
const prefixed = autoPrefix(style2, name);
|
|
if (importantRE.test(val)) {
|
|
style2.setProperty(
|
|
hyphenate(prefixed),
|
|
val.replace(importantRE, ""),
|
|
"important"
|
|
);
|
|
} else {
|
|
style2[prefixed] = val;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const prefixes = ["Webkit", "Moz", "ms"];
|
|
const prefixCache = {};
|
|
function autoPrefix(style2, rawName) {
|
|
const cached = prefixCache[rawName];
|
|
if (cached) {
|
|
return cached;
|
|
}
|
|
let name = camelize(rawName);
|
|
if (name !== "filter" && name in style2) {
|
|
return prefixCache[rawName] = name;
|
|
}
|
|
name = capitalize(name);
|
|
for (let i2 = 0; i2 < prefixes.length; i2++) {
|
|
const prefixed = prefixes[i2] + name;
|
|
if (prefixed in style2) {
|
|
return prefixCache[rawName] = prefixed;
|
|
}
|
|
}
|
|
return rawName;
|
|
}
|
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
|
|
if (isSVG && key.startsWith("xlink:")) {
|
|
if (value == null) {
|
|
el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
|
|
} else {
|
|
el.setAttributeNS(xlinkNS, key, value);
|
|
}
|
|
} else {
|
|
if (value == null || isBoolean && !includeBooleanAttr(value)) {
|
|
el.removeAttribute(key);
|
|
} else {
|
|
el.setAttribute(
|
|
key,
|
|
isBoolean ? "" : isSymbol(value) ? String(value) : value
|
|
);
|
|
}
|
|
}
|
|
}
|
|
function patchDOMProp(el, key, value, parentComponent, attrName) {
|
|
if (key === "innerHTML" || key === "textContent") {
|
|
if (value != null) {
|
|
el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
|
|
}
|
|
return;
|
|
}
|
|
const tag = el.tagName;
|
|
if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
|
|
!tag.includes("-")) {
|
|
const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
|
|
const newValue = value == null ? (
|
|
// #11647: value should be set as empty string for null and undefined,
|
|
// but <input type="checkbox"> should be set as 'on'.
|
|
el.type === "checkbox" ? "on" : ""
|
|
) : String(value);
|
|
if (oldValue !== newValue || !("_value" in el)) {
|
|
el.value = newValue;
|
|
}
|
|
if (value == null) {
|
|
el.removeAttribute(key);
|
|
}
|
|
el._value = value;
|
|
return;
|
|
}
|
|
let needRemove = false;
|
|
if (value === "" || value == null) {
|
|
const type = typeof el[key];
|
|
if (type === "boolean") {
|
|
value = includeBooleanAttr(value);
|
|
} else if (value == null && type === "string") {
|
|
value = "";
|
|
needRemove = true;
|
|
} else if (type === "number") {
|
|
value = 0;
|
|
needRemove = true;
|
|
}
|
|
}
|
|
try {
|
|
el[key] = value;
|
|
} catch (e) {
|
|
}
|
|
needRemove && el.removeAttribute(attrName || key);
|
|
}
|
|
function addEventListener(el, event, handler9, options) {
|
|
el.addEventListener(event, handler9, options);
|
|
}
|
|
function removeEventListener(el, event, handler9, options) {
|
|
el.removeEventListener(event, handler9, options);
|
|
}
|
|
const veiKey = /* @__PURE__ */ Symbol("_vei");
|
|
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
const invokers = el[veiKey] || (el[veiKey] = {});
|
|
const existingInvoker = invokers[rawName];
|
|
if (nextValue && existingInvoker) {
|
|
existingInvoker.value = nextValue;
|
|
} else {
|
|
const [name, options] = parseName(rawName);
|
|
if (nextValue) {
|
|
const invoker = invokers[rawName] = createInvoker(
|
|
nextValue,
|
|
instance
|
|
);
|
|
addEventListener(el, name, invoker, options);
|
|
} else if (existingInvoker) {
|
|
removeEventListener(el, name, existingInvoker, options);
|
|
invokers[rawName] = void 0;
|
|
}
|
|
}
|
|
}
|
|
const optionsModifierRE = /(?:Once|Passive|Capture)$/;
|
|
function parseName(name) {
|
|
let options;
|
|
if (optionsModifierRE.test(name)) {
|
|
options = {};
|
|
let m2;
|
|
while (m2 = name.match(optionsModifierRE)) {
|
|
name = name.slice(0, name.length - m2[0].length);
|
|
options[m2[0].toLowerCase()] = true;
|
|
}
|
|
}
|
|
const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
|
|
return [event, options];
|
|
}
|
|
let cachedNow = 0;
|
|
const p = /* @__PURE__ */ Promise.resolve();
|
|
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
|
|
function createInvoker(initialValue, instance) {
|
|
const invoker = (e) => {
|
|
if (!e._vts) {
|
|
e._vts = Date.now();
|
|
} else if (e._vts <= invoker.attached) {
|
|
return;
|
|
}
|
|
callWithAsyncErrorHandling(
|
|
patchStopImmediatePropagation(e, invoker.value),
|
|
instance,
|
|
5,
|
|
[e]
|
|
);
|
|
};
|
|
invoker.value = initialValue;
|
|
invoker.attached = getNow();
|
|
return invoker;
|
|
}
|
|
function patchStopImmediatePropagation(e, value) {
|
|
if (isArray(value)) {
|
|
const originalStop = e.stopImmediatePropagation;
|
|
e.stopImmediatePropagation = () => {
|
|
originalStop.call(e);
|
|
e._stopped = true;
|
|
};
|
|
return value.map(
|
|
(fn) => (e2) => !e2._stopped && fn && fn(e2)
|
|
);
|
|
} else {
|
|
return value;
|
|
}
|
|
}
|
|
const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
|
|
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
|
|
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
|
|
const isSVG = namespace === "svg";
|
|
if (key === "class") {
|
|
patchClass(el, nextValue, isSVG);
|
|
} else if (key === "style") {
|
|
patchStyle(el, prevValue, nextValue);
|
|
} else if (isOn(key)) {
|
|
if (!isModelListener(key)) {
|
|
patchEvent(el, key, prevValue, nextValue, parentComponent);
|
|
}
|
|
} else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
|
|
patchDOMProp(el, key, nextValue);
|
|
if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
|
|
patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
|
|
}
|
|
} else if (
|
|
// #11081 force set props for possible async custom element
|
|
el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
|
|
) {
|
|
patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
|
|
} else {
|
|
if (key === "true-value") {
|
|
el._trueValue = nextValue;
|
|
} else if (key === "false-value") {
|
|
el._falseValue = nextValue;
|
|
}
|
|
patchAttr(el, key, nextValue, isSVG);
|
|
}
|
|
};
|
|
function shouldSetAsProp(el, key, value, isSVG) {
|
|
if (isSVG) {
|
|
if (key === "innerHTML" || key === "textContent") {
|
|
return true;
|
|
}
|
|
if (key in el && isNativeOn(key) && isFunction(value)) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
|
|
return false;
|
|
}
|
|
if (key === "sandbox" && el.tagName === "IFRAME") {
|
|
return false;
|
|
}
|
|
if (key === "form") {
|
|
return false;
|
|
}
|
|
if (key === "list" && el.tagName === "INPUT") {
|
|
return false;
|
|
}
|
|
if (key === "type" && el.tagName === "TEXTAREA") {
|
|
return false;
|
|
}
|
|
if (key === "width" || key === "height") {
|
|
const tag = el.tagName;
|
|
if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
|
|
return false;
|
|
}
|
|
}
|
|
if (isNativeOn(key) && isString(value)) {
|
|
return false;
|
|
}
|
|
return key in el;
|
|
}
|
|
const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
|
|
let renderer;
|
|
function ensureRenderer() {
|
|
return renderer || (renderer = createRenderer(rendererOptions));
|
|
}
|
|
const createApp = ((...args) => {
|
|
const app2 = ensureRenderer().createApp(...args);
|
|
const { mount } = app2;
|
|
app2.mount = (containerOrSelector) => {
|
|
const container = normalizeContainer(containerOrSelector);
|
|
if (!container) return;
|
|
const component = app2._component;
|
|
if (!isFunction(component) && !component.render && !component.template) {
|
|
component.template = container.innerHTML;
|
|
}
|
|
if (container.nodeType === 1) {
|
|
container.textContent = "";
|
|
}
|
|
const proxy = mount(container, false, resolveRootNamespace(container));
|
|
if (container instanceof Element) {
|
|
container.removeAttribute("v-cloak");
|
|
container.setAttribute("data-v-app", "");
|
|
}
|
|
return proxy;
|
|
};
|
|
return app2;
|
|
});
|
|
function resolveRootNamespace(container) {
|
|
if (container instanceof SVGElement) {
|
|
return "svg";
|
|
}
|
|
if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
|
|
return "mathml";
|
|
}
|
|
}
|
|
function normalizeContainer(container) {
|
|
if (isString(container)) {
|
|
const res = document.querySelector(container);
|
|
return res;
|
|
}
|
|
return container;
|
|
}
|
|
var ie$1 = Object.defineProperty;
|
|
var K$1 = Object.getOwnPropertySymbols;
|
|
var se = Object.prototype.hasOwnProperty, ae$1 = Object.prototype.propertyIsEnumerable;
|
|
var N$1 = (e, t2, n) => t2 in e ? ie$1(e, t2, { enumerable: true, configurable: true, writable: true, value: n }) : e[t2] = n, d = (e, t2) => {
|
|
for (var n in t2 || (t2 = {})) se.call(t2, n) && N$1(e, n, t2[n]);
|
|
if (K$1) for (var n of K$1(t2)) ae$1.call(t2, n) && N$1(e, n, t2[n]);
|
|
return e;
|
|
};
|
|
function l(e) {
|
|
return e == null || e === "" || Array.isArray(e) && e.length === 0 || !(e instanceof Date) && typeof e == "object" && Object.keys(e).length === 0;
|
|
}
|
|
function c$1(e) {
|
|
return typeof e == "function" && "call" in e && "apply" in e;
|
|
}
|
|
function s$2(e) {
|
|
return !l(e);
|
|
}
|
|
function i(e, t2 = true) {
|
|
return e instanceof Object && e.constructor === Object && (t2 || Object.keys(e).length !== 0);
|
|
}
|
|
function $$1(e = {}, t2 = {}) {
|
|
let n = d({}, e);
|
|
return Object.keys(t2).forEach((o) => {
|
|
let r = o;
|
|
i(t2[r]) && r in e && i(e[r]) ? n[r] = $$1(e[r], t2[r]) : n[r] = t2[r];
|
|
}), n;
|
|
}
|
|
function w(...e) {
|
|
return e.reduce((t2, n, o) => o === 0 ? n : $$1(t2, n), {});
|
|
}
|
|
function m(e, ...t2) {
|
|
return c$1(e) ? e(...t2) : e;
|
|
}
|
|
function a(e, t2 = true) {
|
|
return typeof e == "string" && (t2 || e !== "");
|
|
}
|
|
function g(e) {
|
|
return a(e) ? e.replace(/(-|_)/g, "").toLowerCase() : e;
|
|
}
|
|
function F$1(e, t2 = "", n = {}) {
|
|
let o = g(t2).split("."), r = o.shift();
|
|
if (r) {
|
|
if (i(e)) {
|
|
let u = Object.keys(e).find((f2) => g(f2) === r) || "";
|
|
return F$1(m(e[u], n), o.join("."), n);
|
|
}
|
|
return;
|
|
}
|
|
return m(e, n);
|
|
}
|
|
function C$2(e, t2 = true) {
|
|
return Array.isArray(e) && (t2 || e.length !== 0);
|
|
}
|
|
function z$1(e) {
|
|
return s$2(e) && !isNaN(e);
|
|
}
|
|
function G(e, t2) {
|
|
if (t2) {
|
|
let n = t2.test(e);
|
|
return t2.lastIndex = 0, n;
|
|
}
|
|
return false;
|
|
}
|
|
function H(...e) {
|
|
return w(...e);
|
|
}
|
|
function Y$1(e) {
|
|
return e && e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/ ([{:}]) /g, "$1").replace(/([;,]) /g, "$1").replace(/ !/g, "!").replace(/: /g, ":").trim();
|
|
}
|
|
function ne$1(e) {
|
|
return a(e, false) ? e[0].toUpperCase() + e.slice(1) : e;
|
|
}
|
|
function re(e) {
|
|
return a(e) ? e.replace(/(_)/g, "-").replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase() : e;
|
|
}
|
|
function s$1() {
|
|
let r = /* @__PURE__ */ new Map();
|
|
return { on(e, t2) {
|
|
let n = r.get(e);
|
|
return n ? n.push(t2) : n = [t2], r.set(e, n), this;
|
|
}, off(e, t2) {
|
|
let n = r.get(e);
|
|
return n && n.splice(n.indexOf(t2) >>> 0, 1), this;
|
|
}, emit(e, t2) {
|
|
let n = r.get(e);
|
|
n && n.forEach((i2) => {
|
|
i2(t2);
|
|
});
|
|
}, clear() {
|
|
r.clear();
|
|
} };
|
|
}
|
|
function f(...e) {
|
|
if (e) {
|
|
let t2 = [];
|
|
for (let i2 = 0; i2 < e.length; i2++) {
|
|
let n = e[i2];
|
|
if (!n) continue;
|
|
let s2 = typeof n;
|
|
if (s2 === "string" || s2 === "number") t2.push(n);
|
|
else if (s2 === "object") {
|
|
let c2 = Array.isArray(n) ? [f(...n)] : Object.entries(n).map(([r, o]) => o ? r : void 0);
|
|
t2 = c2.length ? t2.concat(c2.filter((r) => !!r)) : t2;
|
|
}
|
|
}
|
|
return t2.join(" ").trim();
|
|
}
|
|
}
|
|
function R(t2, e) {
|
|
return t2 ? t2.classList ? t2.classList.contains(e) : new RegExp("(^| )" + e + "( |$)", "gi").test(t2.className) : false;
|
|
}
|
|
function W(t2, e) {
|
|
if (t2 && e) {
|
|
let o = (n) => {
|
|
R(t2, n) || (t2.classList ? t2.classList.add(n) : t2.className += " " + n);
|
|
};
|
|
[e].flat().filter(Boolean).forEach((n) => n.split(" ").forEach(o));
|
|
}
|
|
}
|
|
function P(t2, e) {
|
|
if (t2 && e) {
|
|
let o = (n) => {
|
|
t2.classList ? t2.classList.remove(n) : t2.className = t2.className.replace(new RegExp("(^|\\b)" + n.split(" ").join("|") + "(\\b|$)", "gi"), " ");
|
|
};
|
|
[e].flat().filter(Boolean).forEach((n) => n.split(" ").forEach(o));
|
|
}
|
|
}
|
|
function E$1(t2) {
|
|
return t2 ? Math.abs(t2.scrollLeft) : 0;
|
|
}
|
|
function v$1(t2, e) {
|
|
if (t2 instanceof HTMLElement) {
|
|
let o = t2.offsetWidth;
|
|
return o;
|
|
}
|
|
return 0;
|
|
}
|
|
function y(t2) {
|
|
if (t2) {
|
|
let e = t2.parentNode;
|
|
return e && e instanceof ShadowRoot && e.host && (e = e.host), e;
|
|
}
|
|
return null;
|
|
}
|
|
function T(t2) {
|
|
return !!(t2 !== null && typeof t2 != "undefined" && t2.nodeName && y(t2));
|
|
}
|
|
function c(t2) {
|
|
return typeof Element != "undefined" ? t2 instanceof Element : t2 !== null && typeof t2 == "object" && t2.nodeType === 1 && typeof t2.nodeName == "string";
|
|
}
|
|
function pt() {
|
|
if (window.getSelection) {
|
|
let t2 = window.getSelection() || {};
|
|
t2.empty ? t2.empty() : t2.removeAllRanges && t2.rangeCount > 0 && t2.getRangeAt(0).getClientRects().length > 0 && t2.removeAllRanges();
|
|
}
|
|
}
|
|
function A(t2, e = {}) {
|
|
if (c(t2)) {
|
|
let o = (n, r) => {
|
|
var l2, d2;
|
|
let i2 = (l2 = t2 == null ? void 0 : t2.$attrs) != null && l2[n] ? [(d2 = t2 == null ? void 0 : t2.$attrs) == null ? void 0 : d2[n]] : [];
|
|
return [r].flat().reduce((s2, a2) => {
|
|
if (a2 != null) {
|
|
let u = typeof a2;
|
|
if (u === "string" || u === "number") s2.push(a2);
|
|
else if (u === "object") {
|
|
let p2 = Array.isArray(a2) ? o(n, a2) : Object.entries(a2).map(([f2, g2]) => n === "style" && (g2 || g2 === 0) ? `${f2.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}:${g2}` : g2 ? f2 : void 0);
|
|
s2 = p2.length ? s2.concat(p2.filter((f2) => !!f2)) : s2;
|
|
}
|
|
}
|
|
return s2;
|
|
}, i2);
|
|
};
|
|
Object.entries(e).forEach(([n, r]) => {
|
|
if (r != null) {
|
|
let i2 = n.match(/^on(.+)/);
|
|
i2 ? t2.addEventListener(i2[1].toLowerCase(), r) : n === "p-bind" || n === "pBind" ? A(t2, r) : (r = n === "class" ? [...new Set(o("class", r))].join(" ").trim() : n === "style" ? o("style", r).join(";").trim() : r, (t2.$attrs = t2.$attrs || {}) && (t2.$attrs[n] = r), t2.setAttribute(n, r));
|
|
}
|
|
});
|
|
}
|
|
}
|
|
function U(t2, e = {}, ...o) {
|
|
{
|
|
let n = document.createElement(t2);
|
|
return A(n, e), n.append(...o), n;
|
|
}
|
|
}
|
|
function z(t2, e) {
|
|
return c(t2) ? t2.matches(e) ? t2 : t2.querySelector(e) : null;
|
|
}
|
|
function Q$1(t2, e) {
|
|
if (c(t2)) {
|
|
let o = t2.getAttribute(e);
|
|
return isNaN(o) ? o === "true" || o === "false" ? o === "true" : o : +o;
|
|
}
|
|
}
|
|
function Tt(t2) {
|
|
if (t2) {
|
|
let e = t2.offsetHeight, o = getComputedStyle(t2);
|
|
return e -= parseFloat(o.paddingTop) + parseFloat(o.paddingBottom) + parseFloat(o.borderTopWidth) + parseFloat(o.borderBottomWidth), e;
|
|
}
|
|
return 0;
|
|
}
|
|
function K(t2) {
|
|
if (t2) {
|
|
let e = t2.getBoundingClientRect();
|
|
return { top: e.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0), left: e.left + (window.pageXOffset || E$1(document.documentElement) || E$1(document.body) || 0) };
|
|
}
|
|
return { top: "auto", left: "auto" };
|
|
}
|
|
function C$1(t2, e) {
|
|
if (t2) {
|
|
let o = t2.offsetHeight;
|
|
return o;
|
|
}
|
|
return 0;
|
|
}
|
|
function Mt() {
|
|
if (window.getSelection) return window.getSelection().toString();
|
|
if (document.getSelection) return document.getSelection().toString();
|
|
}
|
|
function Rt(t2) {
|
|
if (t2) {
|
|
let e = t2.offsetWidth, o = getComputedStyle(t2);
|
|
return e -= parseFloat(o.paddingLeft) + parseFloat(o.paddingRight) + parseFloat(o.borderLeftWidth) + parseFloat(o.borderRightWidth), e;
|
|
}
|
|
return 0;
|
|
}
|
|
function tt() {
|
|
return !!(typeof window != "undefined" && window.document && window.document.createElement);
|
|
}
|
|
function _t(t2, e = "", o) {
|
|
c(t2) && o !== null && o !== void 0 && t2.setAttribute(e, o);
|
|
}
|
|
var t = {};
|
|
function s(n = "pui_id_") {
|
|
return Object.hasOwn(t, n) || (t[n] = 0), t[n]++, `${n}${t[n]}`;
|
|
}
|
|
var rt = Object.defineProperty, st = Object.defineProperties;
|
|
var nt = Object.getOwnPropertyDescriptors;
|
|
var F = Object.getOwnPropertySymbols;
|
|
var xe = Object.prototype.hasOwnProperty, be = Object.prototype.propertyIsEnumerable;
|
|
var _e = (e, t2, r) => t2 in e ? rt(e, t2, { enumerable: true, configurable: true, writable: true, value: r }) : e[t2] = r, h = (e, t2) => {
|
|
for (var r in t2 || (t2 = {})) xe.call(t2, r) && _e(e, r, t2[r]);
|
|
if (F) for (var r of F(t2)) be.call(t2, r) && _e(e, r, t2[r]);
|
|
return e;
|
|
}, $ = (e, t2) => st(e, nt(t2));
|
|
var v = (e, t2) => {
|
|
var r = {};
|
|
for (var s2 in e) xe.call(e, s2) && t2.indexOf(s2) < 0 && (r[s2] = e[s2]);
|
|
if (e != null && F) for (var s2 of F(e)) t2.indexOf(s2) < 0 && be.call(e, s2) && (r[s2] = e[s2]);
|
|
return r;
|
|
};
|
|
var at = s$1(), N = at;
|
|
var k = /{([^}]*)}/g, ne = /(\d+\s+[\+\-\*\/]\s+\d+)/g, ie = /var\([^)]+\)/g;
|
|
function oe(e) {
|
|
return a(e) ? e.replace(/[A-Z]/g, (t2, r) => r === 0 ? t2 : "." + t2.toLowerCase()).toLowerCase() : e;
|
|
}
|
|
function ve(e) {
|
|
return i(e) && e.hasOwnProperty("$value") && e.hasOwnProperty("$type") ? e.$value : e;
|
|
}
|
|
function dt(e) {
|
|
return e.replaceAll(/ /g, "").replace(/[^\w]/g, "-");
|
|
}
|
|
function Q(e = "", t2 = "") {
|
|
return dt(`${a(e, false) && a(t2, false) ? `${e}-` : e}${t2}`);
|
|
}
|
|
function ae(e = "", t2 = "") {
|
|
return `--${Q(e, t2)}`;
|
|
}
|
|
function ht(e = "") {
|
|
let t2 = (e.match(/{/g) || []).length, r = (e.match(/}/g) || []).length;
|
|
return (t2 + r) % 2 !== 0;
|
|
}
|
|
function Y(e, t2 = "", r = "", s2 = [], i2) {
|
|
if (a(e)) {
|
|
let a2 = e.trim();
|
|
if (ht(a2)) return;
|
|
if (G(a2, k)) {
|
|
let n = a2.replaceAll(k, (l2) => {
|
|
let c2 = l2.replace(/{|}/g, "").split(".").filter((m2) => !s2.some((d2) => G(m2, d2)));
|
|
return `var(${ae(r, re(c2.join("-")))}${s$2(i2) ? `, ${i2}` : ""})`;
|
|
});
|
|
return G(n.replace(ie, "0"), ne) ? `calc(${n})` : n;
|
|
}
|
|
return a2;
|
|
} else if (z$1(e)) return e;
|
|
}
|
|
function Re(e, t2, r) {
|
|
a(t2, false) && e.push(`${t2}:${r};`);
|
|
}
|
|
function C(e, t2) {
|
|
return e ? `${e}{${t2}}` : "";
|
|
}
|
|
function le(e, t2) {
|
|
if (e.indexOf("dt(") === -1) return e;
|
|
function r(n, l2) {
|
|
let o = [], c2 = 0, m2 = "", d2 = null, u = 0;
|
|
for (; c2 <= n.length; ) {
|
|
let g2 = n[c2];
|
|
if ((g2 === '"' || g2 === "'" || g2 === "`") && n[c2 - 1] !== "\\" && (d2 = d2 === g2 ? null : g2), !d2 && (g2 === "(" && u++, g2 === ")" && u--, (g2 === "," || c2 === n.length) && u === 0)) {
|
|
let f2 = m2.trim();
|
|
f2.startsWith("dt(") ? o.push(le(f2, l2)) : o.push(s2(f2)), m2 = "", c2++;
|
|
continue;
|
|
}
|
|
g2 !== void 0 && (m2 += g2), c2++;
|
|
}
|
|
return o;
|
|
}
|
|
function s2(n) {
|
|
let l2 = n[0];
|
|
if ((l2 === '"' || l2 === "'" || l2 === "`") && n[n.length - 1] === l2) return n.slice(1, -1);
|
|
let o = Number(n);
|
|
return isNaN(o) ? n : o;
|
|
}
|
|
let i2 = [], a2 = [];
|
|
for (let n = 0; n < e.length; n++) if (e[n] === "d" && e.slice(n, n + 3) === "dt(") a2.push(n), n += 2;
|
|
else if (e[n] === ")" && a2.length > 0) {
|
|
let l2 = a2.pop();
|
|
a2.length === 0 && i2.push([l2, n]);
|
|
}
|
|
if (!i2.length) return e;
|
|
for (let n = i2.length - 1; n >= 0; n--) {
|
|
let [l2, o] = i2[n], c2 = e.slice(l2 + 3, o), m2 = r(c2, t2), d2 = t2(...m2);
|
|
e = e.slice(0, l2) + d2 + e.slice(o + 1);
|
|
}
|
|
return e;
|
|
}
|
|
var E = (...e) => ue(S.getTheme(), ...e), ue = (e = {}, t2, r, s2) => {
|
|
if (t2) {
|
|
let { variable: i2, options: a2 } = S.defaults || {}, { prefix: n, transform: l$1 } = (e == null ? void 0 : e.options) || a2 || {}, o = G(t2, k) ? t2 : `{${t2}}`;
|
|
return s2 === "value" || l(s2) && l$1 === "strict" ? S.getTokenValue(t2) : Y(o, void 0, n, [i2.excludedKeyRegex], r);
|
|
}
|
|
return "";
|
|
};
|
|
function ar(e, ...t2) {
|
|
if (e instanceof Array) {
|
|
let r = e.reduce((s2, i2, a2) => {
|
|
var n;
|
|
return s2 + i2 + ((n = m(t2[a2], { dt: E })) != null ? n : "");
|
|
}, "");
|
|
return le(r, E);
|
|
}
|
|
return m(e, { dt: E });
|
|
}
|
|
function de(e, t2 = {}) {
|
|
let r = S.defaults.variable, { prefix: s2 = r.prefix, selector: i$1 = r.selector, excludedKeyRegex: a2 = r.excludedKeyRegex } = t2, n = [], l2 = [], o = [{ node: e, path: s2 }];
|
|
for (; o.length; ) {
|
|
let { node: m2, path: d2 } = o.pop();
|
|
for (let u in m2) {
|
|
let g2 = m2[u], f2 = ve(g2), p2 = G(u, a2) ? Q(d2) : Q(d2, re(u));
|
|
if (i(f2)) o.push({ node: f2, path: p2 });
|
|
else {
|
|
let y2 = ae(p2), R2 = Y(f2, p2, s2, [a2]);
|
|
Re(l2, y2, R2);
|
|
let T2 = p2;
|
|
s2 && T2.startsWith(s2 + "-") && (T2 = T2.slice(s2.length + 1)), n.push(T2.replace(/-/g, "."));
|
|
}
|
|
}
|
|
}
|
|
let c2 = l2.join("");
|
|
return { value: l2, tokens: n, declarations: c2, css: C(i$1, c2) };
|
|
}
|
|
var b = { regex: { rules: { class: { pattern: /^\.([a-zA-Z][\w-]*)$/, resolve(e) {
|
|
return { type: "class", selector: e, matched: this.pattern.test(e.trim()) };
|
|
} }, attr: { pattern: /^\[(.*)\]$/, resolve(e) {
|
|
return { type: "attr", selector: `:root${e},:host${e}`, matched: this.pattern.test(e.trim()) };
|
|
} }, media: { pattern: /^@media (.*)$/, resolve(e) {
|
|
return { type: "media", selector: e, matched: this.pattern.test(e.trim()) };
|
|
} }, system: { pattern: /^system$/, resolve(e) {
|
|
return { type: "system", selector: "@media (prefers-color-scheme: dark)", matched: this.pattern.test(e.trim()) };
|
|
} }, custom: { resolve(e) {
|
|
return { type: "custom", selector: e, matched: true };
|
|
} } }, resolve(e) {
|
|
let t2 = Object.keys(this.rules).filter((r) => r !== "custom").map((r) => this.rules[r]);
|
|
return [e].flat().map((r) => {
|
|
var s2;
|
|
return (s2 = t2.map((i2) => i2.resolve(r)).find((i2) => i2.matched)) != null ? s2 : this.rules.custom.resolve(r);
|
|
});
|
|
} }, _toVariables(e, t2) {
|
|
return de(e, { prefix: t2 == null ? void 0 : t2.prefix });
|
|
}, getCommon({ name: e = "", theme: t2 = {}, params: r, set: s2, defaults: i2 }) {
|
|
var R2, T2, j, O, M, z2, V;
|
|
let { preset: a2, options: n } = t2, l2, o, c2, m$1, d2, u, g2;
|
|
if (s$2(a2) && n.transform !== "strict") {
|
|
let { primitive: L, semantic: te, extend: re2 } = a2, f2 = te || {}, { colorScheme: K2 } = f2, A2 = v(f2, ["colorScheme"]), x = re2 || {}, { colorScheme: X } = x, G2 = v(x, ["colorScheme"]), p2 = K2 || {}, { dark: U2 } = p2, B = v(p2, ["dark"]), y2 = X || {}, { dark: I } = y2, H2 = v(y2, ["dark"]), W2 = s$2(L) ? this._toVariables({ primitive: L }, n) : {}, q = s$2(A2) ? this._toVariables({ semantic: A2 }, n) : {}, Z = s$2(B) ? this._toVariables({ light: B }, n) : {}, pe = s$2(U2) ? this._toVariables({ dark: U2 }, n) : {}, fe = s$2(G2) ? this._toVariables({ semantic: G2 }, n) : {}, ye = s$2(H2) ? this._toVariables({ light: H2 }, n) : {}, Se = s$2(I) ? this._toVariables({ dark: I }, n) : {}, [Me, ze] = [(R2 = W2.declarations) != null ? R2 : "", W2.tokens], [Ke, Xe] = [(T2 = q.declarations) != null ? T2 : "", q.tokens || []], [Ge, Ue] = [(j = Z.declarations) != null ? j : "", Z.tokens || []], [Be, Ie] = [(O = pe.declarations) != null ? O : "", pe.tokens || []], [He, We] = [(M = fe.declarations) != null ? M : "", fe.tokens || []], [qe, Ze] = [(z2 = ye.declarations) != null ? z2 : "", ye.tokens || []], [Fe, Je] = [(V = Se.declarations) != null ? V : "", Se.tokens || []];
|
|
l2 = this.transformCSS(e, Me, "light", "variable", n, s2, i2), o = ze;
|
|
let Qe = this.transformCSS(e, `${Ke}${Ge}`, "light", "variable", n, s2, i2), Ye = this.transformCSS(e, `${Be}`, "dark", "variable", n, s2, i2);
|
|
c2 = `${Qe}${Ye}`, m$1 = [.../* @__PURE__ */ new Set([...Xe, ...Ue, ...Ie])];
|
|
let et = this.transformCSS(e, `${He}${qe}color-scheme:light`, "light", "variable", n, s2, i2), tt2 = this.transformCSS(e, `${Fe}color-scheme:dark`, "dark", "variable", n, s2, i2);
|
|
d2 = `${et}${tt2}`, u = [.../* @__PURE__ */ new Set([...We, ...Ze, ...Je])], g2 = m(a2.css, { dt: E });
|
|
}
|
|
return { primitive: { css: l2, tokens: o }, semantic: { css: c2, tokens: m$1 }, global: { css: d2, tokens: u }, style: g2 };
|
|
}, getPreset({ name: e = "", preset: t2 = {}, options: r, params: s2, set: i2, defaults: a2, selector: n }) {
|
|
var f2, x, p2;
|
|
let l2, o, c2;
|
|
if (s$2(t2) && r.transform !== "strict") {
|
|
let y2 = e.replace("-directive", ""), m$1 = t2, { colorScheme: R2, extend: T2, css: j } = m$1, O = v(m$1, ["colorScheme", "extend", "css"]), d2 = T2 || {}, { colorScheme: M } = d2, z2 = v(d2, ["colorScheme"]), u = R2 || {}, { dark: V } = u, L = v(u, ["dark"]), g2 = M || {}, { dark: te } = g2, re2 = v(g2, ["dark"]), K2 = s$2(O) ? this._toVariables({ [y2]: h(h({}, O), z2) }, r) : {}, A2 = s$2(L) ? this._toVariables({ [y2]: h(h({}, L), re2) }, r) : {}, X = s$2(V) ? this._toVariables({ [y2]: h(h({}, V), te) }, r) : {}, [G2, U2] = [(f2 = K2.declarations) != null ? f2 : "", K2.tokens || []], [B, I] = [(x = A2.declarations) != null ? x : "", A2.tokens || []], [H2, W2] = [(p2 = X.declarations) != null ? p2 : "", X.tokens || []], q = this.transformCSS(y2, `${G2}${B}`, "light", "variable", r, i2, a2, n), Z = this.transformCSS(y2, H2, "dark", "variable", r, i2, a2, n);
|
|
l2 = `${q}${Z}`, o = [.../* @__PURE__ */ new Set([...U2, ...I, ...W2])], c2 = m(j, { dt: E });
|
|
}
|
|
return { css: l2, tokens: o, style: c2 };
|
|
}, getPresetC({ name: e = "", theme: t2 = {}, params: r, set: s2, defaults: i2 }) {
|
|
var o;
|
|
let { preset: a2, options: n } = t2, l2 = (o = a2 == null ? void 0 : a2.components) == null ? void 0 : o[e];
|
|
return this.getPreset({ name: e, preset: l2, options: n, params: r, set: s2, defaults: i2 });
|
|
}, getPresetD({ name: e = "", theme: t2 = {}, params: r, set: s2, defaults: i2 }) {
|
|
var c2, m2;
|
|
let a2 = e.replace("-directive", ""), { preset: n, options: l2 } = t2, o = ((c2 = n == null ? void 0 : n.components) == null ? void 0 : c2[a2]) || ((m2 = n == null ? void 0 : n.directives) == null ? void 0 : m2[a2]);
|
|
return this.getPreset({ name: a2, preset: o, options: l2, params: r, set: s2, defaults: i2 });
|
|
}, applyDarkColorScheme(e) {
|
|
return !(e.darkModeSelector === "none" || e.darkModeSelector === false);
|
|
}, getColorSchemeOption(e, t2) {
|
|
var r;
|
|
return this.applyDarkColorScheme(e) ? this.regex.resolve(e.darkModeSelector === true ? t2.options.darkModeSelector : (r = e.darkModeSelector) != null ? r : t2.options.darkModeSelector) : [];
|
|
}, getLayerOrder(e, t2 = {}, r, s2) {
|
|
let { cssLayer: i2 } = t2;
|
|
return i2 ? `@layer ${m(i2.order || i2.name || "primeui", r)}` : "";
|
|
}, getCommonStyleSheet({ name: e = "", theme: t2 = {}, params: r, props: s2 = {}, set: i$1, defaults: a2 }) {
|
|
let n = this.getCommon({ name: e, theme: t2, params: r, set: i$1, defaults: a2 }), l2 = Object.entries(s2).reduce((o, [c2, m2]) => o.push(`${c2}="${m2}"`) && o, []).join(" ");
|
|
return Object.entries(n || {}).reduce((o, [c2, m2]) => {
|
|
if (i(m2) && Object.hasOwn(m2, "css")) {
|
|
let d2 = Y$1(m2.css), u = `${c2}-variables`;
|
|
o.push(`<style type="text/css" data-primevue-style-id="${u}" ${l2}>${d2}</style>`);
|
|
}
|
|
return o;
|
|
}, []).join("");
|
|
}, getStyleSheet({ name: e = "", theme: t2 = {}, params: r, props: s2 = {}, set: i2, defaults: a2 }) {
|
|
var c2;
|
|
let n = { name: e, theme: t2, params: r, set: i2, defaults: a2 }, l2 = (c2 = e.includes("-directive") ? this.getPresetD(n) : this.getPresetC(n)) == null ? void 0 : c2.css, o = Object.entries(s2).reduce((m2, [d2, u]) => m2.push(`${d2}="${u}"`) && m2, []).join(" ");
|
|
return l2 ? `<style type="text/css" data-primevue-style-id="${e}-variables" ${o}>${Y$1(l2)}</style>` : "";
|
|
}, createTokens(e = {}, t2, r = "", s2 = "", i$1 = {}) {
|
|
let a2 = function(l$1, o = {}, c2 = []) {
|
|
if (c2.includes(this.path)) return console.warn(`Circular reference detected at ${this.path}`), { colorScheme: l$1, path: this.path, paths: o, value: void 0 };
|
|
c2.push(this.path), o.name = this.path, o.binding || (o.binding = {});
|
|
let m2 = this.value;
|
|
if (typeof this.value == "string" && k.test(this.value)) {
|
|
let u = this.value.trim().replace(k, (g2) => {
|
|
var y2;
|
|
let f2 = g2.slice(1, -1), x = this.tokens[f2];
|
|
if (!x) return console.warn(`Token not found for path: ${f2}`), "__UNRESOLVED__";
|
|
let p2 = x.computed(l$1, o, c2);
|
|
return Array.isArray(p2) && p2.length === 2 ? `light-dark(${p2[0].value},${p2[1].value})` : (y2 = p2 == null ? void 0 : p2.value) != null ? y2 : "__UNRESOLVED__";
|
|
});
|
|
m2 = ne.test(u.replace(ie, "0")) ? `calc(${u})` : u;
|
|
}
|
|
return l(o.binding) && delete o.binding, c2.pop(), { colorScheme: l$1, path: this.path, paths: o, value: m2.includes("__UNRESOLVED__") ? void 0 : m2 };
|
|
}, n = (l2, o, c2) => {
|
|
Object.entries(l2).forEach(([m2, d2]) => {
|
|
let u = G(m2, t2.variable.excludedKeyRegex) ? o : o ? `${o}.${oe(m2)}` : oe(m2), g2 = c2 ? `${c2}.${m2}` : m2;
|
|
i(d2) ? n(d2, u, g2) : (i$1[u] || (i$1[u] = { paths: [], computed: (f2, x = {}, p2 = []) => {
|
|
if (i$1[u].paths.length === 1) return i$1[u].paths[0].computed(i$1[u].paths[0].scheme, x.binding, p2);
|
|
if (f2 && f2 !== "none") for (let y2 = 0; y2 < i$1[u].paths.length; y2++) {
|
|
let R2 = i$1[u].paths[y2];
|
|
if (R2.scheme === f2) return R2.computed(f2, x.binding, p2);
|
|
}
|
|
return i$1[u].paths.map((y2) => y2.computed(y2.scheme, x[y2.scheme], p2));
|
|
} }), i$1[u].paths.push({ path: g2, value: d2, scheme: g2.includes("colorScheme.light") ? "light" : g2.includes("colorScheme.dark") ? "dark" : "none", computed: a2, tokens: i$1 }));
|
|
});
|
|
};
|
|
return n(e, r, s2), i$1;
|
|
}, getTokenValue(e, t2, r) {
|
|
var l2;
|
|
let i2 = ((o) => o.split(".").filter((m2) => !G(m2.toLowerCase(), r.variable.excludedKeyRegex)).join("."))(t2), a2 = t2.includes("colorScheme.light") ? "light" : t2.includes("colorScheme.dark") ? "dark" : void 0, n = [(l2 = e[i2]) == null ? void 0 : l2.computed(a2)].flat().filter((o) => o);
|
|
return n.length === 1 ? n[0].value : n.reduce((o = {}, c2) => {
|
|
let u = c2, { colorScheme: m2 } = u, d2 = v(u, ["colorScheme"]);
|
|
return o[m2] = d2, o;
|
|
}, void 0);
|
|
}, getSelectorRule(e, t2, r, s2) {
|
|
return r === "class" || r === "attr" ? C(s$2(t2) ? `${e}${t2},${e} ${t2}` : e, s2) : C(e, C(t2 != null ? t2 : ":root,:host", s2));
|
|
}, transformCSS(e, t2, r, s2, i$1 = {}, a2, n, l2) {
|
|
if (s$2(t2)) {
|
|
let { cssLayer: o } = i$1;
|
|
if (s2 !== "style") {
|
|
let c2 = this.getColorSchemeOption(i$1, n);
|
|
t2 = r === "dark" ? c2.reduce((m2, { type: d2, selector: u }) => (s$2(u) && (m2 += u.includes("[CSS]") ? u.replace("[CSS]", t2) : this.getSelectorRule(u, l2, d2, t2)), m2), "") : C(l2 != null ? l2 : ":root,:host", t2);
|
|
}
|
|
if (o) {
|
|
let c2 = { name: "primeui" };
|
|
i(o) && (c2.name = m(o.name, { name: e, type: s2 })), s$2(c2.name) && (t2 = C(`@layer ${c2.name}`, t2), a2 == null || a2.layerNames(c2.name));
|
|
}
|
|
return t2;
|
|
}
|
|
return "";
|
|
} };
|
|
var S = { defaults: { variable: { prefix: "p", selector: ":root,:host", excludedKeyRegex: /^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi }, options: { prefix: "p", darkModeSelector: "system", cssLayer: false } }, _theme: void 0, _layerNames: /* @__PURE__ */ new Set(), _loadedStyleNames: /* @__PURE__ */ new Set(), _loadingStyles: /* @__PURE__ */ new Set(), _tokens: {}, update(e = {}) {
|
|
let { theme: t2 } = e;
|
|
t2 && (this._theme = $(h({}, t2), { options: h(h({}, this.defaults.options), t2.options) }), this._tokens = b.createTokens(this.preset, this.defaults), this.clearLoadedStyleNames());
|
|
}, get theme() {
|
|
return this._theme;
|
|
}, get preset() {
|
|
var e;
|
|
return ((e = this.theme) == null ? void 0 : e.preset) || {};
|
|
}, get options() {
|
|
var e;
|
|
return ((e = this.theme) == null ? void 0 : e.options) || {};
|
|
}, get tokens() {
|
|
return this._tokens;
|
|
}, getTheme() {
|
|
return this.theme;
|
|
}, setTheme(e) {
|
|
this.update({ theme: e }), N.emit("theme:change", e);
|
|
}, getPreset() {
|
|
return this.preset;
|
|
}, setPreset(e) {
|
|
this._theme = $(h({}, this.theme), { preset: e }), this._tokens = b.createTokens(e, this.defaults), this.clearLoadedStyleNames(), N.emit("preset:change", e), N.emit("theme:change", this.theme);
|
|
}, getOptions() {
|
|
return this.options;
|
|
}, setOptions(e) {
|
|
this._theme = $(h({}, this.theme), { options: e }), this.clearLoadedStyleNames(), N.emit("options:change", e), N.emit("theme:change", this.theme);
|
|
}, getLayerNames() {
|
|
return [...this._layerNames];
|
|
}, setLayerNames(e) {
|
|
this._layerNames.add(e);
|
|
}, getLoadedStyleNames() {
|
|
return this._loadedStyleNames;
|
|
}, isStyleNameLoaded(e) {
|
|
return this._loadedStyleNames.has(e);
|
|
}, setLoadedStyleName(e) {
|
|
this._loadedStyleNames.add(e);
|
|
}, deleteLoadedStyleName(e) {
|
|
this._loadedStyleNames.delete(e);
|
|
}, clearLoadedStyleNames() {
|
|
this._loadedStyleNames.clear();
|
|
}, getTokenValue(e) {
|
|
return b.getTokenValue(this.tokens, e, this.defaults);
|
|
}, getCommon(e = "", t2) {
|
|
return b.getCommon({ name: e, theme: this.theme, params: t2, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
|
|
}, getComponent(e = "", t2) {
|
|
let r = { name: e, theme: this.theme, params: t2, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
|
|
return b.getPresetC(r);
|
|
}, getDirective(e = "", t2) {
|
|
let r = { name: e, theme: this.theme, params: t2, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
|
|
return b.getPresetD(r);
|
|
}, getCustomPreset(e = "", t2, r, s2) {
|
|
let i2 = { name: e, preset: t2, options: this.options, selector: r, params: s2, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
|
|
return b.getPreset(i2);
|
|
}, getLayerOrderCSS(e = "") {
|
|
return b.getLayerOrder(e, this.options, { names: this.getLayerNames() }, this.defaults);
|
|
}, transformCSS(e = "", t2, r = "style", s2) {
|
|
return b.transformCSS(e, t2, s2, r, this.options, { layerNames: this.setLayerNames.bind(this) }, this.defaults);
|
|
}, getCommonStyleSheet(e = "", t2, r = {}) {
|
|
return b.getCommonStyleSheet({ name: e, theme: this.theme, params: t2, props: r, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
|
|
}, getStyleSheet(e, t2, r = {}) {
|
|
return b.getStyleSheet({ name: e, theme: this.theme, params: t2, props: r, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
|
|
}, onStyleMounted(e) {
|
|
this._loadingStyles.add(e);
|
|
}, onStyleUpdated(e) {
|
|
this._loadingStyles.add(e);
|
|
}, onStyleLoaded(e, { name: t2 }) {
|
|
this._loadingStyles.size && (this._loadingStyles.delete(t2), N.emit(`theme:${t2}:load`, e), !this._loadingStyles.size && N.emit("theme:load"));
|
|
} };
|
|
var FilterMatchMode = {
|
|
STARTS_WITH: "startsWith",
|
|
CONTAINS: "contains",
|
|
NOT_CONTAINS: "notContains",
|
|
ENDS_WITH: "endsWith",
|
|
EQUALS: "equals",
|
|
NOT_EQUALS: "notEquals",
|
|
LESS_THAN: "lt",
|
|
LESS_THAN_OR_EQUAL_TO: "lte",
|
|
GREATER_THAN: "gt",
|
|
GREATER_THAN_OR_EQUAL_TO: "gte",
|
|
DATE_IS: "dateIs",
|
|
DATE_IS_NOT: "dateIsNot",
|
|
DATE_BEFORE: "dateBefore",
|
|
DATE_AFTER: "dateAfter"
|
|
};
|
|
var style$6 = "\n *,\n ::before,\n ::after {\n box-sizing: border-box;\n }\n\n .p-collapsible-enter-active {\n animation: p-animate-collapsible-expand 0.2s ease-out;\n overflow: hidden;\n }\n\n .p-collapsible-leave-active {\n animation: p-animate-collapsible-collapse 0.2s ease-out;\n overflow: hidden;\n }\n\n @keyframes p-animate-collapsible-expand {\n from {\n grid-template-rows: 0fr;\n }\n to {\n grid-template-rows: 1fr;\n }\n }\n\n @keyframes p-animate-collapsible-collapse {\n from {\n grid-template-rows: 1fr;\n }\n to {\n grid-template-rows: 0fr;\n }\n }\n\n .p-disabled,\n .p-disabled * {\n cursor: default;\n pointer-events: none;\n user-select: none;\n }\n\n .p-disabled,\n .p-component:disabled {\n opacity: dt('disabled.opacity');\n }\n\n .pi {\n font-size: dt('icon.size');\n }\n\n .p-icon {\n width: dt('icon.size');\n height: dt('icon.size');\n }\n\n .p-overlay-mask {\n background: var(--px-mask-background, dt('mask.background'));\n color: dt('mask.color');\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n .p-overlay-mask-enter-active {\n animation: p-animate-overlay-mask-enter dt('mask.transition.duration') forwards;\n }\n\n .p-overlay-mask-leave-active {\n animation: p-animate-overlay-mask-leave dt('mask.transition.duration') forwards;\n }\n\n @keyframes p-animate-overlay-mask-enter {\n from {\n background: transparent;\n }\n to {\n background: var(--px-mask-background, dt('mask.background'));\n }\n }\n @keyframes p-animate-overlay-mask-leave {\n from {\n background: var(--px-mask-background, dt('mask.background'));\n }\n to {\n background: transparent;\n }\n }\n\n .p-anchored-overlay-enter-active {\n animation: p-animate-anchored-overlay-enter 300ms cubic-bezier(.19,1,.22,1);\n }\n\n .p-anchored-overlay-leave-active {\n animation: p-animate-anchored-overlay-leave 300ms cubic-bezier(.19,1,.22,1);\n }\n\n @keyframes p-animate-anchored-overlay-enter {\n from {\n opacity: 0;\n transform: scale(0.93);\n }\n }\n\n @keyframes p-animate-anchored-overlay-leave {\n to {\n opacity: 0;\n transform: scale(0.93);\n }\n }\n";
|
|
function _typeof$b(o) {
|
|
"@babel/helpers - typeof";
|
|
return _typeof$b = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
return typeof o2;
|
|
} : function(o2) {
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
}, _typeof$b(o);
|
|
}
|
|
function ownKeys$6(e, r) {
|
|
var t2 = Object.keys(e);
|
|
if (Object.getOwnPropertySymbols) {
|
|
var o = Object.getOwnPropertySymbols(e);
|
|
r && (o = o.filter(function(r2) {
|
|
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
})), t2.push.apply(t2, o);
|
|
}
|
|
return t2;
|
|
}
|
|
function _objectSpread$6(e) {
|
|
for (var r = 1; r < arguments.length; r++) {
|
|
var t2 = null != arguments[r] ? arguments[r] : {};
|
|
r % 2 ? ownKeys$6(Object(t2), true).forEach(function(r2) {
|
|
_defineProperty$b(e, r2, t2[r2]);
|
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$6(Object(t2)).forEach(function(r2) {
|
|
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
|
|
});
|
|
}
|
|
return e;
|
|
}
|
|
function _defineProperty$b(e, r, t2) {
|
|
return (r = _toPropertyKey$b(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
|
|
}
|
|
function _toPropertyKey$b(t2) {
|
|
var i2 = _toPrimitive$b(t2, "string");
|
|
return "symbol" == _typeof$b(i2) ? i2 : i2 + "";
|
|
}
|
|
function _toPrimitive$b(t2, r) {
|
|
if ("object" != _typeof$b(t2) || !t2) return t2;
|
|
var e = t2[Symbol.toPrimitive];
|
|
if (void 0 !== e) {
|
|
var i2 = e.call(t2, r);
|
|
if ("object" != _typeof$b(i2)) return i2;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return ("string" === r ? String : Number)(t2);
|
|
}
|
|
function tryOnMounted(fn) {
|
|
var sync = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
if (getCurrentInstance() && getCurrentInstance().components) onMounted(fn);
|
|
else if (sync) fn();
|
|
else nextTick(fn);
|
|
}
|
|
var _id = 0;
|
|
function useStyle(css3) {
|
|
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
var isLoaded = ref(false);
|
|
var cssRef = ref(css3);
|
|
var styleRef = ref(null);
|
|
var defaultDocument = tt() ? window.document : void 0;
|
|
var _options$document = options.document, document2 = _options$document === void 0 ? defaultDocument : _options$document, _options$immediate = options.immediate, immediate = _options$immediate === void 0 ? true : _options$immediate, _options$manual = options.manual, manual = _options$manual === void 0 ? false : _options$manual, _options$name = options.name, name = _options$name === void 0 ? "style_".concat(++_id) : _options$name, _options$id = options.id, id = _options$id === void 0 ? void 0 : _options$id, _options$media = options.media, media = _options$media === void 0 ? void 0 : _options$media, _options$nonce = options.nonce, nonce = _options$nonce === void 0 ? void 0 : _options$nonce, _options$first = options.first, first = _options$first === void 0 ? false : _options$first, _options$onMounted = options.onMounted, onStyleMounted = _options$onMounted === void 0 ? void 0 : _options$onMounted, _options$onUpdated = options.onUpdated, onStyleUpdated = _options$onUpdated === void 0 ? void 0 : _options$onUpdated, _options$onLoad = options.onLoad, onStyleLoaded = _options$onLoad === void 0 ? void 0 : _options$onLoad, _options$props = options.props, props = _options$props === void 0 ? {} : _options$props;
|
|
var stop = function stop2() {
|
|
};
|
|
var load2 = function load3(_css) {
|
|
var _props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
if (!document2) return;
|
|
var _styleProps = _objectSpread$6(_objectSpread$6({}, props), _props);
|
|
var _name = _styleProps.name || name, _id2 = _styleProps.id || id, _nonce = _styleProps.nonce || nonce;
|
|
styleRef.value = document2.querySelector('style[data-primevue-style-id="'.concat(_name, '"]')) || document2.getElementById(_id2) || document2.createElement("style");
|
|
if (!styleRef.value.isConnected) {
|
|
cssRef.value = _css || css3;
|
|
A(styleRef.value, {
|
|
type: "text/css",
|
|
id: _id2,
|
|
media,
|
|
nonce: _nonce
|
|
});
|
|
first ? document2.head.prepend(styleRef.value) : document2.head.appendChild(styleRef.value);
|
|
_t(styleRef.value, "data-primevue-style-id", _name);
|
|
A(styleRef.value, _styleProps);
|
|
styleRef.value.onload = function(event) {
|
|
return onStyleLoaded === null || onStyleLoaded === void 0 ? void 0 : onStyleLoaded(event, {
|
|
name: _name
|
|
});
|
|
};
|
|
onStyleMounted === null || onStyleMounted === void 0 || onStyleMounted(_name);
|
|
}
|
|
if (isLoaded.value) return;
|
|
stop = watch(cssRef, function(value) {
|
|
styleRef.value.textContent = value;
|
|
onStyleUpdated === null || onStyleUpdated === void 0 || onStyleUpdated(_name);
|
|
}, {
|
|
immediate: true
|
|
});
|
|
isLoaded.value = true;
|
|
};
|
|
var unload = function unload2() {
|
|
if (!document2 || !isLoaded.value) return;
|
|
stop();
|
|
T(styleRef.value) && document2.head.removeChild(styleRef.value);
|
|
isLoaded.value = false;
|
|
styleRef.value = null;
|
|
};
|
|
if (immediate && !manual) tryOnMounted(load2);
|
|
return {
|
|
id,
|
|
name,
|
|
el: styleRef,
|
|
css: cssRef,
|
|
unload,
|
|
load: load2,
|
|
isLoaded: readonly(isLoaded)
|
|
};
|
|
}
|
|
function _typeof$a(o) {
|
|
"@babel/helpers - typeof";
|
|
return _typeof$a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
return typeof o2;
|
|
} : function(o2) {
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
}, _typeof$a(o);
|
|
}
|
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
function _slicedToArray$2(r, e) {
|
|
return _arrayWithHoles$2(r) || _iterableToArrayLimit$2(r, e) || _unsupportedIterableToArray$8(r, e) || _nonIterableRest$2();
|
|
}
|
|
function _nonIterableRest$2() {
|
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
function _unsupportedIterableToArray$8(r, a2) {
|
|
if (r) {
|
|
if ("string" == typeof r) return _arrayLikeToArray$8(r, a2);
|
|
var t2 = {}.toString.call(r).slice(8, -1);
|
|
return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$8(r, a2) : void 0;
|
|
}
|
|
}
|
|
function _arrayLikeToArray$8(r, a2) {
|
|
(null == a2 || a2 > r.length) && (a2 = r.length);
|
|
for (var e = 0, n = Array(a2); e < a2; e++) n[e] = r[e];
|
|
return n;
|
|
}
|
|
function _iterableToArrayLimit$2(r, l2) {
|
|
var t2 = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
if (null != t2) {
|
|
var e, n, i2, u, a2 = [], f2 = true, o = false;
|
|
try {
|
|
if (i2 = (t2 = t2.call(r)).next, 0 === l2) ;
|
|
else for (; !(f2 = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l2); f2 = true) ;
|
|
} catch (r2) {
|
|
o = true, n = r2;
|
|
} finally {
|
|
try {
|
|
if (!f2 && null != t2["return"] && (u = t2["return"](), Object(u) !== u)) return;
|
|
} finally {
|
|
if (o) throw n;
|
|
}
|
|
}
|
|
return a2;
|
|
}
|
|
}
|
|
function _arrayWithHoles$2(r) {
|
|
if (Array.isArray(r)) return r;
|
|
}
|
|
function ownKeys$5(e, r) {
|
|
var t2 = Object.keys(e);
|
|
if (Object.getOwnPropertySymbols) {
|
|
var o = Object.getOwnPropertySymbols(e);
|
|
r && (o = o.filter(function(r2) {
|
|
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
})), t2.push.apply(t2, o);
|
|
}
|
|
return t2;
|
|
}
|
|
function _objectSpread$5(e) {
|
|
for (var r = 1; r < arguments.length; r++) {
|
|
var t2 = null != arguments[r] ? arguments[r] : {};
|
|
r % 2 ? ownKeys$5(Object(t2), true).forEach(function(r2) {
|
|
_defineProperty$a(e, r2, t2[r2]);
|
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$5(Object(t2)).forEach(function(r2) {
|
|
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
|
|
});
|
|
}
|
|
return e;
|
|
}
|
|
function _defineProperty$a(e, r, t2) {
|
|
return (r = _toPropertyKey$a(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
|
|
}
|
|
function _toPropertyKey$a(t2) {
|
|
var i2 = _toPrimitive$a(t2, "string");
|
|
return "symbol" == _typeof$a(i2) ? i2 : i2 + "";
|
|
}
|
|
function _toPrimitive$a(t2, r) {
|
|
if ("object" != _typeof$a(t2) || !t2) return t2;
|
|
var e = t2[Symbol.toPrimitive];
|
|
if (void 0 !== e) {
|
|
var i2 = e.call(t2, r);
|
|
if ("object" != _typeof$a(i2)) return i2;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return ("string" === r ? String : Number)(t2);
|
|
}
|
|
function _taggedTemplateLiteral(e, t2) {
|
|
return t2 || (t2 = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t2) } }));
|
|
}
|
|
var css$1 = function css(_ref) {
|
|
var dt2 = _ref.dt;
|
|
return "\n.p-hidden-accessible {\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n opacity: 0;\n overflow: hidden;\n padding: 0;\n pointer-events: none;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n.p-overflow-hidden {\n overflow: hidden;\n padding-right: ".concat(dt2("scrollbar.width"), ";\n}\n");
|
|
};
|
|
var classes$6 = {};
|
|
var inlineStyles = {};
|
|
var BaseStyle = {
|
|
name: "base",
|
|
css: css$1,
|
|
style: style$6,
|
|
classes: classes$6,
|
|
inlineStyles,
|
|
load: function load(style2) {
|
|
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
var transform = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(cs) {
|
|
return cs;
|
|
};
|
|
var computedStyle = transform(ar(_templateObject || (_templateObject = _taggedTemplateLiteral(["", ""])), style2));
|
|
return s$2(computedStyle) ? useStyle(Y$1(computedStyle), _objectSpread$5({
|
|
name: this.name
|
|
}, options)) : {};
|
|
},
|
|
loadCSS: function loadCSS() {
|
|
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
return this.load(this.css, options);
|
|
},
|
|
loadStyle: function loadStyle() {
|
|
var _this = this;
|
|
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var style2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
return this.load(this.style, options, function() {
|
|
var computedStyle = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
return S.transformCSS(options.name || _this.name, "".concat(computedStyle).concat(ar(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["", ""])), style2)));
|
|
});
|
|
},
|
|
getCommonTheme: function getCommonTheme(params) {
|
|
return S.getCommon(this.name, params);
|
|
},
|
|
getComponentTheme: function getComponentTheme(params) {
|
|
return S.getComponent(this.name, params);
|
|
},
|
|
getDirectiveTheme: function getDirectiveTheme(params) {
|
|
return S.getDirective(this.name, params);
|
|
},
|
|
getPresetTheme: function getPresetTheme(preset, selector, params) {
|
|
return S.getCustomPreset(this.name, preset, selector, params);
|
|
},
|
|
getLayerOrderThemeCSS: function getLayerOrderThemeCSS() {
|
|
return S.getLayerOrderCSS(this.name);
|
|
},
|
|
getStyleSheet: function getStyleSheet() {
|
|
var extendedCSS = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
var props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
if (this.css) {
|
|
var _css = m(this.css, {
|
|
dt: E
|
|
}) || "";
|
|
var _style = Y$1(ar(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["", "", ""])), _css, extendedCSS));
|
|
var _props = Object.entries(props).reduce(function(acc, _ref2) {
|
|
var _ref3 = _slicedToArray$2(_ref2, 2), k2 = _ref3[0], v2 = _ref3[1];
|
|
return acc.push("".concat(k2, '="').concat(v2, '"')) && acc;
|
|
}, []).join(" ");
|
|
return s$2(_style) ? '<style type="text/css" data-primevue-style-id="'.concat(this.name, '" ').concat(_props, ">").concat(_style, "</style>") : "";
|
|
}
|
|
return "";
|
|
},
|
|
getCommonThemeStyleSheet: function getCommonThemeStyleSheet(params) {
|
|
var props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
return S.getCommonStyleSheet(this.name, params, props);
|
|
},
|
|
getThemeStyleSheet: function getThemeStyleSheet(params) {
|
|
var props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
var css3 = [S.getStyleSheet(this.name, params, props)];
|
|
if (this.style) {
|
|
var name = this.name === "base" ? "global-style" : "".concat(this.name, "-style");
|
|
var _css = ar(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["", ""])), m(this.style, {
|
|
dt: E
|
|
}));
|
|
var _style = Y$1(S.transformCSS(name, _css));
|
|
var _props = Object.entries(props).reduce(function(acc, _ref4) {
|
|
var _ref5 = _slicedToArray$2(_ref4, 2), k2 = _ref5[0], v2 = _ref5[1];
|
|
return acc.push("".concat(k2, '="').concat(v2, '"')) && acc;
|
|
}, []).join(" ");
|
|
s$2(_style) && css3.push('<style type="text/css" data-primevue-style-id="'.concat(name, '" ').concat(_props, ">").concat(_style, "</style>"));
|
|
}
|
|
return css3.join("");
|
|
},
|
|
extend: function extend2(inStyle) {
|
|
return _objectSpread$5(_objectSpread$5({}, this), {}, {
|
|
css: void 0,
|
|
style: void 0
|
|
}, inStyle);
|
|
}
|
|
};
|
|
var PrimeVueService = s$1();
|
|
function _typeof$9(o) {
|
|
"@babel/helpers - typeof";
|
|
return _typeof$9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
return typeof o2;
|
|
} : function(o2) {
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
}, _typeof$9(o);
|
|
}
|
|
function ownKeys$4(e, r) {
|
|
var t2 = Object.keys(e);
|
|
if (Object.getOwnPropertySymbols) {
|
|
var o = Object.getOwnPropertySymbols(e);
|
|
r && (o = o.filter(function(r2) {
|
|
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
})), t2.push.apply(t2, o);
|
|
}
|
|
return t2;
|
|
}
|
|
function _objectSpread$4(e) {
|
|
for (var r = 1; r < arguments.length; r++) {
|
|
var t2 = null != arguments[r] ? arguments[r] : {};
|
|
r % 2 ? ownKeys$4(Object(t2), true).forEach(function(r2) {
|
|
_defineProperty$9(e, r2, t2[r2]);
|
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$4(Object(t2)).forEach(function(r2) {
|
|
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
|
|
});
|
|
}
|
|
return e;
|
|
}
|
|
function _defineProperty$9(e, r, t2) {
|
|
return (r = _toPropertyKey$9(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
|
|
}
|
|
function _toPropertyKey$9(t2) {
|
|
var i2 = _toPrimitive$9(t2, "string");
|
|
return "symbol" == _typeof$9(i2) ? i2 : i2 + "";
|
|
}
|
|
function _toPrimitive$9(t2, r) {
|
|
if ("object" != _typeof$9(t2) || !t2) return t2;
|
|
var e = t2[Symbol.toPrimitive];
|
|
if (void 0 !== e) {
|
|
var i2 = e.call(t2, r);
|
|
if ("object" != _typeof$9(i2)) return i2;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return ("string" === r ? String : Number)(t2);
|
|
}
|
|
var defaultOptions = {
|
|
ripple: false,
|
|
inputStyle: null,
|
|
inputVariant: null,
|
|
locale: {
|
|
startsWith: "Starts with",
|
|
contains: "Contains",
|
|
notContains: "Not contains",
|
|
endsWith: "Ends with",
|
|
equals: "Equals",
|
|
notEquals: "Not equals",
|
|
noFilter: "No Filter",
|
|
lt: "Less than",
|
|
lte: "Less than or equal to",
|
|
gt: "Greater than",
|
|
gte: "Greater than or equal to",
|
|
dateIs: "Date is",
|
|
dateIsNot: "Date is not",
|
|
dateBefore: "Date is before",
|
|
dateAfter: "Date is after",
|
|
clear: "Clear",
|
|
apply: "Apply",
|
|
matchAll: "Match All",
|
|
matchAny: "Match Any",
|
|
addRule: "Add Rule",
|
|
removeRule: "Remove Rule",
|
|
accept: "Yes",
|
|
reject: "No",
|
|
choose: "Choose",
|
|
upload: "Upload",
|
|
cancel: "Cancel",
|
|
completed: "Completed",
|
|
pending: "Pending",
|
|
fileSizeTypes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
|
|
dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
chooseYear: "Choose Year",
|
|
chooseMonth: "Choose Month",
|
|
chooseDate: "Choose Date",
|
|
prevDecade: "Previous Decade",
|
|
nextDecade: "Next Decade",
|
|
prevYear: "Previous Year",
|
|
nextYear: "Next Year",
|
|
prevMonth: "Previous Month",
|
|
nextMonth: "Next Month",
|
|
prevHour: "Previous Hour",
|
|
nextHour: "Next Hour",
|
|
prevMinute: "Previous Minute",
|
|
nextMinute: "Next Minute",
|
|
prevSecond: "Previous Second",
|
|
nextSecond: "Next Second",
|
|
am: "am",
|
|
pm: "pm",
|
|
today: "Today",
|
|
weekHeader: "Wk",
|
|
firstDayOfWeek: 0,
|
|
showMonthAfterYear: false,
|
|
dateFormat: "mm/dd/yy",
|
|
weak: "Weak",
|
|
medium: "Medium",
|
|
strong: "Strong",
|
|
passwordPrompt: "Enter a password",
|
|
emptyFilterMessage: "No results found",
|
|
searchMessage: "{0} results are available",
|
|
selectionMessage: "{0} items selected",
|
|
emptySelectionMessage: "No selected item",
|
|
emptySearchMessage: "No results found",
|
|
fileChosenMessage: "{0} files",
|
|
noFileChosenMessage: "No file chosen",
|
|
emptyMessage: "No available options",
|
|
aria: {
|
|
trueLabel: "True",
|
|
falseLabel: "False",
|
|
nullLabel: "Not Selected",
|
|
star: "1 star",
|
|
stars: "{star} stars",
|
|
selectAll: "All items selected",
|
|
unselectAll: "All items unselected",
|
|
close: "Close",
|
|
previous: "Previous",
|
|
next: "Next",
|
|
navigation: "Navigation",
|
|
scrollTop: "Scroll Top",
|
|
moveTop: "Move Top",
|
|
moveUp: "Move Up",
|
|
moveDown: "Move Down",
|
|
moveBottom: "Move Bottom",
|
|
moveToTarget: "Move to Target",
|
|
moveToSource: "Move to Source",
|
|
moveAllToTarget: "Move All to Target",
|
|
moveAllToSource: "Move All to Source",
|
|
pageLabel: "Page {page}",
|
|
firstPageLabel: "First Page",
|
|
lastPageLabel: "Last Page",
|
|
nextPageLabel: "Next Page",
|
|
prevPageLabel: "Previous Page",
|
|
rowsPerPageLabel: "Rows per page",
|
|
jumpToPageDropdownLabel: "Jump to Page Dropdown",
|
|
jumpToPageInputLabel: "Jump to Page Input",
|
|
selectRow: "Row Selected",
|
|
unselectRow: "Row Unselected",
|
|
expandRow: "Row Expanded",
|
|
collapseRow: "Row Collapsed",
|
|
showFilterMenu: "Show Filter Menu",
|
|
hideFilterMenu: "Hide Filter Menu",
|
|
filterOperator: "Filter Operator",
|
|
filterConstraint: "Filter Constraint",
|
|
editRow: "Row Edit",
|
|
saveEdit: "Save Edit",
|
|
cancelEdit: "Cancel Edit",
|
|
listView: "List View",
|
|
gridView: "Grid View",
|
|
slide: "Slide",
|
|
slideNumber: "{slideNumber}",
|
|
zoomImage: "Zoom Image",
|
|
zoomIn: "Zoom In",
|
|
zoomOut: "Zoom Out",
|
|
rotateRight: "Rotate Right",
|
|
rotateLeft: "Rotate Left",
|
|
listLabel: "Option List"
|
|
}
|
|
},
|
|
filterMatchModeOptions: {
|
|
text: [FilterMatchMode.STARTS_WITH, FilterMatchMode.CONTAINS, FilterMatchMode.NOT_CONTAINS, FilterMatchMode.ENDS_WITH, FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS],
|
|
numeric: [FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS, FilterMatchMode.LESS_THAN, FilterMatchMode.LESS_THAN_OR_EQUAL_TO, FilterMatchMode.GREATER_THAN, FilterMatchMode.GREATER_THAN_OR_EQUAL_TO],
|
|
date: [FilterMatchMode.DATE_IS, FilterMatchMode.DATE_IS_NOT, FilterMatchMode.DATE_BEFORE, FilterMatchMode.DATE_AFTER]
|
|
},
|
|
zIndex: {
|
|
modal: 1100,
|
|
overlay: 1e3,
|
|
menu: 1e3,
|
|
tooltip: 1100
|
|
},
|
|
theme: void 0,
|
|
unstyled: false,
|
|
pt: void 0,
|
|
ptOptions: {
|
|
mergeSections: true,
|
|
mergeProps: false
|
|
},
|
|
csp: {
|
|
nonce: void 0
|
|
}
|
|
};
|
|
var PrimeVueSymbol = Symbol();
|
|
function setup(app2, options) {
|
|
var PrimeVue2 = {
|
|
config: reactive(options)
|
|
};
|
|
app2.config.globalProperties.$primevue = PrimeVue2;
|
|
app2.provide(PrimeVueSymbol, PrimeVue2);
|
|
clearConfig();
|
|
setupConfig(app2, PrimeVue2);
|
|
return PrimeVue2;
|
|
}
|
|
var stopWatchers = [];
|
|
function clearConfig() {
|
|
N.clear();
|
|
stopWatchers.forEach(function(fn) {
|
|
return fn === null || fn === void 0 ? void 0 : fn();
|
|
});
|
|
stopWatchers = [];
|
|
}
|
|
function setupConfig(app2, PrimeVue2) {
|
|
var isThemeChanged = ref(false);
|
|
var loadCommonTheme = function loadCommonTheme2() {
|
|
var _PrimeVue$config;
|
|
if (((_PrimeVue$config = PrimeVue2.config) === null || _PrimeVue$config === void 0 ? void 0 : _PrimeVue$config.theme) === "none") return;
|
|
if (!S.isStyleNameLoaded("common")) {
|
|
var _BaseStyle$getCommonT, _PrimeVue$config2;
|
|
var _ref = ((_BaseStyle$getCommonT = BaseStyle.getCommonTheme) === null || _BaseStyle$getCommonT === void 0 ? void 0 : _BaseStyle$getCommonT.call(BaseStyle)) || {}, primitive = _ref.primitive, semantic = _ref.semantic, global2 = _ref.global, style2 = _ref.style;
|
|
var styleOptions = {
|
|
nonce: (_PrimeVue$config2 = PrimeVue2.config) === null || _PrimeVue$config2 === void 0 || (_PrimeVue$config2 = _PrimeVue$config2.csp) === null || _PrimeVue$config2 === void 0 ? void 0 : _PrimeVue$config2.nonce
|
|
};
|
|
BaseStyle.load(primitive === null || primitive === void 0 ? void 0 : primitive.css, _objectSpread$4({
|
|
name: "primitive-variables"
|
|
}, styleOptions));
|
|
BaseStyle.load(semantic === null || semantic === void 0 ? void 0 : semantic.css, _objectSpread$4({
|
|
name: "semantic-variables"
|
|
}, styleOptions));
|
|
BaseStyle.load(global2 === null || global2 === void 0 ? void 0 : global2.css, _objectSpread$4({
|
|
name: "global-variables"
|
|
}, styleOptions));
|
|
BaseStyle.loadStyle(_objectSpread$4({
|
|
name: "global-style"
|
|
}, styleOptions), style2);
|
|
S.setLoadedStyleName("common");
|
|
}
|
|
};
|
|
N.on("theme:change", function(newTheme) {
|
|
if (!isThemeChanged.value) {
|
|
app2.config.globalProperties.$primevue.config.theme = newTheme;
|
|
isThemeChanged.value = true;
|
|
}
|
|
});
|
|
var stopConfigWatcher = watch(PrimeVue2.config, function(newValue, oldValue) {
|
|
PrimeVueService.emit("config:change", {
|
|
newValue,
|
|
oldValue
|
|
});
|
|
}, {
|
|
immediate: true,
|
|
deep: true
|
|
});
|
|
var stopRippleWatcher = watch(function() {
|
|
return PrimeVue2.config.ripple;
|
|
}, function(newValue, oldValue) {
|
|
PrimeVueService.emit("config:ripple:change", {
|
|
newValue,
|
|
oldValue
|
|
});
|
|
}, {
|
|
immediate: true,
|
|
deep: true
|
|
});
|
|
var stopThemeWatcher = watch(function() {
|
|
return PrimeVue2.config.theme;
|
|
}, function(newValue, oldValue) {
|
|
if (!isThemeChanged.value) {
|
|
S.setTheme(newValue);
|
|
}
|
|
if (!PrimeVue2.config.unstyled) {
|
|
loadCommonTheme();
|
|
}
|
|
isThemeChanged.value = false;
|
|
PrimeVueService.emit("config:theme:change", {
|
|
newValue,
|
|
oldValue
|
|
});
|
|
}, {
|
|
immediate: true,
|
|
deep: false
|
|
});
|
|
var stopUnstyledWatcher = watch(function() {
|
|
return PrimeVue2.config.unstyled;
|
|
}, function(newValue, oldValue) {
|
|
if (!newValue && PrimeVue2.config.theme) {
|
|
loadCommonTheme();
|
|
}
|
|
PrimeVueService.emit("config:unstyled:change", {
|
|
newValue,
|
|
oldValue
|
|
});
|
|
}, {
|
|
immediate: true,
|
|
deep: true
|
|
});
|
|
stopWatchers.push(stopConfigWatcher);
|
|
stopWatchers.push(stopRippleWatcher);
|
|
stopWatchers.push(stopThemeWatcher);
|
|
stopWatchers.push(stopUnstyledWatcher);
|
|
}
|
|
var PrimeVue = {
|
|
install: function install(app2, options) {
|
|
var configOptions = H(defaultOptions, options);
|
|
setup(app2, configOptions);
|
|
}
|
|
};
|
|
var Base = {
|
|
_loadedStyleNames: /* @__PURE__ */ new Set(),
|
|
getLoadedStyleNames: function getLoadedStyleNames() {
|
|
return this._loadedStyleNames;
|
|
},
|
|
isStyleNameLoaded: function isStyleNameLoaded(name) {
|
|
return this._loadedStyleNames.has(name);
|
|
},
|
|
setLoadedStyleName: function setLoadedStyleName(name) {
|
|
this._loadedStyleNames.add(name);
|
|
},
|
|
deleteLoadedStyleName: function deleteLoadedStyleName(name) {
|
|
this._loadedStyleNames["delete"](name);
|
|
},
|
|
clearLoadedStyleNames: function clearLoadedStyleNames() {
|
|
this._loadedStyleNames.clear();
|
|
}
|
|
};
|
|
function useAttrSelector() {
|
|
var prefix2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "pc";
|
|
var idx = useId();
|
|
return "".concat(prefix2).concat(idx.replace("v-", "").replaceAll("-", "_"));
|
|
}
|
|
var BaseComponentStyle = BaseStyle.extend({
|
|
name: "common"
|
|
});
|
|
function _typeof$8(o) {
|
|
"@babel/helpers - typeof";
|
|
return _typeof$8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
return typeof o2;
|
|
} : function(o2) {
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
}, _typeof$8(o);
|
|
}
|
|
function _toArray(r) {
|
|
return _arrayWithHoles$1(r) || _iterableToArray$6(r) || _unsupportedIterableToArray$7(r) || _nonIterableRest$1();
|
|
}
|
|
function _iterableToArray$6(r) {
|
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
}
|
|
function _slicedToArray$1(r, e) {
|
|
return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e) || _unsupportedIterableToArray$7(r, e) || _nonIterableRest$1();
|
|
}
|
|
function _nonIterableRest$1() {
|
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
function _unsupportedIterableToArray$7(r, a2) {
|
|
if (r) {
|
|
if ("string" == typeof r) return _arrayLikeToArray$7(r, a2);
|
|
var t2 = {}.toString.call(r).slice(8, -1);
|
|
return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$7(r, a2) : void 0;
|
|
}
|
|
}
|
|
function _arrayLikeToArray$7(r, a2) {
|
|
(null == a2 || a2 > r.length) && (a2 = r.length);
|
|
for (var e = 0, n = Array(a2); e < a2; e++) n[e] = r[e];
|
|
return n;
|
|
}
|
|
function _iterableToArrayLimit$1(r, l2) {
|
|
var t2 = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
if (null != t2) {
|
|
var e, n, i2, u, a2 = [], f2 = true, o = false;
|
|
try {
|
|
if (i2 = (t2 = t2.call(r)).next, 0 === l2) {
|
|
if (Object(t2) !== t2) return;
|
|
f2 = false;
|
|
} else for (; !(f2 = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l2); f2 = true) ;
|
|
} catch (r2) {
|
|
o = true, n = r2;
|
|
} finally {
|
|
try {
|
|
if (!f2 && null != t2["return"] && (u = t2["return"](), Object(u) !== u)) return;
|
|
} finally {
|
|
if (o) throw n;
|
|
}
|
|
}
|
|
return a2;
|
|
}
|
|
}
|
|
function _arrayWithHoles$1(r) {
|
|
if (Array.isArray(r)) return r;
|
|
}
|
|
function ownKeys$3(e, r) {
|
|
var t2 = Object.keys(e);
|
|
if (Object.getOwnPropertySymbols) {
|
|
var o = Object.getOwnPropertySymbols(e);
|
|
r && (o = o.filter(function(r2) {
|
|
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
})), t2.push.apply(t2, o);
|
|
}
|
|
return t2;
|
|
}
|
|
function _objectSpread$3(e) {
|
|
for (var r = 1; r < arguments.length; r++) {
|
|
var t2 = null != arguments[r] ? arguments[r] : {};
|
|
r % 2 ? ownKeys$3(Object(t2), true).forEach(function(r2) {
|
|
_defineProperty$8(e, r2, t2[r2]);
|
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$3(Object(t2)).forEach(function(r2) {
|
|
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
|
|
});
|
|
}
|
|
return e;
|
|
}
|
|
function _defineProperty$8(e, r, t2) {
|
|
return (r = _toPropertyKey$8(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
|
|
}
|
|
function _toPropertyKey$8(t2) {
|
|
var i2 = _toPrimitive$8(t2, "string");
|
|
return "symbol" == _typeof$8(i2) ? i2 : i2 + "";
|
|
}
|
|
function _toPrimitive$8(t2, r) {
|
|
if ("object" != _typeof$8(t2) || !t2) return t2;
|
|
var e = t2[Symbol.toPrimitive];
|
|
if (void 0 !== e) {
|
|
var i2 = e.call(t2, r);
|
|
if ("object" != _typeof$8(i2)) return i2;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return ("string" === r ? String : Number)(t2);
|
|
}
|
|
var script$d = {
|
|
name: "BaseComponent",
|
|
props: {
|
|
pt: {
|
|
type: Object,
|
|
"default": void 0
|
|
},
|
|
ptOptions: {
|
|
type: Object,
|
|
"default": void 0
|
|
},
|
|
unstyled: {
|
|
type: Boolean,
|
|
"default": void 0
|
|
},
|
|
dt: {
|
|
type: Object,
|
|
"default": void 0
|
|
}
|
|
},
|
|
inject: {
|
|
$parentInstance: {
|
|
"default": void 0
|
|
}
|
|
},
|
|
watch: {
|
|
isUnstyled: {
|
|
immediate: true,
|
|
handler: function handler(newValue) {
|
|
N.off("theme:change", this._loadCoreStyles);
|
|
if (!newValue) {
|
|
this._loadCoreStyles();
|
|
this._themeChangeListener(this._loadCoreStyles);
|
|
}
|
|
}
|
|
},
|
|
dt: {
|
|
immediate: true,
|
|
handler: function handler2(newValue, oldValue) {
|
|
var _this = this;
|
|
N.off("theme:change", this._themeScopedListener);
|
|
if (newValue) {
|
|
this._loadScopedThemeStyles(newValue);
|
|
this._themeScopedListener = function() {
|
|
return _this._loadScopedThemeStyles(newValue);
|
|
};
|
|
this._themeChangeListener(this._themeScopedListener);
|
|
} else {
|
|
this._unloadScopedThemeStyles();
|
|
}
|
|
}
|
|
}
|
|
},
|
|
scopedStyleEl: void 0,
|
|
rootEl: void 0,
|
|
uid: void 0,
|
|
$attrSelector: void 0,
|
|
beforeCreate: function beforeCreate() {
|
|
var _this$pt, _this$pt2, _this$pt3, _ref, _ref$onBeforeCreate, _this$$primevueConfig, _this$$primevue, _this$$primevue2, _this$$primevue3, _ref2, _ref2$onBeforeCreate;
|
|
var _usept = (_this$pt = this.pt) === null || _this$pt === void 0 ? void 0 : _this$pt["_usept"];
|
|
var originalValue = _usept ? (_this$pt2 = this.pt) === null || _this$pt2 === void 0 || (_this$pt2 = _this$pt2.originalValue) === null || _this$pt2 === void 0 ? void 0 : _this$pt2[this.$.type.name] : void 0;
|
|
var value = _usept ? (_this$pt3 = this.pt) === null || _this$pt3 === void 0 || (_this$pt3 = _this$pt3.value) === null || _this$pt3 === void 0 ? void 0 : _this$pt3[this.$.type.name] : this.pt;
|
|
(_ref = value || originalValue) === null || _ref === void 0 || (_ref = _ref.hooks) === null || _ref === void 0 || (_ref$onBeforeCreate = _ref["onBeforeCreate"]) === null || _ref$onBeforeCreate === void 0 || _ref$onBeforeCreate.call(_ref);
|
|
var _useptInConfig = (_this$$primevueConfig = this.$primevueConfig) === null || _this$$primevueConfig === void 0 || (_this$$primevueConfig = _this$$primevueConfig.pt) === null || _this$$primevueConfig === void 0 ? void 0 : _this$$primevueConfig["_usept"];
|
|
var originalValueInConfig = _useptInConfig ? (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.pt) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.originalValue : void 0;
|
|
var valueInConfig = _useptInConfig ? (_this$$primevue2 = this.$primevue) === null || _this$$primevue2 === void 0 || (_this$$primevue2 = _this$$primevue2.config) === null || _this$$primevue2 === void 0 || (_this$$primevue2 = _this$$primevue2.pt) === null || _this$$primevue2 === void 0 ? void 0 : _this$$primevue2.value : (_this$$primevue3 = this.$primevue) === null || _this$$primevue3 === void 0 || (_this$$primevue3 = _this$$primevue3.config) === null || _this$$primevue3 === void 0 ? void 0 : _this$$primevue3.pt;
|
|
(_ref2 = valueInConfig || originalValueInConfig) === null || _ref2 === void 0 || (_ref2 = _ref2[this.$.type.name]) === null || _ref2 === void 0 || (_ref2 = _ref2.hooks) === null || _ref2 === void 0 || (_ref2$onBeforeCreate = _ref2["onBeforeCreate"]) === null || _ref2$onBeforeCreate === void 0 || _ref2$onBeforeCreate.call(_ref2);
|
|
this.$attrSelector = useAttrSelector();
|
|
this.uid = this.$attrs.id || this.$attrSelector.replace("pc", "pv_id_");
|
|
},
|
|
created: function created() {
|
|
this._hook("onCreated");
|
|
},
|
|
beforeMount: function beforeMount() {
|
|
var _this$$el;
|
|
this.rootEl = z(c(this.$el) ? this.$el : (_this$$el = this.$el) === null || _this$$el === void 0 ? void 0 : _this$$el.parentElement, "[".concat(this.$attrSelector, "]"));
|
|
if (this.rootEl) {
|
|
this.rootEl.$pc = _objectSpread$3({
|
|
name: this.$.type.name,
|
|
attrSelector: this.$attrSelector
|
|
}, this.$params);
|
|
}
|
|
this._loadStyles();
|
|
this._hook("onBeforeMount");
|
|
},
|
|
mounted: function mounted() {
|
|
this._hook("onMounted");
|
|
},
|
|
beforeUpdate: function beforeUpdate() {
|
|
this._hook("onBeforeUpdate");
|
|
},
|
|
updated: function updated() {
|
|
this._hook("onUpdated");
|
|
},
|
|
beforeUnmount: function beforeUnmount() {
|
|
this._hook("onBeforeUnmount");
|
|
},
|
|
unmounted: function unmounted() {
|
|
this._removeThemeListeners();
|
|
this._unloadScopedThemeStyles();
|
|
this._hook("onUnmounted");
|
|
},
|
|
methods: {
|
|
_hook: function _hook(hookName) {
|
|
if (!this.$options.hostName) {
|
|
var selfHook = this._usePT(this._getPT(this.pt, this.$.type.name), this._getOptionValue, "hooks.".concat(hookName));
|
|
var defaultHook = this._useDefaultPT(this._getOptionValue, "hooks.".concat(hookName));
|
|
selfHook === null || selfHook === void 0 || selfHook();
|
|
defaultHook === null || defaultHook === void 0 || defaultHook();
|
|
}
|
|
},
|
|
_mergeProps: function _mergeProps(fn) {
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key2 = 1; _key2 < _len; _key2++) {
|
|
args[_key2 - 1] = arguments[_key2];
|
|
}
|
|
return c$1(fn) ? fn.apply(void 0, args) : mergeProps.apply(void 0, args);
|
|
},
|
|
_load: function _load() {
|
|
if (!Base.isStyleNameLoaded("base")) {
|
|
BaseStyle.loadCSS(this.$styleOptions);
|
|
this._loadGlobalStyles();
|
|
Base.setLoadedStyleName("base");
|
|
}
|
|
this._loadThemeStyles();
|
|
},
|
|
_loadStyles: function _loadStyles() {
|
|
this._load();
|
|
this._themeChangeListener(this._load);
|
|
},
|
|
_loadCoreStyles: function _loadCoreStyles() {
|
|
var _this$$style, _this$$style2;
|
|
if (!Base.isStyleNameLoaded((_this$$style = this.$style) === null || _this$$style === void 0 ? void 0 : _this$$style.name) && (_this$$style2 = this.$style) !== null && _this$$style2 !== void 0 && _this$$style2.name) {
|
|
BaseComponentStyle.loadCSS(this.$styleOptions);
|
|
this.$options.style && this.$style.loadCSS(this.$styleOptions);
|
|
Base.setLoadedStyleName(this.$style.name);
|
|
}
|
|
},
|
|
_loadGlobalStyles: function _loadGlobalStyles() {
|
|
var globalCSS = this._useGlobalPT(this._getOptionValue, "global.css", this.$params);
|
|
s$2(globalCSS) && BaseStyle.load(globalCSS, _objectSpread$3({
|
|
name: "global"
|
|
}, this.$styleOptions));
|
|
},
|
|
_loadThemeStyles: function _loadThemeStyles() {
|
|
var _this$$style4, _this$$style5;
|
|
if (this.isUnstyled || this.$theme === "none") return;
|
|
if (!S.isStyleNameLoaded("common")) {
|
|
var _this$$style3, _this$$style3$getComm;
|
|
var _ref3 = ((_this$$style3 = this.$style) === null || _this$$style3 === void 0 || (_this$$style3$getComm = _this$$style3.getCommonTheme) === null || _this$$style3$getComm === void 0 ? void 0 : _this$$style3$getComm.call(_this$$style3)) || {}, primitive = _ref3.primitive, semantic = _ref3.semantic, global2 = _ref3.global, style2 = _ref3.style;
|
|
BaseStyle.load(primitive === null || primitive === void 0 ? void 0 : primitive.css, _objectSpread$3({
|
|
name: "primitive-variables"
|
|
}, this.$styleOptions));
|
|
BaseStyle.load(semantic === null || semantic === void 0 ? void 0 : semantic.css, _objectSpread$3({
|
|
name: "semantic-variables"
|
|
}, this.$styleOptions));
|
|
BaseStyle.load(global2 === null || global2 === void 0 ? void 0 : global2.css, _objectSpread$3({
|
|
name: "global-variables"
|
|
}, this.$styleOptions));
|
|
BaseStyle.loadStyle(_objectSpread$3({
|
|
name: "global-style"
|
|
}, this.$styleOptions), style2);
|
|
S.setLoadedStyleName("common");
|
|
}
|
|
if (!S.isStyleNameLoaded((_this$$style4 = this.$style) === null || _this$$style4 === void 0 ? void 0 : _this$$style4.name) && (_this$$style5 = this.$style) !== null && _this$$style5 !== void 0 && _this$$style5.name) {
|
|
var _this$$style6, _this$$style6$getComp, _this$$style7, _this$$style8;
|
|
var _ref4 = ((_this$$style6 = this.$style) === null || _this$$style6 === void 0 || (_this$$style6$getComp = _this$$style6.getComponentTheme) === null || _this$$style6$getComp === void 0 ? void 0 : _this$$style6$getComp.call(_this$$style6)) || {}, css3 = _ref4.css, _style = _ref4.style;
|
|
(_this$$style7 = this.$style) === null || _this$$style7 === void 0 || _this$$style7.load(css3, _objectSpread$3({
|
|
name: "".concat(this.$style.name, "-variables")
|
|
}, this.$styleOptions));
|
|
(_this$$style8 = this.$style) === null || _this$$style8 === void 0 || _this$$style8.loadStyle(_objectSpread$3({
|
|
name: "".concat(this.$style.name, "-style")
|
|
}, this.$styleOptions), _style);
|
|
S.setLoadedStyleName(this.$style.name);
|
|
}
|
|
if (!S.isStyleNameLoaded("layer-order")) {
|
|
var _this$$style9, _this$$style9$getLaye;
|
|
var layerOrder = (_this$$style9 = this.$style) === null || _this$$style9 === void 0 || (_this$$style9$getLaye = _this$$style9.getLayerOrderThemeCSS) === null || _this$$style9$getLaye === void 0 ? void 0 : _this$$style9$getLaye.call(_this$$style9);
|
|
BaseStyle.load(layerOrder, _objectSpread$3({
|
|
name: "layer-order",
|
|
first: true
|
|
}, this.$styleOptions));
|
|
S.setLoadedStyleName("layer-order");
|
|
}
|
|
},
|
|
_loadScopedThemeStyles: function _loadScopedThemeStyles(preset) {
|
|
var _this$$style0, _this$$style0$getPres, _this$$style1;
|
|
var _ref5 = ((_this$$style0 = this.$style) === null || _this$$style0 === void 0 || (_this$$style0$getPres = _this$$style0.getPresetTheme) === null || _this$$style0$getPres === void 0 ? void 0 : _this$$style0$getPres.call(_this$$style0, preset, "[".concat(this.$attrSelector, "]"))) || {}, css3 = _ref5.css;
|
|
var scopedStyle = (_this$$style1 = this.$style) === null || _this$$style1 === void 0 ? void 0 : _this$$style1.load(css3, _objectSpread$3({
|
|
name: "".concat(this.$attrSelector, "-").concat(this.$style.name)
|
|
}, this.$styleOptions));
|
|
this.scopedStyleEl = scopedStyle.el;
|
|
},
|
|
_unloadScopedThemeStyles: function _unloadScopedThemeStyles() {
|
|
var _this$scopedStyleEl;
|
|
(_this$scopedStyleEl = this.scopedStyleEl) === null || _this$scopedStyleEl === void 0 || (_this$scopedStyleEl = _this$scopedStyleEl.value) === null || _this$scopedStyleEl === void 0 || _this$scopedStyleEl.remove();
|
|
},
|
|
_themeChangeListener: function _themeChangeListener() {
|
|
var callback = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function() {
|
|
};
|
|
Base.clearLoadedStyleNames();
|
|
N.on("theme:change", callback);
|
|
},
|
|
_removeThemeListeners: function _removeThemeListeners() {
|
|
N.off("theme:change", this._loadCoreStyles);
|
|
N.off("theme:change", this._load);
|
|
N.off("theme:change", this._themeScopedListener);
|
|
},
|
|
_getHostInstance: function _getHostInstance(instance) {
|
|
return instance ? this.$options.hostName ? instance.$.type.name === this.$options.hostName ? instance : this._getHostInstance(instance.$parentInstance) : instance.$parentInstance : void 0;
|
|
},
|
|
_getPropValue: function _getPropValue(name) {
|
|
var _this$_getHostInstanc;
|
|
return this[name] || ((_this$_getHostInstanc = this._getHostInstance(this)) === null || _this$_getHostInstanc === void 0 ? void 0 : _this$_getHostInstanc[name]);
|
|
},
|
|
_getOptionValue: function _getOptionValue(options) {
|
|
var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
return F$1(options, key, params);
|
|
},
|
|
_getPTValue: function _getPTValue() {
|
|
var _this$$primevueConfig2;
|
|
var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
var searchInDefaultPT = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
|
|
var searchOut = /./g.test(key) && !!params[key.split(".")[0]];
|
|
var _ref6 = this._getPropValue("ptOptions") || ((_this$$primevueConfig2 = this.$primevueConfig) === null || _this$$primevueConfig2 === void 0 ? void 0 : _this$$primevueConfig2.ptOptions) || {}, _ref6$mergeSections = _ref6.mergeSections, mergeSections = _ref6$mergeSections === void 0 ? true : _ref6$mergeSections, _ref6$mergeProps = _ref6.mergeProps, useMergeProps = _ref6$mergeProps === void 0 ? false : _ref6$mergeProps;
|
|
var global2 = searchInDefaultPT ? searchOut ? this._useGlobalPT(this._getPTClassValue, key, params) : this._useDefaultPT(this._getPTClassValue, key, params) : void 0;
|
|
var self2 = searchOut ? void 0 : this._getPTSelf(obj, this._getPTClassValue, key, _objectSpread$3(_objectSpread$3({}, params), {}, {
|
|
global: global2 || {}
|
|
}));
|
|
var datasets = this._getPTDatasets(key);
|
|
return mergeSections || !mergeSections && self2 ? useMergeProps ? this._mergeProps(useMergeProps, global2, self2, datasets) : _objectSpread$3(_objectSpread$3(_objectSpread$3({}, global2), self2), datasets) : _objectSpread$3(_objectSpread$3({}, self2), datasets);
|
|
},
|
|
_getPTSelf: function _getPTSelf() {
|
|
var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key3 = 1; _key3 < _len2; _key3++) {
|
|
args[_key3 - 1] = arguments[_key3];
|
|
}
|
|
return mergeProps(
|
|
this._usePT.apply(this, [this._getPT(obj, this.$name)].concat(args)),
|
|
// Exp; <component :pt="{}"
|
|
this._usePT.apply(this, [this.$_attrsPT].concat(args))
|
|
// Exp; <component :pt:[passthrough_key]:[attribute]="{value}" or <component :pt:[passthrough_key]="() =>{value}"
|
|
);
|
|
},
|
|
_getPTDatasets: function _getPTDatasets() {
|
|
var _this$pt4, _this$pt5;
|
|
var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
var datasetPrefix = "data-pc-";
|
|
var isExtended = key === "root" && s$2((_this$pt4 = this.pt) === null || _this$pt4 === void 0 ? void 0 : _this$pt4["data-pc-section"]);
|
|
return key !== "transition" && _objectSpread$3(_objectSpread$3({}, key === "root" && _objectSpread$3(_objectSpread$3(_defineProperty$8({}, "".concat(datasetPrefix, "name"), g(isExtended ? (_this$pt5 = this.pt) === null || _this$pt5 === void 0 ? void 0 : _this$pt5["data-pc-section"] : this.$.type.name)), isExtended && _defineProperty$8({}, "".concat(datasetPrefix, "extend"), g(this.$.type.name))), {}, _defineProperty$8({}, "".concat(this.$attrSelector), ""))), {}, _defineProperty$8({}, "".concat(datasetPrefix, "section"), g(key)));
|
|
},
|
|
_getPTClassValue: function _getPTClassValue() {
|
|
var value = this._getOptionValue.apply(this, arguments);
|
|
return a(value) || C$2(value) ? {
|
|
"class": value
|
|
} : value;
|
|
},
|
|
_getPT: function _getPT(pt2) {
|
|
var _this2 = this;
|
|
var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
var callback = arguments.length > 2 ? arguments[2] : void 0;
|
|
var getValue = function getValue2(value) {
|
|
var _ref8;
|
|
var checkSameKey = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
var computedValue = callback ? callback(value) : value;
|
|
var _key = g(key);
|
|
var _cKey = g(_this2.$name);
|
|
return (_ref8 = checkSameKey ? _key !== _cKey ? computedValue === null || computedValue === void 0 ? void 0 : computedValue[_key] : void 0 : computedValue === null || computedValue === void 0 ? void 0 : computedValue[_key]) !== null && _ref8 !== void 0 ? _ref8 : computedValue;
|
|
};
|
|
return pt2 !== null && pt2 !== void 0 && pt2.hasOwnProperty("_usept") ? {
|
|
_usept: pt2["_usept"],
|
|
originalValue: getValue(pt2.originalValue),
|
|
value: getValue(pt2.value)
|
|
} : getValue(pt2, true);
|
|
},
|
|
_usePT: function _usePT(pt2, callback, key, params) {
|
|
var fn = function fn2(value2) {
|
|
return callback(value2, key, params);
|
|
};
|
|
if (pt2 !== null && pt2 !== void 0 && pt2.hasOwnProperty("_usept")) {
|
|
var _this$$primevueConfig3;
|
|
var _ref9 = pt2["_usept"] || ((_this$$primevueConfig3 = this.$primevueConfig) === null || _this$$primevueConfig3 === void 0 ? void 0 : _this$$primevueConfig3.ptOptions) || {}, _ref9$mergeSections = _ref9.mergeSections, mergeSections = _ref9$mergeSections === void 0 ? true : _ref9$mergeSections, _ref9$mergeProps = _ref9.mergeProps, useMergeProps = _ref9$mergeProps === void 0 ? false : _ref9$mergeProps;
|
|
var originalValue = fn(pt2.originalValue);
|
|
var value = fn(pt2.value);
|
|
if (originalValue === void 0 && value === void 0) return void 0;
|
|
else if (a(value)) return value;
|
|
else if (a(originalValue)) return originalValue;
|
|
return mergeSections || !mergeSections && value ? useMergeProps ? this._mergeProps(useMergeProps, originalValue, value) : _objectSpread$3(_objectSpread$3({}, originalValue), value) : value;
|
|
}
|
|
return fn(pt2);
|
|
},
|
|
_useGlobalPT: function _useGlobalPT(callback, key, params) {
|
|
return this._usePT(this.globalPT, callback, key, params);
|
|
},
|
|
_useDefaultPT: function _useDefaultPT(callback, key, params) {
|
|
return this._usePT(this.defaultPT, callback, key, params);
|
|
},
|
|
ptm: function ptm() {
|
|
var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
return this._getPTValue(this.pt, key, _objectSpread$3(_objectSpread$3({}, this.$params), params));
|
|
},
|
|
ptmi: function ptmi() {
|
|
var _attrs$id;
|
|
var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
var attrs3 = mergeProps(this.$_attrsWithoutPT, this.ptm(key, params));
|
|
(attrs3 === null || attrs3 === void 0 ? void 0 : attrs3.hasOwnProperty("id")) && ((_attrs$id = attrs3.id) !== null && _attrs$id !== void 0 ? _attrs$id : attrs3.id = this.$id);
|
|
return attrs3;
|
|
},
|
|
ptmo: function ptmo() {
|
|
var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
return this._getPTValue(obj, key, _objectSpread$3({
|
|
instance: this
|
|
}, params), false);
|
|
},
|
|
cx: function cx() {
|
|
var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
return !this.isUnstyled ? this._getOptionValue(this.$style.classes, key, _objectSpread$3(_objectSpread$3({}, this.$params), params)) : void 0;
|
|
},
|
|
sx: function sx() {
|
|
var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
var when = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
if (when) {
|
|
var self2 = this._getOptionValue(this.$style.inlineStyles, key, _objectSpread$3(_objectSpread$3({}, this.$params), params));
|
|
var base = this._getOptionValue(BaseComponentStyle.inlineStyles, key, _objectSpread$3(_objectSpread$3({}, this.$params), params));
|
|
return [base, self2];
|
|
}
|
|
return void 0;
|
|
}
|
|
},
|
|
computed: {
|
|
globalPT: function globalPT() {
|
|
var _this$$primevueConfig4, _this3 = this;
|
|
return this._getPT((_this$$primevueConfig4 = this.$primevueConfig) === null || _this$$primevueConfig4 === void 0 ? void 0 : _this$$primevueConfig4.pt, void 0, function(value) {
|
|
return m(value, {
|
|
instance: _this3
|
|
});
|
|
});
|
|
},
|
|
defaultPT: function defaultPT() {
|
|
var _this$$primevueConfig5, _this4 = this;
|
|
return this._getPT((_this$$primevueConfig5 = this.$primevueConfig) === null || _this$$primevueConfig5 === void 0 ? void 0 : _this$$primevueConfig5.pt, void 0, function(value) {
|
|
return _this4._getOptionValue(value, _this4.$name, _objectSpread$3({}, _this4.$params)) || m(value, _objectSpread$3({}, _this4.$params));
|
|
});
|
|
},
|
|
isUnstyled: function isUnstyled() {
|
|
var _this$$primevueConfig6;
|
|
return this.unstyled !== void 0 ? this.unstyled : (_this$$primevueConfig6 = this.$primevueConfig) === null || _this$$primevueConfig6 === void 0 ? void 0 : _this$$primevueConfig6.unstyled;
|
|
},
|
|
$id: function $id() {
|
|
return this.$attrs.id || this.uid;
|
|
},
|
|
$inProps: function $inProps() {
|
|
var _this$$$vnode;
|
|
var nodePropKeys = Object.keys(((_this$$$vnode = this.$.vnode) === null || _this$$$vnode === void 0 ? void 0 : _this$$$vnode.props) || {});
|
|
return Object.fromEntries(Object.entries(this.$props).filter(function(_ref0) {
|
|
var _ref1 = _slicedToArray$1(_ref0, 1), k2 = _ref1[0];
|
|
return nodePropKeys === null || nodePropKeys === void 0 ? void 0 : nodePropKeys.includes(k2);
|
|
}));
|
|
},
|
|
$theme: function $theme() {
|
|
var _this$$primevueConfig7;
|
|
return (_this$$primevueConfig7 = this.$primevueConfig) === null || _this$$primevueConfig7 === void 0 ? void 0 : _this$$primevueConfig7.theme;
|
|
},
|
|
$style: function $style() {
|
|
return _objectSpread$3(_objectSpread$3({
|
|
classes: void 0,
|
|
inlineStyles: void 0,
|
|
load: function load2() {
|
|
},
|
|
loadCSS: function loadCSS2() {
|
|
},
|
|
loadStyle: function loadStyle2() {
|
|
}
|
|
}, (this._getHostInstance(this) || {}).$style), this.$options.style);
|
|
},
|
|
$styleOptions: function $styleOptions() {
|
|
var _this$$primevueConfig8;
|
|
return {
|
|
nonce: (_this$$primevueConfig8 = this.$primevueConfig) === null || _this$$primevueConfig8 === void 0 || (_this$$primevueConfig8 = _this$$primevueConfig8.csp) === null || _this$$primevueConfig8 === void 0 ? void 0 : _this$$primevueConfig8.nonce
|
|
};
|
|
},
|
|
$primevueConfig: function $primevueConfig() {
|
|
var _this$$primevue4;
|
|
return (_this$$primevue4 = this.$primevue) === null || _this$$primevue4 === void 0 ? void 0 : _this$$primevue4.config;
|
|
},
|
|
$name: function $name() {
|
|
return this.$options.hostName || this.$.type.name;
|
|
},
|
|
$params: function $params() {
|
|
var parentInstance = this._getHostInstance(this) || this.$parent;
|
|
return {
|
|
instance: this,
|
|
props: this.$props,
|
|
state: this.$data,
|
|
attrs: this.$attrs,
|
|
parent: {
|
|
instance: parentInstance,
|
|
props: parentInstance === null || parentInstance === void 0 ? void 0 : parentInstance.$props,
|
|
state: parentInstance === null || parentInstance === void 0 ? void 0 : parentInstance.$data,
|
|
attrs: parentInstance === null || parentInstance === void 0 ? void 0 : parentInstance.$attrs
|
|
}
|
|
};
|
|
},
|
|
$_attrsPT: function $_attrsPT() {
|
|
return Object.entries(this.$attrs || {}).filter(function(_ref10) {
|
|
var _ref11 = _slicedToArray$1(_ref10, 1), key = _ref11[0];
|
|
return key === null || key === void 0 ? void 0 : key.startsWith("pt:");
|
|
}).reduce(function(result, _ref12) {
|
|
var _ref13 = _slicedToArray$1(_ref12, 2), key = _ref13[0], value = _ref13[1];
|
|
var _key$split = key.split(":"), _key$split2 = _toArray(_key$split), rest = _arrayLikeToArray$7(_key$split2).slice(1);
|
|
rest === null || rest === void 0 || rest.reduce(function(currentObj, nestedKey, index, array) {
|
|
!currentObj[nestedKey] && (currentObj[nestedKey] = index === array.length - 1 ? value : {});
|
|
return currentObj[nestedKey];
|
|
}, result);
|
|
return result;
|
|
}, {});
|
|
},
|
|
$_attrsWithoutPT: function $_attrsWithoutPT() {
|
|
return Object.entries(this.$attrs || {}).filter(function(_ref14) {
|
|
var _ref15 = _slicedToArray$1(_ref14, 1), key = _ref15[0];
|
|
return !(key !== null && key !== void 0 && key.startsWith("pt:"));
|
|
}).reduce(function(acc, _ref16) {
|
|
var _ref17 = _slicedToArray$1(_ref16, 2), key = _ref17[0], value = _ref17[1];
|
|
acc[key] = value;
|
|
return acc;
|
|
}, {});
|
|
}
|
|
}
|
|
};
|
|
var css2 = "\n.p-icon {\n display: inline-block;\n vertical-align: baseline;\n flex-shrink: 0;\n}\n\n.p-icon-spin {\n -webkit-animation: p-icon-spin 2s infinite linear;\n animation: p-icon-spin 2s infinite linear;\n}\n\n@-webkit-keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n@keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n";
|
|
var BaseIconStyle = BaseStyle.extend({
|
|
name: "baseicon",
|
|
css: css2
|
|
});
|
|
function _typeof$7(o) {
|
|
"@babel/helpers - typeof";
|
|
return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
return typeof o2;
|
|
} : function(o2) {
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
}, _typeof$7(o);
|
|
}
|
|
function ownKeys$2(e, r) {
|
|
var t2 = Object.keys(e);
|
|
if (Object.getOwnPropertySymbols) {
|
|
var o = Object.getOwnPropertySymbols(e);
|
|
r && (o = o.filter(function(r2) {
|
|
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
})), t2.push.apply(t2, o);
|
|
}
|
|
return t2;
|
|
}
|
|
function _objectSpread$2(e) {
|
|
for (var r = 1; r < arguments.length; r++) {
|
|
var t2 = null != arguments[r] ? arguments[r] : {};
|
|
r % 2 ? ownKeys$2(Object(t2), true).forEach(function(r2) {
|
|
_defineProperty$7(e, r2, t2[r2]);
|
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$2(Object(t2)).forEach(function(r2) {
|
|
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
|
|
});
|
|
}
|
|
return e;
|
|
}
|
|
function _defineProperty$7(e, r, t2) {
|
|
return (r = _toPropertyKey$7(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
|
|
}
|
|
function _toPropertyKey$7(t2) {
|
|
var i2 = _toPrimitive$7(t2, "string");
|
|
return "symbol" == _typeof$7(i2) ? i2 : i2 + "";
|
|
}
|
|
function _toPrimitive$7(t2, r) {
|
|
if ("object" != _typeof$7(t2) || !t2) return t2;
|
|
var e = t2[Symbol.toPrimitive];
|
|
if (void 0 !== e) {
|
|
var i2 = e.call(t2, r);
|
|
if ("object" != _typeof$7(i2)) return i2;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return ("string" === r ? String : Number)(t2);
|
|
}
|
|
var script$c = {
|
|
name: "BaseIcon",
|
|
"extends": script$d,
|
|
props: {
|
|
label: {
|
|
type: String,
|
|
"default": void 0
|
|
},
|
|
spin: {
|
|
type: Boolean,
|
|
"default": false
|
|
}
|
|
},
|
|
style: BaseIconStyle,
|
|
provide: function provide2() {
|
|
return {
|
|
$pcIcon: this,
|
|
$parentInstance: this
|
|
};
|
|
},
|
|
methods: {
|
|
pti: function pti() {
|
|
var isLabelEmpty = l(this.label);
|
|
return _objectSpread$2(_objectSpread$2({}, !this.isUnstyled && {
|
|
"class": ["p-icon", {
|
|
"p-icon-spin": this.spin
|
|
}]
|
|
}), {}, {
|
|
role: !isLabelEmpty ? "img" : void 0,
|
|
"aria-label": !isLabelEmpty ? this.label : void 0,
|
|
"aria-hidden": isLabelEmpty
|
|
});
|
|
}
|
|
}
|
|
};
|
|
var script$b = {
|
|
name: "SpinnerIcon",
|
|
"extends": script$c
|
|
};
|
|
function _toConsumableArray$5(r) {
|
|
return _arrayWithoutHoles$5(r) || _iterableToArray$5(r) || _unsupportedIterableToArray$6(r) || _nonIterableSpread$5();
|
|
}
|
|
function _nonIterableSpread$5() {
|
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
function _unsupportedIterableToArray$6(r, a2) {
|
|
if (r) {
|
|
if ("string" == typeof r) return _arrayLikeToArray$6(r, a2);
|
|
var t2 = {}.toString.call(r).slice(8, -1);
|
|
return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$6(r, a2) : void 0;
|
|
}
|
|
}
|
|
function _iterableToArray$5(r) {
|
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
}
|
|
function _arrayWithoutHoles$5(r) {
|
|
if (Array.isArray(r)) return _arrayLikeToArray$6(r);
|
|
}
|
|
function _arrayLikeToArray$6(r, a2) {
|
|
(null == a2 || a2 > r.length) && (a2 = r.length);
|
|
for (var e = 0, n = Array(a2); e < a2; e++) n[e] = r[e];
|
|
return n;
|
|
}
|
|
function render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return openBlock(), createElementBlock("svg", mergeProps({
|
|
width: "14",
|
|
height: "14",
|
|
viewBox: "0 0 14 14",
|
|
fill: "none",
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
}, _ctx.pti()), _toConsumableArray$5(_cache[0] || (_cache[0] = [createBaseVNode("path", {
|
|
d: "M6.99701 14C5.85441 13.999 4.72939 13.7186 3.72012 13.1832C2.71084 12.6478 1.84795 11.8737 1.20673 10.9284C0.565504 9.98305 0.165424 8.89526 0.041387 7.75989C-0.0826496 6.62453 0.073125 5.47607 0.495122 4.4147C0.917119 3.35333 1.59252 2.4113 2.46241 1.67077C3.33229 0.930247 4.37024 0.413729 5.4857 0.166275C6.60117 -0.0811796 7.76026 -0.0520535 8.86188 0.251112C9.9635 0.554278 10.9742 1.12227 11.8057 1.90555C11.915 2.01493 11.9764 2.16319 11.9764 2.31778C11.9764 2.47236 11.915 2.62062 11.8057 2.73C11.7521 2.78503 11.688 2.82877 11.6171 2.85864C11.5463 2.8885 11.4702 2.90389 11.3933 2.90389C11.3165 2.90389 11.2404 2.8885 11.1695 2.85864C11.0987 2.82877 11.0346 2.78503 10.9809 2.73C9.9998 1.81273 8.73246 1.26138 7.39226 1.16876C6.05206 1.07615 4.72086 1.44794 3.62279 2.22152C2.52471 2.99511 1.72683 4.12325 1.36345 5.41602C1.00008 6.70879 1.09342 8.08723 1.62775 9.31926C2.16209 10.5513 3.10478 11.5617 4.29713 12.1803C5.48947 12.7989 6.85865 12.988 8.17414 12.7157C9.48963 12.4435 10.6711 11.7264 11.5196 10.6854C12.3681 9.64432 12.8319 8.34282 12.8328 7C12.8328 6.84529 12.8943 6.69692 13.0038 6.58752C13.1132 6.47812 13.2616 6.41667 13.4164 6.41667C13.5712 6.41667 13.7196 6.47812 13.8291 6.58752C13.9385 6.69692 14 6.84529 14 7C14 8.85651 13.2622 10.637 11.9489 11.9497C10.6356 13.2625 8.85432 14 6.99701 14Z",
|
|
fill: "currentColor"
|
|
}, null, -1)])), 16);
|
|
}
|
|
script$b.render = render$8;
|
|
var style$5 = "\n .p-badge {\n display: inline-flex;\n border-radius: dt('badge.border.radius');\n align-items: center;\n justify-content: center;\n padding: dt('badge.padding');\n background: dt('badge.primary.background');\n color: dt('badge.primary.color');\n font-size: dt('badge.font.size');\n font-weight: dt('badge.font.weight');\n min-width: dt('badge.min.width');\n height: dt('badge.height');\n }\n\n .p-badge-dot {\n width: dt('badge.dot.size');\n min-width: dt('badge.dot.size');\n height: dt('badge.dot.size');\n border-radius: 50%;\n padding: 0;\n }\n\n .p-badge-circle {\n padding: 0;\n border-radius: 50%;\n }\n\n .p-badge-secondary {\n background: dt('badge.secondary.background');\n color: dt('badge.secondary.color');\n }\n\n .p-badge-success {\n background: dt('badge.success.background');\n color: dt('badge.success.color');\n }\n\n .p-badge-info {\n background: dt('badge.info.background');\n color: dt('badge.info.color');\n }\n\n .p-badge-warn {\n background: dt('badge.warn.background');\n color: dt('badge.warn.color');\n }\n\n .p-badge-danger {\n background: dt('badge.danger.background');\n color: dt('badge.danger.color');\n }\n\n .p-badge-contrast {\n background: dt('badge.contrast.background');\n color: dt('badge.contrast.color');\n }\n\n .p-badge-sm {\n font-size: dt('badge.sm.font.size');\n min-width: dt('badge.sm.min.width');\n height: dt('badge.sm.height');\n }\n\n .p-badge-lg {\n font-size: dt('badge.lg.font.size');\n min-width: dt('badge.lg.min.width');\n height: dt('badge.lg.height');\n }\n\n .p-badge-xl {\n font-size: dt('badge.xl.font.size');\n min-width: dt('badge.xl.min.width');\n height: dt('badge.xl.height');\n }\n";
|
|
var classes$5 = {
|
|
root: function root(_ref) {
|
|
var props = _ref.props, instance = _ref.instance;
|
|
return ["p-badge p-component", {
|
|
"p-badge-circle": s$2(props.value) && String(props.value).length === 1,
|
|
"p-badge-dot": l(props.value) && !instance.$slots["default"],
|
|
"p-badge-sm": props.size === "small",
|
|
"p-badge-lg": props.size === "large",
|
|
"p-badge-xl": props.size === "xlarge",
|
|
"p-badge-info": props.severity === "info",
|
|
"p-badge-success": props.severity === "success",
|
|
"p-badge-warn": props.severity === "warn",
|
|
"p-badge-danger": props.severity === "danger",
|
|
"p-badge-secondary": props.severity === "secondary",
|
|
"p-badge-contrast": props.severity === "contrast"
|
|
}];
|
|
}
|
|
};
|
|
var BadgeStyle = BaseStyle.extend({
|
|
name: "badge",
|
|
style: style$5,
|
|
classes: classes$5
|
|
});
|
|
var script$1$4 = {
|
|
name: "BaseBadge",
|
|
"extends": script$d,
|
|
props: {
|
|
value: {
|
|
type: [String, Number],
|
|
"default": null
|
|
},
|
|
severity: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
size: {
|
|
type: String,
|
|
"default": null
|
|
}
|
|
},
|
|
style: BadgeStyle,
|
|
provide: function provide3() {
|
|
return {
|
|
$pcBadge: this,
|
|
$parentInstance: this
|
|
};
|
|
}
|
|
};
|
|
function _typeof$6(o) {
|
|
"@babel/helpers - typeof";
|
|
return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
return typeof o2;
|
|
} : function(o2) {
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
}, _typeof$6(o);
|
|
}
|
|
function _defineProperty$6(e, r, t2) {
|
|
return (r = _toPropertyKey$6(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
|
|
}
|
|
function _toPropertyKey$6(t2) {
|
|
var i2 = _toPrimitive$6(t2, "string");
|
|
return "symbol" == _typeof$6(i2) ? i2 : i2 + "";
|
|
}
|
|
function _toPrimitive$6(t2, r) {
|
|
if ("object" != _typeof$6(t2) || !t2) return t2;
|
|
var e = t2[Symbol.toPrimitive];
|
|
if (void 0 !== e) {
|
|
var i2 = e.call(t2, r);
|
|
if ("object" != _typeof$6(i2)) return i2;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return ("string" === r ? String : Number)(t2);
|
|
}
|
|
var script$a = {
|
|
name: "Badge",
|
|
"extends": script$1$4,
|
|
inheritAttrs: false,
|
|
computed: {
|
|
dataP: function dataP() {
|
|
return f(_defineProperty$6(_defineProperty$6({
|
|
circle: this.value != null && String(this.value).length === 1,
|
|
empty: this.value == null && !this.$slots["default"]
|
|
}, this.severity, this.severity), this.size, this.size));
|
|
}
|
|
}
|
|
};
|
|
var _hoisted_1$4 = ["data-p"];
|
|
function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return openBlock(), createElementBlock("span", mergeProps({
|
|
"class": _ctx.cx("root"),
|
|
"data-p": $options.dataP
|
|
}, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default", {}, function() {
|
|
return [createTextVNode(toDisplayString(_ctx.value), 1)];
|
|
})], 16, _hoisted_1$4);
|
|
}
|
|
script$a.render = render$7;
|
|
function _typeof$5(o) {
|
|
"@babel/helpers - typeof";
|
|
return _typeof$5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
return typeof o2;
|
|
} : function(o2) {
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
}, _typeof$5(o);
|
|
}
|
|
function _slicedToArray(r, e) {
|
|
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$5(r, e) || _nonIterableRest();
|
|
}
|
|
function _nonIterableRest() {
|
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
function _unsupportedIterableToArray$5(r, a2) {
|
|
if (r) {
|
|
if ("string" == typeof r) return _arrayLikeToArray$5(r, a2);
|
|
var t2 = {}.toString.call(r).slice(8, -1);
|
|
return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$5(r, a2) : void 0;
|
|
}
|
|
}
|
|
function _arrayLikeToArray$5(r, a2) {
|
|
(null == a2 || a2 > r.length) && (a2 = r.length);
|
|
for (var e = 0, n = Array(a2); e < a2; e++) n[e] = r[e];
|
|
return n;
|
|
}
|
|
function _iterableToArrayLimit(r, l2) {
|
|
var t2 = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
if (null != t2) {
|
|
var e, n, i2, u, a2 = [], f2 = true, o = false;
|
|
try {
|
|
if (i2 = (t2 = t2.call(r)).next, 0 === l2) ;
|
|
else for (; !(f2 = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l2); f2 = true) ;
|
|
} catch (r2) {
|
|
o = true, n = r2;
|
|
} finally {
|
|
try {
|
|
if (!f2 && null != t2["return"] && (u = t2["return"](), Object(u) !== u)) return;
|
|
} finally {
|
|
if (o) throw n;
|
|
}
|
|
}
|
|
return a2;
|
|
}
|
|
}
|
|
function _arrayWithHoles(r) {
|
|
if (Array.isArray(r)) return r;
|
|
}
|
|
function ownKeys$1(e, r) {
|
|
var t2 = Object.keys(e);
|
|
if (Object.getOwnPropertySymbols) {
|
|
var o = Object.getOwnPropertySymbols(e);
|
|
r && (o = o.filter(function(r2) {
|
|
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
})), t2.push.apply(t2, o);
|
|
}
|
|
return t2;
|
|
}
|
|
function _objectSpread$1(e) {
|
|
for (var r = 1; r < arguments.length; r++) {
|
|
var t2 = null != arguments[r] ? arguments[r] : {};
|
|
r % 2 ? ownKeys$1(Object(t2), true).forEach(function(r2) {
|
|
_defineProperty$5(e, r2, t2[r2]);
|
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1(Object(t2)).forEach(function(r2) {
|
|
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
|
|
});
|
|
}
|
|
return e;
|
|
}
|
|
function _defineProperty$5(e, r, t2) {
|
|
return (r = _toPropertyKey$5(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
|
|
}
|
|
function _toPropertyKey$5(t2) {
|
|
var i2 = _toPrimitive$5(t2, "string");
|
|
return "symbol" == _typeof$5(i2) ? i2 : i2 + "";
|
|
}
|
|
function _toPrimitive$5(t2, r) {
|
|
if ("object" != _typeof$5(t2) || !t2) return t2;
|
|
var e = t2[Symbol.toPrimitive];
|
|
if (void 0 !== e) {
|
|
var i2 = e.call(t2, r);
|
|
if ("object" != _typeof$5(i2)) return i2;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return ("string" === r ? String : Number)(t2);
|
|
}
|
|
var BaseDirective = {
|
|
_getMeta: function _getMeta() {
|
|
return [i(arguments.length <= 0 ? void 0 : arguments[0]) ? void 0 : arguments.length <= 0 ? void 0 : arguments[0], m(i(arguments.length <= 0 ? void 0 : arguments[0]) ? arguments.length <= 0 ? void 0 : arguments[0] : arguments.length <= 1 ? void 0 : arguments[1])];
|
|
},
|
|
_getConfig: function _getConfig(binding, vnode) {
|
|
var _ref, _binding$instance, _vnode$ctx;
|
|
return (_ref = (binding === null || binding === void 0 || (_binding$instance = binding.instance) === null || _binding$instance === void 0 ? void 0 : _binding$instance.$primevue) || (vnode === null || vnode === void 0 || (_vnode$ctx = vnode.ctx) === null || _vnode$ctx === void 0 || (_vnode$ctx = _vnode$ctx.appContext) === null || _vnode$ctx === void 0 || (_vnode$ctx = _vnode$ctx.config) === null || _vnode$ctx === void 0 || (_vnode$ctx = _vnode$ctx.globalProperties) === null || _vnode$ctx === void 0 ? void 0 : _vnode$ctx.$primevue)) === null || _ref === void 0 ? void 0 : _ref.config;
|
|
},
|
|
_getOptionValue: F$1,
|
|
_getPTValue: function _getPTValue2() {
|
|
var _instance$binding, _instance$$primevueCo;
|
|
var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var obj = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
|
|
var params = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
var searchInDefaultPT = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
|
|
var getValue = function getValue2() {
|
|
var value = BaseDirective._getOptionValue.apply(BaseDirective, arguments);
|
|
return a(value) || C$2(value) ? {
|
|
"class": value
|
|
} : value;
|
|
};
|
|
var _ref2 = ((_instance$binding = instance.binding) === null || _instance$binding === void 0 || (_instance$binding = _instance$binding.value) === null || _instance$binding === void 0 ? void 0 : _instance$binding.ptOptions) || ((_instance$$primevueCo = instance.$primevueConfig) === null || _instance$$primevueCo === void 0 ? void 0 : _instance$$primevueCo.ptOptions) || {}, _ref2$mergeSections = _ref2.mergeSections, mergeSections = _ref2$mergeSections === void 0 ? true : _ref2$mergeSections, _ref2$mergeProps = _ref2.mergeProps, useMergeProps = _ref2$mergeProps === void 0 ? false : _ref2$mergeProps;
|
|
var global2 = searchInDefaultPT ? BaseDirective._useDefaultPT(instance, instance.defaultPT(), getValue, key, params) : void 0;
|
|
var self2 = BaseDirective._usePT(instance, BaseDirective._getPT(obj, instance.$name), getValue, key, _objectSpread$1(_objectSpread$1({}, params), {}, {
|
|
global: global2 || {}
|
|
}));
|
|
var datasets = BaseDirective._getPTDatasets(instance, key);
|
|
return mergeSections || !mergeSections && self2 ? useMergeProps ? BaseDirective._mergeProps(instance, useMergeProps, global2, self2, datasets) : _objectSpread$1(_objectSpread$1(_objectSpread$1({}, global2), self2), datasets) : _objectSpread$1(_objectSpread$1({}, self2), datasets);
|
|
},
|
|
_getPTDatasets: function _getPTDatasets2() {
|
|
var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
var datasetPrefix = "data-pc-";
|
|
return _objectSpread$1(_objectSpread$1({}, key === "root" && _defineProperty$5({}, "".concat(datasetPrefix, "name"), g(instance.$name))), {}, _defineProperty$5({}, "".concat(datasetPrefix, "section"), g(key)));
|
|
},
|
|
_getPT: function _getPT2(pt2) {
|
|
var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
var callback = arguments.length > 2 ? arguments[2] : void 0;
|
|
var getValue = function getValue2(value) {
|
|
var _computedValue$_key;
|
|
var computedValue = callback ? callback(value) : value;
|
|
var _key = g(key);
|
|
return (_computedValue$_key = computedValue === null || computedValue === void 0 ? void 0 : computedValue[_key]) !== null && _computedValue$_key !== void 0 ? _computedValue$_key : computedValue;
|
|
};
|
|
return pt2 && Object.hasOwn(pt2, "_usept") ? {
|
|
_usept: pt2["_usept"],
|
|
originalValue: getValue(pt2.originalValue),
|
|
value: getValue(pt2.value)
|
|
} : getValue(pt2);
|
|
},
|
|
_usePT: function _usePT2() {
|
|
var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var pt2 = arguments.length > 1 ? arguments[1] : void 0;
|
|
var callback = arguments.length > 2 ? arguments[2] : void 0;
|
|
var key = arguments.length > 3 ? arguments[3] : void 0;
|
|
var params = arguments.length > 4 ? arguments[4] : void 0;
|
|
var fn = function fn2(value2) {
|
|
return callback(value2, key, params);
|
|
};
|
|
if (pt2 && Object.hasOwn(pt2, "_usept")) {
|
|
var _instance$$primevueCo2;
|
|
var _ref4 = pt2["_usept"] || ((_instance$$primevueCo2 = instance.$primevueConfig) === null || _instance$$primevueCo2 === void 0 ? void 0 : _instance$$primevueCo2.ptOptions) || {}, _ref4$mergeSections = _ref4.mergeSections, mergeSections = _ref4$mergeSections === void 0 ? true : _ref4$mergeSections, _ref4$mergeProps = _ref4.mergeProps, useMergeProps = _ref4$mergeProps === void 0 ? false : _ref4$mergeProps;
|
|
var originalValue = fn(pt2.originalValue);
|
|
var value = fn(pt2.value);
|
|
if (originalValue === void 0 && value === void 0) return void 0;
|
|
else if (a(value)) return value;
|
|
else if (a(originalValue)) return originalValue;
|
|
return mergeSections || !mergeSections && value ? useMergeProps ? BaseDirective._mergeProps(instance, useMergeProps, originalValue, value) : _objectSpread$1(_objectSpread$1({}, originalValue), value) : value;
|
|
}
|
|
return fn(pt2);
|
|
},
|
|
_useDefaultPT: function _useDefaultPT2() {
|
|
var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var defaultPT2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
var callback = arguments.length > 2 ? arguments[2] : void 0;
|
|
var key = arguments.length > 3 ? arguments[3] : void 0;
|
|
var params = arguments.length > 4 ? arguments[4] : void 0;
|
|
return BaseDirective._usePT(instance, defaultPT2, callback, key, params);
|
|
},
|
|
_loadStyles: function _loadStyles2() {
|
|
var _config$csp;
|
|
var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var binding = arguments.length > 1 ? arguments[1] : void 0;
|
|
var vnode = arguments.length > 2 ? arguments[2] : void 0;
|
|
var config = BaseDirective._getConfig(binding, vnode);
|
|
var useStyleOptions = {
|
|
nonce: config === null || config === void 0 || (_config$csp = config.csp) === null || _config$csp === void 0 ? void 0 : _config$csp.nonce
|
|
};
|
|
BaseDirective._loadCoreStyles(instance, useStyleOptions);
|
|
BaseDirective._loadThemeStyles(instance, useStyleOptions);
|
|
BaseDirective._loadScopedThemeStyles(instance, useStyleOptions);
|
|
BaseDirective._removeThemeListeners(instance);
|
|
instance.$loadStyles = function() {
|
|
return BaseDirective._loadThemeStyles(instance, useStyleOptions);
|
|
};
|
|
BaseDirective._themeChangeListener(instance.$loadStyles);
|
|
},
|
|
_loadCoreStyles: function _loadCoreStyles2() {
|
|
var _instance$$style, _instance$$style2;
|
|
var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var useStyleOptions = arguments.length > 1 ? arguments[1] : void 0;
|
|
if (!Base.isStyleNameLoaded((_instance$$style = instance.$style) === null || _instance$$style === void 0 ? void 0 : _instance$$style.name) && (_instance$$style2 = instance.$style) !== null && _instance$$style2 !== void 0 && _instance$$style2.name) {
|
|
var _instance$$style3;
|
|
BaseStyle.loadCSS(useStyleOptions);
|
|
(_instance$$style3 = instance.$style) === null || _instance$$style3 === void 0 || _instance$$style3.loadCSS(useStyleOptions);
|
|
Base.setLoadedStyleName(instance.$style.name);
|
|
}
|
|
},
|
|
_loadThemeStyles: function _loadThemeStyles2() {
|
|
var _instance$theme, _instance$$style5, _instance$$style6;
|
|
var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var useStyleOptions = arguments.length > 1 ? arguments[1] : void 0;
|
|
if (instance !== null && instance !== void 0 && instance.isUnstyled() || (instance === null || instance === void 0 || (_instance$theme = instance.theme) === null || _instance$theme === void 0 ? void 0 : _instance$theme.call(instance)) === "none") return;
|
|
if (!S.isStyleNameLoaded("common")) {
|
|
var _instance$$style4, _instance$$style4$get;
|
|
var _ref5 = ((_instance$$style4 = instance.$style) === null || _instance$$style4 === void 0 || (_instance$$style4$get = _instance$$style4.getCommonTheme) === null || _instance$$style4$get === void 0 ? void 0 : _instance$$style4$get.call(_instance$$style4)) || {}, primitive = _ref5.primitive, semantic = _ref5.semantic, global2 = _ref5.global, style2 = _ref5.style;
|
|
BaseStyle.load(primitive === null || primitive === void 0 ? void 0 : primitive.css, _objectSpread$1({
|
|
name: "primitive-variables"
|
|
}, useStyleOptions));
|
|
BaseStyle.load(semantic === null || semantic === void 0 ? void 0 : semantic.css, _objectSpread$1({
|
|
name: "semantic-variables"
|
|
}, useStyleOptions));
|
|
BaseStyle.load(global2 === null || global2 === void 0 ? void 0 : global2.css, _objectSpread$1({
|
|
name: "global-variables"
|
|
}, useStyleOptions));
|
|
BaseStyle.loadStyle(_objectSpread$1({
|
|
name: "global-style"
|
|
}, useStyleOptions), style2);
|
|
S.setLoadedStyleName("common");
|
|
}
|
|
if (!S.isStyleNameLoaded((_instance$$style5 = instance.$style) === null || _instance$$style5 === void 0 ? void 0 : _instance$$style5.name) && (_instance$$style6 = instance.$style) !== null && _instance$$style6 !== void 0 && _instance$$style6.name) {
|
|
var _instance$$style7, _instance$$style7$get, _instance$$style8, _instance$$style9;
|
|
var _ref6 = ((_instance$$style7 = instance.$style) === null || _instance$$style7 === void 0 || (_instance$$style7$get = _instance$$style7.getDirectiveTheme) === null || _instance$$style7$get === void 0 ? void 0 : _instance$$style7$get.call(_instance$$style7)) || {}, css3 = _ref6.css, _style = _ref6.style;
|
|
(_instance$$style8 = instance.$style) === null || _instance$$style8 === void 0 || _instance$$style8.load(css3, _objectSpread$1({
|
|
name: "".concat(instance.$style.name, "-variables")
|
|
}, useStyleOptions));
|
|
(_instance$$style9 = instance.$style) === null || _instance$$style9 === void 0 || _instance$$style9.loadStyle(_objectSpread$1({
|
|
name: "".concat(instance.$style.name, "-style")
|
|
}, useStyleOptions), _style);
|
|
S.setLoadedStyleName(instance.$style.name);
|
|
}
|
|
if (!S.isStyleNameLoaded("layer-order")) {
|
|
var _instance$$style0, _instance$$style0$get;
|
|
var layerOrder = (_instance$$style0 = instance.$style) === null || _instance$$style0 === void 0 || (_instance$$style0$get = _instance$$style0.getLayerOrderThemeCSS) === null || _instance$$style0$get === void 0 ? void 0 : _instance$$style0$get.call(_instance$$style0);
|
|
BaseStyle.load(layerOrder, _objectSpread$1({
|
|
name: "layer-order",
|
|
first: true
|
|
}, useStyleOptions));
|
|
S.setLoadedStyleName("layer-order");
|
|
}
|
|
},
|
|
_loadScopedThemeStyles: function _loadScopedThemeStyles2() {
|
|
var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var useStyleOptions = arguments.length > 1 ? arguments[1] : void 0;
|
|
var preset = instance.preset();
|
|
if (preset && instance.$attrSelector) {
|
|
var _instance$$style1, _instance$$style1$get, _instance$$style10;
|
|
var _ref7 = ((_instance$$style1 = instance.$style) === null || _instance$$style1 === void 0 || (_instance$$style1$get = _instance$$style1.getPresetTheme) === null || _instance$$style1$get === void 0 ? void 0 : _instance$$style1$get.call(_instance$$style1, preset, "[".concat(instance.$attrSelector, "]"))) || {}, css3 = _ref7.css;
|
|
var scopedStyle = (_instance$$style10 = instance.$style) === null || _instance$$style10 === void 0 ? void 0 : _instance$$style10.load(css3, _objectSpread$1({
|
|
name: "".concat(instance.$attrSelector, "-").concat(instance.$style.name)
|
|
}, useStyleOptions));
|
|
instance.scopedStyleEl = scopedStyle.el;
|
|
}
|
|
},
|
|
_themeChangeListener: function _themeChangeListener2() {
|
|
var callback = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function() {
|
|
};
|
|
Base.clearLoadedStyleNames();
|
|
N.on("theme:change", callback);
|
|
},
|
|
_removeThemeListeners: function _removeThemeListeners2() {
|
|
var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
N.off("theme:change", instance.$loadStyles);
|
|
instance.$loadStyles = void 0;
|
|
},
|
|
_hook: function _hook2(directiveName, hookName, el, binding, vnode, prevVnode) {
|
|
var _binding$value, _config$pt;
|
|
var name = "on".concat(ne$1(hookName));
|
|
var config = BaseDirective._getConfig(binding, vnode);
|
|
var instance = el === null || el === void 0 ? void 0 : el.$instance;
|
|
var selfHook = BaseDirective._usePT(instance, BaseDirective._getPT(binding === null || binding === void 0 || (_binding$value = binding.value) === null || _binding$value === void 0 ? void 0 : _binding$value.pt, directiveName), BaseDirective._getOptionValue, "hooks.".concat(name));
|
|
var defaultHook = BaseDirective._useDefaultPT(instance, config === null || config === void 0 || (_config$pt = config.pt) === null || _config$pt === void 0 || (_config$pt = _config$pt.directives) === null || _config$pt === void 0 ? void 0 : _config$pt[directiveName], BaseDirective._getOptionValue, "hooks.".concat(name));
|
|
var options = {
|
|
el,
|
|
binding,
|
|
vnode,
|
|
prevVnode
|
|
};
|
|
selfHook === null || selfHook === void 0 || selfHook(instance, options);
|
|
defaultHook === null || defaultHook === void 0 || defaultHook(instance, options);
|
|
},
|
|
/* eslint-disable-next-line no-unused-vars */
|
|
_mergeProps: function _mergeProps2() {
|
|
var fn = arguments.length > 1 ? arguments[1] : void 0;
|
|
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key2 = 2; _key2 < _len; _key2++) {
|
|
args[_key2 - 2] = arguments[_key2];
|
|
}
|
|
return c$1(fn) ? fn.apply(void 0, args) : mergeProps.apply(void 0, args);
|
|
},
|
|
_extend: function _extend(name) {
|
|
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
var handleHook = function handleHook2(hook, el, binding, vnode, prevVnode) {
|
|
var _el$$pd, _el$$instance$hook, _el$$instance, _el$$pd2;
|
|
el._$instances = el._$instances || {};
|
|
var config = BaseDirective._getConfig(binding, vnode);
|
|
var $prevInstance = el._$instances[name] || {};
|
|
var $options = l($prevInstance) ? _objectSpread$1(_objectSpread$1({}, options), options === null || options === void 0 ? void 0 : options.methods) : {};
|
|
el._$instances[name] = _objectSpread$1(_objectSpread$1({}, $prevInstance), {}, {
|
|
/* new instance variables to pass in directive methods */
|
|
$name: name,
|
|
$host: el,
|
|
$binding: binding,
|
|
$modifiers: binding === null || binding === void 0 ? void 0 : binding.modifiers,
|
|
$value: binding === null || binding === void 0 ? void 0 : binding.value,
|
|
$el: $prevInstance["$el"] || el || void 0,
|
|
$style: _objectSpread$1({
|
|
classes: void 0,
|
|
inlineStyles: void 0,
|
|
load: function load2() {
|
|
},
|
|
loadCSS: function loadCSS2() {
|
|
},
|
|
loadStyle: function loadStyle2() {
|
|
}
|
|
}, options === null || options === void 0 ? void 0 : options.style),
|
|
$primevueConfig: config,
|
|
$attrSelector: (_el$$pd = el.$pd) === null || _el$$pd === void 0 || (_el$$pd = _el$$pd[name]) === null || _el$$pd === void 0 ? void 0 : _el$$pd.attrSelector,
|
|
/* computed instance variables */
|
|
defaultPT: function defaultPT2() {
|
|
return BaseDirective._getPT(config === null || config === void 0 ? void 0 : config.pt, void 0, function(value) {
|
|
var _value$directives;
|
|
return value === null || value === void 0 || (_value$directives = value.directives) === null || _value$directives === void 0 ? void 0 : _value$directives[name];
|
|
});
|
|
},
|
|
isUnstyled: function isUnstyled2() {
|
|
var _el$_$instances$name, _el$_$instances$name2;
|
|
return ((_el$_$instances$name = el._$instances[name]) === null || _el$_$instances$name === void 0 || (_el$_$instances$name = _el$_$instances$name.$binding) === null || _el$_$instances$name === void 0 || (_el$_$instances$name = _el$_$instances$name.value) === null || _el$_$instances$name === void 0 ? void 0 : _el$_$instances$name.unstyled) !== void 0 ? (_el$_$instances$name2 = el._$instances[name]) === null || _el$_$instances$name2 === void 0 || (_el$_$instances$name2 = _el$_$instances$name2.$binding) === null || _el$_$instances$name2 === void 0 || (_el$_$instances$name2 = _el$_$instances$name2.value) === null || _el$_$instances$name2 === void 0 ? void 0 : _el$_$instances$name2.unstyled : config === null || config === void 0 ? void 0 : config.unstyled;
|
|
},
|
|
theme: function theme() {
|
|
var _el$_$instances$name3;
|
|
return (_el$_$instances$name3 = el._$instances[name]) === null || _el$_$instances$name3 === void 0 || (_el$_$instances$name3 = _el$_$instances$name3.$primevueConfig) === null || _el$_$instances$name3 === void 0 ? void 0 : _el$_$instances$name3.theme;
|
|
},
|
|
preset: function preset() {
|
|
var _el$_$instances$name4;
|
|
return (_el$_$instances$name4 = el._$instances[name]) === null || _el$_$instances$name4 === void 0 || (_el$_$instances$name4 = _el$_$instances$name4.$binding) === null || _el$_$instances$name4 === void 0 || (_el$_$instances$name4 = _el$_$instances$name4.value) === null || _el$_$instances$name4 === void 0 ? void 0 : _el$_$instances$name4.dt;
|
|
},
|
|
/* instance's methods */
|
|
ptm: function ptm2() {
|
|
var _el$_$instances$name5;
|
|
var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
return BaseDirective._getPTValue(el._$instances[name], (_el$_$instances$name5 = el._$instances[name]) === null || _el$_$instances$name5 === void 0 || (_el$_$instances$name5 = _el$_$instances$name5.$binding) === null || _el$_$instances$name5 === void 0 || (_el$_$instances$name5 = _el$_$instances$name5.value) === null || _el$_$instances$name5 === void 0 ? void 0 : _el$_$instances$name5.pt, key, _objectSpread$1({}, params));
|
|
},
|
|
ptmo: function ptmo2() {
|
|
var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
return BaseDirective._getPTValue(el._$instances[name], obj, key, params, false);
|
|
},
|
|
cx: function cx2() {
|
|
var _el$_$instances$name6, _el$_$instances$name7;
|
|
var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
return !((_el$_$instances$name6 = el._$instances[name]) !== null && _el$_$instances$name6 !== void 0 && _el$_$instances$name6.isUnstyled()) ? BaseDirective._getOptionValue((_el$_$instances$name7 = el._$instances[name]) === null || _el$_$instances$name7 === void 0 || (_el$_$instances$name7 = _el$_$instances$name7.$style) === null || _el$_$instances$name7 === void 0 ? void 0 : _el$_$instances$name7.classes, key, _objectSpread$1({}, params)) : void 0;
|
|
},
|
|
sx: function sx2() {
|
|
var _el$_$instances$name8;
|
|
var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
var when = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
return when ? BaseDirective._getOptionValue((_el$_$instances$name8 = el._$instances[name]) === null || _el$_$instances$name8 === void 0 || (_el$_$instances$name8 = _el$_$instances$name8.$style) === null || _el$_$instances$name8 === void 0 ? void 0 : _el$_$instances$name8.inlineStyles, key, _objectSpread$1({}, params)) : void 0;
|
|
}
|
|
}, $options);
|
|
el.$instance = el._$instances[name];
|
|
(_el$$instance$hook = (_el$$instance = el.$instance)[hook]) === null || _el$$instance$hook === void 0 || _el$$instance$hook.call(_el$$instance, el, binding, vnode, prevVnode);
|
|
el["$".concat(name)] = el.$instance;
|
|
BaseDirective._hook(name, hook, el, binding, vnode, prevVnode);
|
|
el.$pd || (el.$pd = {});
|
|
el.$pd[name] = _objectSpread$1(_objectSpread$1({}, (_el$$pd2 = el.$pd) === null || _el$$pd2 === void 0 ? void 0 : _el$$pd2[name]), {}, {
|
|
name,
|
|
instance: el._$instances[name]
|
|
});
|
|
};
|
|
var handleWatchers = function handleWatchers2(el) {
|
|
var _watchers$config2, _watchers$configRipp2, _instance$$primevueCo3;
|
|
var instance = el._$instances[name];
|
|
var watchers = instance === null || instance === void 0 ? void 0 : instance.watch;
|
|
var handleWatchConfig = function handleWatchConfig2(_ref8) {
|
|
var _watchers$config;
|
|
var newValue = _ref8.newValue, oldValue = _ref8.oldValue;
|
|
return watchers === null || watchers === void 0 || (_watchers$config = watchers["config"]) === null || _watchers$config === void 0 ? void 0 : _watchers$config.call(instance, newValue, oldValue);
|
|
};
|
|
var handleWatchConfigRipple = function handleWatchConfigRipple2(_ref9) {
|
|
var _watchers$configRipp;
|
|
var newValue = _ref9.newValue, oldValue = _ref9.oldValue;
|
|
return watchers === null || watchers === void 0 || (_watchers$configRipp = watchers["config.ripple"]) === null || _watchers$configRipp === void 0 ? void 0 : _watchers$configRipp.call(instance, newValue, oldValue);
|
|
};
|
|
instance.$watchersCallback = {
|
|
config: handleWatchConfig,
|
|
"config.ripple": handleWatchConfigRipple
|
|
};
|
|
watchers === null || watchers === void 0 || (_watchers$config2 = watchers["config"]) === null || _watchers$config2 === void 0 || _watchers$config2.call(instance, instance === null || instance === void 0 ? void 0 : instance.$primevueConfig);
|
|
PrimeVueService.on("config:change", handleWatchConfig);
|
|
watchers === null || watchers === void 0 || (_watchers$configRipp2 = watchers["config.ripple"]) === null || _watchers$configRipp2 === void 0 || _watchers$configRipp2.call(instance, instance === null || instance === void 0 || (_instance$$primevueCo3 = instance.$primevueConfig) === null || _instance$$primevueCo3 === void 0 ? void 0 : _instance$$primevueCo3.ripple);
|
|
PrimeVueService.on("config:ripple:change", handleWatchConfigRipple);
|
|
};
|
|
var stopWatchers2 = function stopWatchers3(el) {
|
|
var watchers = el._$instances[name].$watchersCallback;
|
|
if (watchers) {
|
|
PrimeVueService.off("config:change", watchers.config);
|
|
PrimeVueService.off("config:ripple:change", watchers["config.ripple"]);
|
|
el._$instances[name].$watchersCallback = void 0;
|
|
}
|
|
};
|
|
return {
|
|
created: function created3(el, binding, vnode, prevVnode) {
|
|
el.$pd || (el.$pd = {});
|
|
el.$pd[name] = {
|
|
name,
|
|
attrSelector: s("pd")
|
|
};
|
|
handleHook("created", el, binding, vnode, prevVnode);
|
|
},
|
|
beforeMount: function beforeMount2(el, binding, vnode, prevVnode) {
|
|
var _el$$pd$name;
|
|
BaseDirective._loadStyles((_el$$pd$name = el.$pd[name]) === null || _el$$pd$name === void 0 ? void 0 : _el$$pd$name.instance, binding, vnode);
|
|
handleHook("beforeMount", el, binding, vnode, prevVnode);
|
|
handleWatchers(el);
|
|
},
|
|
mounted: function mounted3(el, binding, vnode, prevVnode) {
|
|
var _el$$pd$name2;
|
|
BaseDirective._loadStyles((_el$$pd$name2 = el.$pd[name]) === null || _el$$pd$name2 === void 0 ? void 0 : _el$$pd$name2.instance, binding, vnode);
|
|
handleHook("mounted", el, binding, vnode, prevVnode);
|
|
},
|
|
beforeUpdate: function beforeUpdate2(el, binding, vnode, prevVnode) {
|
|
handleHook("beforeUpdate", el, binding, vnode, prevVnode);
|
|
},
|
|
updated: function updated2(el, binding, vnode, prevVnode) {
|
|
var _el$$pd$name3;
|
|
BaseDirective._loadStyles((_el$$pd$name3 = el.$pd[name]) === null || _el$$pd$name3 === void 0 ? void 0 : _el$$pd$name3.instance, binding, vnode);
|
|
handleHook("updated", el, binding, vnode, prevVnode);
|
|
},
|
|
beforeUnmount: function beforeUnmount2(el, binding, vnode, prevVnode) {
|
|
var _el$$pd$name4;
|
|
stopWatchers2(el);
|
|
BaseDirective._removeThemeListeners((_el$$pd$name4 = el.$pd[name]) === null || _el$$pd$name4 === void 0 ? void 0 : _el$$pd$name4.instance);
|
|
handleHook("beforeUnmount", el, binding, vnode, prevVnode);
|
|
},
|
|
unmounted: function unmounted3(el, binding, vnode, prevVnode) {
|
|
var _el$$pd$name5;
|
|
(_el$$pd$name5 = el.$pd[name]) === null || _el$$pd$name5 === void 0 || (_el$$pd$name5 = _el$$pd$name5.instance) === null || _el$$pd$name5 === void 0 || (_el$$pd$name5 = _el$$pd$name5.scopedStyleEl) === null || _el$$pd$name5 === void 0 || (_el$$pd$name5 = _el$$pd$name5.value) === null || _el$$pd$name5 === void 0 || _el$$pd$name5.remove();
|
|
handleHook("unmounted", el, binding, vnode, prevVnode);
|
|
}
|
|
};
|
|
},
|
|
extend: function extend3() {
|
|
var _BaseDirective$_getMe = BaseDirective._getMeta.apply(BaseDirective, arguments), _BaseDirective$_getMe2 = _slicedToArray(_BaseDirective$_getMe, 2), name = _BaseDirective$_getMe2[0], options = _BaseDirective$_getMe2[1];
|
|
return _objectSpread$1({
|
|
extend: function extend4() {
|
|
var _BaseDirective$_getMe3 = BaseDirective._getMeta.apply(BaseDirective, arguments), _BaseDirective$_getMe4 = _slicedToArray(_BaseDirective$_getMe3, 2), _name = _BaseDirective$_getMe4[0], _options = _BaseDirective$_getMe4[1];
|
|
return BaseDirective.extend(_name, _objectSpread$1(_objectSpread$1(_objectSpread$1({}, options), options === null || options === void 0 ? void 0 : options.methods), _options));
|
|
}
|
|
}, BaseDirective._extend(name, options));
|
|
}
|
|
};
|
|
var style$4 = "\n .p-ink {\n display: block;\n position: absolute;\n background: dt('ripple.background');\n border-radius: 100%;\n transform: scale(0);\n pointer-events: none;\n }\n\n .p-ink-active {\n animation: ripple 0.4s linear;\n }\n\n @keyframes ripple {\n 100% {\n opacity: 0;\n transform: scale(2.5);\n }\n }\n";
|
|
var classes$4 = {
|
|
root: "p-ink"
|
|
};
|
|
var RippleStyle = BaseStyle.extend({
|
|
name: "ripple-directive",
|
|
style: style$4,
|
|
classes: classes$4
|
|
});
|
|
var BaseRipple = BaseDirective.extend({
|
|
style: RippleStyle
|
|
});
|
|
function _typeof$4(o) {
|
|
"@babel/helpers - typeof";
|
|
return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
return typeof o2;
|
|
} : function(o2) {
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
}, _typeof$4(o);
|
|
}
|
|
function _toConsumableArray$4(r) {
|
|
return _arrayWithoutHoles$4(r) || _iterableToArray$4(r) || _unsupportedIterableToArray$4(r) || _nonIterableSpread$4();
|
|
}
|
|
function _nonIterableSpread$4() {
|
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
function _unsupportedIterableToArray$4(r, a2) {
|
|
if (r) {
|
|
if ("string" == typeof r) return _arrayLikeToArray$4(r, a2);
|
|
var t2 = {}.toString.call(r).slice(8, -1);
|
|
return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$4(r, a2) : void 0;
|
|
}
|
|
}
|
|
function _iterableToArray$4(r) {
|
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
}
|
|
function _arrayWithoutHoles$4(r) {
|
|
if (Array.isArray(r)) return _arrayLikeToArray$4(r);
|
|
}
|
|
function _arrayLikeToArray$4(r, a2) {
|
|
(null == a2 || a2 > r.length) && (a2 = r.length);
|
|
for (var e = 0, n = Array(a2); e < a2; e++) n[e] = r[e];
|
|
return n;
|
|
}
|
|
function _defineProperty$4(e, r, t2) {
|
|
return (r = _toPropertyKey$4(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
|
|
}
|
|
function _toPropertyKey$4(t2) {
|
|
var i2 = _toPrimitive$4(t2, "string");
|
|
return "symbol" == _typeof$4(i2) ? i2 : i2 + "";
|
|
}
|
|
function _toPrimitive$4(t2, r) {
|
|
if ("object" != _typeof$4(t2) || !t2) return t2;
|
|
var e = t2[Symbol.toPrimitive];
|
|
if (void 0 !== e) {
|
|
var i2 = e.call(t2, r);
|
|
if ("object" != _typeof$4(i2)) return i2;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return ("string" === r ? String : Number)(t2);
|
|
}
|
|
var Ripple = BaseRipple.extend("ripple", {
|
|
watch: {
|
|
"config.ripple": function configRipple(newValue) {
|
|
if (newValue) {
|
|
this.createRipple(this.$host);
|
|
this.bindEvents(this.$host);
|
|
this.$host.setAttribute("data-pd-ripple", true);
|
|
this.$host.style["overflow"] = "hidden";
|
|
this.$host.style["position"] = "relative";
|
|
} else {
|
|
this.remove(this.$host);
|
|
this.$host.removeAttribute("data-pd-ripple");
|
|
}
|
|
}
|
|
},
|
|
unmounted: function unmounted2(el) {
|
|
this.remove(el);
|
|
},
|
|
timeout: void 0,
|
|
methods: {
|
|
bindEvents: function bindEvents(el) {
|
|
el.addEventListener("mousedown", this.onMouseDown.bind(this));
|
|
},
|
|
unbindEvents: function unbindEvents(el) {
|
|
el.removeEventListener("mousedown", this.onMouseDown.bind(this));
|
|
},
|
|
createRipple: function createRipple(el) {
|
|
var ink = this.getInk(el);
|
|
if (!ink) {
|
|
ink = U("span", _defineProperty$4(_defineProperty$4({
|
|
role: "presentation",
|
|
"aria-hidden": true,
|
|
"data-p-ink": true,
|
|
"data-p-ink-active": false,
|
|
"class": !this.isUnstyled() && this.cx("root"),
|
|
onAnimationEnd: this.onAnimationEnd.bind(this)
|
|
}, this.$attrSelector, ""), "p-bind", this.ptm("root")));
|
|
el.appendChild(ink);
|
|
this.$el = ink;
|
|
}
|
|
},
|
|
remove: function remove2(el) {
|
|
var ink = this.getInk(el);
|
|
if (ink) {
|
|
this.$host.style["overflow"] = "";
|
|
this.$host.style["position"] = "";
|
|
this.unbindEvents(el);
|
|
ink.removeEventListener("animationend", this.onAnimationEnd);
|
|
ink.remove();
|
|
}
|
|
},
|
|
onMouseDown: function onMouseDown(event) {
|
|
var _this = this;
|
|
var target = event.currentTarget;
|
|
var ink = this.getInk(target);
|
|
if (!ink || getComputedStyle(ink, null).display === "none") {
|
|
return;
|
|
}
|
|
!this.isUnstyled() && P(ink, "p-ink-active");
|
|
ink.setAttribute("data-p-ink-active", "false");
|
|
if (!Tt(ink) && !Rt(ink)) {
|
|
var d2 = Math.max(v$1(target), C$1(target));
|
|
ink.style.height = d2 + "px";
|
|
ink.style.width = d2 + "px";
|
|
}
|
|
var offset = K(target);
|
|
var x = event.pageX - offset.left + document.body.scrollTop - Rt(ink) / 2;
|
|
var y2 = event.pageY - offset.top + document.body.scrollLeft - Tt(ink) / 2;
|
|
ink.style.top = y2 + "px";
|
|
ink.style.left = x + "px";
|
|
!this.isUnstyled() && W(ink, "p-ink-active");
|
|
ink.setAttribute("data-p-ink-active", "true");
|
|
this.timeout = setTimeout(function() {
|
|
if (ink) {
|
|
!_this.isUnstyled() && P(ink, "p-ink-active");
|
|
ink.setAttribute("data-p-ink-active", "false");
|
|
}
|
|
}, 401);
|
|
},
|
|
onAnimationEnd: function onAnimationEnd(event) {
|
|
if (this.timeout) {
|
|
clearTimeout(this.timeout);
|
|
}
|
|
!this.isUnstyled() && P(event.currentTarget, "p-ink-active");
|
|
event.currentTarget.setAttribute("data-p-ink-active", "false");
|
|
},
|
|
getInk: function getInk(el) {
|
|
return el && el.children ? _toConsumableArray$4(el.children).find(function(child) {
|
|
return Q$1(child, "data-pc-name") === "ripple";
|
|
}) : void 0;
|
|
}
|
|
}
|
|
});
|
|
var style$3 = `
|
|
.p-button {
|
|
display: inline-flex;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
align-items: center;
|
|
justify-content: center;
|
|
overflow: hidden;
|
|
position: relative;
|
|
color: dt('button.primary.color');
|
|
background: dt('button.primary.background');
|
|
border: 1px solid dt('button.primary.border.color');
|
|
padding: dt('button.padding.y') dt('button.padding.x');
|
|
font-size: 1rem;
|
|
font-family: inherit;
|
|
font-feature-settings: inherit;
|
|
transition:
|
|
background dt('button.transition.duration'),
|
|
color dt('button.transition.duration'),
|
|
border-color dt('button.transition.duration'),
|
|
outline-color dt('button.transition.duration'),
|
|
box-shadow dt('button.transition.duration');
|
|
border-radius: dt('button.border.radius');
|
|
outline-color: transparent;
|
|
gap: dt('button.gap');
|
|
}
|
|
|
|
.p-button:disabled {
|
|
cursor: default;
|
|
}
|
|
|
|
.p-button-icon-right {
|
|
order: 1;
|
|
}
|
|
|
|
.p-button-icon-right:dir(rtl) {
|
|
order: -1;
|
|
}
|
|
|
|
.p-button:not(.p-button-vertical) .p-button-icon:not(.p-button-icon-right):dir(rtl) {
|
|
order: 1;
|
|
}
|
|
|
|
.p-button-icon-bottom {
|
|
order: 2;
|
|
}
|
|
|
|
.p-button-icon-only {
|
|
width: dt('button.icon.only.width');
|
|
padding-inline-start: 0;
|
|
padding-inline-end: 0;
|
|
gap: 0;
|
|
}
|
|
|
|
.p-button-icon-only.p-button-rounded {
|
|
border-radius: 50%;
|
|
height: dt('button.icon.only.width');
|
|
}
|
|
|
|
.p-button-icon-only .p-button-label {
|
|
visibility: hidden;
|
|
width: 0;
|
|
}
|
|
|
|
.p-button-icon-only::after {
|
|
content: "\0A0";
|
|
visibility: hidden;
|
|
width: 0;
|
|
}
|
|
|
|
.p-button-sm {
|
|
font-size: dt('button.sm.font.size');
|
|
padding: dt('button.sm.padding.y') dt('button.sm.padding.x');
|
|
}
|
|
|
|
.p-button-sm .p-button-icon {
|
|
font-size: dt('button.sm.font.size');
|
|
}
|
|
|
|
.p-button-sm.p-button-icon-only {
|
|
width: dt('button.sm.icon.only.width');
|
|
}
|
|
|
|
.p-button-sm.p-button-icon-only.p-button-rounded {
|
|
height: dt('button.sm.icon.only.width');
|
|
}
|
|
|
|
.p-button-lg {
|
|
font-size: dt('button.lg.font.size');
|
|
padding: dt('button.lg.padding.y') dt('button.lg.padding.x');
|
|
}
|
|
|
|
.p-button-lg .p-button-icon {
|
|
font-size: dt('button.lg.font.size');
|
|
}
|
|
|
|
.p-button-lg.p-button-icon-only {
|
|
width: dt('button.lg.icon.only.width');
|
|
}
|
|
|
|
.p-button-lg.p-button-icon-only.p-button-rounded {
|
|
height: dt('button.lg.icon.only.width');
|
|
}
|
|
|
|
.p-button-vertical {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.p-button-label {
|
|
font-weight: dt('button.label.font.weight');
|
|
}
|
|
|
|
.p-button-fluid {
|
|
width: 100%;
|
|
}
|
|
|
|
.p-button-fluid.p-button-icon-only {
|
|
width: dt('button.icon.only.width');
|
|
}
|
|
|
|
.p-button:not(:disabled):hover {
|
|
background: dt('button.primary.hover.background');
|
|
border: 1px solid dt('button.primary.hover.border.color');
|
|
color: dt('button.primary.hover.color');
|
|
}
|
|
|
|
.p-button:not(:disabled):active {
|
|
background: dt('button.primary.active.background');
|
|
border: 1px solid dt('button.primary.active.border.color');
|
|
color: dt('button.primary.active.color');
|
|
}
|
|
|
|
.p-button:focus-visible {
|
|
box-shadow: dt('button.primary.focus.ring.shadow');
|
|
outline: dt('button.focus.ring.width') dt('button.focus.ring.style') dt('button.primary.focus.ring.color');
|
|
outline-offset: dt('button.focus.ring.offset');
|
|
}
|
|
|
|
.p-button .p-badge {
|
|
min-width: dt('button.badge.size');
|
|
height: dt('button.badge.size');
|
|
line-height: dt('button.badge.size');
|
|
}
|
|
|
|
.p-button-raised {
|
|
box-shadow: dt('button.raised.shadow');
|
|
}
|
|
|
|
.p-button-rounded {
|
|
border-radius: dt('button.rounded.border.radius');
|
|
}
|
|
|
|
.p-button-secondary {
|
|
background: dt('button.secondary.background');
|
|
border: 1px solid dt('button.secondary.border.color');
|
|
color: dt('button.secondary.color');
|
|
}
|
|
|
|
.p-button-secondary:not(:disabled):hover {
|
|
background: dt('button.secondary.hover.background');
|
|
border: 1px solid dt('button.secondary.hover.border.color');
|
|
color: dt('button.secondary.hover.color');
|
|
}
|
|
|
|
.p-button-secondary:not(:disabled):active {
|
|
background: dt('button.secondary.active.background');
|
|
border: 1px solid dt('button.secondary.active.border.color');
|
|
color: dt('button.secondary.active.color');
|
|
}
|
|
|
|
.p-button-secondary:focus-visible {
|
|
outline-color: dt('button.secondary.focus.ring.color');
|
|
box-shadow: dt('button.secondary.focus.ring.shadow');
|
|
}
|
|
|
|
.p-button-success {
|
|
background: dt('button.success.background');
|
|
border: 1px solid dt('button.success.border.color');
|
|
color: dt('button.success.color');
|
|
}
|
|
|
|
.p-button-success:not(:disabled):hover {
|
|
background: dt('button.success.hover.background');
|
|
border: 1px solid dt('button.success.hover.border.color');
|
|
color: dt('button.success.hover.color');
|
|
}
|
|
|
|
.p-button-success:not(:disabled):active {
|
|
background: dt('button.success.active.background');
|
|
border: 1px solid dt('button.success.active.border.color');
|
|
color: dt('button.success.active.color');
|
|
}
|
|
|
|
.p-button-success:focus-visible {
|
|
outline-color: dt('button.success.focus.ring.color');
|
|
box-shadow: dt('button.success.focus.ring.shadow');
|
|
}
|
|
|
|
.p-button-info {
|
|
background: dt('button.info.background');
|
|
border: 1px solid dt('button.info.border.color');
|
|
color: dt('button.info.color');
|
|
}
|
|
|
|
.p-button-info:not(:disabled):hover {
|
|
background: dt('button.info.hover.background');
|
|
border: 1px solid dt('button.info.hover.border.color');
|
|
color: dt('button.info.hover.color');
|
|
}
|
|
|
|
.p-button-info:not(:disabled):active {
|
|
background: dt('button.info.active.background');
|
|
border: 1px solid dt('button.info.active.border.color');
|
|
color: dt('button.info.active.color');
|
|
}
|
|
|
|
.p-button-info:focus-visible {
|
|
outline-color: dt('button.info.focus.ring.color');
|
|
box-shadow: dt('button.info.focus.ring.shadow');
|
|
}
|
|
|
|
.p-button-warn {
|
|
background: dt('button.warn.background');
|
|
border: 1px solid dt('button.warn.border.color');
|
|
color: dt('button.warn.color');
|
|
}
|
|
|
|
.p-button-warn:not(:disabled):hover {
|
|
background: dt('button.warn.hover.background');
|
|
border: 1px solid dt('button.warn.hover.border.color');
|
|
color: dt('button.warn.hover.color');
|
|
}
|
|
|
|
.p-button-warn:not(:disabled):active {
|
|
background: dt('button.warn.active.background');
|
|
border: 1px solid dt('button.warn.active.border.color');
|
|
color: dt('button.warn.active.color');
|
|
}
|
|
|
|
.p-button-warn:focus-visible {
|
|
outline-color: dt('button.warn.focus.ring.color');
|
|
box-shadow: dt('button.warn.focus.ring.shadow');
|
|
}
|
|
|
|
.p-button-help {
|
|
background: dt('button.help.background');
|
|
border: 1px solid dt('button.help.border.color');
|
|
color: dt('button.help.color');
|
|
}
|
|
|
|
.p-button-help:not(:disabled):hover {
|
|
background: dt('button.help.hover.background');
|
|
border: 1px solid dt('button.help.hover.border.color');
|
|
color: dt('button.help.hover.color');
|
|
}
|
|
|
|
.p-button-help:not(:disabled):active {
|
|
background: dt('button.help.active.background');
|
|
border: 1px solid dt('button.help.active.border.color');
|
|
color: dt('button.help.active.color');
|
|
}
|
|
|
|
.p-button-help:focus-visible {
|
|
outline-color: dt('button.help.focus.ring.color');
|
|
box-shadow: dt('button.help.focus.ring.shadow');
|
|
}
|
|
|
|
.p-button-danger {
|
|
background: dt('button.danger.background');
|
|
border: 1px solid dt('button.danger.border.color');
|
|
color: dt('button.danger.color');
|
|
}
|
|
|
|
.p-button-danger:not(:disabled):hover {
|
|
background: dt('button.danger.hover.background');
|
|
border: 1px solid dt('button.danger.hover.border.color');
|
|
color: dt('button.danger.hover.color');
|
|
}
|
|
|
|
.p-button-danger:not(:disabled):active {
|
|
background: dt('button.danger.active.background');
|
|
border: 1px solid dt('button.danger.active.border.color');
|
|
color: dt('button.danger.active.color');
|
|
}
|
|
|
|
.p-button-danger:focus-visible {
|
|
outline-color: dt('button.danger.focus.ring.color');
|
|
box-shadow: dt('button.danger.focus.ring.shadow');
|
|
}
|
|
|
|
.p-button-contrast {
|
|
background: dt('button.contrast.background');
|
|
border: 1px solid dt('button.contrast.border.color');
|
|
color: dt('button.contrast.color');
|
|
}
|
|
|
|
.p-button-contrast:not(:disabled):hover {
|
|
background: dt('button.contrast.hover.background');
|
|
border: 1px solid dt('button.contrast.hover.border.color');
|
|
color: dt('button.contrast.hover.color');
|
|
}
|
|
|
|
.p-button-contrast:not(:disabled):active {
|
|
background: dt('button.contrast.active.background');
|
|
border: 1px solid dt('button.contrast.active.border.color');
|
|
color: dt('button.contrast.active.color');
|
|
}
|
|
|
|
.p-button-contrast:focus-visible {
|
|
outline-color: dt('button.contrast.focus.ring.color');
|
|
box-shadow: dt('button.contrast.focus.ring.shadow');
|
|
}
|
|
|
|
.p-button-outlined {
|
|
background: transparent;
|
|
border-color: dt('button.outlined.primary.border.color');
|
|
color: dt('button.outlined.primary.color');
|
|
}
|
|
|
|
.p-button-outlined:not(:disabled):hover {
|
|
background: dt('button.outlined.primary.hover.background');
|
|
border-color: dt('button.outlined.primary.border.color');
|
|
color: dt('button.outlined.primary.color');
|
|
}
|
|
|
|
.p-button-outlined:not(:disabled):active {
|
|
background: dt('button.outlined.primary.active.background');
|
|
border-color: dt('button.outlined.primary.border.color');
|
|
color: dt('button.outlined.primary.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-secondary {
|
|
border-color: dt('button.outlined.secondary.border.color');
|
|
color: dt('button.outlined.secondary.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-secondary:not(:disabled):hover {
|
|
background: dt('button.outlined.secondary.hover.background');
|
|
border-color: dt('button.outlined.secondary.border.color');
|
|
color: dt('button.outlined.secondary.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-secondary:not(:disabled):active {
|
|
background: dt('button.outlined.secondary.active.background');
|
|
border-color: dt('button.outlined.secondary.border.color');
|
|
color: dt('button.outlined.secondary.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-success {
|
|
border-color: dt('button.outlined.success.border.color');
|
|
color: dt('button.outlined.success.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-success:not(:disabled):hover {
|
|
background: dt('button.outlined.success.hover.background');
|
|
border-color: dt('button.outlined.success.border.color');
|
|
color: dt('button.outlined.success.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-success:not(:disabled):active {
|
|
background: dt('button.outlined.success.active.background');
|
|
border-color: dt('button.outlined.success.border.color');
|
|
color: dt('button.outlined.success.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-info {
|
|
border-color: dt('button.outlined.info.border.color');
|
|
color: dt('button.outlined.info.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-info:not(:disabled):hover {
|
|
background: dt('button.outlined.info.hover.background');
|
|
border-color: dt('button.outlined.info.border.color');
|
|
color: dt('button.outlined.info.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-info:not(:disabled):active {
|
|
background: dt('button.outlined.info.active.background');
|
|
border-color: dt('button.outlined.info.border.color');
|
|
color: dt('button.outlined.info.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-warn {
|
|
border-color: dt('button.outlined.warn.border.color');
|
|
color: dt('button.outlined.warn.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-warn:not(:disabled):hover {
|
|
background: dt('button.outlined.warn.hover.background');
|
|
border-color: dt('button.outlined.warn.border.color');
|
|
color: dt('button.outlined.warn.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-warn:not(:disabled):active {
|
|
background: dt('button.outlined.warn.active.background');
|
|
border-color: dt('button.outlined.warn.border.color');
|
|
color: dt('button.outlined.warn.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-help {
|
|
border-color: dt('button.outlined.help.border.color');
|
|
color: dt('button.outlined.help.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-help:not(:disabled):hover {
|
|
background: dt('button.outlined.help.hover.background');
|
|
border-color: dt('button.outlined.help.border.color');
|
|
color: dt('button.outlined.help.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-help:not(:disabled):active {
|
|
background: dt('button.outlined.help.active.background');
|
|
border-color: dt('button.outlined.help.border.color');
|
|
color: dt('button.outlined.help.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-danger {
|
|
border-color: dt('button.outlined.danger.border.color');
|
|
color: dt('button.outlined.danger.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-danger:not(:disabled):hover {
|
|
background: dt('button.outlined.danger.hover.background');
|
|
border-color: dt('button.outlined.danger.border.color');
|
|
color: dt('button.outlined.danger.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-danger:not(:disabled):active {
|
|
background: dt('button.outlined.danger.active.background');
|
|
border-color: dt('button.outlined.danger.border.color');
|
|
color: dt('button.outlined.danger.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-contrast {
|
|
border-color: dt('button.outlined.contrast.border.color');
|
|
color: dt('button.outlined.contrast.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-contrast:not(:disabled):hover {
|
|
background: dt('button.outlined.contrast.hover.background');
|
|
border-color: dt('button.outlined.contrast.border.color');
|
|
color: dt('button.outlined.contrast.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-contrast:not(:disabled):active {
|
|
background: dt('button.outlined.contrast.active.background');
|
|
border-color: dt('button.outlined.contrast.border.color');
|
|
color: dt('button.outlined.contrast.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-plain {
|
|
border-color: dt('button.outlined.plain.border.color');
|
|
color: dt('button.outlined.plain.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-plain:not(:disabled):hover {
|
|
background: dt('button.outlined.plain.hover.background');
|
|
border-color: dt('button.outlined.plain.border.color');
|
|
color: dt('button.outlined.plain.color');
|
|
}
|
|
|
|
.p-button-outlined.p-button-plain:not(:disabled):active {
|
|
background: dt('button.outlined.plain.active.background');
|
|
border-color: dt('button.outlined.plain.border.color');
|
|
color: dt('button.outlined.plain.color');
|
|
}
|
|
|
|
.p-button-text {
|
|
background: transparent;
|
|
border-color: transparent;
|
|
color: dt('button.text.primary.color');
|
|
}
|
|
|
|
.p-button-text:not(:disabled):hover {
|
|
background: dt('button.text.primary.hover.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.primary.color');
|
|
}
|
|
|
|
.p-button-text:not(:disabled):active {
|
|
background: dt('button.text.primary.active.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.primary.color');
|
|
}
|
|
|
|
.p-button-text.p-button-secondary {
|
|
background: transparent;
|
|
border-color: transparent;
|
|
color: dt('button.text.secondary.color');
|
|
}
|
|
|
|
.p-button-text.p-button-secondary:not(:disabled):hover {
|
|
background: dt('button.text.secondary.hover.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.secondary.color');
|
|
}
|
|
|
|
.p-button-text.p-button-secondary:not(:disabled):active {
|
|
background: dt('button.text.secondary.active.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.secondary.color');
|
|
}
|
|
|
|
.p-button-text.p-button-success {
|
|
background: transparent;
|
|
border-color: transparent;
|
|
color: dt('button.text.success.color');
|
|
}
|
|
|
|
.p-button-text.p-button-success:not(:disabled):hover {
|
|
background: dt('button.text.success.hover.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.success.color');
|
|
}
|
|
|
|
.p-button-text.p-button-success:not(:disabled):active {
|
|
background: dt('button.text.success.active.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.success.color');
|
|
}
|
|
|
|
.p-button-text.p-button-info {
|
|
background: transparent;
|
|
border-color: transparent;
|
|
color: dt('button.text.info.color');
|
|
}
|
|
|
|
.p-button-text.p-button-info:not(:disabled):hover {
|
|
background: dt('button.text.info.hover.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.info.color');
|
|
}
|
|
|
|
.p-button-text.p-button-info:not(:disabled):active {
|
|
background: dt('button.text.info.active.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.info.color');
|
|
}
|
|
|
|
.p-button-text.p-button-warn {
|
|
background: transparent;
|
|
border-color: transparent;
|
|
color: dt('button.text.warn.color');
|
|
}
|
|
|
|
.p-button-text.p-button-warn:not(:disabled):hover {
|
|
background: dt('button.text.warn.hover.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.warn.color');
|
|
}
|
|
|
|
.p-button-text.p-button-warn:not(:disabled):active {
|
|
background: dt('button.text.warn.active.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.warn.color');
|
|
}
|
|
|
|
.p-button-text.p-button-help {
|
|
background: transparent;
|
|
border-color: transparent;
|
|
color: dt('button.text.help.color');
|
|
}
|
|
|
|
.p-button-text.p-button-help:not(:disabled):hover {
|
|
background: dt('button.text.help.hover.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.help.color');
|
|
}
|
|
|
|
.p-button-text.p-button-help:not(:disabled):active {
|
|
background: dt('button.text.help.active.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.help.color');
|
|
}
|
|
|
|
.p-button-text.p-button-danger {
|
|
background: transparent;
|
|
border-color: transparent;
|
|
color: dt('button.text.danger.color');
|
|
}
|
|
|
|
.p-button-text.p-button-danger:not(:disabled):hover {
|
|
background: dt('button.text.danger.hover.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.danger.color');
|
|
}
|
|
|
|
.p-button-text.p-button-danger:not(:disabled):active {
|
|
background: dt('button.text.danger.active.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.danger.color');
|
|
}
|
|
|
|
.p-button-text.p-button-contrast {
|
|
background: transparent;
|
|
border-color: transparent;
|
|
color: dt('button.text.contrast.color');
|
|
}
|
|
|
|
.p-button-text.p-button-contrast:not(:disabled):hover {
|
|
background: dt('button.text.contrast.hover.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.contrast.color');
|
|
}
|
|
|
|
.p-button-text.p-button-contrast:not(:disabled):active {
|
|
background: dt('button.text.contrast.active.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.contrast.color');
|
|
}
|
|
|
|
.p-button-text.p-button-plain {
|
|
background: transparent;
|
|
border-color: transparent;
|
|
color: dt('button.text.plain.color');
|
|
}
|
|
|
|
.p-button-text.p-button-plain:not(:disabled):hover {
|
|
background: dt('button.text.plain.hover.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.plain.color');
|
|
}
|
|
|
|
.p-button-text.p-button-plain:not(:disabled):active {
|
|
background: dt('button.text.plain.active.background');
|
|
border-color: transparent;
|
|
color: dt('button.text.plain.color');
|
|
}
|
|
|
|
.p-button-link {
|
|
background: transparent;
|
|
border-color: transparent;
|
|
color: dt('button.link.color');
|
|
}
|
|
|
|
.p-button-link:not(:disabled):hover {
|
|
background: transparent;
|
|
border-color: transparent;
|
|
color: dt('button.link.hover.color');
|
|
}
|
|
|
|
.p-button-link:not(:disabled):hover .p-button-label {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.p-button-link:not(:disabled):active {
|
|
background: transparent;
|
|
border-color: transparent;
|
|
color: dt('button.link.active.color');
|
|
}
|
|
`;
|
|
function _typeof$3(o) {
|
|
"@babel/helpers - typeof";
|
|
return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
return typeof o2;
|
|
} : function(o2) {
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
}, _typeof$3(o);
|
|
}
|
|
function _defineProperty$3(e, r, t2) {
|
|
return (r = _toPropertyKey$3(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
|
|
}
|
|
function _toPropertyKey$3(t2) {
|
|
var i2 = _toPrimitive$3(t2, "string");
|
|
return "symbol" == _typeof$3(i2) ? i2 : i2 + "";
|
|
}
|
|
function _toPrimitive$3(t2, r) {
|
|
if ("object" != _typeof$3(t2) || !t2) return t2;
|
|
var e = t2[Symbol.toPrimitive];
|
|
if (void 0 !== e) {
|
|
var i2 = e.call(t2, r);
|
|
if ("object" != _typeof$3(i2)) return i2;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return ("string" === r ? String : Number)(t2);
|
|
}
|
|
var classes$3 = {
|
|
root: function root2(_ref) {
|
|
var instance = _ref.instance, props = _ref.props;
|
|
return ["p-button p-component", _defineProperty$3(_defineProperty$3(_defineProperty$3(_defineProperty$3(_defineProperty$3(_defineProperty$3(_defineProperty$3(_defineProperty$3(_defineProperty$3({
|
|
"p-button-icon-only": instance.hasIcon && !props.label && !props.badge,
|
|
"p-button-vertical": (props.iconPos === "top" || props.iconPos === "bottom") && props.label,
|
|
"p-button-loading": props.loading,
|
|
"p-button-link": props.link || props.variant === "link"
|
|
}, "p-button-".concat(props.severity), props.severity), "p-button-raised", props.raised), "p-button-rounded", props.rounded), "p-button-text", props.text || props.variant === "text"), "p-button-outlined", props.outlined || props.variant === "outlined"), "p-button-sm", props.size === "small"), "p-button-lg", props.size === "large"), "p-button-plain", props.plain), "p-button-fluid", instance.hasFluid)];
|
|
},
|
|
loadingIcon: "p-button-loading-icon",
|
|
icon: function icon(_ref3) {
|
|
var props = _ref3.props;
|
|
return ["p-button-icon", _defineProperty$3({}, "p-button-icon-".concat(props.iconPos), props.label)];
|
|
},
|
|
label: "p-button-label"
|
|
};
|
|
var ButtonStyle = BaseStyle.extend({
|
|
name: "button",
|
|
style: style$3,
|
|
classes: classes$3
|
|
});
|
|
var script$1$3 = {
|
|
name: "BaseButton",
|
|
"extends": script$d,
|
|
props: {
|
|
label: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
icon: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
iconPos: {
|
|
type: String,
|
|
"default": "left"
|
|
},
|
|
iconClass: {
|
|
type: [String, Object],
|
|
"default": null
|
|
},
|
|
badge: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
badgeClass: {
|
|
type: [String, Object],
|
|
"default": null
|
|
},
|
|
badgeSeverity: {
|
|
type: String,
|
|
"default": "secondary"
|
|
},
|
|
loading: {
|
|
type: Boolean,
|
|
"default": false
|
|
},
|
|
loadingIcon: {
|
|
type: String,
|
|
"default": void 0
|
|
},
|
|
as: {
|
|
type: [String, Object],
|
|
"default": "BUTTON"
|
|
},
|
|
asChild: {
|
|
type: Boolean,
|
|
"default": false
|
|
},
|
|
link: {
|
|
type: Boolean,
|
|
"default": false
|
|
},
|
|
severity: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
raised: {
|
|
type: Boolean,
|
|
"default": false
|
|
},
|
|
rounded: {
|
|
type: Boolean,
|
|
"default": false
|
|
},
|
|
text: {
|
|
type: Boolean,
|
|
"default": false
|
|
},
|
|
outlined: {
|
|
type: Boolean,
|
|
"default": false
|
|
},
|
|
size: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
variant: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
plain: {
|
|
type: Boolean,
|
|
"default": false
|
|
},
|
|
fluid: {
|
|
type: Boolean,
|
|
"default": null
|
|
}
|
|
},
|
|
style: ButtonStyle,
|
|
provide: function provide4() {
|
|
return {
|
|
$pcButton: this,
|
|
$parentInstance: this
|
|
};
|
|
}
|
|
};
|
|
function _typeof$2(o) {
|
|
"@babel/helpers - typeof";
|
|
return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
return typeof o2;
|
|
} : function(o2) {
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
}, _typeof$2(o);
|
|
}
|
|
function _defineProperty$2(e, r, t2) {
|
|
return (r = _toPropertyKey$2(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
|
|
}
|
|
function _toPropertyKey$2(t2) {
|
|
var i2 = _toPrimitive$2(t2, "string");
|
|
return "symbol" == _typeof$2(i2) ? i2 : i2 + "";
|
|
}
|
|
function _toPrimitive$2(t2, r) {
|
|
if ("object" != _typeof$2(t2) || !t2) return t2;
|
|
var e = t2[Symbol.toPrimitive];
|
|
if (void 0 !== e) {
|
|
var i2 = e.call(t2, r);
|
|
if ("object" != _typeof$2(i2)) return i2;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return ("string" === r ? String : Number)(t2);
|
|
}
|
|
var script$9 = {
|
|
name: "Button",
|
|
"extends": script$1$3,
|
|
inheritAttrs: false,
|
|
inject: {
|
|
$pcFluid: {
|
|
"default": null
|
|
}
|
|
},
|
|
methods: {
|
|
getPTOptions: function getPTOptions(key) {
|
|
var _ptm = key === "root" ? this.ptmi : this.ptm;
|
|
return _ptm(key, {
|
|
context: {
|
|
disabled: this.disabled
|
|
}
|
|
});
|
|
}
|
|
},
|
|
computed: {
|
|
disabled: function disabled() {
|
|
return this.$attrs.disabled || this.$attrs.disabled === "" || this.loading;
|
|
},
|
|
defaultAriaLabel: function defaultAriaLabel() {
|
|
return this.label ? this.label + (this.badge ? " " + this.badge : "") : this.$attrs.ariaLabel;
|
|
},
|
|
hasIcon: function hasIcon() {
|
|
return this.icon || this.$slots.icon;
|
|
},
|
|
attrs: function attrs() {
|
|
return mergeProps(this.asAttrs, this.a11yAttrs, this.getPTOptions("root"));
|
|
},
|
|
asAttrs: function asAttrs() {
|
|
return this.as === "BUTTON" ? {
|
|
type: "button",
|
|
disabled: this.disabled
|
|
} : void 0;
|
|
},
|
|
a11yAttrs: function a11yAttrs() {
|
|
return {
|
|
"aria-label": this.defaultAriaLabel,
|
|
"data-pc-name": "button",
|
|
"data-p-disabled": this.disabled,
|
|
"data-p-severity": this.severity
|
|
};
|
|
},
|
|
hasFluid: function hasFluid() {
|
|
return l(this.fluid) ? !!this.$pcFluid : this.fluid;
|
|
},
|
|
dataP: function dataP2() {
|
|
return f(_defineProperty$2(_defineProperty$2(_defineProperty$2(_defineProperty$2(_defineProperty$2(_defineProperty$2(_defineProperty$2(_defineProperty$2(_defineProperty$2(_defineProperty$2({}, this.size, this.size), "icon-only", this.hasIcon && !this.label && !this.badge), "loading", this.loading), "fluid", this.hasFluid), "rounded", this.rounded), "raised", this.raised), "outlined", this.outlined || this.variant === "outlined"), "text", this.text || this.variant === "text"), "link", this.link || this.variant === "link"), "vertical", (this.iconPos === "top" || this.iconPos === "bottom") && this.label));
|
|
},
|
|
dataIconP: function dataIconP() {
|
|
return f(_defineProperty$2(_defineProperty$2({}, this.iconPos, this.iconPos), this.size, this.size));
|
|
},
|
|
dataLabelP: function dataLabelP() {
|
|
return f(_defineProperty$2(_defineProperty$2({}, this.size, this.size), "icon-only", this.hasIcon && !this.label && !this.badge));
|
|
}
|
|
},
|
|
components: {
|
|
SpinnerIcon: script$b,
|
|
Badge: script$a
|
|
},
|
|
directives: {
|
|
ripple: Ripple
|
|
}
|
|
};
|
|
var _hoisted_1$3 = ["data-p"];
|
|
var _hoisted_2$2 = ["data-p"];
|
|
function render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
var _component_SpinnerIcon = resolveComponent("SpinnerIcon");
|
|
var _component_Badge = resolveComponent("Badge");
|
|
var _directive_ripple = resolveDirective("ripple");
|
|
return !_ctx.asChild ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({
|
|
key: 0,
|
|
"class": _ctx.cx("root"),
|
|
"data-p": $options.dataP
|
|
}, $options.attrs), {
|
|
"default": withCtx(function() {
|
|
return [renderSlot(_ctx.$slots, "default", {}, function() {
|
|
return [_ctx.loading ? renderSlot(_ctx.$slots, "loadingicon", mergeProps({
|
|
key: 0,
|
|
"class": [_ctx.cx("loadingIcon"), _ctx.cx("icon")]
|
|
}, _ctx.ptm("loadingIcon")), function() {
|
|
return [_ctx.loadingIcon ? (openBlock(), createElementBlock("span", mergeProps({
|
|
key: 0,
|
|
"class": [_ctx.cx("loadingIcon"), _ctx.cx("icon"), _ctx.loadingIcon]
|
|
}, _ctx.ptm("loadingIcon")), null, 16)) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({
|
|
key: 1,
|
|
"class": [_ctx.cx("loadingIcon"), _ctx.cx("icon")],
|
|
spin: ""
|
|
}, _ctx.ptm("loadingIcon")), null, 16, ["class"]))];
|
|
}) : renderSlot(_ctx.$slots, "icon", mergeProps({
|
|
key: 1,
|
|
"class": [_ctx.cx("icon")]
|
|
}, _ctx.ptm("icon")), function() {
|
|
return [_ctx.icon ? (openBlock(), createElementBlock("span", mergeProps({
|
|
key: 0,
|
|
"class": [_ctx.cx("icon"), _ctx.icon, _ctx.iconClass],
|
|
"data-p": $options.dataIconP
|
|
}, _ctx.ptm("icon")), null, 16, _hoisted_1$3)) : createCommentVNode("", true)];
|
|
}), _ctx.label ? (openBlock(), createElementBlock("span", mergeProps({
|
|
key: 2,
|
|
"class": _ctx.cx("label")
|
|
}, _ctx.ptm("label"), {
|
|
"data-p": $options.dataLabelP
|
|
}), toDisplayString(_ctx.label), 17, _hoisted_2$2)) : createCommentVNode("", true), _ctx.badge ? (openBlock(), createBlock(_component_Badge, {
|
|
key: 3,
|
|
value: _ctx.badge,
|
|
"class": normalizeClass(_ctx.badgeClass),
|
|
severity: _ctx.badgeSeverity,
|
|
unstyled: _ctx.unstyled,
|
|
pt: _ctx.ptm("pcBadge")
|
|
}, null, 8, ["value", "class", "severity", "unstyled", "pt"])) : createCommentVNode("", true)];
|
|
})];
|
|
}),
|
|
_: 3
|
|
}, 16, ["class", "data-p"])), [[_directive_ripple]]) : renderSlot(_ctx.$slots, "default", {
|
|
key: 1,
|
|
"class": normalizeClass(_ctx.cx("root")),
|
|
a11yAttrs: $options.a11yAttrs
|
|
});
|
|
}
|
|
script$9.render = render$6;
|
|
var script$8 = {
|
|
name: "BaseEditableHolder",
|
|
"extends": script$d,
|
|
emits: ["update:modelValue", "value-change"],
|
|
props: {
|
|
modelValue: {
|
|
type: null,
|
|
"default": void 0
|
|
},
|
|
defaultValue: {
|
|
type: null,
|
|
"default": void 0
|
|
},
|
|
name: {
|
|
type: String,
|
|
"default": void 0
|
|
},
|
|
invalid: {
|
|
type: Boolean,
|
|
"default": void 0
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
"default": false
|
|
},
|
|
formControl: {
|
|
type: Object,
|
|
"default": void 0
|
|
}
|
|
},
|
|
inject: {
|
|
$parentInstance: {
|
|
"default": void 0
|
|
},
|
|
$pcForm: {
|
|
"default": void 0
|
|
},
|
|
$pcFormField: {
|
|
"default": void 0
|
|
}
|
|
},
|
|
data: function data() {
|
|
return {
|
|
d_value: this.defaultValue !== void 0 ? this.defaultValue : this.modelValue
|
|
};
|
|
},
|
|
watch: {
|
|
modelValue: {
|
|
deep: true,
|
|
handler: function handler3(newValue) {
|
|
this.d_value = newValue;
|
|
}
|
|
},
|
|
defaultValue: function defaultValue(newValue) {
|
|
this.d_value = newValue;
|
|
},
|
|
$formName: {
|
|
immediate: true,
|
|
handler: function handler4(newValue) {
|
|
var _this$$pcForm, _this$$pcForm$registe;
|
|
this.formField = ((_this$$pcForm = this.$pcForm) === null || _this$$pcForm === void 0 || (_this$$pcForm$registe = _this$$pcForm.register) === null || _this$$pcForm$registe === void 0 ? void 0 : _this$$pcForm$registe.call(_this$$pcForm, newValue, this.$formControl)) || {};
|
|
}
|
|
},
|
|
$formControl: {
|
|
immediate: true,
|
|
handler: function handler5(newValue) {
|
|
var _this$$pcForm2, _this$$pcForm2$regist;
|
|
this.formField = ((_this$$pcForm2 = this.$pcForm) === null || _this$$pcForm2 === void 0 || (_this$$pcForm2$regist = _this$$pcForm2.register) === null || _this$$pcForm2$regist === void 0 ? void 0 : _this$$pcForm2$regist.call(_this$$pcForm2, this.$formName, newValue)) || {};
|
|
}
|
|
},
|
|
$formDefaultValue: {
|
|
immediate: true,
|
|
handler: function handler6(newValue) {
|
|
this.d_value !== newValue && (this.d_value = newValue);
|
|
}
|
|
},
|
|
$formValue: {
|
|
immediate: false,
|
|
handler: function handler7(newValue) {
|
|
var _this$$pcForm3;
|
|
if ((_this$$pcForm3 = this.$pcForm) !== null && _this$$pcForm3 !== void 0 && _this$$pcForm3.getFieldState(this.$formName) && newValue !== this.d_value) {
|
|
this.d_value = newValue;
|
|
}
|
|
}
|
|
}
|
|
},
|
|
formField: {},
|
|
methods: {
|
|
writeValue: function writeValue(value, event) {
|
|
var _this$formField$onCha, _this$formField;
|
|
if (this.controlled) {
|
|
this.d_value = value;
|
|
this.$emit("update:modelValue", value);
|
|
}
|
|
this.$emit("value-change", value);
|
|
(_this$formField$onCha = (_this$formField = this.formField).onChange) === null || _this$formField$onCha === void 0 || _this$formField$onCha.call(_this$formField, {
|
|
originalEvent: event,
|
|
value
|
|
});
|
|
},
|
|
// @todo move to @primeuix/utils
|
|
findNonEmpty: function findNonEmpty() {
|
|
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
values[_key] = arguments[_key];
|
|
}
|
|
return values.find(s$2);
|
|
}
|
|
},
|
|
computed: {
|
|
$filled: function $filled() {
|
|
return s$2(this.d_value);
|
|
},
|
|
$invalid: function $invalid() {
|
|
var _this$$pcFormField, _this$$pcForm4;
|
|
return !this.$formNovalidate && this.findNonEmpty(this.invalid, (_this$$pcFormField = this.$pcFormField) === null || _this$$pcFormField === void 0 || (_this$$pcFormField = _this$$pcFormField.$field) === null || _this$$pcFormField === void 0 ? void 0 : _this$$pcFormField.invalid, (_this$$pcForm4 = this.$pcForm) === null || _this$$pcForm4 === void 0 || (_this$$pcForm4 = _this$$pcForm4.getFieldState(this.$formName)) === null || _this$$pcForm4 === void 0 ? void 0 : _this$$pcForm4.invalid);
|
|
},
|
|
$formName: function $formName() {
|
|
var _this$$formControl;
|
|
return !this.$formNovalidate ? this.name || ((_this$$formControl = this.$formControl) === null || _this$$formControl === void 0 ? void 0 : _this$$formControl.name) : void 0;
|
|
},
|
|
$formControl: function $formControl() {
|
|
var _this$$pcFormField2;
|
|
return this.formControl || ((_this$$pcFormField2 = this.$pcFormField) === null || _this$$pcFormField2 === void 0 ? void 0 : _this$$pcFormField2.formControl);
|
|
},
|
|
$formNovalidate: function $formNovalidate() {
|
|
var _this$$formControl2;
|
|
return (_this$$formControl2 = this.$formControl) === null || _this$$formControl2 === void 0 ? void 0 : _this$$formControl2.novalidate;
|
|
},
|
|
$formDefaultValue: function $formDefaultValue() {
|
|
var _this$$pcFormField3, _this$$pcForm5;
|
|
return this.findNonEmpty(this.d_value, (_this$$pcFormField3 = this.$pcFormField) === null || _this$$pcFormField3 === void 0 ? void 0 : _this$$pcFormField3.initialValue, (_this$$pcForm5 = this.$pcForm) === null || _this$$pcForm5 === void 0 || (_this$$pcForm5 = _this$$pcForm5.initialValues) === null || _this$$pcForm5 === void 0 ? void 0 : _this$$pcForm5[this.$formName]);
|
|
},
|
|
$formValue: function $formValue() {
|
|
var _this$$pcFormField4, _this$$pcForm6;
|
|
return this.findNonEmpty((_this$$pcFormField4 = this.$pcFormField) === null || _this$$pcFormField4 === void 0 || (_this$$pcFormField4 = _this$$pcFormField4.$field) === null || _this$$pcFormField4 === void 0 ? void 0 : _this$$pcFormField4.value, (_this$$pcForm6 = this.$pcForm) === null || _this$$pcForm6 === void 0 || (_this$$pcForm6 = _this$$pcForm6.getFieldState(this.$formName)) === null || _this$$pcForm6 === void 0 ? void 0 : _this$$pcForm6.value);
|
|
},
|
|
controlled: function controlled() {
|
|
return this.$inProps.hasOwnProperty("modelValue") || !this.$inProps.hasOwnProperty("modelValue") && !this.$inProps.hasOwnProperty("defaultValue");
|
|
},
|
|
// @deprecated use $filled instead
|
|
filled: function filled() {
|
|
return this.$filled;
|
|
}
|
|
}
|
|
};
|
|
var script$7 = {
|
|
name: "BaseInput",
|
|
"extends": script$8,
|
|
props: {
|
|
size: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
fluid: {
|
|
type: Boolean,
|
|
"default": null
|
|
},
|
|
variant: {
|
|
type: String,
|
|
"default": null
|
|
}
|
|
},
|
|
inject: {
|
|
$parentInstance: {
|
|
"default": void 0
|
|
},
|
|
$pcFluid: {
|
|
"default": void 0
|
|
}
|
|
},
|
|
computed: {
|
|
$variant: function $variant() {
|
|
var _this$variant;
|
|
return (_this$variant = this.variant) !== null && _this$variant !== void 0 ? _this$variant : this.$primevue.config.inputStyle || this.$primevue.config.inputVariant;
|
|
},
|
|
$fluid: function $fluid() {
|
|
var _this$fluid;
|
|
return (_this$fluid = this.fluid) !== null && _this$fluid !== void 0 ? _this$fluid : !!this.$pcFluid;
|
|
},
|
|
// @deprecated use $fluid instead
|
|
hasFluid: function hasFluid2() {
|
|
return this.$fluid;
|
|
}
|
|
}
|
|
};
|
|
var style$2 = "\n .p-inputtext {\n font-family: inherit;\n font-feature-settings: inherit;\n font-size: 1rem;\n color: dt('inputtext.color');\n background: dt('inputtext.background');\n padding-block: dt('inputtext.padding.y');\n padding-inline: dt('inputtext.padding.x');\n border: 1px solid dt('inputtext.border.color');\n transition:\n background dt('inputtext.transition.duration'),\n color dt('inputtext.transition.duration'),\n border-color dt('inputtext.transition.duration'),\n outline-color dt('inputtext.transition.duration'),\n box-shadow dt('inputtext.transition.duration');\n appearance: none;\n border-radius: dt('inputtext.border.radius');\n outline-color: transparent;\n box-shadow: dt('inputtext.shadow');\n }\n\n .p-inputtext:enabled:hover {\n border-color: dt('inputtext.hover.border.color');\n }\n\n .p-inputtext:enabled:focus {\n border-color: dt('inputtext.focus.border.color');\n box-shadow: dt('inputtext.focus.ring.shadow');\n outline: dt('inputtext.focus.ring.width') dt('inputtext.focus.ring.style') dt('inputtext.focus.ring.color');\n outline-offset: dt('inputtext.focus.ring.offset');\n }\n\n .p-inputtext.p-invalid {\n border-color: dt('inputtext.invalid.border.color');\n }\n\n .p-inputtext.p-variant-filled {\n background: dt('inputtext.filled.background');\n }\n\n .p-inputtext.p-variant-filled:enabled:hover {\n background: dt('inputtext.filled.hover.background');\n }\n\n .p-inputtext.p-variant-filled:enabled:focus {\n background: dt('inputtext.filled.focus.background');\n }\n\n .p-inputtext:disabled {\n opacity: 1;\n background: dt('inputtext.disabled.background');\n color: dt('inputtext.disabled.color');\n }\n\n .p-inputtext::placeholder {\n color: dt('inputtext.placeholder.color');\n }\n\n .p-inputtext.p-invalid::placeholder {\n color: dt('inputtext.invalid.placeholder.color');\n }\n\n .p-inputtext-sm {\n font-size: dt('inputtext.sm.font.size');\n padding-block: dt('inputtext.sm.padding.y');\n padding-inline: dt('inputtext.sm.padding.x');\n }\n\n .p-inputtext-lg {\n font-size: dt('inputtext.lg.font.size');\n padding-block: dt('inputtext.lg.padding.y');\n padding-inline: dt('inputtext.lg.padding.x');\n }\n\n .p-inputtext-fluid {\n width: 100%;\n }\n";
|
|
var classes$2 = {
|
|
root: function root3(_ref) {
|
|
var instance = _ref.instance, props = _ref.props;
|
|
return ["p-inputtext p-component", {
|
|
"p-filled": instance.$filled,
|
|
"p-inputtext-sm p-inputfield-sm": props.size === "small",
|
|
"p-inputtext-lg p-inputfield-lg": props.size === "large",
|
|
"p-invalid": instance.$invalid,
|
|
"p-variant-filled": instance.$variant === "filled",
|
|
"p-inputtext-fluid": instance.$fluid
|
|
}];
|
|
}
|
|
};
|
|
var InputTextStyle = BaseStyle.extend({
|
|
name: "inputtext",
|
|
style: style$2,
|
|
classes: classes$2
|
|
});
|
|
var script$1$2 = {
|
|
name: "BaseInputText",
|
|
"extends": script$7,
|
|
style: InputTextStyle,
|
|
provide: function provide5() {
|
|
return {
|
|
$pcInputText: this,
|
|
$parentInstance: this
|
|
};
|
|
}
|
|
};
|
|
function _typeof$1(o) {
|
|
"@babel/helpers - typeof";
|
|
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
return typeof o2;
|
|
} : function(o2) {
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
}, _typeof$1(o);
|
|
}
|
|
function _defineProperty$1(e, r, t2) {
|
|
return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
|
|
}
|
|
function _toPropertyKey$1(t2) {
|
|
var i2 = _toPrimitive$1(t2, "string");
|
|
return "symbol" == _typeof$1(i2) ? i2 : i2 + "";
|
|
}
|
|
function _toPrimitive$1(t2, r) {
|
|
if ("object" != _typeof$1(t2) || !t2) return t2;
|
|
var e = t2[Symbol.toPrimitive];
|
|
if (void 0 !== e) {
|
|
var i2 = e.call(t2, r);
|
|
if ("object" != _typeof$1(i2)) return i2;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return ("string" === r ? String : Number)(t2);
|
|
}
|
|
var script$6 = {
|
|
name: "InputText",
|
|
"extends": script$1$2,
|
|
inheritAttrs: false,
|
|
methods: {
|
|
onInput: function onInput(event) {
|
|
this.writeValue(event.target.value, event);
|
|
}
|
|
},
|
|
computed: {
|
|
attrs: function attrs2() {
|
|
return mergeProps(this.ptmi("root", {
|
|
context: {
|
|
filled: this.$filled,
|
|
disabled: this.disabled
|
|
}
|
|
}), this.formField);
|
|
},
|
|
dataP: function dataP3() {
|
|
return f(_defineProperty$1({
|
|
invalid: this.$invalid,
|
|
fluid: this.$fluid,
|
|
filled: this.$variant === "filled"
|
|
}, this.size, this.size));
|
|
}
|
|
}
|
|
};
|
|
var _hoisted_1$2 = ["value", "name", "disabled", "aria-invalid", "data-p"];
|
|
function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return openBlock(), createElementBlock("input", mergeProps({
|
|
type: "text",
|
|
"class": _ctx.cx("root"),
|
|
value: _ctx.d_value,
|
|
name: _ctx.name,
|
|
disabled: _ctx.disabled,
|
|
"aria-invalid": _ctx.$invalid || void 0,
|
|
"data-p": $options.dataP,
|
|
onInput: _cache[0] || (_cache[0] = function() {
|
|
return $options.onInput && $options.onInput.apply($options, arguments);
|
|
})
|
|
}, $options.attrs), null, 16, _hoisted_1$2);
|
|
}
|
|
script$6.render = render$5;
|
|
var script$5 = {
|
|
name: "AngleDownIcon",
|
|
"extends": script$c
|
|
};
|
|
function _toConsumableArray$3(r) {
|
|
return _arrayWithoutHoles$3(r) || _iterableToArray$3(r) || _unsupportedIterableToArray$3(r) || _nonIterableSpread$3();
|
|
}
|
|
function _nonIterableSpread$3() {
|
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
function _unsupportedIterableToArray$3(r, a2) {
|
|
if (r) {
|
|
if ("string" == typeof r) return _arrayLikeToArray$3(r, a2);
|
|
var t2 = {}.toString.call(r).slice(8, -1);
|
|
return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$3(r, a2) : void 0;
|
|
}
|
|
}
|
|
function _iterableToArray$3(r) {
|
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
}
|
|
function _arrayWithoutHoles$3(r) {
|
|
if (Array.isArray(r)) return _arrayLikeToArray$3(r);
|
|
}
|
|
function _arrayLikeToArray$3(r, a2) {
|
|
(null == a2 || a2 > r.length) && (a2 = r.length);
|
|
for (var e = 0, n = Array(a2); e < a2; e++) n[e] = r[e];
|
|
return n;
|
|
}
|
|
function render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return openBlock(), createElementBlock("svg", mergeProps({
|
|
width: "14",
|
|
height: "14",
|
|
viewBox: "0 0 14 14",
|
|
fill: "none",
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
}, _ctx.pti()), _toConsumableArray$3(_cache[0] || (_cache[0] = [createBaseVNode("path", {
|
|
d: "M3.58659 4.5007C3.68513 4.50023 3.78277 4.51945 3.87379 4.55723C3.9648 4.59501 4.04735 4.65058 4.11659 4.7207L7.11659 7.7207L10.1166 4.7207C10.2619 4.65055 10.4259 4.62911 10.5843 4.65956C10.7427 4.69002 10.8871 4.77074 10.996 4.88976C11.1049 5.00877 11.1726 5.15973 11.1889 5.32022C11.2052 5.48072 11.1693 5.6422 11.0866 5.7807L7.58659 9.2807C7.44597 9.42115 7.25534 9.50004 7.05659 9.50004C6.85784 9.50004 6.66722 9.42115 6.52659 9.2807L3.02659 5.7807C2.88614 5.64007 2.80725 5.44945 2.80725 5.2507C2.80725 5.05195 2.88614 4.86132 3.02659 4.7207C3.09932 4.64685 3.18675 4.58911 3.28322 4.55121C3.37969 4.51331 3.48305 4.4961 3.58659 4.5007Z",
|
|
fill: "currentColor"
|
|
}, null, -1)])), 16);
|
|
}
|
|
script$5.render = render$4;
|
|
var script$4 = {
|
|
name: "AngleUpIcon",
|
|
"extends": script$c
|
|
};
|
|
function _toConsumableArray$2(r) {
|
|
return _arrayWithoutHoles$2(r) || _iterableToArray$2(r) || _unsupportedIterableToArray$2(r) || _nonIterableSpread$2();
|
|
}
|
|
function _nonIterableSpread$2() {
|
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
function _unsupportedIterableToArray$2(r, a2) {
|
|
if (r) {
|
|
if ("string" == typeof r) return _arrayLikeToArray$2(r, a2);
|
|
var t2 = {}.toString.call(r).slice(8, -1);
|
|
return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$2(r, a2) : void 0;
|
|
}
|
|
}
|
|
function _iterableToArray$2(r) {
|
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
}
|
|
function _arrayWithoutHoles$2(r) {
|
|
if (Array.isArray(r)) return _arrayLikeToArray$2(r);
|
|
}
|
|
function _arrayLikeToArray$2(r, a2) {
|
|
(null == a2 || a2 > r.length) && (a2 = r.length);
|
|
for (var e = 0, n = Array(a2); e < a2; e++) n[e] = r[e];
|
|
return n;
|
|
}
|
|
function render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return openBlock(), createElementBlock("svg", mergeProps({
|
|
width: "14",
|
|
height: "14",
|
|
viewBox: "0 0 14 14",
|
|
fill: "none",
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
}, _ctx.pti()), _toConsumableArray$2(_cache[0] || (_cache[0] = [createBaseVNode("path", {
|
|
d: "M10.4134 9.49931C10.3148 9.49977 10.2172 9.48055 10.1262 9.44278C10.0352 9.405 9.95263 9.34942 9.88338 9.27931L6.88338 6.27931L3.88338 9.27931C3.73811 9.34946 3.57409 9.3709 3.41567 9.34044C3.25724 9.30999 3.11286 9.22926 3.00395 9.11025C2.89504 8.99124 2.82741 8.84028 2.8111 8.67978C2.79478 8.51928 2.83065 8.35781 2.91338 8.21931L6.41338 4.71931C6.55401 4.57886 6.74463 4.49997 6.94338 4.49997C7.14213 4.49997 7.33276 4.57886 7.47338 4.71931L10.9734 8.21931C11.1138 8.35994 11.1927 8.55056 11.1927 8.74931C11.1927 8.94806 11.1138 9.13868 10.9734 9.27931C10.9007 9.35315 10.8132 9.41089 10.7168 9.44879C10.6203 9.48669 10.5169 9.5039 10.4134 9.49931Z",
|
|
fill: "currentColor"
|
|
}, null, -1)])), 16);
|
|
}
|
|
script$4.render = render$3;
|
|
var script$3 = {
|
|
name: "TimesIcon",
|
|
"extends": script$c
|
|
};
|
|
function _toConsumableArray$1(r) {
|
|
return _arrayWithoutHoles$1(r) || _iterableToArray$1(r) || _unsupportedIterableToArray$1(r) || _nonIterableSpread$1();
|
|
}
|
|
function _nonIterableSpread$1() {
|
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
function _unsupportedIterableToArray$1(r, a2) {
|
|
if (r) {
|
|
if ("string" == typeof r) return _arrayLikeToArray$1(r, a2);
|
|
var t2 = {}.toString.call(r).slice(8, -1);
|
|
return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$1(r, a2) : void 0;
|
|
}
|
|
}
|
|
function _iterableToArray$1(r) {
|
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
}
|
|
function _arrayWithoutHoles$1(r) {
|
|
if (Array.isArray(r)) return _arrayLikeToArray$1(r);
|
|
}
|
|
function _arrayLikeToArray$1(r, a2) {
|
|
(null == a2 || a2 > r.length) && (a2 = r.length);
|
|
for (var e = 0, n = Array(a2); e < a2; e++) n[e] = r[e];
|
|
return n;
|
|
}
|
|
function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return openBlock(), createElementBlock("svg", mergeProps({
|
|
width: "14",
|
|
height: "14",
|
|
viewBox: "0 0 14 14",
|
|
fill: "none",
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
}, _ctx.pti()), _toConsumableArray$1(_cache[0] || (_cache[0] = [createBaseVNode("path", {
|
|
d: "M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z",
|
|
fill: "currentColor"
|
|
}, null, -1)])), 16);
|
|
}
|
|
script$3.render = render$2;
|
|
var style$1 = "\n .p-inputnumber {\n display: inline-flex;\n position: relative;\n }\n\n .p-inputnumber-button {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n cursor: pointer;\n background: dt('inputnumber.button.background');\n color: dt('inputnumber.button.color');\n width: dt('inputnumber.button.width');\n transition:\n background dt('inputnumber.transition.duration'),\n color dt('inputnumber.transition.duration'),\n border-color dt('inputnumber.transition.duration'),\n outline-color dt('inputnumber.transition.duration');\n }\n\n .p-inputnumber-button:disabled {\n cursor: auto;\n }\n\n .p-inputnumber-button:not(:disabled):hover {\n background: dt('inputnumber.button.hover.background');\n color: dt('inputnumber.button.hover.color');\n }\n\n .p-inputnumber-button:not(:disabled):active {\n background: dt('inputnumber.button.active.background');\n color: dt('inputnumber.button.active.color');\n }\n\n .p-inputnumber-stacked .p-inputnumber-button {\n position: relative;\n flex: 1 1 auto;\n border: 0 none;\n }\n\n .p-inputnumber-stacked .p-inputnumber-button-group {\n display: flex;\n flex-direction: column;\n position: absolute;\n inset-block-start: 1px;\n inset-inline-end: 1px;\n height: calc(100% - 2px);\n z-index: 1;\n }\n\n .p-inputnumber-stacked .p-inputnumber-increment-button {\n padding: 0;\n border-start-end-radius: calc(dt('inputnumber.button.border.radius') - 1px);\n }\n\n .p-inputnumber-stacked .p-inputnumber-decrement-button {\n padding: 0;\n border-end-end-radius: calc(dt('inputnumber.button.border.radius') - 1px);\n }\n\n .p-inputnumber-stacked .p-inputnumber-input {\n padding-inline-end: calc(dt('inputnumber.button.width') + dt('form.field.padding.x'));\n }\n\n .p-inputnumber-horizontal .p-inputnumber-button {\n border: 1px solid dt('inputnumber.button.border.color');\n }\n\n .p-inputnumber-horizontal .p-inputnumber-button:hover {\n border-color: dt('inputnumber.button.hover.border.color');\n }\n\n .p-inputnumber-horizontal .p-inputnumber-button:active {\n border-color: dt('inputnumber.button.active.border.color');\n }\n\n .p-inputnumber-horizontal .p-inputnumber-increment-button {\n order: 3;\n border-start-end-radius: dt('inputnumber.button.border.radius');\n border-end-end-radius: dt('inputnumber.button.border.radius');\n border-inline-start: 0 none;\n }\n\n .p-inputnumber-horizontal .p-inputnumber-input {\n order: 2;\n border-radius: 0;\n }\n\n .p-inputnumber-horizontal .p-inputnumber-decrement-button {\n order: 1;\n border-start-start-radius: dt('inputnumber.button.border.radius');\n border-end-start-radius: dt('inputnumber.button.border.radius');\n border-inline-end: 0 none;\n }\n\n .p-floatlabel:has(.p-inputnumber-horizontal) label {\n margin-inline-start: dt('inputnumber.button.width');\n }\n\n .p-inputnumber-vertical {\n flex-direction: column;\n }\n\n .p-inputnumber-vertical .p-inputnumber-button {\n border: 1px solid dt('inputnumber.button.border.color');\n padding: dt('inputnumber.button.vertical.padding');\n }\n\n .p-inputnumber-vertical .p-inputnumber-button:hover {\n border-color: dt('inputnumber.button.hover.border.color');\n }\n\n .p-inputnumber-vertical .p-inputnumber-button:active {\n border-color: dt('inputnumber.button.active.border.color');\n }\n\n .p-inputnumber-vertical .p-inputnumber-increment-button {\n order: 1;\n border-start-start-radius: dt('inputnumber.button.border.radius');\n border-start-end-radius: dt('inputnumber.button.border.radius');\n width: 100%;\n border-block-end: 0 none;\n }\n\n .p-inputnumber-vertical .p-inputnumber-input {\n order: 2;\n border-radius: 0;\n text-align: center;\n }\n\n .p-inputnumber-vertical .p-inputnumber-decrement-button {\n order: 3;\n border-end-start-radius: dt('inputnumber.button.border.radius');\n border-end-end-radius: dt('inputnumber.button.border.radius');\n width: 100%;\n border-block-start: 0 none;\n }\n\n .p-inputnumber-input {\n flex: 1 1 auto;\n }\n\n .p-inputnumber-fluid {\n width: 100%;\n }\n\n .p-inputnumber-fluid .p-inputnumber-input {\n width: 1%;\n }\n\n .p-inputnumber-fluid.p-inputnumber-vertical .p-inputnumber-input {\n width: 100%;\n }\n\n .p-inputnumber:has(.p-inputtext-sm) .p-inputnumber-button .p-icon {\n font-size: dt('form.field.sm.font.size');\n width: dt('form.field.sm.font.size');\n height: dt('form.field.sm.font.size');\n }\n\n .p-inputnumber:has(.p-inputtext-lg) .p-inputnumber-button .p-icon {\n font-size: dt('form.field.lg.font.size');\n width: dt('form.field.lg.font.size');\n height: dt('form.field.lg.font.size');\n }\n\n .p-inputnumber-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n cursor: pointer;\n inset-inline-end: dt('form.field.padding.x');\n color: dt('form.field.icon.color');\n }\n\n .p-inputnumber:has(.p-inputnumber-clear-icon) .p-inputnumber-input {\n padding-inline-end: calc((dt('form.field.padding.x') * 2) + dt('icon.size'));\n }\n\n .p-inputnumber-stacked .p-inputnumber-clear-icon {\n inset-inline-end: calc(dt('inputnumber.button.width') + dt('form.field.padding.x'));\n }\n\n .p-inputnumber-stacked:has(.p-inputnumber-clear-icon) .p-inputnumber-input {\n padding-inline-end: calc(dt('inputnumber.button.width') + (dt('form.field.padding.x') * 2) + dt('icon.size'));\n }\n\n .p-inputnumber-horizontal .p-inputnumber-clear-icon {\n inset-inline-end: calc(dt('inputnumber.button.width') + dt('form.field.padding.x'));\n }\n";
|
|
var classes$1 = {
|
|
root: function root4(_ref) {
|
|
var instance = _ref.instance, props = _ref.props;
|
|
return ["p-inputnumber p-component p-inputwrapper", {
|
|
"p-invalid": instance.$invalid,
|
|
"p-inputwrapper-filled": instance.$filled || props.allowEmpty === false,
|
|
"p-inputwrapper-focus": instance.focused,
|
|
"p-inputnumber-stacked": props.showButtons && props.buttonLayout === "stacked",
|
|
"p-inputnumber-horizontal": props.showButtons && props.buttonLayout === "horizontal",
|
|
"p-inputnumber-vertical": props.showButtons && props.buttonLayout === "vertical",
|
|
"p-inputnumber-fluid": instance.$fluid
|
|
}];
|
|
},
|
|
pcInputText: "p-inputnumber-input",
|
|
clearIcon: "p-inputnumber-clear-icon",
|
|
buttonGroup: "p-inputnumber-button-group",
|
|
incrementButton: function incrementButton(_ref2) {
|
|
var instance = _ref2.instance, props = _ref2.props;
|
|
return ["p-inputnumber-button p-inputnumber-increment-button", {
|
|
"p-disabled": props.showButtons && props.max !== null && instance.maxBoundry()
|
|
}];
|
|
},
|
|
decrementButton: function decrementButton(_ref3) {
|
|
var instance = _ref3.instance, props = _ref3.props;
|
|
return ["p-inputnumber-button p-inputnumber-decrement-button", {
|
|
"p-disabled": props.showButtons && props.min !== null && instance.minBoundry()
|
|
}];
|
|
}
|
|
};
|
|
var InputNumberStyle = BaseStyle.extend({
|
|
name: "inputnumber",
|
|
style: style$1,
|
|
classes: classes$1
|
|
});
|
|
var script$1$1 = {
|
|
name: "BaseInputNumber",
|
|
"extends": script$7,
|
|
props: {
|
|
format: {
|
|
type: Boolean,
|
|
"default": true
|
|
},
|
|
showButtons: {
|
|
type: Boolean,
|
|
"default": false
|
|
},
|
|
buttonLayout: {
|
|
type: String,
|
|
"default": "stacked"
|
|
},
|
|
incrementButtonClass: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
decrementButtonClass: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
incrementButtonIcon: {
|
|
type: String,
|
|
"default": void 0
|
|
},
|
|
incrementIcon: {
|
|
type: String,
|
|
"default": void 0
|
|
},
|
|
decrementButtonIcon: {
|
|
type: String,
|
|
"default": void 0
|
|
},
|
|
decrementIcon: {
|
|
type: String,
|
|
"default": void 0
|
|
},
|
|
locale: {
|
|
type: String,
|
|
"default": void 0
|
|
},
|
|
localeMatcher: {
|
|
type: String,
|
|
"default": void 0
|
|
},
|
|
mode: {
|
|
type: String,
|
|
"default": "decimal"
|
|
},
|
|
prefix: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
suffix: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
currency: {
|
|
type: String,
|
|
"default": void 0
|
|
},
|
|
currencyDisplay: {
|
|
type: String,
|
|
"default": void 0
|
|
},
|
|
useGrouping: {
|
|
type: Boolean,
|
|
"default": true
|
|
},
|
|
minFractionDigits: {
|
|
type: Number,
|
|
"default": void 0
|
|
},
|
|
maxFractionDigits: {
|
|
type: Number,
|
|
"default": void 0
|
|
},
|
|
roundingMode: {
|
|
type: String,
|
|
"default": "halfExpand",
|
|
validator: function validator(value) {
|
|
return ["ceil", "floor", "expand", "trunc", "halfCeil", "halfFloor", "halfExpand", "halfTrunc", "halfEven"].includes(value);
|
|
}
|
|
},
|
|
min: {
|
|
type: Number,
|
|
"default": null
|
|
},
|
|
max: {
|
|
type: Number,
|
|
"default": null
|
|
},
|
|
step: {
|
|
type: Number,
|
|
"default": 1
|
|
},
|
|
allowEmpty: {
|
|
type: Boolean,
|
|
"default": true
|
|
},
|
|
highlightOnFocus: {
|
|
type: Boolean,
|
|
"default": false
|
|
},
|
|
showClear: {
|
|
type: Boolean,
|
|
"default": false
|
|
},
|
|
readonly: {
|
|
type: Boolean,
|
|
"default": false
|
|
},
|
|
placeholder: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
inputId: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
inputClass: {
|
|
type: [String, Object],
|
|
"default": null
|
|
},
|
|
inputStyle: {
|
|
type: Object,
|
|
"default": null
|
|
},
|
|
ariaLabelledby: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
ariaLabel: {
|
|
type: String,
|
|
"default": null
|
|
},
|
|
required: {
|
|
type: Boolean,
|
|
"default": false
|
|
}
|
|
},
|
|
style: InputNumberStyle,
|
|
provide: function provide6() {
|
|
return {
|
|
$pcInputNumber: this,
|
|
$parentInstance: this
|
|
};
|
|
}
|
|
};
|
|
function _typeof(o) {
|
|
"@babel/helpers - typeof";
|
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
return typeof o2;
|
|
} : function(o2) {
|
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
}, _typeof(o);
|
|
}
|
|
function ownKeys(e, r) {
|
|
var t2 = Object.keys(e);
|
|
if (Object.getOwnPropertySymbols) {
|
|
var o = Object.getOwnPropertySymbols(e);
|
|
r && (o = o.filter(function(r2) {
|
|
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
})), t2.push.apply(t2, o);
|
|
}
|
|
return t2;
|
|
}
|
|
function _objectSpread(e) {
|
|
for (var r = 1; r < arguments.length; r++) {
|
|
var t2 = null != arguments[r] ? arguments[r] : {};
|
|
r % 2 ? ownKeys(Object(t2), true).forEach(function(r2) {
|
|
_defineProperty(e, r2, t2[r2]);
|
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r2) {
|
|
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
|
|
});
|
|
}
|
|
return e;
|
|
}
|
|
function _defineProperty(e, r, t2) {
|
|
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
|
|
}
|
|
function _toPropertyKey(t2) {
|
|
var i2 = _toPrimitive(t2, "string");
|
|
return "symbol" == _typeof(i2) ? i2 : i2 + "";
|
|
}
|
|
function _toPrimitive(t2, r) {
|
|
if ("object" != _typeof(t2) || !t2) return t2;
|
|
var e = t2[Symbol.toPrimitive];
|
|
if (void 0 !== e) {
|
|
var i2 = e.call(t2, r);
|
|
if ("object" != _typeof(i2)) return i2;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return ("string" === r ? String : Number)(t2);
|
|
}
|
|
function _toConsumableArray(r) {
|
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
}
|
|
function _nonIterableSpread() {
|
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
function _unsupportedIterableToArray(r, a2) {
|
|
if (r) {
|
|
if ("string" == typeof r) return _arrayLikeToArray(r, a2);
|
|
var t2 = {}.toString.call(r).slice(8, -1);
|
|
return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray(r, a2) : void 0;
|
|
}
|
|
}
|
|
function _iterableToArray(r) {
|
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
}
|
|
function _arrayWithoutHoles(r) {
|
|
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
}
|
|
function _arrayLikeToArray(r, a2) {
|
|
(null == a2 || a2 > r.length) && (a2 = r.length);
|
|
for (var e = 0, n = Array(a2); e < a2; e++) n[e] = r[e];
|
|
return n;
|
|
}
|
|
var script$2 = {
|
|
name: "InputNumber",
|
|
"extends": script$1$1,
|
|
inheritAttrs: false,
|
|
emits: ["input", "focus", "blur"],
|
|
inject: {
|
|
$pcFluid: {
|
|
"default": null
|
|
}
|
|
},
|
|
numberFormat: null,
|
|
_numeral: null,
|
|
_decimal: null,
|
|
_group: null,
|
|
_minusSign: null,
|
|
_currency: null,
|
|
_suffix: null,
|
|
_prefix: null,
|
|
_index: null,
|
|
groupChar: "",
|
|
isSpecialChar: null,
|
|
prefixChar: null,
|
|
suffixChar: null,
|
|
timer: null,
|
|
data: function data2() {
|
|
return {
|
|
// @deprecated
|
|
d_modelValue: this.d_value,
|
|
focused: false
|
|
};
|
|
},
|
|
watch: {
|
|
d_value: {
|
|
immediate: true,
|
|
handler: function handler8(newValue) {
|
|
var _this$$refs$clearIcon;
|
|
this.d_modelValue = newValue;
|
|
if ((_this$$refs$clearIcon = this.$refs.clearIcon) !== null && _this$$refs$clearIcon !== void 0 && (_this$$refs$clearIcon = _this$$refs$clearIcon.$el) !== null && _this$$refs$clearIcon !== void 0 && _this$$refs$clearIcon.style) {
|
|
this.$refs.clearIcon.$el.style.display = l(newValue) ? "none" : "block";
|
|
}
|
|
}
|
|
},
|
|
locale: function locale(newValue, oldValue) {
|
|
this.updateConstructParser(newValue, oldValue);
|
|
},
|
|
localeMatcher: function localeMatcher(newValue, oldValue) {
|
|
this.updateConstructParser(newValue, oldValue);
|
|
},
|
|
mode: function mode(newValue, oldValue) {
|
|
this.updateConstructParser(newValue, oldValue);
|
|
},
|
|
currency: function currency(newValue, oldValue) {
|
|
this.updateConstructParser(newValue, oldValue);
|
|
},
|
|
currencyDisplay: function currencyDisplay(newValue, oldValue) {
|
|
this.updateConstructParser(newValue, oldValue);
|
|
},
|
|
useGrouping: function useGrouping(newValue, oldValue) {
|
|
this.updateConstructParser(newValue, oldValue);
|
|
},
|
|
minFractionDigits: function minFractionDigits(newValue, oldValue) {
|
|
this.updateConstructParser(newValue, oldValue);
|
|
},
|
|
maxFractionDigits: function maxFractionDigits(newValue, oldValue) {
|
|
this.updateConstructParser(newValue, oldValue);
|
|
},
|
|
suffix: function suffix(newValue, oldValue) {
|
|
this.updateConstructParser(newValue, oldValue);
|
|
},
|
|
prefix: function prefix(newValue, oldValue) {
|
|
this.updateConstructParser(newValue, oldValue);
|
|
}
|
|
},
|
|
created: function created2() {
|
|
this.constructParser();
|
|
},
|
|
mounted: function mounted2() {
|
|
var _this$$refs$clearIcon2;
|
|
if ((_this$$refs$clearIcon2 = this.$refs.clearIcon) !== null && _this$$refs$clearIcon2 !== void 0 && (_this$$refs$clearIcon2 = _this$$refs$clearIcon2.$el) !== null && _this$$refs$clearIcon2 !== void 0 && _this$$refs$clearIcon2.style) {
|
|
this.$refs.clearIcon.$el.style.display = !this.$filled ? "none" : "block";
|
|
}
|
|
},
|
|
methods: {
|
|
getOptions: function getOptions() {
|
|
return {
|
|
localeMatcher: this.localeMatcher,
|
|
style: this.mode,
|
|
currency: this.currency,
|
|
currencyDisplay: this.currencyDisplay,
|
|
useGrouping: this.useGrouping,
|
|
minimumFractionDigits: this.minFractionDigits,
|
|
maximumFractionDigits: this.maxFractionDigits,
|
|
roundingMode: this.roundingMode
|
|
};
|
|
},
|
|
constructParser: function constructParser() {
|
|
this.numberFormat = new Intl.NumberFormat(this.locale, this.getOptions());
|
|
var numerals = _toConsumableArray(new Intl.NumberFormat(this.locale, {
|
|
useGrouping: false
|
|
}).format(9876543210)).reverse();
|
|
var index = new Map(numerals.map(function(d2, i2) {
|
|
return [d2, i2];
|
|
}));
|
|
this._numeral = new RegExp("[".concat(numerals.join(""), "]"), "g");
|
|
this._group = this.getGroupingExpression();
|
|
this._minusSign = this.getMinusSignExpression();
|
|
this._currency = this.getCurrencyExpression();
|
|
this._decimal = this.getDecimalExpression();
|
|
this._suffix = this.getSuffixExpression();
|
|
this._prefix = this.getPrefixExpression();
|
|
this._index = function(d2) {
|
|
return index.get(d2);
|
|
};
|
|
},
|
|
updateConstructParser: function updateConstructParser(newValue, oldValue) {
|
|
if (newValue !== oldValue) {
|
|
this.constructParser();
|
|
}
|
|
},
|
|
escapeRegExp: function escapeRegExp(text) {
|
|
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
},
|
|
getDecimalExpression: function getDecimalExpression() {
|
|
var formatter = new Intl.NumberFormat(this.locale, _objectSpread(_objectSpread({}, this.getOptions()), {}, {
|
|
useGrouping: false
|
|
}));
|
|
return new RegExp("[".concat(formatter.format(1.1).replace(this._currency, "").trim().replace(this._numeral, ""), "]"), "g");
|
|
},
|
|
getGroupingExpression: function getGroupingExpression() {
|
|
var formatter = new Intl.NumberFormat(this.locale, {
|
|
useGrouping: true
|
|
});
|
|
this.groupChar = formatter.format(1e6).trim().replace(this._numeral, "").charAt(0);
|
|
return new RegExp("[".concat(this.groupChar, "]"), "g");
|
|
},
|
|
getMinusSignExpression: function getMinusSignExpression() {
|
|
var formatter = new Intl.NumberFormat(this.locale, {
|
|
useGrouping: false
|
|
});
|
|
return new RegExp("[".concat(formatter.format(-1).trim().replace(this._numeral, ""), "]"), "g");
|
|
},
|
|
getCurrencyExpression: function getCurrencyExpression() {
|
|
if (this.currency) {
|
|
var formatter = new Intl.NumberFormat(this.locale, {
|
|
style: "currency",
|
|
currency: this.currency,
|
|
currencyDisplay: this.currencyDisplay,
|
|
minimumFractionDigits: 0,
|
|
maximumFractionDigits: 0,
|
|
roundingMode: this.roundingMode
|
|
});
|
|
return new RegExp("[".concat(formatter.format(1).replace(/\s/g, "").replace(this._numeral, "").replace(this._group, ""), "]"), "g");
|
|
}
|
|
return new RegExp("[]", "g");
|
|
},
|
|
getPrefixExpression: function getPrefixExpression() {
|
|
if (this.prefix) {
|
|
this.prefixChar = this.prefix;
|
|
} else {
|
|
var formatter = new Intl.NumberFormat(this.locale, {
|
|
style: this.mode,
|
|
currency: this.currency,
|
|
currencyDisplay: this.currencyDisplay
|
|
});
|
|
this.prefixChar = formatter.format(1).split("1")[0];
|
|
}
|
|
return new RegExp("".concat(this.escapeRegExp(this.prefixChar || "")), "g");
|
|
},
|
|
getSuffixExpression: function getSuffixExpression() {
|
|
if (this.suffix) {
|
|
this.suffixChar = this.suffix;
|
|
} else {
|
|
var formatter = new Intl.NumberFormat(this.locale, {
|
|
style: this.mode,
|
|
currency: this.currency,
|
|
currencyDisplay: this.currencyDisplay,
|
|
minimumFractionDigits: 0,
|
|
maximumFractionDigits: 0,
|
|
roundingMode: this.roundingMode
|
|
});
|
|
this.suffixChar = formatter.format(1).split("1")[1];
|
|
}
|
|
return new RegExp("".concat(this.escapeRegExp(this.suffixChar || "")), "g");
|
|
},
|
|
formatValue: function formatValue(value) {
|
|
if (value != null) {
|
|
if (value === "-") {
|
|
return value;
|
|
}
|
|
if (this.format) {
|
|
var formatter = new Intl.NumberFormat(this.locale, this.getOptions());
|
|
var formattedValue2 = formatter.format(value);
|
|
if (this.prefix) {
|
|
formattedValue2 = this.prefix + formattedValue2;
|
|
}
|
|
if (this.suffix) {
|
|
formattedValue2 = formattedValue2 + this.suffix;
|
|
}
|
|
return formattedValue2;
|
|
}
|
|
return value.toString();
|
|
}
|
|
return "";
|
|
},
|
|
parseValue: function parseValue(text) {
|
|
var filteredText = text.replace(this._suffix, "").replace(this._prefix, "").trim().replace(/\s/g, "").replace(this._currency, "").replace(this._group, "").replace(this._minusSign, "-").replace(this._decimal, ".").replace(this._numeral, this._index);
|
|
if (filteredText) {
|
|
if (filteredText === "-")
|
|
return filteredText;
|
|
var parsedValue = +filteredText;
|
|
return isNaN(parsedValue) ? null : parsedValue;
|
|
}
|
|
return null;
|
|
},
|
|
repeat: function repeat(event, interval, dir) {
|
|
var _this = this;
|
|
if (this.readonly) {
|
|
return;
|
|
}
|
|
var i2 = interval || 500;
|
|
this.clearTimer();
|
|
this.timer = setTimeout(function() {
|
|
_this.repeat(event, 40, dir);
|
|
}, i2);
|
|
this.spin(event, dir);
|
|
},
|
|
addWithPrecision: function addWithPrecision(base, increment) {
|
|
var baseStr = base.toString();
|
|
var stepStr = increment.toString();
|
|
var baseDecimalPlaces = baseStr.includes(".") ? baseStr.split(".")[1].length : 0;
|
|
var stepDecimalPlaces = stepStr.includes(".") ? stepStr.split(".")[1].length : 0;
|
|
var maxDecimalPlaces = Math.max(baseDecimalPlaces, stepDecimalPlaces);
|
|
var precision = Math.pow(10, maxDecimalPlaces);
|
|
return Math.round((base + increment) * precision) / precision;
|
|
},
|
|
spin: function spin(event, dir) {
|
|
if (this.$refs.input) {
|
|
var step = this.step * dir;
|
|
var currentValue = this.parseValue(this.$refs.input.$el.value) || 0;
|
|
var newValue = this.validateValue(this.addWithPrecision(currentValue, step));
|
|
this.updateInput(newValue, null, "spin");
|
|
this.updateModel(event, newValue);
|
|
this.handleOnInput(event, currentValue, newValue);
|
|
}
|
|
},
|
|
onUpButtonMouseDown: function onUpButtonMouseDown(event) {
|
|
if (!this.disabled) {
|
|
this.$refs.input.$el.focus();
|
|
this.repeat(event, null, 1);
|
|
event.preventDefault();
|
|
}
|
|
},
|
|
onUpButtonMouseUp: function onUpButtonMouseUp() {
|
|
if (!this.disabled) {
|
|
this.clearTimer();
|
|
}
|
|
},
|
|
onUpButtonMouseLeave: function onUpButtonMouseLeave() {
|
|
if (!this.disabled) {
|
|
this.clearTimer();
|
|
}
|
|
},
|
|
onUpButtonKeyUp: function onUpButtonKeyUp() {
|
|
if (!this.disabled) {
|
|
this.clearTimer();
|
|
}
|
|
},
|
|
onUpButtonKeyDown: function onUpButtonKeyDown(event) {
|
|
if (event.code === "Space" || event.code === "Enter" || event.code === "NumpadEnter") {
|
|
this.repeat(event, null, 1);
|
|
}
|
|
},
|
|
onDownButtonMouseDown: function onDownButtonMouseDown(event) {
|
|
if (!this.disabled) {
|
|
this.$refs.input.$el.focus();
|
|
this.repeat(event, null, -1);
|
|
event.preventDefault();
|
|
}
|
|
},
|
|
onDownButtonMouseUp: function onDownButtonMouseUp() {
|
|
if (!this.disabled) {
|
|
this.clearTimer();
|
|
}
|
|
},
|
|
onDownButtonMouseLeave: function onDownButtonMouseLeave() {
|
|
if (!this.disabled) {
|
|
this.clearTimer();
|
|
}
|
|
},
|
|
onDownButtonKeyUp: function onDownButtonKeyUp() {
|
|
if (!this.disabled) {
|
|
this.clearTimer();
|
|
}
|
|
},
|
|
onDownButtonKeyDown: function onDownButtonKeyDown(event) {
|
|
if (event.code === "Space" || event.code === "Enter" || event.code === "NumpadEnter") {
|
|
this.repeat(event, null, -1);
|
|
}
|
|
},
|
|
onUserInput: function onUserInput() {
|
|
if (this.isSpecialChar) {
|
|
this.$refs.input.$el.value = this.lastValue;
|
|
}
|
|
this.isSpecialChar = false;
|
|
},
|
|
onInputKeyDown: function onInputKeyDown(event) {
|
|
if (this.readonly) {
|
|
return;
|
|
}
|
|
if (event.isComposing) {
|
|
return;
|
|
}
|
|
if (event.altKey || event.ctrlKey || event.metaKey) {
|
|
this.isSpecialChar = true;
|
|
this.lastValue = this.$refs.input.$el.value;
|
|
return;
|
|
}
|
|
this.lastValue = event.target.value;
|
|
var selectionStart = event.target.selectionStart;
|
|
var selectionEnd = event.target.selectionEnd;
|
|
var selectionRange = selectionEnd - selectionStart;
|
|
var inputValue = event.target.value;
|
|
var newValueStr = null;
|
|
var code = event.code || event.key;
|
|
switch (code) {
|
|
case "ArrowUp":
|
|
this.spin(event, 1);
|
|
event.preventDefault();
|
|
break;
|
|
case "ArrowDown":
|
|
this.spin(event, -1);
|
|
event.preventDefault();
|
|
break;
|
|
case "ArrowLeft":
|
|
if (selectionRange > 1) {
|
|
var cursorPosition = this.isNumeralChar(inputValue.charAt(selectionStart)) ? selectionStart + 1 : selectionStart + 2;
|
|
this.$refs.input.$el.setSelectionRange(cursorPosition, cursorPosition);
|
|
} else if (!this.isNumeralChar(inputValue.charAt(selectionStart - 1))) {
|
|
event.preventDefault();
|
|
}
|
|
break;
|
|
case "ArrowRight":
|
|
if (selectionRange > 1) {
|
|
var _cursorPosition = selectionEnd - 1;
|
|
this.$refs.input.$el.setSelectionRange(_cursorPosition, _cursorPosition);
|
|
} else if (!this.isNumeralChar(inputValue.charAt(selectionStart))) {
|
|
event.preventDefault();
|
|
}
|
|
break;
|
|
case "Tab":
|
|
case "Enter":
|
|
case "NumpadEnter":
|
|
newValueStr = this.validateValue(this.parseValue(inputValue));
|
|
this.$refs.input.$el.value = this.formatValue(newValueStr);
|
|
this.$refs.input.$el.setAttribute("aria-valuenow", newValueStr);
|
|
this.updateModel(event, newValueStr);
|
|
break;
|
|
case "Backspace": {
|
|
event.preventDefault();
|
|
if (selectionStart === selectionEnd) {
|
|
if (selectionStart >= inputValue.length && this.suffixChar !== null) {
|
|
selectionStart = inputValue.length - this.suffixChar.length;
|
|
this.$refs.input.$el.setSelectionRange(selectionStart, selectionStart);
|
|
}
|
|
var deleteChar = inputValue.charAt(selectionStart - 1);
|
|
var _this$getDecimalCharI = this.getDecimalCharIndexes(inputValue), decimalCharIndex = _this$getDecimalCharI.decimalCharIndex, decimalCharIndexWithoutPrefix = _this$getDecimalCharI.decimalCharIndexWithoutPrefix;
|
|
if (this.isNumeralChar(deleteChar)) {
|
|
var decimalLength = this.getDecimalLength(inputValue);
|
|
if (this._group.test(deleteChar)) {
|
|
this._group.lastIndex = 0;
|
|
newValueStr = inputValue.slice(0, selectionStart - 2) + inputValue.slice(selectionStart - 1);
|
|
} else if (this._decimal.test(deleteChar)) {
|
|
this._decimal.lastIndex = 0;
|
|
if (decimalLength) {
|
|
this.$refs.input.$el.setSelectionRange(selectionStart - 1, selectionStart - 1);
|
|
} else {
|
|
newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart);
|
|
}
|
|
} else if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
|
|
var insertedText = this.isDecimalMode() && (this.minFractionDigits || 0) < decimalLength ? "" : "0";
|
|
newValueStr = inputValue.slice(0, selectionStart - 1) + insertedText + inputValue.slice(selectionStart);
|
|
} else if (decimalCharIndexWithoutPrefix === 1) {
|
|
newValueStr = inputValue.slice(0, selectionStart - 1) + "0" + inputValue.slice(selectionStart);
|
|
newValueStr = this.parseValue(newValueStr) > 0 ? newValueStr : "";
|
|
} else {
|
|
newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart);
|
|
}
|
|
}
|
|
this.updateValue(event, newValueStr, null, "delete-single");
|
|
} else {
|
|
newValueStr = this.deleteRange(inputValue, selectionStart, selectionEnd);
|
|
this.updateValue(event, newValueStr, null, "delete-range");
|
|
}
|
|
break;
|
|
}
|
|
case "Delete":
|
|
event.preventDefault();
|
|
if (selectionStart === selectionEnd) {
|
|
var _deleteChar = inputValue.charAt(selectionStart);
|
|
var _this$getDecimalCharI2 = this.getDecimalCharIndexes(inputValue), _decimalCharIndex = _this$getDecimalCharI2.decimalCharIndex, _decimalCharIndexWithoutPrefix = _this$getDecimalCharI2.decimalCharIndexWithoutPrefix;
|
|
if (this.isNumeralChar(_deleteChar)) {
|
|
var _decimalLength = this.getDecimalLength(inputValue);
|
|
if (this._group.test(_deleteChar)) {
|
|
this._group.lastIndex = 0;
|
|
newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 2);
|
|
} else if (this._decimal.test(_deleteChar)) {
|
|
this._decimal.lastIndex = 0;
|
|
if (_decimalLength) {
|
|
this.$refs.input.$el.setSelectionRange(selectionStart + 1, selectionStart + 1);
|
|
} else {
|
|
newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1);
|
|
}
|
|
} else if (_decimalCharIndex > 0 && selectionStart > _decimalCharIndex) {
|
|
var _insertedText = this.isDecimalMode() && (this.minFractionDigits || 0) < _decimalLength ? "" : "0";
|
|
newValueStr = inputValue.slice(0, selectionStart) + _insertedText + inputValue.slice(selectionStart + 1);
|
|
} else if (_decimalCharIndexWithoutPrefix === 1) {
|
|
newValueStr = inputValue.slice(0, selectionStart) + "0" + inputValue.slice(selectionStart + 1);
|
|
newValueStr = this.parseValue(newValueStr) > 0 ? newValueStr : "";
|
|
} else {
|
|
newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1);
|
|
}
|
|
}
|
|
this.updateValue(event, newValueStr, null, "delete-back-single");
|
|
} else {
|
|
newValueStr = this.deleteRange(inputValue, selectionStart, selectionEnd);
|
|
this.updateValue(event, newValueStr, null, "delete-range");
|
|
}
|
|
break;
|
|
case "Home":
|
|
event.preventDefault();
|
|
if (s$2(this.min)) {
|
|
this.updateModel(event, this.min);
|
|
}
|
|
break;
|
|
case "End":
|
|
event.preventDefault();
|
|
if (s$2(this.max)) {
|
|
this.updateModel(event, this.max);
|
|
}
|
|
break;
|
|
}
|
|
},
|
|
onInputKeyPress: function onInputKeyPress(event) {
|
|
if (this.readonly) {
|
|
return;
|
|
}
|
|
var _char = event.key;
|
|
var isDecimalSign2 = this.isDecimalSign(_char);
|
|
var isMinusSign2 = this.isMinusSign(_char);
|
|
if (event.code !== "Enter") {
|
|
event.preventDefault();
|
|
}
|
|
if (Number(_char) >= 0 && Number(_char) <= 9 || isMinusSign2 || isDecimalSign2) {
|
|
this.insert(event, _char, {
|
|
isDecimalSign: isDecimalSign2,
|
|
isMinusSign: isMinusSign2
|
|
});
|
|
}
|
|
},
|
|
onPaste: function onPaste(event) {
|
|
if (this.readonly) {
|
|
return;
|
|
}
|
|
event.preventDefault();
|
|
var data3 = (event.clipboardData || window["clipboardData"]).getData("Text");
|
|
if (this.inputId === "integeronly" && /[^\d-]/.test(data3)) {
|
|
return;
|
|
}
|
|
if (data3) {
|
|
var filteredData = this.parseValue(data3);
|
|
if (filteredData != null) {
|
|
this.insert(event, filteredData.toString());
|
|
}
|
|
}
|
|
},
|
|
onClearClick: function onClearClick(event) {
|
|
this.updateModel(event, null);
|
|
this.$refs.input.$el.focus();
|
|
},
|
|
allowMinusSign: function allowMinusSign() {
|
|
return this.min === null || this.min < 0;
|
|
},
|
|
isMinusSign: function isMinusSign(_char2) {
|
|
if (this._minusSign.test(_char2) || _char2 === "-") {
|
|
this._minusSign.lastIndex = 0;
|
|
return true;
|
|
}
|
|
return false;
|
|
},
|
|
isDecimalSign: function isDecimalSign(_char3) {
|
|
var _this$locale;
|
|
if ((_this$locale = this.locale) !== null && _this$locale !== void 0 && _this$locale.includes("fr") && [".", ","].includes(_char3) || this._decimal.test(_char3)) {
|
|
this._decimal.lastIndex = 0;
|
|
return true;
|
|
}
|
|
return false;
|
|
},
|
|
isDecimalMode: function isDecimalMode() {
|
|
return this.mode === "decimal";
|
|
},
|
|
getDecimalCharIndexes: function getDecimalCharIndexes(val) {
|
|
var decimalCharIndex = val.search(this._decimal);
|
|
this._decimal.lastIndex = 0;
|
|
var filteredVal = val.replace(this._prefix, "").trim().replace(/\s/g, "").replace(this._currency, "");
|
|
var decimalCharIndexWithoutPrefix = filteredVal.search(this._decimal);
|
|
this._decimal.lastIndex = 0;
|
|
return {
|
|
decimalCharIndex,
|
|
decimalCharIndexWithoutPrefix
|
|
};
|
|
},
|
|
getCharIndexes: function getCharIndexes(val) {
|
|
var decimalCharIndex = val.search(this._decimal);
|
|
this._decimal.lastIndex = 0;
|
|
var minusCharIndex = val.search(this._minusSign);
|
|
this._minusSign.lastIndex = 0;
|
|
var suffixCharIndex = val.search(this._suffix);
|
|
this._suffix.lastIndex = 0;
|
|
var currencyCharIndex = val.search(this._currency);
|
|
this._currency.lastIndex = 0;
|
|
return {
|
|
decimalCharIndex,
|
|
minusCharIndex,
|
|
suffixCharIndex,
|
|
currencyCharIndex
|
|
};
|
|
},
|
|
insert: function insert(event, text) {
|
|
var sign = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
isDecimalSign: false,
|
|
isMinusSign: false
|
|
};
|
|
var minusCharIndexOnText = text.search(this._minusSign);
|
|
this._minusSign.lastIndex = 0;
|
|
if (!this.allowMinusSign() && minusCharIndexOnText !== -1) {
|
|
return;
|
|
}
|
|
var selectionStart = this.$refs.input.$el.selectionStart;
|
|
var selectionEnd = this.$refs.input.$el.selectionEnd;
|
|
var inputValue = this.$refs.input.$el.value.trim();
|
|
var _this$getCharIndexes = this.getCharIndexes(inputValue), decimalCharIndex = _this$getCharIndexes.decimalCharIndex, minusCharIndex = _this$getCharIndexes.minusCharIndex, suffixCharIndex = _this$getCharIndexes.suffixCharIndex, currencyCharIndex = _this$getCharIndexes.currencyCharIndex;
|
|
var newValueStr;
|
|
if (sign.isMinusSign) {
|
|
var isNewMinusSign = minusCharIndex === -1;
|
|
if (selectionStart === 0 || selectionStart === currencyCharIndex + 1) {
|
|
newValueStr = inputValue;
|
|
if (isNewMinusSign || selectionEnd !== 0) {
|
|
newValueStr = this.insertText(inputValue, text, 0, selectionEnd);
|
|
}
|
|
this.updateValue(event, newValueStr, text, "insert");
|
|
}
|
|
} else if (sign.isDecimalSign) {
|
|
if (decimalCharIndex > 0 && selectionStart === decimalCharIndex) {
|
|
this.updateValue(event, inputValue, text, "insert");
|
|
} else if (decimalCharIndex > selectionStart && decimalCharIndex < selectionEnd) {
|
|
newValueStr = this.insertText(inputValue, text, selectionStart, selectionEnd);
|
|
this.updateValue(event, newValueStr, text, "insert");
|
|
} else if (decimalCharIndex === -1 && this.maxFractionDigits) {
|
|
newValueStr = this.insertText(inputValue, text, selectionStart, selectionEnd);
|
|
this.updateValue(event, newValueStr, text, "insert");
|
|
}
|
|
} else {
|
|
var maxFractionDigits2 = this.numberFormat.resolvedOptions().maximumFractionDigits;
|
|
var operation = selectionStart !== selectionEnd ? "range-insert" : "insert";
|
|
if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
|
|
if (selectionStart + text.length - (decimalCharIndex + 1) <= maxFractionDigits2) {
|
|
var charIndex = currencyCharIndex >= selectionStart ? currencyCharIndex - 1 : suffixCharIndex >= selectionStart ? suffixCharIndex : inputValue.length;
|
|
newValueStr = inputValue.slice(0, selectionStart) + text + inputValue.slice(selectionStart + text.length, charIndex) + inputValue.slice(charIndex);
|
|
this.updateValue(event, newValueStr, text, operation);
|
|
}
|
|
} else {
|
|
newValueStr = this.insertText(inputValue, text, selectionStart, selectionEnd);
|
|
this.updateValue(event, newValueStr, text, operation);
|
|
}
|
|
}
|
|
},
|
|
insertText: function insertText(value, text, start, end) {
|
|
var textSplit = text === "." ? text : text.split(".");
|
|
if (textSplit.length === 2) {
|
|
var decimalCharIndex = value.slice(start, end).search(this._decimal);
|
|
this._decimal.lastIndex = 0;
|
|
return decimalCharIndex > 0 ? value.slice(0, start) + this.formatValue(text) + value.slice(end) : this.formatValue(text) || value;
|
|
} else if (end - start === value.length) {
|
|
return this.formatValue(text);
|
|
} else if (start === 0) {
|
|
return text + value.slice(end);
|
|
} else if (end === value.length) {
|
|
return value.slice(0, start) + text;
|
|
} else {
|
|
return value.slice(0, start) + text + value.slice(end);
|
|
}
|
|
},
|
|
deleteRange: function deleteRange(value, start, end) {
|
|
var newValueStr;
|
|
if (end - start === value.length) newValueStr = "";
|
|
else if (start === 0) newValueStr = value.slice(end);
|
|
else if (end === value.length) newValueStr = value.slice(0, start);
|
|
else newValueStr = value.slice(0, start) + value.slice(end);
|
|
return newValueStr;
|
|
},
|
|
initCursor: function initCursor() {
|
|
var selectionStart = this.$refs.input.$el.selectionStart;
|
|
var inputValue = this.$refs.input.$el.value;
|
|
var valueLength = inputValue.length;
|
|
var index = null;
|
|
var prefixLength = (this.prefixChar || "").length;
|
|
inputValue = inputValue.replace(this._prefix, "");
|
|
selectionStart = selectionStart - prefixLength;
|
|
var _char4 = inputValue.charAt(selectionStart);
|
|
if (this.isNumeralChar(_char4)) {
|
|
return selectionStart + prefixLength;
|
|
}
|
|
var i2 = selectionStart - 1;
|
|
while (i2 >= 0) {
|
|
_char4 = inputValue.charAt(i2);
|
|
if (this.isNumeralChar(_char4)) {
|
|
index = i2 + prefixLength;
|
|
break;
|
|
} else {
|
|
i2--;
|
|
}
|
|
}
|
|
if (index !== null) {
|
|
this.$refs.input.$el.setSelectionRange(index + 1, index + 1);
|
|
} else {
|
|
i2 = selectionStart;
|
|
while (i2 < valueLength) {
|
|
_char4 = inputValue.charAt(i2);
|
|
if (this.isNumeralChar(_char4)) {
|
|
index = i2 + prefixLength;
|
|
break;
|
|
} else {
|
|
i2++;
|
|
}
|
|
}
|
|
if (index !== null) {
|
|
this.$refs.input.$el.setSelectionRange(index, index);
|
|
}
|
|
}
|
|
return index || 0;
|
|
},
|
|
onInputClick: function onInputClick() {
|
|
var currentValue = this.$refs.input.$el.value;
|
|
if (!this.readonly && currentValue !== Mt()) {
|
|
this.initCursor();
|
|
}
|
|
},
|
|
isNumeralChar: function isNumeralChar(_char5) {
|
|
if (_char5.length === 1 && (this._numeral.test(_char5) || this._decimal.test(_char5) || this._group.test(_char5) || this._minusSign.test(_char5))) {
|
|
this.resetRegex();
|
|
return true;
|
|
}
|
|
return false;
|
|
},
|
|
resetRegex: function resetRegex() {
|
|
this._numeral.lastIndex = 0;
|
|
this._decimal.lastIndex = 0;
|
|
this._group.lastIndex = 0;
|
|
this._minusSign.lastIndex = 0;
|
|
},
|
|
updateValue: function updateValue(event, valueStr, insertedValueStr, operation) {
|
|
var currentValue = this.$refs.input.$el.value;
|
|
var newValue = null;
|
|
if (valueStr != null) {
|
|
newValue = this.parseValue(valueStr);
|
|
newValue = !newValue && !this.allowEmpty ? 0 : newValue;
|
|
this.updateInput(newValue, insertedValueStr, operation, valueStr);
|
|
this.handleOnInput(event, currentValue, newValue);
|
|
}
|
|
},
|
|
handleOnInput: function handleOnInput(event, currentValue, newValue) {
|
|
if (this.isValueChanged(currentValue, newValue)) {
|
|
var _this$formField$onInp, _this$formField;
|
|
this.$emit("input", {
|
|
originalEvent: event,
|
|
value: newValue,
|
|
formattedValue: currentValue
|
|
});
|
|
(_this$formField$onInp = (_this$formField = this.formField).onInput) === null || _this$formField$onInp === void 0 || _this$formField$onInp.call(_this$formField, {
|
|
originalEvent: event,
|
|
value: newValue
|
|
});
|
|
}
|
|
},
|
|
isValueChanged: function isValueChanged(currentValue, newValue) {
|
|
if (newValue === null && currentValue !== null) {
|
|
return true;
|
|
}
|
|
if (newValue != null) {
|
|
var parsedCurrentValue = typeof currentValue === "string" ? this.parseValue(currentValue) : currentValue;
|
|
return newValue !== parsedCurrentValue;
|
|
}
|
|
return false;
|
|
},
|
|
validateValue: function validateValue(value) {
|
|
if (value === "-" || value == null) {
|
|
return null;
|
|
}
|
|
if (this.min != null && value < this.min) {
|
|
return this.min;
|
|
}
|
|
if (this.max != null && value > this.max) {
|
|
return this.max;
|
|
}
|
|
return value;
|
|
},
|
|
updateInput: function updateInput(value, insertedValueStr, operation, valueStr) {
|
|
var _this$$refs$clearIcon3;
|
|
insertedValueStr = insertedValueStr || "";
|
|
var inputValue = this.$refs.input.$el.value;
|
|
var newValue = this.formatValue(value);
|
|
var currentLength = inputValue.length;
|
|
if (newValue !== valueStr) {
|
|
newValue = this.concatValues(newValue, valueStr);
|
|
}
|
|
if (currentLength === 0) {
|
|
this.$refs.input.$el.value = newValue;
|
|
this.$refs.input.$el.setSelectionRange(0, 0);
|
|
var index = this.initCursor();
|
|
var selectionEnd = index + insertedValueStr.length;
|
|
this.$refs.input.$el.setSelectionRange(selectionEnd, selectionEnd);
|
|
} else {
|
|
var selectionStart = this.$refs.input.$el.selectionStart;
|
|
var _selectionEnd = this.$refs.input.$el.selectionEnd;
|
|
this.$refs.input.$el.value = newValue;
|
|
var newLength = newValue.length;
|
|
if (operation === "range-insert") {
|
|
var startValue = this.parseValue((inputValue || "").slice(0, selectionStart));
|
|
var startValueStr = startValue !== null ? startValue.toString() : "";
|
|
var startExpr = startValueStr.split("").join("(".concat(this.groupChar, ")?"));
|
|
var sRegex = new RegExp(startExpr, "g");
|
|
sRegex.test(newValue);
|
|
var tExpr = insertedValueStr.split("").join("(".concat(this.groupChar, ")?"));
|
|
var tRegex = new RegExp(tExpr, "g");
|
|
tRegex.test(newValue.slice(sRegex.lastIndex));
|
|
_selectionEnd = sRegex.lastIndex + tRegex.lastIndex;
|
|
this.$refs.input.$el.setSelectionRange(_selectionEnd, _selectionEnd);
|
|
} else if (newLength === currentLength) {
|
|
if (operation === "insert" || operation === "delete-back-single") {
|
|
this.$refs.input.$el.setSelectionRange(_selectionEnd + 1, _selectionEnd + 1);
|
|
} else if (operation === "delete-single") {
|
|
this.$refs.input.$el.setSelectionRange(_selectionEnd - 1, _selectionEnd - 1);
|
|
} else if (operation === "delete-range" || operation === "spin") {
|
|
this.$refs.input.$el.setSelectionRange(_selectionEnd, _selectionEnd);
|
|
}
|
|
} else if (operation === "delete-back-single") {
|
|
var prevChar = inputValue.charAt(_selectionEnd - 1);
|
|
var nextChar = inputValue.charAt(_selectionEnd);
|
|
var diff = currentLength - newLength;
|
|
var isGroupChar = this._group.test(nextChar);
|
|
if (isGroupChar && diff === 1) {
|
|
_selectionEnd += 1;
|
|
} else if (!isGroupChar && this.isNumeralChar(prevChar)) {
|
|
_selectionEnd += -1 * diff + 1;
|
|
}
|
|
this._group.lastIndex = 0;
|
|
this.$refs.input.$el.setSelectionRange(_selectionEnd, _selectionEnd);
|
|
} else if (inputValue === "-" && operation === "insert") {
|
|
this.$refs.input.$el.setSelectionRange(0, 0);
|
|
var _index = this.initCursor();
|
|
var _selectionEnd2 = _index + insertedValueStr.length + 1;
|
|
this.$refs.input.$el.setSelectionRange(_selectionEnd2, _selectionEnd2);
|
|
} else {
|
|
_selectionEnd = _selectionEnd + (newLength - currentLength);
|
|
this.$refs.input.$el.setSelectionRange(_selectionEnd, _selectionEnd);
|
|
}
|
|
}
|
|
this.$refs.input.$el.setAttribute("aria-valuenow", value);
|
|
if ((_this$$refs$clearIcon3 = this.$refs.clearIcon) !== null && _this$$refs$clearIcon3 !== void 0 && (_this$$refs$clearIcon3 = _this$$refs$clearIcon3.$el) !== null && _this$$refs$clearIcon3 !== void 0 && _this$$refs$clearIcon3.style) {
|
|
this.$refs.clearIcon.$el.style.display = l(newValue) ? "none" : "block";
|
|
}
|
|
},
|
|
concatValues: function concatValues(val1, val2) {
|
|
if (val1 && val2) {
|
|
var decimalCharIndex = val2.search(this._decimal);
|
|
this._decimal.lastIndex = 0;
|
|
if (this.suffixChar) {
|
|
return decimalCharIndex !== -1 ? val1.replace(this.suffixChar, "").split(this._decimal)[0] + val2.replace(this.suffixChar, "").slice(decimalCharIndex) + this.suffixChar : val1;
|
|
} else {
|
|
return decimalCharIndex !== -1 ? val1.split(this._decimal)[0] + val2.slice(decimalCharIndex) : val1;
|
|
}
|
|
}
|
|
return val1;
|
|
},
|
|
getDecimalLength: function getDecimalLength(value) {
|
|
if (value) {
|
|
var valueSplit = value.split(this._decimal);
|
|
if (valueSplit.length === 2) {
|
|
return valueSplit[1].replace(this._suffix, "").trim().replace(/\s/g, "").replace(this._currency, "").length;
|
|
}
|
|
}
|
|
return 0;
|
|
},
|
|
updateModel: function updateModel(event, value) {
|
|
this.writeValue(value, event);
|
|
},
|
|
onInputFocus: function onInputFocus(event) {
|
|
this.focused = true;
|
|
if (!this.disabled && !this.readonly && this.$refs.input.$el.value !== Mt() && this.highlightOnFocus) {
|
|
event.target.select();
|
|
}
|
|
this.$emit("focus", event);
|
|
},
|
|
onInputBlur: function onInputBlur(event) {
|
|
var _this$formField$onBlu, _this$formField2;
|
|
this.focused = false;
|
|
var input = event.target;
|
|
var newValue = this.validateValue(this.parseValue(input.value));
|
|
this.$emit("blur", {
|
|
originalEvent: event,
|
|
value: input.value
|
|
});
|
|
(_this$formField$onBlu = (_this$formField2 = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField2, event);
|
|
input.value = this.formatValue(newValue);
|
|
input.setAttribute("aria-valuenow", newValue);
|
|
this.updateModel(event, newValue);
|
|
if (!this.disabled && !this.readonly && this.highlightOnFocus) {
|
|
pt();
|
|
}
|
|
},
|
|
clearTimer: function clearTimer() {
|
|
if (this.timer) {
|
|
clearTimeout(this.timer);
|
|
}
|
|
},
|
|
maxBoundry: function maxBoundry() {
|
|
return this.d_value >= this.max;
|
|
},
|
|
minBoundry: function minBoundry() {
|
|
return this.d_value <= this.min;
|
|
}
|
|
},
|
|
computed: {
|
|
upButtonListeners: function upButtonListeners() {
|
|
var _this2 = this;
|
|
return {
|
|
mousedown: function mousedown(event) {
|
|
return _this2.onUpButtonMouseDown(event);
|
|
},
|
|
mouseup: function mouseup(event) {
|
|
return _this2.onUpButtonMouseUp(event);
|
|
},
|
|
mouseleave: function mouseleave(event) {
|
|
return _this2.onUpButtonMouseLeave(event);
|
|
},
|
|
keydown: function keydown(event) {
|
|
return _this2.onUpButtonKeyDown(event);
|
|
},
|
|
keyup: function keyup(event) {
|
|
return _this2.onUpButtonKeyUp(event);
|
|
}
|
|
};
|
|
},
|
|
downButtonListeners: function downButtonListeners() {
|
|
var _this3 = this;
|
|
return {
|
|
mousedown: function mousedown(event) {
|
|
return _this3.onDownButtonMouseDown(event);
|
|
},
|
|
mouseup: function mouseup(event) {
|
|
return _this3.onDownButtonMouseUp(event);
|
|
},
|
|
mouseleave: function mouseleave(event) {
|
|
return _this3.onDownButtonMouseLeave(event);
|
|
},
|
|
keydown: function keydown(event) {
|
|
return _this3.onDownButtonKeyDown(event);
|
|
},
|
|
keyup: function keyup(event) {
|
|
return _this3.onDownButtonKeyUp(event);
|
|
}
|
|
};
|
|
},
|
|
formattedValue: function formattedValue() {
|
|
var val = !this.d_value && !this.allowEmpty ? 0 : this.d_value;
|
|
return this.formatValue(val);
|
|
},
|
|
getFormatter: function getFormatter() {
|
|
return this.numberFormat;
|
|
},
|
|
dataP: function dataP4() {
|
|
return f(_defineProperty(_defineProperty({
|
|
invalid: this.$invalid,
|
|
fluid: this.$fluid,
|
|
filled: this.$variant === "filled"
|
|
}, this.size, this.size), this.buttonLayout, this.showButtons && this.buttonLayout));
|
|
}
|
|
},
|
|
components: {
|
|
InputText: script$6,
|
|
AngleUpIcon: script$4,
|
|
AngleDownIcon: script$5,
|
|
TimesIcon: script$3
|
|
}
|
|
};
|
|
var _hoisted_1$1 = ["data-p"];
|
|
var _hoisted_2$1 = ["data-p"];
|
|
var _hoisted_3$1 = ["disabled", "data-p"];
|
|
var _hoisted_4$1 = ["disabled", "data-p"];
|
|
var _hoisted_5$1 = ["disabled", "data-p"];
|
|
var _hoisted_6 = ["disabled", "data-p"];
|
|
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
var _component_InputText = resolveComponent("InputText");
|
|
var _component_TimesIcon = resolveComponent("TimesIcon");
|
|
return openBlock(), createElementBlock("span", mergeProps({
|
|
"class": _ctx.cx("root")
|
|
}, _ctx.ptmi("root"), {
|
|
"data-p": $options.dataP
|
|
}), [createVNode(_component_InputText, {
|
|
ref: "input",
|
|
id: _ctx.inputId,
|
|
name: _ctx.$formName,
|
|
role: "spinbutton",
|
|
"class": normalizeClass([_ctx.cx("pcInputText"), _ctx.inputClass]),
|
|
style: normalizeStyle(_ctx.inputStyle),
|
|
defaultValue: $options.formattedValue,
|
|
"aria-valuemin": _ctx.min,
|
|
"aria-valuemax": _ctx.max,
|
|
"aria-valuenow": _ctx.d_value,
|
|
inputmode: _ctx.mode === "decimal" && !_ctx.minFractionDigits ? "numeric" : "decimal",
|
|
disabled: _ctx.disabled,
|
|
readonly: _ctx.readonly,
|
|
placeholder: _ctx.placeholder,
|
|
"aria-labelledby": _ctx.ariaLabelledby,
|
|
"aria-label": _ctx.ariaLabel,
|
|
required: _ctx.required,
|
|
size: _ctx.size,
|
|
invalid: _ctx.invalid,
|
|
variant: _ctx.variant,
|
|
onInput: $options.onUserInput,
|
|
onKeydown: $options.onInputKeyDown,
|
|
onKeypress: $options.onInputKeyPress,
|
|
onPaste: $options.onPaste,
|
|
onClick: $options.onInputClick,
|
|
onFocus: $options.onInputFocus,
|
|
onBlur: $options.onInputBlur,
|
|
pt: _ctx.ptm("pcInputText"),
|
|
unstyled: _ctx.unstyled,
|
|
"data-p": $options.dataP
|
|
}, null, 8, ["id", "name", "class", "style", "defaultValue", "aria-valuemin", "aria-valuemax", "aria-valuenow", "inputmode", "disabled", "readonly", "placeholder", "aria-labelledby", "aria-label", "required", "size", "invalid", "variant", "onInput", "onKeydown", "onKeypress", "onPaste", "onClick", "onFocus", "onBlur", "pt", "unstyled", "data-p"]), _ctx.showClear && _ctx.buttonLayout !== "vertical" ? renderSlot(_ctx.$slots, "clearicon", {
|
|
key: 0,
|
|
"class": normalizeClass(_ctx.cx("clearIcon")),
|
|
clearCallback: $options.onClearClick
|
|
}, function() {
|
|
return [createVNode(_component_TimesIcon, mergeProps({
|
|
ref: "clearIcon",
|
|
"class": [_ctx.cx("clearIcon")],
|
|
onClick: $options.onClearClick
|
|
}, _ctx.ptm("clearIcon")), null, 16, ["class", "onClick"])];
|
|
}) : createCommentVNode("", true), _ctx.showButtons && _ctx.buttonLayout === "stacked" ? (openBlock(), createElementBlock("span", mergeProps({
|
|
key: 1,
|
|
"class": _ctx.cx("buttonGroup")
|
|
}, _ctx.ptm("buttonGroup"), {
|
|
"data-p": $options.dataP
|
|
}), [renderSlot(_ctx.$slots, "incrementbutton", {
|
|
listeners: $options.upButtonListeners
|
|
}, function() {
|
|
return [createBaseVNode("button", mergeProps({
|
|
"class": [_ctx.cx("incrementButton"), _ctx.incrementButtonClass]
|
|
}, toHandlers($options.upButtonListeners), {
|
|
disabled: _ctx.disabled,
|
|
tabindex: -1,
|
|
"aria-hidden": "true",
|
|
type: "button"
|
|
}, _ctx.ptm("incrementButton"), {
|
|
"data-p": $options.dataP
|
|
}), [renderSlot(_ctx.$slots, _ctx.$slots.incrementicon ? "incrementicon" : "incrementbuttonicon", {}, function() {
|
|
return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.incrementIcon || _ctx.incrementButtonIcon ? "span" : "AngleUpIcon"), mergeProps({
|
|
"class": [_ctx.incrementIcon, _ctx.incrementButtonIcon]
|
|
}, _ctx.ptm("incrementIcon"), {
|
|
"data-pc-section": "incrementicon"
|
|
}), null, 16, ["class"]))];
|
|
})], 16, _hoisted_3$1)];
|
|
}), renderSlot(_ctx.$slots, "decrementbutton", {
|
|
listeners: $options.downButtonListeners
|
|
}, function() {
|
|
return [createBaseVNode("button", mergeProps({
|
|
"class": [_ctx.cx("decrementButton"), _ctx.decrementButtonClass]
|
|
}, toHandlers($options.downButtonListeners), {
|
|
disabled: _ctx.disabled,
|
|
tabindex: -1,
|
|
"aria-hidden": "true",
|
|
type: "button"
|
|
}, _ctx.ptm("decrementButton"), {
|
|
"data-p": $options.dataP
|
|
}), [renderSlot(_ctx.$slots, _ctx.$slots.decrementicon ? "decrementicon" : "decrementbuttonicon", {}, function() {
|
|
return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.decrementIcon || _ctx.decrementButtonIcon ? "span" : "AngleDownIcon"), mergeProps({
|
|
"class": [_ctx.decrementIcon, _ctx.decrementButtonIcon]
|
|
}, _ctx.ptm("decrementIcon"), {
|
|
"data-pc-section": "decrementicon"
|
|
}), null, 16, ["class"]))];
|
|
})], 16, _hoisted_4$1)];
|
|
})], 16, _hoisted_2$1)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "incrementbutton", {
|
|
listeners: $options.upButtonListeners
|
|
}, function() {
|
|
return [_ctx.showButtons && _ctx.buttonLayout !== "stacked" ? (openBlock(), createElementBlock("button", mergeProps({
|
|
key: 0,
|
|
"class": [_ctx.cx("incrementButton"), _ctx.incrementButtonClass]
|
|
}, toHandlers($options.upButtonListeners), {
|
|
disabled: _ctx.disabled,
|
|
tabindex: -1,
|
|
"aria-hidden": "true",
|
|
type: "button"
|
|
}, _ctx.ptm("incrementButton"), {
|
|
"data-p": $options.dataP
|
|
}), [renderSlot(_ctx.$slots, _ctx.$slots.incrementicon ? "incrementicon" : "incrementbuttonicon", {}, function() {
|
|
return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.incrementIcon || _ctx.incrementButtonIcon ? "span" : "AngleUpIcon"), mergeProps({
|
|
"class": [_ctx.incrementIcon, _ctx.incrementButtonIcon]
|
|
}, _ctx.ptm("incrementIcon"), {
|
|
"data-pc-section": "incrementicon"
|
|
}), null, 16, ["class"]))];
|
|
})], 16, _hoisted_5$1)) : createCommentVNode("", true)];
|
|
}), renderSlot(_ctx.$slots, "decrementbutton", {
|
|
listeners: $options.downButtonListeners
|
|
}, function() {
|
|
return [_ctx.showButtons && _ctx.buttonLayout !== "stacked" ? (openBlock(), createElementBlock("button", mergeProps({
|
|
key: 0,
|
|
"class": [_ctx.cx("decrementButton"), _ctx.decrementButtonClass]
|
|
}, toHandlers($options.downButtonListeners), {
|
|
disabled: _ctx.disabled,
|
|
tabindex: -1,
|
|
"aria-hidden": "true",
|
|
type: "button"
|
|
}, _ctx.ptm("decrementButton"), {
|
|
"data-p": $options.dataP
|
|
}), [renderSlot(_ctx.$slots, _ctx.$slots.decrementicon ? "decrementicon" : "decrementbuttonicon", {}, function() {
|
|
return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.decrementIcon || _ctx.decrementButtonIcon ? "span" : "AngleDownIcon"), mergeProps({
|
|
"class": [_ctx.decrementIcon, _ctx.decrementButtonIcon]
|
|
}, _ctx.ptm("decrementIcon"), {
|
|
"data-pc-section": "decrementicon"
|
|
}), null, 16, ["class"]))];
|
|
})], 16, _hoisted_6)) : createCommentVNode("", true)];
|
|
})], 16, _hoisted_1$1);
|
|
}
|
|
script$2.render = render$1;
|
|
var style = "\n .p-card {\n background: dt('card.background');\n color: dt('card.color');\n box-shadow: dt('card.shadow');\n border-radius: dt('card.border.radius');\n display: flex;\n flex-direction: column;\n }\n\n .p-card-caption {\n display: flex;\n flex-direction: column;\n gap: dt('card.caption.gap');\n }\n\n .p-card-body {\n padding: dt('card.body.padding');\n display: flex;\n flex-direction: column;\n gap: dt('card.body.gap');\n }\n\n .p-card-title {\n font-size: dt('card.title.font.size');\n font-weight: dt('card.title.font.weight');\n }\n\n .p-card-subtitle {\n color: dt('card.subtitle.color');\n }\n";
|
|
var classes = {
|
|
root: "p-card p-component",
|
|
header: "p-card-header",
|
|
body: "p-card-body",
|
|
caption: "p-card-caption",
|
|
title: "p-card-title",
|
|
subtitle: "p-card-subtitle",
|
|
content: "p-card-content",
|
|
footer: "p-card-footer"
|
|
};
|
|
var CardStyle = BaseStyle.extend({
|
|
name: "card",
|
|
style,
|
|
classes
|
|
});
|
|
var script$1 = {
|
|
name: "BaseCard",
|
|
"extends": script$d,
|
|
style: CardStyle,
|
|
provide: function provide7() {
|
|
return {
|
|
$pcCard: this,
|
|
$parentInstance: this
|
|
};
|
|
}
|
|
};
|
|
var script = {
|
|
name: "Card",
|
|
"extends": script$1,
|
|
inheritAttrs: false
|
|
};
|
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return openBlock(), createElementBlock("div", mergeProps({
|
|
"class": _ctx.cx("root")
|
|
}, _ctx.ptmi("root")), [_ctx.$slots.header ? (openBlock(), createElementBlock("div", mergeProps({
|
|
key: 0,
|
|
"class": _ctx.cx("header")
|
|
}, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header")], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
|
|
"class": _ctx.cx("body")
|
|
}, _ctx.ptm("body")), [_ctx.$slots.title || _ctx.$slots.subtitle ? (openBlock(), createElementBlock("div", mergeProps({
|
|
key: 0,
|
|
"class": _ctx.cx("caption")
|
|
}, _ctx.ptm("caption")), [_ctx.$slots.title ? (openBlock(), createElementBlock("div", mergeProps({
|
|
key: 0,
|
|
"class": _ctx.cx("title")
|
|
}, _ctx.ptm("title")), [renderSlot(_ctx.$slots, "title")], 16)) : createCommentVNode("", true), _ctx.$slots.subtitle ? (openBlock(), createElementBlock("div", mergeProps({
|
|
key: 1,
|
|
"class": _ctx.cx("subtitle")
|
|
}, _ctx.ptm("subtitle")), [renderSlot(_ctx.$slots, "subtitle")], 16)) : createCommentVNode("", true)], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
|
|
"class": _ctx.cx("content")
|
|
}, _ctx.ptm("content")), [renderSlot(_ctx.$slots, "content")], 16), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", mergeProps({
|
|
key: 1,
|
|
"class": _ctx.cx("footer")
|
|
}, _ctx.ptm("footer")), [renderSlot(_ctx.$slots, "footer")], 16)) : createCommentVNode("", true)], 16)], 16);
|
|
}
|
|
script.render = render;
|
|
const _hoisted_1 = { class: "demo-widget-container" };
|
|
const _hoisted_2 = { class: "demo-content" };
|
|
const _hoisted_3 = { class: "input-group" };
|
|
const _hoisted_4 = { class: "input-group" };
|
|
const _hoisted_5 = { class: "button-group" };
|
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
__name: "DemoWidget",
|
|
props: {
|
|
widget: {},
|
|
node: {}
|
|
},
|
|
setup(__props) {
|
|
const props = __props;
|
|
const modelName = ref("");
|
|
const strength = ref(1);
|
|
const appliedValue = ref(null);
|
|
function handleApply() {
|
|
appliedValue.value = {
|
|
modelName: modelName.value,
|
|
strength: strength.value
|
|
};
|
|
console.log("Applied configuration:", appliedValue.value);
|
|
}
|
|
function handleReset() {
|
|
modelName.value = "";
|
|
strength.value = 1;
|
|
appliedValue.value = null;
|
|
console.log("Reset configuration");
|
|
}
|
|
onMounted(() => {
|
|
props.widget.serializeValue = async () => {
|
|
const value = appliedValue.value || { modelName: "", strength: 1 };
|
|
console.log("Serializing widget value:", value);
|
|
return value;
|
|
};
|
|
if (props.widget.value) {
|
|
const savedValue = props.widget.value;
|
|
modelName.value = savedValue.modelName || "";
|
|
strength.value = savedValue.strength || 1;
|
|
appliedValue.value = savedValue;
|
|
console.log("Restored widget value:", savedValue);
|
|
}
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
_cache[7] || (_cache[7] = createBaseVNode("h3", { class: "demo-title" }, "LoRA Manager Demo Widget", -1)),
|
|
createBaseVNode("div", _hoisted_2, [
|
|
createBaseVNode("div", _hoisted_3, [
|
|
_cache[2] || (_cache[2] = createBaseVNode("label", { for: "demo-input" }, "Model Name:", -1)),
|
|
createVNode(unref(script$6), {
|
|
id: "demo-input",
|
|
modelValue: modelName.value,
|
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelName.value = $event),
|
|
placeholder: "Enter model name...",
|
|
class: "demo-input"
|
|
}, null, 8, ["modelValue"])
|
|
]),
|
|
createBaseVNode("div", _hoisted_4, [
|
|
_cache[3] || (_cache[3] = createBaseVNode("label", { for: "strength-input" }, "Strength:", -1)),
|
|
createVNode(unref(script$2), {
|
|
id: "strength-input",
|
|
modelValue: strength.value,
|
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => strength.value = $event),
|
|
min: 0,
|
|
max: 2,
|
|
step: 0.1,
|
|
showButtons: "",
|
|
class: "demo-input"
|
|
}, null, 8, ["modelValue"])
|
|
]),
|
|
createBaseVNode("div", _hoisted_5, [
|
|
createVNode(unref(script$9), {
|
|
label: "Apply",
|
|
icon: "pi pi-check",
|
|
onClick: handleApply,
|
|
severity: "success"
|
|
}),
|
|
createVNode(unref(script$9), {
|
|
label: "Reset",
|
|
icon: "pi pi-refresh",
|
|
onClick: handleReset,
|
|
severity: "secondary"
|
|
})
|
|
]),
|
|
appliedValue.value ? (openBlock(), createBlock(unref(script), {
|
|
key: 0,
|
|
class: "result-card"
|
|
}, {
|
|
title: withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
createTextVNode("Current Configuration", -1)
|
|
])]),
|
|
content: withCtx(() => [
|
|
createBaseVNode("p", null, [
|
|
_cache[5] || (_cache[5] = createBaseVNode("strong", null, "Model:", -1)),
|
|
createTextVNode(" " + toDisplayString(appliedValue.value.modelName || "None"), 1)
|
|
]),
|
|
createBaseVNode("p", null, [
|
|
_cache[6] || (_cache[6] = createBaseVNode("strong", null, "Strength:", -1)),
|
|
createTextVNode(" " + toDisplayString(appliedValue.value.strength), 1)
|
|
])
|
|
]),
|
|
_: 1
|
|
})) : createCommentVNode("", true)
|
|
])
|
|
]);
|
|
};
|
|
}
|
|
});
|
|
const _export_sfc = (sfc, props) => {
|
|
const target = sfc.__vccOpts || sfc;
|
|
for (const [key, val] of props) {
|
|
target[key] = val;
|
|
}
|
|
return target;
|
|
};
|
|
const DemoWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-df0cb94d"]]);
|
|
const vueApps = /* @__PURE__ */ new Map();
|
|
function createVueWidget(node) {
|
|
const container = document.createElement("div");
|
|
container.id = `lora-manager-demo-widget-${node.id}`;
|
|
container.style.width = "100%";
|
|
container.style.height = "100%";
|
|
container.style.minHeight = "300px";
|
|
container.style.display = "flex";
|
|
container.style.flexDirection = "column";
|
|
container.style.overflow = "hidden";
|
|
const widget = node.addDOMWidget(
|
|
"lora_demo_widget",
|
|
"lora-manager-demo",
|
|
container,
|
|
{
|
|
getMinHeight: () => 320,
|
|
hideOnZoom: false,
|
|
serialize: true
|
|
}
|
|
);
|
|
const vueApp = createApp(DemoWidget, {
|
|
widget,
|
|
node
|
|
});
|
|
vueApp.use(PrimeVue);
|
|
vueApp.mount(container);
|
|
vueApps.set(node.id, vueApp);
|
|
widget.onRemove = () => {
|
|
const vueApp2 = vueApps.get(node.id);
|
|
if (vueApp2) {
|
|
vueApp2.unmount();
|
|
vueApps.delete(node.id);
|
|
}
|
|
};
|
|
return { widget };
|
|
}
|
|
app.registerExtension({
|
|
name: "comfyui.loramanager.demo",
|
|
getCustomWidgets() {
|
|
return {
|
|
// @ts-ignore
|
|
LORA_DEMO_WIDGET(node) {
|
|
return createVueWidget(node);
|
|
}
|
|
};
|
|
},
|
|
// @ts-ignore
|
|
nodeCreated(node) {
|
|
var _a;
|
|
if (((_a = node.constructor) == null ? void 0 : _a.comfyClass) !== "LoraManagerDemoNode") return;
|
|
const [oldWidth, oldHeight] = node.size;
|
|
node.setSize([Math.max(oldWidth, 350), Math.max(oldHeight, 400)]);
|
|
}
|
|
});
|
|
//# sourceMappingURL=demo-widget.js.map
|