quasar
Version:
Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
1,593 lines (1,570 loc) • 1.07 MB
JavaScript
/*!
* Quasar Framework v2.18.1
* (c) 2015-present Razvan Stoenescu
* Released under the MIT License.
*/
(() => {
var __defProp = Object.defineProperty;
var __export = (target2, all) => {
for (var name2 in all)
__defProp(target2, name2, { get: all[name2], enumerable: true });
};
// Search for vueNamedImportsCode in /ui/build :vue
var { h, ref, computed, watch, isRef, toRaw, unref, reactive, shallowReactive, nextTick, onActivated, onDeactivated, onBeforeMount, onMounted, onBeforeUnmount, onUnmounted, onBeforeUpdate, onUpdated, inject, provide, getCurrentInstance, markRaw, Transition, TransitionGroup, KeepAlive, Teleport, useSSRContext, withDirectives, vShow, defineComponent, createApp } = window.Vue;
// src/utils/private.inject-obj-prop/inject-obj-prop.js
function injectProp(target2, propName, get2, set2) {
Object.defineProperty(target2, propName, {
get: get2,
set: set2,
enumerable: true
});
return target2;
}
function injectMultipleProps(target2, props4) {
for (const key in props4) {
injectProp(target2, key, props4[key]);
}
return target2;
}
// src/plugins/platform/Platform.js
var isRuntimeSsrPreHydration = false ? { value: true } : ref(
false
);
var preHydrationBrowser;
function getMatch(userAgent2, platformMatch) {
const match = /(edg|edge|edga|edgios)\/([\w.]+)/.exec(userAgent2) || /(opr)[\/]([\w.]+)/.exec(userAgent2) || /(vivaldi)[\/]([\w.]+)/.exec(userAgent2) || /(chrome|crios)[\/]([\w.]+)/.exec(userAgent2) || /(version)(applewebkit)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(userAgent2) || /(webkit)[\/]([\w.]+).*(version)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(userAgent2) || /(firefox|fxios)[\/]([\w.]+)/.exec(userAgent2) || /(webkit)[\/]([\w.]+)/.exec(userAgent2) || /(opera)(?:.*version|)[\/]([\w.]+)/.exec(userAgent2) || [];
return {
browser: match[5] || match[3] || match[1] || "",
version: match[4] || match[2] || "0",
platform: platformMatch[0] || ""
};
}
function getPlatformMatch(userAgent2) {
return /(ipad)/.exec(userAgent2) || /(ipod)/.exec(userAgent2) || /(windows phone)/.exec(userAgent2) || /(iphone)/.exec(userAgent2) || /(kindle)/.exec(userAgent2) || /(silk)/.exec(userAgent2) || /(android)/.exec(userAgent2) || /(win)/.exec(userAgent2) || /(mac)/.exec(userAgent2) || /(linux)/.exec(userAgent2) || /(cros)/.exec(userAgent2) || /(playbook)/.exec(userAgent2) || /(bb)/.exec(userAgent2) || /(blackberry)/.exec(userAgent2) || [];
}
var hasTouch = false ? false : "ontouchstart" in window || window.navigator.maxTouchPoints > 0;
function getPlatform(UA) {
const userAgent2 = UA.toLowerCase();
const platformMatch = getPlatformMatch(userAgent2);
const matched = getMatch(userAgent2, platformMatch);
const browser = {
mobile: false,
desktop: false,
cordova: false,
capacitor: false,
nativeMobile: false,
// nativeMobileWrapper: void 0,
electron: false,
bex: false,
linux: false,
mac: false,
win: false,
cros: false,
chrome: false,
firefox: false,
opera: false,
safari: false,
vivaldi: false,
edge: false,
edgeChromium: false,
ie: false,
webkit: false,
android: false,
ios: false,
ipad: false,
iphone: false,
ipod: false,
kindle: false,
winphone: false,
blackberry: false,
playbook: false,
silk: false
};
if (matched.browser) {
browser[matched.browser] = true;
browser.version = matched.version;
browser.versionNumber = parseInt(matched.version, 10);
}
if (matched.platform) {
browser[matched.platform] = true;
}
const knownMobiles = browser.android || browser.ios || browser.bb || browser.blackberry || browser.ipad || browser.iphone || browser.ipod || browser.kindle || browser.playbook || browser.silk || browser["windows phone"];
if (knownMobiles === true || userAgent2.indexOf("mobile") !== -1) {
browser.mobile = true;
} else {
browser.desktop = true;
}
if (browser["windows phone"]) {
browser.winphone = true;
delete browser["windows phone"];
}
if (browser.edga || browser.edgios || browser.edg) {
browser.edge = true;
matched.browser = "edge";
} else if (browser.crios) {
browser.chrome = true;
matched.browser = "chrome";
} else if (browser.fxios) {
browser.firefox = true;
matched.browser = "firefox";
}
if (browser.ipod || browser.ipad || browser.iphone) {
browser.ios = true;
}
if (browser.vivaldi) {
matched.browser = "vivaldi";
browser.vivaldi = true;
}
if (
// Chrome, Opera 15+, Vivaldi and Safari are webkit based browsers
browser.chrome || browser.opr || browser.safari || browser.vivaldi || browser.mobile === true && browser.ios !== true && knownMobiles !== true
) {
browser.webkit = true;
}
if (browser.opr) {
matched.browser = "opera";
browser.opera = true;
}
if (browser.safari) {
if (browser.blackberry || browser.bb) {
matched.browser = "blackberry";
browser.blackberry = true;
} else if (browser.playbook) {
matched.browser = "playbook";
browser.playbook = true;
} else if (browser.android) {
matched.browser = "android";
browser.android = true;
} else if (browser.kindle) {
matched.browser = "kindle";
browser.kindle = true;
} else if (browser.silk) {
matched.browser = "silk";
browser.silk = true;
}
}
browser.name = matched.browser;
browser.platform = matched.platform;
if (true) {
if (userAgent2.indexOf("electron") !== -1) {
browser.electron = true;
} else if (document.location.href.indexOf("-extension://") !== -1) {
browser.bex = true;
} else {
if (window.Capacitor !== void 0) {
browser.capacitor = true;
browser.nativeMobile = true;
browser.nativeMobileWrapper = "capacitor";
} else if (window._cordovaNative !== void 0 || window.cordova !== void 0) {
browser.cordova = true;
browser.nativeMobile = true;
browser.nativeMobileWrapper = "cordova";
}
if (isRuntimeSsrPreHydration.value === true) {
preHydrationBrowser = { is: { ...browser } };
}
if (hasTouch === true && browser.mac === true && (browser.desktop === true && browser.safari === true || browser.nativeMobile === true && browser.android !== true && browser.ios !== true && browser.ipad !== true)) {
delete browser.mac;
delete browser.desktop;
const platform = Math.min(window.innerHeight, window.innerWidth) > 414 ? "ipad" : "iphone";
Object.assign(browser, {
mobile: true,
ios: true,
platform,
[platform]: true
});
}
if (browser.mobile !== true && window.navigator.userAgentData && window.navigator.userAgentData.mobile) {
delete browser.desktop;
browser.mobile = true;
}
}
}
return browser;
}
var userAgent = false ? "" : navigator.userAgent || navigator.vendor || window.opera;
var ssrClient = {
has: {
touch: false,
webStorage: false
},
within: { iframe: false }
};
var client = false ? ssrClient : {
userAgent,
is: getPlatform(userAgent),
has: {
touch: hasTouch
},
within: {
iframe: window.self !== window.top
}
};
var Platform = {
install(opts) {
const { $q } = opts;
if (false) {
$q.platform = this.parseSSR(opts.ssrContext);
} else if (isRuntimeSsrPreHydration.value === true) {
opts.onSSRHydrated.push(() => {
Object.assign($q.platform, client);
isRuntimeSsrPreHydration.value = false;
});
$q.platform = reactive(this);
} else {
$q.platform = this;
}
}
};
if (false) {
Platform.parseSSR = (ssrContext) => {
const userAgent2 = ssrContext.req.headers["user-agent"] || ssrContext.req.headers["User-Agent"] || "";
return {
...client,
userAgent: userAgent2,
is: getPlatform(userAgent2)
};
};
} else {
let hasWebStorage;
injectProp(client.has, "webStorage", () => {
if (hasWebStorage !== void 0) {
return hasWebStorage;
}
try {
if (window.localStorage) {
hasWebStorage = true;
return true;
}
} catch (_) {
}
hasWebStorage = false;
return false;
});
Object.assign(Platform, client);
if (isRuntimeSsrPreHydration.value === true) {
Object.assign(Platform, preHydrationBrowser, ssrClient);
preHydrationBrowser = null;
}
}
var Platform_default = Platform;
// src/utils/private.create/create.js
function createComponent(raw) {
return markRaw(defineComponent(raw));
}
function createDirective(raw) {
return markRaw(raw);
}
var createReactivePlugin = false ? (state, plugin) => {
Object.assign(plugin, state);
return plugin;
} : (state, plugin) => {
const reactiveState = reactive(state);
for (const name2 in state) {
injectProp(
plugin,
name2,
() => reactiveState[name2],
(val) => {
reactiveState[name2] = val;
}
);
}
return plugin;
};
// src/utils/event/event.js
var listenOpts = {
hasPassive: false,
passiveCapture: true,
notPassiveCapture: true
};
try {
const opts = Object.defineProperty({}, "passive", {
get() {
Object.assign(listenOpts, {
hasPassive: true,
passive: { passive: true },
notPassive: { passive: false },
passiveCapture: { passive: true, capture: true },
notPassiveCapture: { passive: false, capture: true }
});
}
});
window.addEventListener("qtest", null, opts);
window.removeEventListener("qtest", null, opts);
} catch (_) {
}
function noop() {
}
function leftClick(e) {
return e.button === 0;
}
function middleClick(e) {
return e.button === 1;
}
function rightClick(e) {
return e.button === 2;
}
function position(e) {
if (e.touches && e.touches[0]) {
e = e.touches[0];
} else if (e.changedTouches && e.changedTouches[0]) {
e = e.changedTouches[0];
} else if (e.targetTouches && e.targetTouches[0]) {
e = e.targetTouches[0];
}
return {
top: e.clientY,
left: e.clientX
};
}
function getEventPath(e) {
if (e.path) {
return e.path;
}
if (e.composedPath) {
return e.composedPath();
}
const path = [];
let el = e.target;
while (el) {
path.push(el);
if (el.tagName === "HTML") {
path.push(document);
path.push(window);
return path;
}
el = el.parentElement;
}
}
var LINE_HEIGHT = 40;
var PAGE_HEIGHT = 800;
function getMouseWheelDistance(e) {
let x = e.deltaX, y = e.deltaY;
if ((x || y) && e.deltaMode) {
const multiplier = e.deltaMode === 1 ? LINE_HEIGHT : PAGE_HEIGHT;
x *= multiplier;
y *= multiplier;
}
if (e.shiftKey && !x) {
[y, x] = [x, y];
}
return { x, y };
}
function stop(e) {
e.stopPropagation();
}
function prevent(e) {
e.cancelable !== false && e.preventDefault();
}
function stopAndPrevent(e) {
e.cancelable !== false && e.preventDefault();
e.stopPropagation();
}
function preventDraggable(el, status) {
if (el === void 0 || status === true && el.__dragPrevented === true) {
return;
}
const fn = status === true ? (el2) => {
el2.__dragPrevented = true;
el2.addEventListener("dragstart", prevent, listenOpts.notPassiveCapture);
} : (el2) => {
delete el2.__dragPrevented;
el2.removeEventListener("dragstart", prevent, listenOpts.notPassiveCapture);
};
el.querySelectorAll("a, img").forEach(fn);
}
function addEvt(ctx, targetName, events) {
const name2 = `__q_${targetName}_evt`;
ctx[name2] = ctx[name2] !== void 0 ? ctx[name2].concat(events) : events;
events.forEach((evt) => {
evt[0].addEventListener(evt[1], ctx[evt[2]], listenOpts[evt[3]]);
});
}
function cleanEvt(ctx, targetName) {
const name2 = `__q_${targetName}_evt`;
if (ctx[name2] !== void 0) {
ctx[name2].forEach((evt) => {
evt[0].removeEventListener(evt[1], ctx[evt[2]], listenOpts[evt[3]]);
});
ctx[name2] = void 0;
}
}
var event_default = {
listenOpts,
leftClick,
middleClick,
rightClick,
position,
getEventPath,
getMouseWheelDistance,
stop,
prevent,
stopAndPrevent,
preventDraggable
};
// src/utils/debounce/debounce.js
function debounce_default(fn, wait = 250, immediate) {
let timer2 = null;
function debounced() {
const args = arguments;
const later = () => {
timer2 = null;
if (immediate !== true) {
fn.apply(this, args);
}
};
if (timer2 !== null) {
clearTimeout(timer2);
} else if (immediate === true) {
fn.apply(this, args);
}
timer2 = setTimeout(later, wait);
}
debounced.cancel = () => {
timer2 !== null && clearTimeout(timer2);
};
return debounced;
}
// src/plugins/screen/Screen.js
var SIZE_LIST = ["sm", "md", "lg", "xl"];
var { passive } = listenOpts;
var Screen_default = createReactivePlugin({
width: 0,
height: 0,
name: "xs",
sizes: {
sm: 600,
md: 1024,
lg: 1440,
xl: 1920
},
lt: {
sm: true,
md: true,
lg: true,
xl: true
},
gt: {
xs: false,
sm: false,
md: false,
lg: false
},
xs: true,
sm: false,
md: false,
lg: false,
xl: false
}, {
setSizes: noop,
setDebounce: noop,
install({ $q, onSSRHydrated }) {
$q.screen = this;
if (false) return;
if (this.__installed === true) {
if ($q.config.screen !== void 0) {
if ($q.config.screen.bodyClasses === false) {
document.body.classList.remove(`screen--${this.name}`);
} else {
this.__update(true);
}
}
return;
}
const { visualViewport } = window;
const target2 = visualViewport || window;
const scrollingElement = document.scrollingElement || document.documentElement;
const getSize = visualViewport === void 0 || client.is.mobile === true ? () => [
Math.max(window.innerWidth, scrollingElement.clientWidth),
Math.max(window.innerHeight, scrollingElement.clientHeight)
] : () => [
visualViewport.width * visualViewport.scale + window.innerWidth - scrollingElement.clientWidth,
visualViewport.height * visualViewport.scale + window.innerHeight - scrollingElement.clientHeight
];
const classes = $q.config.screen?.bodyClasses === true;
this.__update = (force) => {
const [w, h2] = getSize();
if (h2 !== this.height) {
this.height = h2;
}
if (w !== this.width) {
this.width = w;
} else if (force !== true) {
return;
}
let s = this.sizes;
this.gt.xs = w >= s.sm;
this.gt.sm = w >= s.md;
this.gt.md = w >= s.lg;
this.gt.lg = w >= s.xl;
this.lt.sm = w < s.sm;
this.lt.md = w < s.md;
this.lt.lg = w < s.lg;
this.lt.xl = w < s.xl;
this.xs = this.lt.sm;
this.sm = this.gt.xs === true && this.lt.md === true;
this.md = this.gt.sm === true && this.lt.lg === true;
this.lg = this.gt.md === true && this.lt.xl === true;
this.xl = this.gt.lg;
s = this.xs === true && "xs" || this.sm === true && "sm" || this.md === true && "md" || this.lg === true && "lg" || "xl";
if (s !== this.name) {
if (classes === true) {
document.body.classList.remove(`screen--${this.name}`);
document.body.classList.add(`screen--${s}`);
}
this.name = s;
}
};
let updateEvt, updateSizes = {}, updateDebounce = 16;
this.setSizes = (sizes) => {
SIZE_LIST.forEach((name2) => {
if (sizes[name2] !== void 0) {
updateSizes[name2] = sizes[name2];
}
});
};
this.setDebounce = (deb) => {
updateDebounce = deb;
};
const start = () => {
const style2 = getComputedStyle(document.body);
if (style2.getPropertyValue("--q-size-sm")) {
SIZE_LIST.forEach((name2) => {
this.sizes[name2] = parseInt(style2.getPropertyValue(`--q-size-${name2}`), 10);
});
}
this.setSizes = (sizes) => {
SIZE_LIST.forEach((name2) => {
if (sizes[name2]) {
this.sizes[name2] = sizes[name2];
}
});
this.__update(true);
};
this.setDebounce = (delay) => {
updateEvt !== void 0 && target2.removeEventListener("resize", updateEvt, passive);
updateEvt = delay > 0 ? debounce_default(this.__update, delay) : this.__update;
target2.addEventListener("resize", updateEvt, passive);
};
this.setDebounce(updateDebounce);
if (Object.keys(updateSizes).length !== 0) {
this.setSizes(updateSizes);
updateSizes = void 0;
} else {
this.__update();
}
classes === true && this.name === "xs" && document.body.classList.add("screen--xs");
};
if (isRuntimeSsrPreHydration.value === true) {
onSSRHydrated.push(start);
} else {
start();
}
}
});
// src/plugins/dark/Dark.js
var Plugin = createReactivePlugin({
isActive: false,
mode: false
}, {
__media: void 0,
set(val) {
if (false) return;
Plugin.mode = val;
if (val === "auto") {
if (Plugin.__media === void 0) {
Plugin.__media = window.matchMedia("(prefers-color-scheme: dark)");
Plugin.__updateMedia = () => {
Plugin.set("auto");
};
Plugin.__media.addListener(Plugin.__updateMedia);
}
val = Plugin.__media.matches;
} else if (Plugin.__media !== void 0) {
Plugin.__media.removeListener(Plugin.__updateMedia);
Plugin.__media = void 0;
}
Plugin.isActive = val === true;
document.body.classList.remove(`body--${val === true ? "light" : "dark"}`);
document.body.classList.add(`body--${val === true ? "dark" : "light"}`);
},
toggle() {
if (true) {
Plugin.set(Plugin.isActive === false);
}
},
install({ $q, ssrContext }) {
const { dark } = $q.config;
if (false) {
this.isActive = dark === true;
$q.dark = {
isActive: false,
mode: false,
set: (val) => {
ssrContext._meta.bodyClasses = ssrContext._meta.bodyClasses.replace(" body--light", "").replace(" body--dark", "") + ` body--${val === true ? "dark" : "light"}`;
$q.dark.isActive = val === true;
$q.dark.mode = val;
},
toggle: () => {
$q.dark.set($q.dark.isActive === false);
}
};
$q.dark.set(dark);
return;
}
$q.dark = this;
if (this.__installed !== true) {
this.set(dark !== void 0 ? dark : false);
}
}
});
var Dark_default = Plugin;
// src/utils/css-var/set-css-var.js
function setCssVar(propName, value2, element = document.body) {
if (typeof propName !== "string") {
throw new TypeError("Expected a string as propName");
}
if (typeof value2 !== "string") {
throw new TypeError("Expected a string as value");
}
if (!(element instanceof Element)) {
throw new TypeError("Expected a DOM element");
}
element.style.setProperty(`--q-${propName}`, value2);
}
// src/utils/private.keyboard/key-composition.js
var lastKeyCompositionStatus = false;
function onKeyDownComposition(evt) {
lastKeyCompositionStatus = evt.isComposing === true;
}
function shouldIgnoreKey(evt) {
return lastKeyCompositionStatus === true || evt !== Object(evt) || evt.isComposing === true || evt.qKeyEvent === true;
}
function isKeyCode(evt, keyCodes4) {
return shouldIgnoreKey(evt) === true ? false : [].concat(keyCodes4).includes(evt.keyCode);
}
// src/plugins/private.body/Body.js
function getMobilePlatform(is) {
if (is.ios === true) return "ios";
if (is.android === true) return "android";
}
function getBodyClasses({ is, has: has2, within }, cfg) {
const cls = [
is.desktop === true ? "desktop" : "mobile",
`${has2.touch === false ? "no-" : ""}touch`
];
if (is.mobile === true) {
const mobile = getMobilePlatform(is);
mobile !== void 0 && cls.push("platform-" + mobile);
}
if (is.nativeMobile === true) {
const type = is.nativeMobileWrapper;
cls.push(type);
cls.push("native-mobile");
if (is.ios === true && (cfg[type] === void 0 || cfg[type].iosStatusBarPadding !== false)) {
cls.push("q-ios-padding");
}
} else if (is.electron === true) {
cls.push("electron");
} else if (is.bex === true) {
cls.push("bex");
}
within.iframe === true && cls.push("within-iframe");
return cls;
}
function applyClientSsrCorrections() {
const { is } = client;
const classes = document.body.className;
const classList = new Set(classes.replace(/ {2}/g, " ").split(" "));
if (is.nativeMobile !== true && is.electron !== true && is.bex !== true) {
if (is.desktop === true) {
classList.delete("mobile");
classList.delete("platform-ios");
classList.delete("platform-android");
classList.add("desktop");
} else if (is.mobile === true) {
classList.delete("desktop");
classList.add("mobile");
classList.delete("platform-ios");
classList.delete("platform-android");
const mobile = getMobilePlatform(is);
if (mobile !== void 0) {
classList.add(`platform-${mobile}`);
}
}
}
if (client.has.touch === true) {
classList.delete("no-touch");
classList.add("touch");
}
if (client.within.iframe === true) {
classList.add("within-iframe");
}
const newCls = Array.from(classList).join(" ");
if (classes !== newCls) {
document.body.className = newCls;
}
}
function setColors(brand) {
for (const color in brand) {
setCssVar(color, brand[color]);
}
}
var Body_default = {
install(opts) {
if (false) {
const { $q, ssrContext } = opts;
const cls = getBodyClasses($q.platform, $q.config);
if ($q.config.screen?.bodyClass === true) {
cls.push("screen--xs");
}
ssrContext._meta.bodyClasses += cls.join(" ");
const brand = $q.config.brand;
if (brand !== void 0) {
const vars = Object.keys(brand).map((key) => `--q-${key}:${brand[key]};`).join("");
ssrContext._meta.endingHeadTags += `<style>:root{${vars}}</style>`;
}
return;
}
if (this.__installed === true) return;
if (isRuntimeSsrPreHydration.value === true) {
applyClientSsrCorrections();
} else {
const { $q } = opts;
$q.config.brand !== void 0 && setColors($q.config.brand);
const cls = getBodyClasses(client, $q.config);
document.body.classList.add.apply(document.body.classList, cls);
}
if (client.is.ios === true) {
document.body.addEventListener("touchstart", noop);
}
window.addEventListener("keydown", onKeyDownComposition, true);
}
};
// src/plugins/private.history/History.js
var getTrue = () => true;
function filterInvalidPath(path) {
return typeof path === "string" && path !== "" && path !== "/" && path !== "#/";
}
function normalizeExitPath(path) {
path.startsWith("#") === true && (path = path.substring(1));
path.startsWith("/") === false && (path = "/" + path);
path.endsWith("/") === true && (path = path.substring(0, path.length - 1));
return "#" + path;
}
function getShouldExitFn(cfg) {
if (cfg.backButtonExit === false) {
return () => false;
}
if (cfg.backButtonExit === "*") {
return getTrue;
}
const exitPaths = ["#/"];
Array.isArray(cfg.backButtonExit) === true && exitPaths.push(
...cfg.backButtonExit.filter(filterInvalidPath).map(normalizeExitPath)
);
return () => exitPaths.includes(window.location.hash);
}
var History_default = {
__history: [],
add: noop,
remove: noop,
install({ $q }) {
if (this.__installed === true) return;
const { cordova: cordova2, capacitor } = client.is;
if (cordova2 !== true && capacitor !== true) return;
const qConf = $q.config[cordova2 === true ? "cordova" : "capacitor"];
if (qConf?.backButton === false) return;
if (
// if we're on Capacitor mode
capacitor === true && (window.Capacitor === void 0 || window.Capacitor.Plugins.App === void 0)
) return;
this.add = (entry) => {
if (entry.condition === void 0) {
entry.condition = getTrue;
}
this.__history.push(entry);
};
this.remove = (entry) => {
const index = this.__history.indexOf(entry);
if (index >= 0) {
this.__history.splice(index, 1);
}
};
const shouldExit = getShouldExitFn(
Object.assign(
{ backButtonExit: true },
qConf
)
);
const backHandler = () => {
if (this.__history.length) {
const entry = this.__history[this.__history.length - 1];
if (entry.condition() === true) {
this.__history.pop();
entry.handler();
}
} else if (shouldExit() === true) {
navigator.app.exitApp();
} else {
window.history.back();
}
};
if (cordova2 === true) {
document.addEventListener("deviceready", () => {
document.addEventListener("backbutton", backHandler, false);
});
} else {
window.Capacitor.Plugins.App.addListener("backButton", backHandler);
}
}
};
// lang/en-US.js
var en_US_default = {
isoName: "en-US",
nativeName: "English (US)",
label: {
clear: "Clear",
ok: "OK",
cancel: "Cancel",
close: "Close",
set: "Set",
select: "Select",
reset: "Reset",
remove: "Remove",
update: "Update",
create: "Create",
search: "Search",
filter: "Filter",
refresh: "Refresh",
expand: (label) => label ? `Expand "${label}"` : "Expand",
collapse: (label) => label ? `Collapse "${label}"` : "Collapse"
},
date: {
days: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
daysShort: "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
monthsShort: "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
firstDayOfWeek: 0,
// 0-6, 0 - Sunday, 1 Monday, ...
format24h: false,
pluralDay: "days",
prevMonth: "Previous month",
nextMonth: "Next month",
prevYear: "Previous year",
nextYear: "Next year",
today: "Today",
prevRangeYears: (range) => `Previous ${range} years`,
nextRangeYears: (range) => `Next ${range} years`
},
table: {
noData: "No data available",
noResults: "No matching records found",
loading: "Loading...",
selectedRecords: (rows) => rows === 1 ? "1 record selected." : (rows === 0 ? "No" : rows) + " records selected.",
recordsPerPage: "Records per page:",
allRows: "All",
pagination: (start, end, total) => start + "-" + end + " of " + total,
columns: "Columns"
},
pagination: {
first: "First page",
prev: "Previous page",
next: "Next page",
last: "Last page"
},
editor: {
url: "URL",
bold: "Bold",
italic: "Italic",
strikethrough: "Strikethrough",
underline: "Underline",
unorderedList: "Unordered List",
orderedList: "Ordered List",
subscript: "Subscript",
superscript: "Superscript",
hyperlink: "Hyperlink",
toggleFullscreen: "Toggle Fullscreen",
quote: "Quote",
left: "Left align",
center: "Center align",
right: "Right align",
justify: "Justify align",
print: "Print",
outdent: "Decrease indentation",
indent: "Increase indentation",
removeFormat: "Remove formatting",
formatting: "Formatting",
fontSize: "Font Size",
align: "Align",
hr: "Insert Horizontal Rule",
undo: "Undo",
redo: "Redo",
heading1: "Heading 1",
heading2: "Heading 2",
heading3: "Heading 3",
heading4: "Heading 4",
heading5: "Heading 5",
heading6: "Heading 6",
paragraph: "Paragraph",
code: "Code",
size1: "Very small",
size2: "A bit small",
size3: "Normal",
size4: "Medium-large",
size5: "Big",
size6: "Very big",
size7: "Maximum",
defaultFont: "Default Font",
viewSource: "View Source"
},
tree: {
noNodes: "No nodes available",
noResults: "No matching nodes found"
}
};
// src/plugins/lang/Lang.js
function getLocale() {
if (false) return;
const val = Array.isArray(navigator.languages) === true && navigator.languages.length !== 0 ? navigator.languages[0] : navigator.language;
if (typeof val === "string") {
return val.split(/[-_]/).map((v, i) => i === 0 ? v.toLowerCase() : i > 1 || v.length < 4 ? v.toUpperCase() : v[0].toUpperCase() + v.slice(1).toLowerCase()).join("-");
}
}
var Plugin2 = createReactivePlugin({
__qLang: {}
}, {
// props: object
// __langConfig: object
getLocale,
set(langObject = en_US_default, ssrContext) {
const lang = {
...langObject,
rtl: langObject.rtl === true,
getLocale
};
if (false) {
if (ssrContext === void 0) {
console.error("SSR ERROR: second param required: Lang.set(lang, ssrContext)");
return;
}
lang.set = ssrContext.$q.lang.set;
if (ssrContext.$q.config.lang === void 0 || ssrContext.$q.config.lang.noHtmlAttrs !== true) {
const dir = lang.rtl === true ? "rtl" : "ltr";
const attrs = `lang=${lang.isoName} dir=${dir}`;
ssrContext._meta.htmlAttrs = ssrContext.__qPrevLang !== void 0 ? ssrContext._meta.htmlAttrs.replace(ssrContext.__qPrevLang, attrs) : attrs;
ssrContext.__qPrevLang = attrs;
}
ssrContext.$q.lang = lang;
} else {
lang.set = Plugin2.set;
if (Plugin2.__langConfig === void 0 || Plugin2.__langConfig.noHtmlAttrs !== true) {
const el = document.documentElement;
el.setAttribute("dir", lang.rtl === true ? "rtl" : "ltr");
el.setAttribute("lang", lang.isoName);
}
Object.assign(Plugin2.__qLang, lang);
}
},
install({ $q, lang, ssrContext }) {
if (false) {
const initialLang = lang || en_US_default;
$q.lang = {};
$q.lang.set = (langObject) => {
this.set(langObject, ssrContext);
};
$q.lang.set(initialLang);
if (this.props === void 0 || this.props.isoName !== initialLang.isoName) {
this.props = { ...initialLang };
}
} else {
$q.lang = Plugin2.__qLang;
Plugin2.__langConfig = $q.config.lang;
if (this.__installed === true) {
lang !== void 0 && this.set(lang);
} else {
this.props = new Proxy(this.__qLang, {
get() {
return Reflect.get(...arguments);
},
ownKeys(target2) {
return Reflect.ownKeys(target2).filter((key) => key !== "set" && key !== "getLocale");
}
});
this.set(lang || en_US_default);
}
}
}
});
var Lang_default = Plugin2;
// icon-set/material-icons.js
var material_icons_default = {
name: "material-icons",
type: {
positive: "check_circle",
negative: "warning",
info: "info",
warning: "priority_high"
},
arrow: {
up: "arrow_upward",
right: "arrow_forward",
down: "arrow_downward",
left: "arrow_back",
dropdown: "arrow_drop_down"
},
chevron: {
left: "chevron_left",
right: "chevron_right"
},
colorPicker: {
spectrum: "gradient",
tune: "tune",
palette: "style"
},
pullToRefresh: {
icon: "refresh"
},
carousel: {
left: "chevron_left",
right: "chevron_right",
up: "keyboard_arrow_up",
down: "keyboard_arrow_down",
navigationIcon: "lens"
},
chip: {
remove: "cancel",
selected: "check"
},
datetime: {
arrowLeft: "chevron_left",
arrowRight: "chevron_right",
now: "access_time",
today: "today"
},
editor: {
bold: "format_bold",
italic: "format_italic",
strikethrough: "strikethrough_s",
underline: "format_underlined",
unorderedList: "format_list_bulleted",
orderedList: "format_list_numbered",
subscript: "vertical_align_bottom",
superscript: "vertical_align_top",
hyperlink: "link",
toggleFullscreen: "fullscreen",
quote: "format_quote",
left: "format_align_left",
center: "format_align_center",
right: "format_align_right",
justify: "format_align_justify",
print: "print",
outdent: "format_indent_decrease",
indent: "format_indent_increase",
removeFormat: "format_clear",
formatting: "text_format",
fontSize: "format_size",
align: "format_align_left",
hr: "remove",
undo: "undo",
redo: "redo",
heading: "format_size",
code: "code",
size: "format_size",
font: "font_download",
viewSource: "code"
},
expansionItem: {
icon: "keyboard_arrow_down",
denseIcon: "arrow_drop_down"
},
fab: {
icon: "add",
activeIcon: "close"
},
field: {
clear: "cancel",
error: "error"
},
pagination: {
first: "first_page",
prev: "keyboard_arrow_left",
next: "keyboard_arrow_right",
last: "last_page"
},
rating: {
icon: "grade"
},
stepper: {
done: "check",
active: "edit",
error: "warning"
},
tabs: {
left: "chevron_left",
right: "chevron_right",
up: "keyboard_arrow_up",
down: "keyboard_arrow_down"
},
table: {
arrowUp: "arrow_upward",
warning: "warning",
firstPage: "first_page",
prevPage: "chevron_left",
nextPage: "chevron_right",
lastPage: "last_page"
},
tree: {
icon: "play_arrow"
},
uploader: {
done: "done",
clear: "clear",
add: "add_box",
upload: "cloud_upload",
removeQueue: "clear_all",
removeUploaded: "done_all"
}
};
// src/plugins/icon-set/IconSet.js
var Plugin3 = createReactivePlugin({
iconMapFn: null,
__qIconSet: {}
}, {
// props: object
set(setObject, ssrContext) {
const def = { ...setObject };
if (false) {
if (ssrContext === void 0) {
console.error("SSR ERROR: second param required: IconSet.set(iconSet, ssrContext)");
return;
}
def.set = ssrContext.$q.iconSet.set;
Object.assign(ssrContext.$q.iconSet, def);
} else {
def.set = Plugin3.set;
Object.assign(Plugin3.__qIconSet, def);
}
},
install({ $q, iconSet, ssrContext }) {
if (false) {
const initialSet = iconSet || material_icons_default;
$q.iconMapFn = ssrContext.$q.config.iconMapFn || this.iconMapFn || null;
$q.iconSet = {};
$q.iconSet.set = (setObject) => {
this.set(setObject, ssrContext);
};
$q.iconSet.set(initialSet);
if (this.props === void 0 || this.props.name !== initialSet.name) {
this.props = { ...initialSet };
}
} else {
if ($q.config.iconMapFn !== void 0) {
this.iconMapFn = $q.config.iconMapFn;
}
$q.iconSet = this.__qIconSet;
injectProp($q, "iconMapFn", () => this.iconMapFn, (val) => {
this.iconMapFn = val;
});
if (this.__installed === true) {
iconSet !== void 0 && this.set(iconSet);
} else {
this.props = new Proxy(this.__qIconSet, {
get() {
return Reflect.get(...arguments);
},
ownKeys(target2) {
return Reflect.ownKeys(target2).filter((key) => key !== "set");
}
});
this.set(iconSet || material_icons_default);
}
}
}
});
var IconSet_default = Plugin3;
// src/utils/private.symbols/symbols.js
var quasarKey = "_q_";
var timelineKey = "_q_t_";
var stepperKey = "_q_s_";
var layoutKey = "_q_l_";
var pageContainerKey = "_q_pc_";
var fabKey = "_q_f_";
var formKey = "_q_fo_";
var tabsKey = "_q_tabs_";
var uploaderKey = "_q_u_";
function emptyRenderFn() {
}
// src/utils/private.config/instance-config.js
var globalConfig = {};
var globalConfigIsFrozen = false;
function freezeGlobalConfig() {
globalConfigIsFrozen = true;
}
// src/utils/is/is.js
function isDeepEqual(a, b) {
if (a === b) {
return true;
}
if (a !== null && b !== null && typeof a === "object" && typeof b === "object") {
if (a.constructor !== b.constructor) {
return false;
}
let length, i;
if (a.constructor === Array) {
length = a.length;
if (length !== b.length) {
return false;
}
for (i = length; i-- !== 0; ) {
if (isDeepEqual(a[i], b[i]) !== true) {
return false;
}
}
return true;
}
if (a.constructor === Map) {
if (a.size !== b.size) {
return false;
}
let iter = a.entries();
i = iter.next();
while (i.done !== true) {
if (b.has(i.value[0]) !== true) {
return false;
}
i = iter.next();
}
iter = a.entries();
i = iter.next();
while (i.done !== true) {
if (isDeepEqual(i.value[1], b.get(i.value[0])) !== true) {
return false;
}
i = iter.next();
}
return true;
}
if (a.constructor === Set) {
if (a.size !== b.size) {
return false;
}
const iter = a.entries();
i = iter.next();
while (i.done !== true) {
if (b.has(i.value[0]) !== true) {
return false;
}
i = iter.next();
}
return true;
}
if (a.buffer != null && a.buffer.constructor === ArrayBuffer) {
length = a.length;
if (length !== b.length) {
return false;
}
for (i = length; i-- !== 0; ) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
}
if (a.constructor === RegExp) {
return a.source === b.source && a.flags === b.flags;
}
if (a.valueOf !== Object.prototype.valueOf) {
return a.valueOf() === b.valueOf();
}
if (a.toString !== Object.prototype.toString) {
return a.toString() === b.toString();
}
const keys = Object.keys(a).filter((key) => a[key] !== void 0);
length = keys.length;
if (length !== Object.keys(b).filter((key) => b[key] !== void 0).length) {
return false;
}
for (i = length; i-- !== 0; ) {
const key = keys[i];
if (isDeepEqual(a[key], b[key]) !== true) {
return false;
}
}
return true;
}
return a !== a && b !== b;
}
function isObject(v) {
return v !== null && typeof v === "object" && Array.isArray(v) !== true;
}
function isDate(v) {
return Object.prototype.toString.call(v) === "[object Date]";
}
function isRegexp(v) {
return Object.prototype.toString.call(v) === "[object RegExp]";
}
function isNumber(v) {
return typeof v === "number" && isFinite(v);
}
var is_default = {
deepEqual: isDeepEqual,
object: isObject,
date: isDate,
regexp: isRegexp,
number: isNumber
};
// src/install-quasar.js
var autoInstalledPlugins = [
Platform_default,
Body_default,
Dark_default,
Screen_default,
History_default,
Lang_default,
IconSet_default
];
function createChildApp(appCfg, parentApp) {
const app2 = createApp(appCfg);
app2.config.globalProperties = parentApp.config.globalProperties;
const { reload, ...appContext } = parentApp._context;
Object.assign(app2._context, appContext);
return app2;
}
function installPlugins(pluginOpts, pluginList) {
pluginList.forEach((Plugin11) => {
Plugin11.install(pluginOpts);
Plugin11.__installed = true;
});
}
function prepareApp(app2, uiOpts, pluginOpts) {
app2.config.globalProperties.$q = pluginOpts.$q;
app2.provide(quasarKey, pluginOpts.$q);
installPlugins(pluginOpts, autoInstalledPlugins);
uiOpts.components !== void 0 && Object.values(uiOpts.components).forEach((c) => {
if (isObject(c) === true && c.name !== void 0) {
app2.component(c.name, c);
}
});
uiOpts.directives !== void 0 && Object.values(uiOpts.directives).forEach((d) => {
if (isObject(d) === true && d.name !== void 0) {
app2.directive(d.name, d);
}
});
uiOpts.plugins !== void 0 && installPlugins(
pluginOpts,
Object.values(uiOpts.plugins).filter(
(p) => typeof p.install === "function" && autoInstalledPlugins.includes(p) === false
)
);
if (isRuntimeSsrPreHydration.value === true) {
pluginOpts.$q.onSSRHydrated = () => {
pluginOpts.onSSRHydrated.forEach((fn) => {
fn();
});
pluginOpts.$q.onSSRHydrated = () => {
};
};
}
}
var install_quasar_default = false ? function(parentApp, opts = {}, ssrContext) {
const $q = {
version: "2.18.1",
config: opts.config || {}
};
Object.assign(ssrContext, {
$q,
_meta: {
htmlAttrs: "",
headTags: "",
endingHeadTags: "",
bodyClasses: "",
bodyAttrs: "data-server-rendered",
bodyTags: ""
}
});
if (ssrContext._modules === void 0) {
ssrContext._modules = [];
}
if (ssrContext.onRendered === void 0) {
ssrContext.onRendered = () => {
};
}
parentApp.config.globalProperties.ssrContext = ssrContext;
prepareApp(parentApp, opts, {
parentApp,
$q,
lang: opts.lang,
iconSet: opts.iconSet,
ssrContext
});
} : function(parentApp, opts = {}) {
const $q = { version: "2.18.1" };
if (globalConfigIsFrozen === false) {
if (opts.config !== void 0) {
Object.assign(globalConfig, opts.config);
}
$q.config = { ...globalConfig };
freezeGlobalConfig();
} else {
$q.config = opts.config || {};
}
prepareApp(parentApp, opts, {
parentApp,
$q,
lang: opts.lang,
iconSet: opts.iconSet,
onSSRHydrated: []
});
};
// src/components.js
var components_exports = {};
__export(components_exports, {
QAjaxBar: () => QAjaxBar_default,
QAvatar: () => QAvatar_default,
QBadge: () => QBadge_default,
QBanner: () => QBanner_default,
QBar: () => QBar_default,
QBreadcrumbs: () => QBreadcrumbs_default,
QBreadcrumbsEl: () => QBreadcrumbsEl_default,
QBtn: () => QBtn_default,
QBtnDropdown: () => QBtnDropdown_default,
QBtnGroup: () => QBtnGroup_default,
QBtnToggle: () => QBtnToggle_default,
QCard: () => QCard_default,
QCardActions: () => QCardActions_default,
QCardSection: () => QCardSection_default,
QCarousel: () => QCarousel_default,
QCarouselControl: () => QCarouselControl_default,
QCarouselSlide: () => QCarouselSlide_default,
QChatMessage: () => QChatMessage_default,
QCheckbox: () => QCheckbox_default,
QChip: () => QChip_default,
QCircularProgress: () => QCircularProgress_default,
QColor: () => QColor_default,
QDate: () => QDate_default,
QDialog: () => QDialog_default,
QDrawer: () => QDrawer_default,
QEditor: () => QEditor_default,
QExpansionItem: () => QExpansionItem_default,
QFab: () => QFab_default,
QFabAction: () => QFabAction_default,
QField: () => QField_default,
QFile: () => QFile_default,
QFooter: () => QFooter_default,
QForm: () => QForm_default,
QFormChildMixin: () => QFormChildMixin_default,
QHeader: () => QHeader_default,
QIcon: () => QIcon_default,
QImg: () => QImg_default,
QInfiniteScroll: () => QInfiniteScroll_default,
QInnerLoading: () => QInnerLoading_default,
QInput: () => QInput_default,
QIntersection: () => QIntersection_default,
QItem: () => QItem_default,
QItemLabel: () => QItemLabel_default,
QItemSection: () => QItemSection_default,
QKnob: () => QKnob_default,
QLayout: () => QLayout_default,
QLinearProgress: () => QLinearProgress_default,
QList: () => QList_default,
QMarkupTable: () => QMarkupTable_default,
QMenu: () => QMenu_default,
QNoSsr: () => QNoSsr_default,
QOptionGroup: () => QOptionGroup_default,
QPage: () => QPage_default,
QPageContainer: () => QPageContainer_default,
QPageScroller: () => QPageScroller_default,
QPageSticky: () => QPageSticky_default,
QPagination: () => QPagination_default,
QParallax: () => QParallax_default,
QPopupEdit: () => QPopupEdit_default,
QPopupProxy: () => QPopupProxy_default,
QPullToRefresh: () => QPullToRefresh_default,
QRadio: () => QRadio_default,
QRange: () => QRange_default,
QRating: () => QRating_default,
QResizeObserver: () => QResizeObserver_default,
QResponsive: () => QResponsive_default,
QRouteTab: () => QRouteTab_default,
QScrollArea: () => QScrollArea_default,
QScrollObserver: () => QScrollObserver_default,
QSelect: () => QSelect_default,
QSeparator: () => QSeparator_default,
QSkeleton: () => QSkeleton_default,
QSlideItem: () => QSlideItem_default,
QSlideTransition: () => QSlideTransition_default,
QSlider: () => QSlider_default,
QSpace: () => QSpace_default,
QSpinner: () => QSpinner_default,
QSpinnerAudio: () => QSpinnerAudio_default,
QSpinnerBall: () => QSpinnerBall_default,
QSpinnerBars: () => QSpinnerBars_default,
QSpinnerBox: () => QSpinnerBox_default,
QSpinnerClock: () => QSpinnerClock_default,
QSpinnerComment: () => QSpinnerComment_default,
QSpinnerCube: () => QSpinnerCube_default,
QSpinnerDots: () => QSpinnerDots_default,
QSpinnerFacebook: () => QSpinnerFacebook_default,
QSpinnerGears: () => QSpinnerGears_default,
QSpinnerGrid: () => QSpinnerGrid_default,
QSpinnerHearts: () => QSpinnerHearts_default,
QSpinnerHourglass: () => QSpinnerHourglass_default,
QSpinnerInfinity: () => QSpinnerInfinity_default,
QSpinnerIos: () => QSpinnerIos_default,
QSpinnerOrbit: () => QSpinnerOrbit_default,
QSpinnerOval: () => QSpinnerOval_default,
QSpinnerPie: () => QSpinnerPie_default,
QSpinnerPuff: () => QSpinnerPuff_default,
QSpinnerRadio: () => QSpinnerRadio_default,
QSpinnerRings: () => QSpinnerRings_default,
QSpinnerTail: () => QSpinnerTail_default,
QSplitter: () => QSplitter_default,
QStep: () => QStep_default,
QStepper: () => QStepper_default,
QStepperNavigation: () => QStepperNavigation_default,
QTab: () => QTab_default,
QTabPanel: () => QTabPanel_default,
QTabPanels: () => QTabPanels_default,
QTable: () => QTable_default,
QTabs: () => QTabs_default,
QTd: () => QTd_default,
QTh: () => QTh_default,
QTime: () => QTime_default,
QTimeline: () => QTimeline_default,
QTimelineEntry: () => QTimelineEntry_default,
QToggle: () => QToggle_default,
QToolbar: () => QToolbar_default,
QToolbarTitle: () => QToolbarTitle_default,
QTooltip: () => QTooltip_default,
QTr: () => QTr_default,
QTree: () => QTree_default,
QUploader: () => QUploader_default,
QUploaderAddTrigger: () => QUploaderAddTrigger_default,
QVideo: () => QVideo_default,
QVirtualScroll: () => QVirtualScroll_default
});
// src/utils/format/format.js
var units = ["B", "KB", "MB", "GB", "TB", "PB"];
function humanStorageSize(bytes, decimals = 1) {
let u = 0;
while (parseInt(bytes, 10) >= 1024 && u < units.length - 1) {
bytes /= 1024;
++u;
}
return `${bytes.toFixed(decimals)}${units[u]}`;
}
function capitalize(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
function between(v, min, max) {
return max <= min ? min : Math.min(max, Math.max(min, v));
}
function normalizeToInterval(v, min, max) {
if (max <= min) {
return min;
}
const size2 = max - min + 1;
let index = min + (v - min) % size2;
if