anq-modal-form
Version:
A powerful, customizable modal form component for Quasar Framework and Vue 3 applications. Features include responsive design, dynamic form generation, validation, animations, and seamless integration with Quasar's design system.
1,785 lines • 64.4 kB
JavaScript
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.flex{display:flex}.hidden{display:none}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.border{border-width:1px}.border-solid{border-style:solid}.p-5{padding:1.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.font-bold{font-weight:700}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
import { computed as d, markRaw as st, defineComponent as ut, getCurrentInstance as F, h as w, ref as A, onBeforeUnmount as re, Transition as Pe, withDirectives as _e, reactive as ct, onDeactivated as Me, nextTick as me, watch as be, onMounted as dt, onUnmounted as Bt, Teleport as Mt, provide as Ot, onActivated as Rt, createBlock as jt, openBlock as Ft, withCtx as X, createVNode as D, unref as Fe, mergeProps as ze, createElementVNode as zt, renderSlot as ue, toDisplayString as Vt } from "vue";
const Te = {
xs: 18,
sm: 24,
md: 32,
lg: 38,
xl: 46
}, ft = {
size: String
};
function vt(e, t = Te) {
return d(() => e.size !== void 0 ? { fontSize: e.size in t ? `${t[e.size]}px` : e.size } : null);
}
function mt(e, t, o, i) {
return Object.defineProperty(e, t, {
get: o,
set: i,
enumerable: !0
}), e;
}
function I(e) {
return st(ut(e));
}
function bt(e) {
return st(e);
}
function ae(e, t) {
return e !== void 0 && e() || t;
}
function te(e, t) {
return e !== void 0 ? t.concat(e()) : t;
}
const Ve = "0 0 24 24", ke = (e) => e, xe = (e) => `ionicons ${e}`, gt = {
"mdi-": (e) => `mdi ${e}`,
"icon-": ke,
// fontawesome equiv
"bt-": (e) => `bt ${e}`,
"eva-": (e) => `eva ${e}`,
"ion-md": xe,
"ion-ios": xe,
"ion-logo": xe,
"iconfont ": ke,
"ti-": (e) => `themify-icon ${e}`,
"bi-": (e) => `bootstrap-icons ${e}`,
"i-": ke
// UnoCSS pure icons
}, ht = {
o_: "-outlined",
r_: "-round",
s_: "-sharp"
}, pt = {
sym_o_: "-outlined",
sym_r_: "-rounded",
sym_s_: "-sharp"
}, Dt = new RegExp("^(" + Object.keys(gt).join("|") + ")"), Ht = new RegExp("^(" + Object.keys(ht).join("|") + ")"), De = new RegExp("^(" + Object.keys(pt).join("|") + ")"), At = /^[Mm]\s?[-+]?\.?\d/, It = /^img:/, Kt = /^svguse:/, Nt = /^ion-/, Qt = /^(fa-(classic|sharp|solid|regular|light|brands|duotone|thin)|[lf]a[srlbdk]?) /, He = I({
name: "QIcon",
props: {
...ft,
tag: {
type: String,
default: "i"
},
name: String,
color: String,
left: Boolean,
right: Boolean
},
setup(e, { slots: t }) {
const { proxy: { $q: o } } = F(), i = vt(e), n = d(
() => "q-icon" + (e.left === !0 ? " on-left" : "") + (e.right === !0 ? " on-right" : "") + (e.color !== void 0 ? ` text-${e.color}` : "")
), a = d(() => {
let r, l = e.name;
if (l === "none" || !l)
return { none: !0 };
if (o.iconMapFn !== null) {
const s = o.iconMapFn(l);
if (s !== void 0)
if (s.icon !== void 0) {
if (l = s.icon, l === "none" || !l)
return { none: !0 };
} else
return {
cls: s.cls,
content: s.content !== void 0 ? s.content : " "
};
}
if (At.test(l) === !0) {
const [s, p = Ve] = l.split("|");
return {
svg: !0,
viewBox: p,
nodes: s.split("&&").map((c) => {
const [f, k, S] = c.split("@@");
return w("path", { style: k, d: f, transform: S });
})
};
}
if (It.test(l) === !0)
return {
img: !0,
src: l.substring(4)
};
if (Kt.test(l) === !0) {
const [s, p = Ve] = l.split("|");
return {
svguse: !0,
src: s.substring(7),
viewBox: p
};
}
let v = " ";
const m = l.match(Dt);
if (m !== null)
r = gt[m[1]](l);
else if (Qt.test(l) === !0)
r = l;
else if (Nt.test(l) === !0)
r = `ionicons ion-${o.platform.is.ios === !0 ? "ios" : "md"}${l.substring(3)}`;
else if (De.test(l) === !0) {
r = "notranslate material-symbols";
const s = l.match(De);
s !== null && (l = l.substring(6), r += pt[s[1]]), v = l;
} else {
r = "notranslate material-icons";
const s = l.match(Ht);
s !== null && (l = l.substring(2), r += ht[s[1]]), v = l;
}
return {
cls: r,
content: v
};
});
return () => {
const r = {
class: n.value,
style: i.value,
"aria-hidden": "true"
};
return a.value.none === !0 ? w(e.tag, r, ae(t.default)) : a.value.img === !0 ? w(e.tag, r, te(t.default, [
w("img", { src: a.value.src })
])) : a.value.svg === !0 ? w(e.tag, r, te(t.default, [
w("svg", {
viewBox: a.value.viewBox || "0 0 24 24"
}, a.value.nodes)
])) : a.value.svguse === !0 ? w(e.tag, r, te(t.default, [
w("svg", {
viewBox: a.value.viewBox
}, [
w("use", { "xlink:href": a.value.src })
])
])) : (a.value.cls !== void 0 && (r.class += " " + a.value.cls), w(e.tag, r, te(t.default, [
a.value.content
])));
};
}
}), Wt = {
size: {
type: [String, Number],
default: "1em"
},
color: String
};
function Ut(e) {
return {
cSize: d(() => e.size in Te ? `${Te[e.size]}px` : e.size),
classes: d(
() => "q-spinner" + (e.color ? ` text-${e.color}` : "")
)
};
}
const Xt = I({
name: "QSpinner",
props: {
...Wt,
thickness: {
type: Number,
default: 5
}
},
setup(e) {
const { cSize: t, classes: o } = Ut(e);
return () => w("svg", {
class: o.value + " q-spinner-mat",
width: t.value,
height: t.value,
viewBox: "25 25 50 50"
}, [
w("circle", {
class: "path",
cx: "50",
cy: "50",
r: "20",
fill: "none",
stroke: "currentColor",
"stroke-width": e.thickness,
"stroke-miterlimit": "10"
})
]);
}
});
function Yt(e, t) {
const o = e.style;
for (const i in t)
o[i] = t[i];
}
function Gt(e, t) {
if (e == null || e.contains(t) === !0)
return !0;
for (let o = e.nextElementSibling; o !== null; o = o.nextElementSibling)
if (o.contains(t))
return !0;
return !1;
}
const O = {
hasPassive: !1,
passiveCapture: !0,
notPassiveCapture: !0
};
try {
const e = Object.defineProperty({}, "passive", {
get() {
Object.assign(O, {
hasPassive: !0,
passive: { passive: !0 },
notPassive: { passive: !1 },
passiveCapture: { passive: !0, capture: !0 },
notPassiveCapture: { passive: !1, capture: !0 }
});
}
});
window.addEventListener("qtest", null, e), window.removeEventListener("qtest", null, e);
} catch {
}
function Jt(e) {
return e.touches && e.touches[0] ? e = e.touches[0] : e.changedTouches && e.changedTouches[0] ? e = e.changedTouches[0] : e.targetTouches && e.targetTouches[0] && (e = e.targetTouches[0]), {
top: e.clientY,
left: e.clientX
};
}
function Zt(e) {
if (e.path)
return e.path;
if (e.composedPath)
return e.composedPath();
const t = [];
let o = e.target;
for (; o; ) {
if (t.push(o), o.tagName === "HTML")
return t.push(document), t.push(window), t;
o = o.parentElement;
}
}
function yt(e) {
e.stopPropagation();
}
function en(e) {
e.cancelable !== !1 && e.preventDefault();
}
function H(e) {
e.cancelable !== !1 && e.preventDefault(), e.stopPropagation();
}
function tn(e, t, o) {
const i = `__q_${t}_evt`;
e[i] = e[i] !== void 0 ? e[i].concat(o) : o, o.forEach((n) => {
n[0].addEventListener(n[1], e[n[2]], O[n[3]]);
});
}
function nn(e, t) {
const o = `__q_${t}_evt`;
e[o] !== void 0 && (e[o].forEach((i) => {
i[0].removeEventListener(i[1], e[i[2]], O[i[3]]);
}), e[o] = void 0);
}
function on(e) {
return e !== Object(e) || e.isComposing === !0 || e.qKeyEvent === !0;
}
function ie(e, t) {
return on(e) === !0 ? !1 : [].concat(t).includes(e.keyCode);
}
function ln(e, t = 250) {
let o = !1, i;
return function() {
return o === !1 && (o = !0, setTimeout(() => {
o = !1;
}, t), i = e.apply(this, arguments)), i;
};
}
function Ae(e, t, o, i) {
o.modifiers.stop === !0 && yt(e);
const n = o.modifiers.color;
let a = o.modifiers.center;
a = a === !0 || i === !0;
const r = document.createElement("span"), l = document.createElement("span"), v = Jt(e), { left: m, top: s, width: p, height: c } = t.getBoundingClientRect(), f = Math.sqrt(p * p + c * c), k = f / 2, S = `${(p - f) / 2}px`, b = a ? S : `${v.left - m - k}px`, E = `${(c - f) / 2}px`, g = a ? E : `${v.top - s - k}px`;
l.className = "q-ripple__inner", Yt(l, {
height: `${f}px`,
width: `${f}px`,
transform: `translate3d(${b},${g},0) scale3d(.2,.2,1)`,
opacity: 0
}), r.className = `q-ripple${n ? " text-" + n : ""}`, r.setAttribute("dir", "ltr"), r.appendChild(l), t.appendChild(r);
const y = () => {
r.remove(), clearTimeout(L);
};
o.abort.push(y);
let L = setTimeout(() => {
l.classList.add("q-ripple__inner--enter"), l.style.transform = `translate3d(${S},${E},0) scale3d(1,1,1)`, l.style.opacity = 0.2, L = setTimeout(() => {
l.classList.remove("q-ripple__inner--enter"), l.classList.add("q-ripple__inner--leave"), l.style.opacity = 0, L = setTimeout(() => {
r.remove(), o.abort.splice(o.abort.indexOf(y), 1);
}, 275);
}, 250);
}, 50);
}
function Ie(e, { modifiers: t, value: o, arg: i }) {
const n = Object.assign({}, e.cfg.ripple, t, o);
e.modifiers = {
early: n.early === !0,
stop: n.stop === !0,
center: n.center === !0,
color: n.color || i,
keyCodes: [].concat(n.keyCodes || 13)
};
}
const rn = bt(
{
name: "ripple",
beforeMount(e, t) {
const o = t.instance.$.appContext.config.globalProperties.$q.config || {};
if (o.ripple === !1) return;
const i = {
cfg: o,
enabled: t.value !== !1,
modifiers: {},
abort: [],
start(n) {
i.enabled === !0 && n.qSkipRipple !== !0 && n.type === (i.modifiers.early === !0 ? "pointerdown" : "click") && Ae(n, e, i, n.qKeyEvent === !0);
},
keystart: ln((n) => {
i.enabled === !0 && n.qSkipRipple !== !0 && ie(n, i.modifiers.keyCodes) === !0 && n.type === `key${i.modifiers.early === !0 ? "down" : "up"}` && Ae(n, e, i, !0);
}, 300)
};
Ie(i, t), e.__qripple = i, tn(i, "main", [
[e, "pointerdown", "start", "passive"],
[e, "click", "start", "passive"],
[e, "keydown", "keystart", "passive"],
[e, "keyup", "keystart", "passive"]
]);
},
updated(e, t) {
if (t.oldValue !== t.value) {
const o = e.__qripple;
o !== void 0 && (o.enabled = t.value !== !1, o.enabled === !0 && Object(t.value) === t.value && Ie(o, t));
}
},
beforeUnmount(e) {
const t = e.__qripple;
t !== void 0 && (t.abort.forEach((o) => {
o();
}), nn(t, "main"), delete e._qripple);
}
}
), wt = {
left: "start",
center: "center",
right: "end",
between: "between",
around: "around",
evenly: "evenly",
stretch: "stretch"
}, an = Object.keys(wt), sn = {
align: {
type: String,
validator: (e) => an.includes(e)
}
};
function un(e) {
return d(() => {
const t = e.align === void 0 ? e.vertical === !0 ? "stretch" : "left" : e.align;
return `${e.vertical === !0 ? "items" : "justify"}-${wt[t]}`;
});
}
function fe(e) {
if (Object(e.$parent) === e.$parent)
return e.$parent;
let { parent: t } = e.$;
for (; Object(t) === t; ) {
if (Object(t.proxy) === t.proxy)
return t.proxy;
t = t.parent;
}
}
function kt(e) {
return e.appContext.config.globalProperties.$router !== void 0;
}
function Oe(e) {
return e.isUnmounted === !0 || e.isDeactivated === !0;
}
function Ke(e) {
return e ? e.aliasOf ? e.aliasOf.path : e.path : "";
}
function Ne(e, t) {
return (e.aliasOf || e) === (t.aliasOf || t);
}
function cn(e, t) {
for (const o in t) {
const i = t[o], n = e[o];
if (typeof i == "string") {
if (i !== n)
return !1;
} else if (Array.isArray(n) === !1 || n.length !== i.length || i.some((a, r) => a !== n[r]))
return !1;
}
return !0;
}
function Qe(e, t) {
return Array.isArray(t) === !0 ? e.length === t.length && e.every((o, i) => o === t[i]) : e.length === 1 && e[0] === t;
}
function dn(e, t) {
return Array.isArray(e) === !0 ? Qe(e, t) : Array.isArray(t) === !0 ? Qe(t, e) : e === t;
}
function fn(e, t) {
if (Object.keys(e).length !== Object.keys(t).length)
return !1;
for (const o in e)
if (dn(e[o], t[o]) === !1)
return !1;
return !0;
}
const vn = {
// router-link
to: [String, Object],
replace: Boolean,
// regular <a> link
href: String,
target: String,
// state
disable: Boolean
};
function mn({ fallbackTag: e, useDisableForRouterLinkProps: t = !0 } = {}) {
const o = F(), { props: i, proxy: n, emit: a } = o, r = kt(o), l = d(() => i.disable !== !0 && i.href !== void 0), v = t === !0 ? d(
() => r === !0 && i.disable !== !0 && l.value !== !0 && i.to !== void 0 && i.to !== null && i.to !== ""
) : d(
() => r === !0 && l.value !== !0 && i.to !== void 0 && i.to !== null && i.to !== ""
), m = d(() => v.value === !0 ? g(i.to) : null), s = d(() => m.value !== null), p = d(() => l.value === !0 || s.value === !0), c = d(() => i.type === "a" || p.value === !0 ? "a" : i.tag || e || "div"), f = d(() => l.value === !0 ? {
href: i.href,
target: i.target
} : s.value === !0 ? {
href: m.value.href,
target: i.target
} : {}), k = d(() => {
if (s.value === !1)
return -1;
const { matched: h } = m.value, { length: C } = h, P = h[C - 1];
if (P === void 0)
return -1;
const _ = n.$route.matched;
if (_.length === 0)
return -1;
const j = _.findIndex(
Ne.bind(null, P)
);
if (j !== -1)
return j;
const z = Ke(h[C - 2]);
return (
// we are dealing with nested routes
C > 1 && Ke(P) === z && _[_.length - 1].path !== z ? _.findIndex(
Ne.bind(null, h[C - 2])
) : j
);
}), S = d(
() => s.value === !0 && k.value !== -1 && cn(n.$route.params, m.value.params)
), b = d(
() => S.value === !0 && k.value === n.$route.matched.length - 1 && fn(n.$route.params, m.value.params)
), E = d(() => s.value === !0 ? b.value === !0 ? ` ${i.exactActiveClass} ${i.activeClass}` : i.exact === !0 ? "" : S.value === !0 ? ` ${i.activeClass}` : "" : "");
function g(h) {
try {
return n.$router.resolve(h);
} catch {
}
return null;
}
function y(h, { returnRouterError: C, to: P = i.to, replace: _ = i.replace } = {}) {
if (i.disable === !0)
return h.preventDefault(), Promise.resolve(!1);
if (
// don't redirect with control keys;
// should match RouterLink from Vue Router
h.metaKey || h.altKey || h.ctrlKey || h.shiftKey || h.button !== void 0 && h.button !== 0 || i.target === "_blank"
)
return Promise.resolve(!1);
h.preventDefault();
const j = n.$router[_ === !0 ? "replace" : "push"](P);
return C === !0 ? j : j.then(() => {
}).catch(() => {
});
}
function L(h) {
if (s.value === !0) {
const C = (P) => y(h, P);
a("click", h, C), h.defaultPrevented !== !0 && C();
} else
a("click", h);
}
return {
hasRouterLink: s,
hasHrefLink: l,
hasLink: p,
linkTag: c,
resolvedLink: m,
linkIsActive: S,
linkIsExactActive: b,
linkClass: E,
linkAttrs: f,
getLink: g,
navigateToRouterLink: y,
navigateOnClick: L
};
}
const We = {
none: 0,
xs: 4,
sm: 8,
md: 16,
lg: 24,
xl: 32
}, bn = {
xs: 8,
sm: 10,
md: 14,
lg: 20,
xl: 24
}, gn = ["button", "submit", "reset"], hn = /[^\s]\/[^\s]/, pn = ["flat", "outline", "push", "unelevated"];
function yn(e, t) {
return e.flat === !0 ? "flat" : e.outline === !0 ? "outline" : e.push === !0 ? "push" : e.unelevated === !0 ? "unelevated" : t;
}
const wn = {
...ft,
...vn,
type: {
type: String,
default: "button"
},
label: [Number, String],
icon: String,
iconRight: String,
...pn.reduce(
(e, t) => (e[t] = Boolean) && e,
{}
),
square: Boolean,
rounded: Boolean,
glossy: Boolean,
size: String,
fab: Boolean,
fabMini: Boolean,
padding: String,
color: String,
textColor: String,
noCaps: Boolean,
noWrap: Boolean,
dense: Boolean,
tabindex: [Number, String],
ripple: {
type: [Boolean, Object],
default: !0
},
align: {
...sn.align,
default: "center"
},
stack: Boolean,
stretch: Boolean,
loading: {
type: Boolean,
default: null
},
disable: Boolean
}, kn = {
...wn,
round: Boolean
};
function xn(e) {
const t = vt(e, bn), o = un(e), { hasRouterLink: i, hasLink: n, linkTag: a, linkAttrs: r, navigateOnClick: l } = mn({
fallbackTag: "button"
}), v = d(() => {
const b = e.fab === !1 && e.fabMini === !1 ? t.value : {};
return e.padding !== void 0 ? Object.assign({}, b, {
padding: e.padding.split(/\s+/).map((E) => E in We ? We[E] + "px" : E).join(" "),
minWidth: "0",
minHeight: "0"
}) : b;
}), m = d(
() => e.rounded === !0 || e.fab === !0 || e.fabMini === !0
), s = d(
() => e.disable !== !0 && e.loading !== !0
), p = d(() => s.value === !0 ? e.tabindex || 0 : -1), c = d(() => yn(e, "standard")), f = d(() => {
const b = { tabindex: p.value };
return n.value === !0 ? Object.assign(b, r.value) : gn.includes(e.type) === !0 && (b.type = e.type), a.value === "a" ? (e.disable === !0 ? b["aria-disabled"] = "true" : b.href === void 0 && (b.role = "button"), i.value !== !0 && hn.test(e.type) === !0 && (b.type = e.type)) : e.disable === !0 && (b.disabled = "", b["aria-disabled"] = "true"), e.loading === !0 && e.percentage !== void 0 && Object.assign(b, {
role: "progressbar",
"aria-valuemin": 0,
"aria-valuemax": 100,
"aria-valuenow": e.percentage
}), b;
}), k = d(() => {
let b;
e.color !== void 0 ? e.flat === !0 || e.outline === !0 ? b = `text-${e.textColor || e.color}` : b = `bg-${e.color} text-${e.textColor || "white"}` : e.textColor && (b = `text-${e.textColor}`);
const E = e.round === !0 ? "round" : `rectangle${m.value === !0 ? " q-btn--rounded" : e.square === !0 ? " q-btn--square" : ""}`;
return `q-btn--${c.value} q-btn--${E}` + (b !== void 0 ? " " + b : "") + (s.value === !0 ? " q-btn--actionable q-focusable q-hoverable" : e.disable === !0 ? " disabled" : "") + (e.fab === !0 ? " q-btn--fab" : e.fabMini === !0 ? " q-btn--fab-mini" : "") + (e.noCaps === !0 ? " q-btn--no-uppercase" : "") + (e.dense === !0 ? " q-btn--dense" : "") + (e.stretch === !0 ? " no-border-radius self-stretch" : "") + (e.glossy === !0 ? " glossy" : "") + (e.square ? " q-btn--square" : "");
}), S = d(
() => o.value + (e.stack === !0 ? " column" : " row") + (e.noWrap === !0 ? " no-wrap text-no-wrap" : "") + (e.loading === !0 ? " q-btn__content--hidden" : "")
);
return {
classes: k,
style: v,
innerClasses: S,
attributes: f,
hasLink: n,
linkTag: a,
navigateOnClick: l,
isActionable: s
};
}
const { passiveCapture: B } = O;
let Y = null, G = null, J = null;
const qe = I({
name: "QBtn",
props: {
...kn,
percentage: Number,
darkPercentage: Boolean,
onTouchstart: [Function, Array]
},
emits: ["click", "keydown", "mousedown", "keyup"],
setup(e, { slots: t, emit: o }) {
const { proxy: i } = F(), {
classes: n,
style: a,
innerClasses: r,
attributes: l,
hasLink: v,
linkTag: m,
navigateOnClick: s,
isActionable: p
} = xn(e), c = A(null), f = A(null);
let k = null, S, b = null;
const E = d(
() => e.label !== void 0 && e.label !== null && e.label !== ""
), g = d(() => e.disable === !0 || e.ripple === !1 ? !1 : {
keyCodes: v.value === !0 ? [13, 32] : [13],
...e.ripple === !0 ? {} : e.ripple
}), y = d(() => ({ center: e.round })), L = d(() => {
const u = Math.max(0, Math.min(100, e.percentage));
return u > 0 ? { transition: "transform 0.6s", transform: `translateX(${u - 100}%)` } : {};
}), h = d(() => {
if (e.loading === !0)
return {
onMousedown: N,
onTouchstart: N,
onClick: N,
onKeydown: N,
onKeyup: N
};
if (p.value === !0) {
const u = {
onClick: P,
onKeydown: _,
onMousedown: z
};
if (i.$q.platform.has.touch === !0) {
const q = e.onTouchstart !== void 0 ? "" : "Passive";
u[`onTouchstart${q}`] = j;
}
return u;
}
return {
// needed; especially for disabled <a> tags
onClick: H
};
}), C = d(() => ({
ref: c,
class: "q-btn q-btn-item non-selectable no-outline " + n.value,
style: a.value,
...l.value,
...h.value
}));
function P(u) {
if (c.value !== null) {
if (u !== void 0) {
if (u.defaultPrevented === !0) return;
const q = document.activeElement;
if (e.type === "submit" && q !== document.body && c.value.contains(q) === !1 && q.contains(c.value) === !1) {
u.qAvoidFocus !== !0 && c.value.focus();
const M = () => {
var V;
document.removeEventListener("keydown", H, !0), document.removeEventListener("keyup", M, B), (V = c.value) == null || V.removeEventListener("blur", M, B);
};
document.addEventListener("keydown", H, !0), document.addEventListener("keyup", M, B), c.value.addEventListener("blur", M, B);
}
}
s(u);
}
}
function _(u) {
c.value !== null && (o("keydown", u), ie(u, [13, 32]) === !0 && G !== c.value && (G !== null && K(), u.defaultPrevented !== !0 && (u.qAvoidFocus !== !0 && c.value.focus(), G = c.value, c.value.classList.add("q-btn--active"), document.addEventListener("keyup", T, !0), c.value.addEventListener("blur", T, B)), H(u)));
}
function j(u) {
c.value !== null && (o("touchstart", u), u.defaultPrevented !== !0 && (Y !== c.value && (Y !== null && K(), Y = c.value, k = u.target, k.addEventListener("touchcancel", T, B), k.addEventListener("touchend", T, B)), S = !0, b !== null && clearTimeout(b), b = setTimeout(() => {
b = null, S = !1;
}, 200)));
}
function z(u) {
c.value !== null && (u.qSkipRipple = S === !0, o("mousedown", u), u.defaultPrevented !== !0 && J !== c.value && (J !== null && K(), J = c.value, c.value.classList.add("q-btn--active"), document.addEventListener("mouseup", T, B)));
}
function T(u) {
if (c.value !== null && !((u == null ? void 0 : u.type) === "blur" && document.activeElement === c.value)) {
if ((u == null ? void 0 : u.type) === "keyup") {
if (G === c.value && ie(u, [13, 32]) === !0) {
const q = new MouseEvent("click", u);
q.qKeyEvent = !0, u.defaultPrevented === !0 && en(q), u.cancelBubble === !0 && yt(q), c.value.dispatchEvent(q), H(u), u.qKeyEvent = !0;
}
o("keyup", u);
}
K();
}
}
function K(u) {
var M, V;
const q = f.value;
u !== !0 && (Y === c.value || J === c.value) && q !== null && q !== document.activeElement && (q.setAttribute("tabindex", -1), q.focus()), Y === c.value && (k !== null && (k.removeEventListener("touchcancel", T, B), k.removeEventListener("touchend", T, B)), Y = k = null), J === c.value && (document.removeEventListener("mouseup", T, B), J = null), G === c.value && (document.removeEventListener("keyup", T, !0), (M = c.value) == null || M.removeEventListener("blur", T, B), G = null), (V = c.value) == null || V.classList.remove("q-btn--active");
}
function N(u) {
H(u), u.qSkipRipple = !0;
}
return re(() => {
K(!0);
}), Object.assign(i, {
click: (u) => {
p.value === !0 && P(u);
}
}), () => {
let u = [];
e.icon !== void 0 && u.push(
w(He, {
name: e.icon,
left: e.stack !== !0 && E.value === !0,
role: "img"
})
), E.value === !0 && u.push(
w("span", { class: "block" }, [e.label])
), u = te(t.default, u), e.iconRight !== void 0 && e.round === !1 && u.push(
w(He, {
name: e.iconRight,
right: e.stack !== !0 && E.value === !0,
role: "img"
})
);
const q = [
w("span", {
class: "q-focus-helper",
ref: f
})
];
return e.loading === !0 && e.percentage !== void 0 && q.push(
w("span", {
class: "q-btn__progress absolute-full overflow-hidden" + (e.darkPercentage === !0 ? " q-btn__progress--dark" : "")
}, [
w("span", {
class: "q-btn__progress-indicator fit block",
style: L.value
})
])
), q.push(
w("span", {
class: "q-btn__content text-center col items-center q-anchor--skip " + r.value
}, u)
), e.loading !== null && q.push(
w(Pe, {
name: "q-transition--fade"
}, () => e.loading === !0 ? [
w("span", {
key: "loading",
class: "absolute-full flex flex-center"
}, t.loading !== void 0 ? t.loading() : [w(Xt)])
] : null)
), _e(
w(
m.value,
C.value,
q
),
[[
rn,
g.value,
void 0,
y.value
]]
);
};
}
}), Se = I({
name: "QCardSection",
props: {
tag: {
type: String,
default: "div"
},
horizontal: Boolean
},
setup(e, { slots: t }) {
const o = d(
() => `q-card__section q-card__section--${e.horizontal === !0 ? "horiz row no-wrap" : "vert"}`
);
return () => w(e.tag, { class: o.value }, ae(t.default));
}
}), xt = {
dark: {
type: Boolean,
default: null
}
};
function qt(e, t) {
return d(() => e.dark === null ? t.dark.isActive : e.dark);
}
const qn = {
true: "inset",
item: "item-inset",
"item-thumbnail": "item-thumbnail-inset"
}, Ee = {
xs: 2,
sm: 4,
md: 8,
lg: 16,
xl: 24
}, Sn = I({
name: "QSeparator",
props: {
...xt,
spaced: [Boolean, String],
inset: [Boolean, String],
vertical: Boolean,
color: String,
size: String
},
setup(e) {
const t = F(), o = qt(e, t.proxy.$q), i = d(() => e.vertical === !0 ? "vertical" : "horizontal"), n = d(() => ` q-separator--${i.value}`), a = d(() => e.inset !== !1 ? `${n.value}-${qn[e.inset]}` : ""), r = d(
() => `q-separator${n.value}${a.value}` + (e.color !== void 0 ? ` bg-${e.color}` : "") + (o.value === !0 ? " q-separator--dark" : "")
), l = d(() => {
const v = {};
if (e.size !== void 0 && (v[e.vertical === !0 ? "width" : "height"] = e.size), e.spaced !== !1) {
const m = e.spaced === !0 ? `${Ee.md}px` : e.spaced in Ee ? `${Ee[e.spaced]}px` : e.spaced, s = e.vertical === !0 ? ["Left", "Right"] : ["Top", "Bottom"];
v[`margin${s[0]}`] = v[`margin${s[1]}`] = m;
}
return v;
});
return () => w("hr", {
class: r.value,
style: l.value,
"aria-orientation": i.value
});
}
}), ge = A(
!1
);
let Be;
function En(e, t) {
const o = /(edg|edge|edga|edgios)\/([\w.]+)/.exec(e) || /(opr)[\/]([\w.]+)/.exec(e) || /(vivaldi)[\/]([\w.]+)/.exec(e) || /(chrome|crios)[\/]([\w.]+)/.exec(e) || /(version)(applewebkit)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(e) || /(webkit)[\/]([\w.]+).*(version)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(e) || /(firefox|fxios)[\/]([\w.]+)/.exec(e) || /(webkit)[\/]([\w.]+)/.exec(e) || /(opera)(?:.*version|)[\/]([\w.]+)/.exec(e) || [];
return {
browser: o[5] || o[3] || o[1] || "",
version: o[4] || o[2] || "0",
platform: t[0] || ""
};
}
function Ln(e) {
return /(ipad)/.exec(e) || /(ipod)/.exec(e) || /(windows phone)/.exec(e) || /(iphone)/.exec(e) || /(kindle)/.exec(e) || /(silk)/.exec(e) || /(android)/.exec(e) || /(win)/.exec(e) || /(mac)/.exec(e) || /(linux)/.exec(e) || /(cros)/.exec(e) || /(playbook)/.exec(e) || /(bb)/.exec(e) || /(blackberry)/.exec(e) || [];
}
const St = "ontouchstart" in window || window.navigator.maxTouchPoints > 0;
function Cn(e) {
const t = e.toLowerCase(), o = Ln(t), i = En(t, o), n = {
mobile: !1,
desktop: !1,
cordova: !1,
capacitor: !1,
nativeMobile: !1,
// nativeMobileWrapper: void 0,
electron: !1,
bex: !1,
linux: !1,
mac: !1,
win: !1,
cros: !1,
chrome: !1,
firefox: !1,
opera: !1,
safari: !1,
vivaldi: !1,
edge: !1,
edgeChromium: !1,
ie: !1,
webkit: !1,
android: !1,
ios: !1,
ipad: !1,
iphone: !1,
ipod: !1,
kindle: !1,
winphone: !1,
blackberry: !1,
playbook: !1,
silk: !1
};
i.browser && (n[i.browser] = !0, n.version = i.version, n.versionNumber = parseInt(i.version, 10)), i.platform && (n[i.platform] = !0);
const a = n.android || n.ios || n.bb || n.blackberry || n.ipad || n.iphone || n.ipod || n.kindle || n.playbook || n.silk || n["windows phone"];
if (a === !0 || t.indexOf("mobile") !== -1 ? n.mobile = !0 : n.desktop = !0, n["windows phone"] && (n.winphone = !0, delete n["windows phone"]), n.edga || n.edgios || n.edg ? (n.edge = !0, i.browser = "edge") : n.crios ? (n.chrome = !0, i.browser = "chrome") : n.fxios && (n.firefox = !0, i.browser = "firefox"), (n.ipod || n.ipad || n.iphone) && (n.ios = !0), n.vivaldi && (i.browser = "vivaldi", n.vivaldi = !0), // Chrome, Opera 15+, Vivaldi and Safari are webkit based browsers
(n.chrome || n.opr || n.safari || n.vivaldi || n.mobile === !0 && n.ios !== !0 && a !== !0) && (n.webkit = !0), n.opr && (i.browser = "opera", n.opera = !0), n.safari && (n.blackberry || n.bb ? (i.browser = "blackberry", n.blackberry = !0) : n.playbook ? (i.browser = "playbook", n.playbook = !0) : n.android ? (i.browser = "android", n.android = !0) : n.kindle ? (i.browser = "kindle", n.kindle = !0) : n.silk && (i.browser = "silk", n.silk = !0)), n.name = i.browser, n.platform = i.platform, t.indexOf("electron") !== -1)
n.electron = !0;
else if (document.location.href.indexOf("-extension://") !== -1)
n.bex = !0;
else {
if (window.Capacitor !== void 0 ? (n.capacitor = !0, n.nativeMobile = !0, n.nativeMobileWrapper = "capacitor") : (window._cordovaNative !== void 0 || window.cordova !== void 0) && (n.cordova = !0, n.nativeMobile = !0, n.nativeMobileWrapper = "cordova"), ge.value === !0 && (Be = { is: { ...n } }), St === !0 && n.mac === !0 && (n.desktop === !0 && n.safari === !0 || n.nativeMobile === !0 && n.android !== !0 && n.ios !== !0 && n.ipad !== !0)) {
delete n.mac, delete n.desktop;
const r = Math.min(window.innerHeight, window.innerWidth) > 414 ? "ipad" : "iphone";
Object.assign(n, {
mobile: !0,
ios: !0,
platform: r,
[r]: !0
});
}
n.mobile !== !0 && window.navigator.userAgentData && window.navigator.userAgentData.mobile && (delete n.desktop, n.mobile = !0);
}
return n;
}
const Ue = navigator.userAgent || navigator.vendor || window.opera, $n = {
has: {
touch: !1,
webStorage: !1
},
within: { iframe: !1 }
}, R = {
userAgent: Ue,
is: Cn(Ue),
has: {
touch: St
},
within: {
iframe: window.self !== window.top
}
}, Xe = {
install(e) {
const { $q: t } = e;
ge.value === !0 ? (e.onSSRHydrated.push(() => {
Object.assign(t.platform, R), ge.value = !1;
}), t.platform = ct(this)) : t.platform = this;
}
};
{
let e;
mt(R.has, "webStorage", () => {
if (e !== void 0)
return e;
try {
if (window.localStorage)
return e = !0, !0;
} catch {
}
return e = !1, !1;
}), Object.assign(Xe, R), ge.value === !0 && (Object.assign(Xe, Be, $n), Be = null);
}
function Pn(e, t, o) {
function i() {
}
return re(() => {
e.value === !0 && void 0;
}), {
removeFromHistory: i,
addToHistory() {
}
};
}
function _n() {
let e = null;
const t = F();
function o() {
e !== null && (clearTimeout(e), e = null);
}
return Me(o), re(o), {
removeTimeout: o,
registerTimeout(i, n) {
o(), Oe(t) === !1 && (e = setTimeout(() => {
e = null, i();
}, n));
}
};
}
function Tn() {
let e;
const t = F();
function o() {
e = void 0;
}
return Me(o), re(o), {
removeTick: o,
registerTick(i) {
e = i, me(() => {
e === i && (Oe(t) === !1 && e(), e = void 0);
});
}
};
}
const Bn = {
modelValue: {
type: Boolean,
default: null
},
"onUpdate:modelValue": [Function, Array]
}, Mn = [
"beforeShow",
"show",
"beforeHide",
"hide"
];
function On({
showing: e,
canShow: t,
// optional
hideOnRouteChange: o,
// optional
handleShow: i,
// optional
handleHide: n,
// optional
processOnMount: a
// optional
}) {
const r = F(), { props: l, emit: v, proxy: m } = r;
let s;
function p(g) {
e.value === !0 ? k(g) : c(g);
}
function c(g) {
if (l.disable === !0 || (g == null ? void 0 : g.qAnchorHandled) === !0 || t !== void 0 && t(g) !== !0) return;
const y = l["onUpdate:modelValue"] !== void 0;
y === !0 && (v("update:modelValue", !0), s = g, me(() => {
s === g && (s = void 0);
})), (l.modelValue === null || y === !1) && f(g);
}
function f(g) {
e.value !== !0 && (e.value = !0, v("beforeShow", g), i !== void 0 ? i(g) : v("show", g));
}
function k(g) {
if (l.disable === !0) return;
const y = l["onUpdate:modelValue"] !== void 0;
y === !0 && (v("update:modelValue", !1), s = g, me(() => {
s === g && (s = void 0);
})), (l.modelValue === null || y === !1) && S(g);
}
function S(g) {
e.value !== !1 && (e.value = !1, v("beforeHide", g), n !== void 0 ? n(g) : v("hide", g));
}
function b(g) {
l.disable === !0 && g === !0 ? l["onUpdate:modelValue"] !== void 0 && v("update:modelValue", !1) : g === !0 !== e.value && (g === !0 ? f : S)(s);
}
be(() => l.modelValue, b), o !== void 0 && kt(r) === !0 && be(() => m.$route.fullPath, () => {
o.value === !0 && e.value === !0 && k();
}), dt(() => {
b(l.modelValue);
});
const E = { show: c, hide: k, toggle: p };
return Object.assign(m, E), E;
}
const Rn = {
transitionShow: {
type: String,
default: "fade"
},
transitionHide: {
type: String,
default: "fade"
},
transitionDuration: {
type: [String, Number],
default: 300
}
};
function jn(e, t = () => {
}, o = () => {
}) {
return {
transitionProps: d(() => {
const i = `q-transition--${e.transitionShow || t()}`, n = `q-transition--${e.transitionHide || o()}`;
return {
appear: !0,
enterFromClass: `${i}-enter-from`,
enterActiveClass: `${i}-enter-active`,
enterToClass: `${i}-enter-to`,
leaveFromClass: `${n}-leave-from`,
leaveActiveClass: `${n}-leave-active`,
leaveToClass: `${n}-leave-to`
};
}),
transitionStyle: d(() => `--q-transition-duration: ${e.transitionDuration}ms`)
};
}
let ne = [], le = [];
function Et(e) {
le = le.filter((t) => t !== e);
}
function Fn(e) {
Et(e), le.push(e);
}
function Ye(e) {
Et(e), le.length === 0 && ne.length !== 0 && (ne[ne.length - 1](), ne = []);
}
function Lt(e) {
le.length === 0 ? e() : ne.push(e);
}
const Ge = {};
let zn = 1, Vn = document.body;
function Dn(e, t) {
const o = document.createElement("div");
if (o.id = `q-portal--${t}--${zn++}`, Ge.globalNodes !== void 0) {
const i = Ge.globalNodes.class;
i !== void 0 && (o.className = i);
}
return Vn.appendChild(o), o;
}
function Hn(e) {
e.remove();
}
const ve = [];
function An(e) {
return ve.find(
(t) => t.contentEl !== null && t.contentEl.contains(e)
);
}
function In(e, t) {
do {
if (e.$options.name === "QMenu") {
if (e.hide(t), e.$props.separateClosePopup === !0)
return fe(e);
} else if (e.__qPortal === !0) {
const o = fe(e);
return (o == null ? void 0 : o.$options.name) === "QPopupProxy" ? (e.hide(t), o) : e;
}
e = fe(e);
} while (e != null);
}
function Kn(e, t, o) {
for (; o !== 0 && e !== void 0 && e !== null; ) {
if (e.__qPortal === !0) {
if (o--, e.$options.name === "QMenu") {
e = In(e, t);
continue;
}
e.hide(t);
}
e = fe(e);
}
}
const Nn = I({
name: "QPortal",
setup(e, { slots: t }) {
return () => t.default();
}
});
function Qn(e) {
for (e = e.parent; e != null; ) {
if (e.type.name === "QGlobalDialog")
return !0;
if (e.type.name === "QDialog" || e.type.name === "QMenu")
return !1;
e = e.parent;
}
return !1;
}
function Wn(e, t, o, i) {
const n = A(!1), a = A(!1);
let r = null;
const l = {}, v = Qn(e);
function m(p) {
if (p === !0) {
Ye(l), a.value = !0;
return;
}
a.value = !1, n.value === !1 && (v === !1 && r === null && (r = Dn(!1, i)), n.value = !0, ve.push(e.proxy), Fn(l));
}
function s(p) {
if (a.value = !1, p !== !0) return;
Ye(l), n.value = !1;
const c = ve.indexOf(e.proxy);
c !== -1 && ve.splice(c, 1), r !== null && (Hn(r), r = null);
}
return Bt(() => {
s(!0);
}), e.proxy.__qPortal = !0, mt(e.proxy, "contentEl", () => t.value), {
showPortal: m,
hidePortal: s,
portalIsActive: n,
portalIsAccessible: a,
renderPortal: () => v === !0 ? o() : n.value === !0 ? [w(Mt, { to: r }, w(Nn, o))] : void 0
};
}
function Un(e) {
return e === window ? window.pageYOffset || window.scrollY || document.body.scrollTop || 0 : e.scrollTop;
}
function Xn(e) {
return e === window ? window.pageXOffset || window.scrollX || document.body.scrollLeft || 0 : e.scrollLeft;
}
function Yn(e, t = !0) {
return !e || e.nodeType !== Node.ELEMENT_NODE ? !1 : t ? e.scrollHeight > e.clientHeight && (e.classList.contains("scroll") || e.classList.contains("overflow-auto") || ["auto", "scroll"].includes(window.getComputedStyle(e)["overflow-y"])) : e.scrollWidth > e.clientWidth && (e.classList.contains("scroll") || e.classList.contains("overflow-auto") || ["auto", "scroll"].includes(window.getComputedStyle(e)["overflow-x"]));
}
let ee = 0, Le, Ce, oe, $e = !1, Je, Ze, et, Q = null;
function Gn(e) {
Jn(e) && H(e);
}
function Jn(e) {
if (e.target === document.body || e.target.classList.contains("q-layout__backdrop"))
return !0;
const t = Zt(e), o = e.shiftKey && !e.deltaX, i = !o && Math.abs(e.deltaX) <= Math.abs(e.deltaY), n = o || i ? e.deltaY : e.deltaX;
for (let a = 0; a < t.length; a++) {
const r = t[a];
if (Yn(r, i))
return i ? n < 0 && r.scrollTop === 0 ? !0 : n > 0 && r.scrollTop + r.clientHeight === r.scrollHeight : n < 0 && r.scrollLeft === 0 ? !0 : n > 0 && r.scrollLeft + r.clientWidth === r.scrollWidth;
}
return !0;
}
function tt(e) {
e.target === document && (document.scrollingElement.scrollTop = document.scrollingElement.scrollTop);
}
function ce(e) {
$e !== !0 && ($e = !0, requestAnimationFrame(() => {
$e = !1;
const { height: t } = e.target, { clientHeight: o, scrollTop: i } = document.scrollingElement;
(oe === void 0 || t !== window.innerHeight) && (oe = o - t, document.scrollingElement.scrollTop = i), i > oe && (document.scrollingElement.scrollTop -= Math.ceil((i - oe) / 8));
}));
}
function nt(e) {
const t = document.body, o = window.visualViewport !== void 0;
if (e === "add") {
const { overflowY: i, overflowX: n } = window.getComputedStyle(t);
Le = Xn(window), Ce = Un(window), Je = t.style.left, Ze = t.style.top, et = window.location.href, t.style.left = `-${Le}px`, t.style.top = `-${Ce}px`, n !== "hidden" && (n === "scroll" || t.scrollWidth > window.innerWidth) && t.classList.add("q-body--force-scrollbar-x"), i !== "hidden" && (i === "scroll" || t.scrollHeight > window.innerHeight) && t.classList.add("q-body--force-scrollbar-y"), t.classList.add("q-body--prevent-scroll"), document.qScrollPrevented = !0, R.is.ios === !0 && (o === !0 ? (window.scrollTo(0, 0), window.visualViewport.addEventListener("resize", ce, O.passiveCapture), window.visualViewport.addEventListener("scroll", ce, O.passiveCapture), window.scrollTo(0, 0)) : window.addEventListener("scroll", tt, O.passiveCapture));
}
R.is.desktop === !0 && R.is.mac === !0 && window[`${e}EventListener`]("wheel", Gn, O.notPassive), e === "remove" && (R.is.ios === !0 && (o === !0 ? (window.visualViewport.removeEventListener("resize", ce, O.passiveCapture), window.visualViewport.removeEventListener("scroll", ce, O.passiveCapture)) : window.removeEventListener("scroll", tt, O.passiveCapture)), t.classList.remove("q-body--prevent-scroll"), t.classList.remove("q-body--force-scrollbar-x"), t.classList.remove("q-body--force-scrollbar-y"), document.qScrollPrevented = !1, t.style.left = Je, t.style.top = Ze, window.location.href === et && window.scrollTo(Le, Ce), oe = void 0);
}
function Zn(e) {
let t = "add";
if (e === !0) {
if (ee++, Q !== null) {
clearTimeout(Q), Q = null;
return;
}
if (ee > 1) return;
} else {
if (ee === 0 || (ee--, ee > 0)) return;
if (t = "remove", R.is.ios === !0 && R.is.nativeMobile === !0) {
Q !== null && clearTimeout(Q), Q = setTimeout(() => {
nt(t), Q = null;
}, 100);
return;
}
}
nt(t);
}
function eo() {
let e;
return {
preventBodyScroll(t) {
t !== e && (e !== void 0 || t === !0) && (e = t, Zn(t));
}
};
}
const W = [];
let Z;
function to(e) {
Z = e.keyCode === 27;
}
function no() {
Z === !0 && (Z = !1);
}
function oo(e) {
Z === !0 && (Z = !1, ie(e, 27) === !0 && W[W.length - 1](e));
}
function Ct(e) {
window[e]("keydown", to), window[e]("blur", no), window[e]("keyup", oo), Z = !1;
}
function io(e) {
R.is.desktop === !0 && (W.push(e), W.length === 1 && Ct("addEventListener"));
}
function ot(e) {
const t = W.indexOf(e);
t !== -1 && (W.splice(t, 1), W.length === 0 && Ct("removeEventListener"));
}
const U = [];
function $t(e) {
U[U.length - 1](e);
}
function lo(e) {
R.is.desktop === !0 && (U.push(e), U.length === 1 && document.body.addEventListener("focusin", $t));
}
function it(e) {
const t = U.indexOf(e);
t !== -1 && (U.splice(t, 1), U.length === 0 && document.body.removeEventListener("focusin", $t));
}
let de = 0;
const ro = {
standard: "fixed-full flex-center",
top: "fixed-top justify-center",
bottom: "fixed-bottom justify-center",
right: "fixed-right items-center",
left: "fixed-left items-center"
}, lt = {
standard: ["scale", "scale"],
top: ["slide-down", "slide-up"],
bottom: ["slide-up", "slide-down"],
right: ["slide-left", "slide-right"],
left: ["slide-right", "slide-left"]
}, ao = I({
name: "QDialog",
inheritAttrs: !1,
props: {
...Bn,
...Rn,
transitionShow: String,
// override useTransitionProps
transitionHide: String,
// override useTransitionProps
persistent: Boolean,
autoClose: Boolean,
allowFocusOutside: Boolean,
noEscDismiss: Boolean,
noBackdropDismiss: Boolean,
noRouteDismiss: Boolean,
noRefocus: Boolean,
noFocus: Boolean,
noShake: Boolean,
seamless: Boolean,
maximized: Boolean,
fullWidth: Boolean,
fullHeight: Boolean,
square: Boolean,
backdropFilter: String,
position: {
type: String,
default: "standard",
validator: (e) => ["standard", "top", "bottom", "left", "right"].includes(e)
}
},
emits: [
...Mn,
"shake",
"click",
"escapeKey"
],
setup(e, { slots: t, emit: o, attrs: i }) {
const n = F(), a = A(null), r = A(!1), l = A(!1);
let v = null, m = null, s, p;
const c = d(
() => e.persistent !== !0 && e.noRouteDismiss !== !0 && e.seamless !== !0
), { preventBodyScroll: f } = eo(), { registerTimeout: k } = _n(), { registerTick: S, removeTick: b } = Tn(), { transitionProps: E, transitionStyle: g } = jn(
e,
() => lt[e.position][0],
() => lt[e.position][1]
), y = d(() => g.value + (e.backdropFilter !== void 0 ? `;backdrop-filter:${e.backdropFilter};-webkit-backdrop-filter:${e.backdropFilter}` : "")), { showPortal: L, hidePortal: h, portalIsAccessible: C, renderPortal: P } = Wn(
n,
a,
Tt,
"dialog"
), { hide: _ } = On({
showing: r,
hideOnRouteChange: c,
handleShow: N,
handleHide: u,
processOnMount: !0
});
Pn(r);
const j = d(
() => `q-dialog__inner flex no-pointer-events q-dialog__inner--${e.maximized === !0 ? "maximized" : "minimized"} q-dialog__inner--${e.position} ${ro[e.position]}` + (l.value === !0 ? " q-dialog__inner--animating" : "") + (e.fullWidth === !0 ? " q-dialog__inner--fullwidth" : "") + (e.fullHeight === !0 ? " q-dialog__inner--fullheight" : "") + (e.square === !0 ? " q-dialog__inner--square" : "")
), z = d(() => r.value === !0 && e.seamless !== !0), T = d(() => e.autoClose === !0 ? { onClick: Pt } : {}), K = d(() => [
`q-dialog fullscreen no-pointer-events q-dialog--${z.value === !0 ? "modal" : "seamless"}`,
i.class
]);
be(() => e.maximized, (x) => {
r.value === !0 && he(x);
}), be(z, (x) => {
f(x), x === !0 ? (lo(pe), io(V)) : (it(pe), ot(V));
});
function N(x) {
var $;
m = e.noRefocus === !1 && document.activeElement !== null ? document.activeElement : null, he(e.maximized), L(), l.value = !0, e.noFocus !== !0 ? (($ = document.activeElement) == null || $.blur(), S(q)) : b(), k(() => {
if (n.proxy.$q.platform.is.ios === !0) {
if (e.seamless !== !0 && document.activeElement) {
const { top: se, bottom: ye } = document.activeElement.getBoundingClientRect(), { innerHeight: je } = window, we = window.visualViewport !== void 0 ? window.visualViewport.height : je;
se > 0 && ye > we / 2 && (document.scrollingElement.scrollTop = Math.min(
document.scrollingElement.scrollHeight - we,
ye >= je ? 1 / 0 : Math.ceil(document.scrollingElement.scrollTop + ye - we / 2)
)), document.activeElement.scrollIntoView();
}
p = !0, a.value.click(), p = !1;
}
L(!0), l.value = !1, o("show", x);
}, e.transitionDuration);
}
function u(x) {
b(), Re(!0), l.value = !0, h(), m !== null && ((((x == null ? void 0 : x.type.indexOf("key")) === 0 ? m.closest('[tabindex]:not([tabindex^="-"])') : void 0) || m).focus(), m = null), k(() => {
h(!0), l.value = !1, o("hide", x);
}, e.transitionDuration);
}
function q(x) {
Lt(() => {
let $ = a.value;
if ($ !== null) {
if (x !== void 0) {
const se = $.querySelector(x);
if (se !== null) {
se.focus({ preventScroll: !0 });
return;
}
}
$.contains(document.activeElement) !== !0 && ($ = $.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]") || $.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]") || $.querySelector("[autofocus], [data-autofocus]") || $, $.focus({ preventScroll: !0 }));
}
});
}
function M(x) {
x && typeof x.focus == "function" ? x.focus({ preventScroll: !0 }) : q(), o("shake");
const $ = a.value;
$ !== null && ($.classList.remove("q-animate--scale"), $.classList.add("q-animate--scale"), v !== null && clearTimeout(v), v = setTimeout(() => {
v = null, a.value !== null && ($.classList.remove("q-animate--scale"), q());
}, 170));
}
function V() {
e.seamless !== !0 && (e.persistent === !0 || e.noEscDismiss === !0 ? e.maximized !== !0 && e.noShake !== !0 && M() : (o("escapeKey"), _()));
}
function Re(x) {
v !== null && (clearTimeout(v), v = null), (x === !0 || r.value === !0) && (he(!1), e.seamless !== !0 && (f(!1), it(pe), ot(V))), x !== !0 && (m = null);
}
function he(x) {
x === !0 ? s !== !0 && (de < 1 && document.body.classList.add("q-body--dialog"), de++, s = !0) : s === !0 && (de < 2 && document.body.classList.remove("q-body--dialog"), de--, s = !1);
}
function Pt(x) {
p !== !0 && (_(x), o("click", x));
}
function _t(x) {
e.persistent !== !0 && e.noBackdropDismiss !== !0 ? _(x) : e.noShake !== !0 && M();
}
function pe(x) {
e.allowFocusOutside !== !0 && C.value === !0 && Gt(a.value, x.target) !== !0 && q('[tabindex]:not([tabindex="-1"])');
}
Object.assign(n.proxy, {
// expose public methods
focus: q,
shake: M,
// private but needed by QSelect
__updateRefocusTarget(x) {
m = x || null;
}
}), re(Re);
function Tt() {
return w("div", {
role: "dialog",
"aria-modal": z.value === !0 ? "true" : "false",
...i,
class: K.value
}, [
w(Pe, {
name: "q-transition--fade",
appear: !0
}, () => z.value === !0 ? w("div", {
class: "q-dialog__backdrop fixed-full",
style: y.value,
"aria-hidden": "true",
tabindex: -1,
onClick: _t
}) : null),
w(
Pe,
E.value,
() => r.value === !0 ? w("div", {
ref: a,
class: j.value,
style: g.value,
tabindex: -1,
...T.value
}, ae(t.default)) : null
)
]);
}
return P;
}
});
function rt(e) {
if (e === !1)
return 0;
if (e === !0 || e === void 0)
return 1;
const t = parseInt(e, 10);
return isNaN(t) ? 0 : t;
}
const at = bt(
{
name: "close-popup",
beforeMount(e, { value: t }) {
const o = {
depth: rt(t),
handler(i) {
o.depth !== 0 && setTimeout(() => {
const n = An(e);
n !== void 0 && Kn(n, i, o.depth);
});
},
handlerKey(i) {
ie(i, 13) === !0 && o.handler(i);
}
};
e.__qclosepopup = o, e.addEventListener("click", o.handler), e.addEventListener("keyup", o.handlerKey);
},
updated(e, { value: t, oldValue: o }) {
t !== o && (e.__qclosepopup.depth = rt(t));
},
beforeUnmount(e) {
const t = e.__qclosepopup;
e.removeEventListener("click", t.handler), e.removeEventListener("keyup", t.handlerKey), delete e.__qclosepopup;
}
}
), so = I({
name: "QCard",
props: {
...xt,
tag: {
type: String,
default: "div"
},
square: Boolean,
flat: Boolean,
bordered: Boolean
},
setup(e, { slots: t }) {
const { proxy: { $q: o } } = F(), i = qt(e, o), n = d(
() => "q-card" + (i.value === !0 ? " q-card--dark q-dark" : "") + (e.bordered === !0 ? " q-card--bordered" : "") + (e.square === !0 ? " q-card--square no-border-radius" : "") + (e.flat === !0 ? " q-card--flat no-shadow" : "")
);
return () => w(e.tag, { class: n.value }, ae(t.default));
}
}), uo = "_q_fo_", co = I({
name: "QForm",
props: {
autofocus: Boolean,
noErrorFocus: Boolean,
noResetFocus: Boolean,
greedy: Boolean,
onSubmit: Function
},
emits: ["reset", "validationSuccess", "validationError"],
setup(e, { slots: t, emit: o }) {
const i = F(), n = A(null);
let a = 0;
const r = [];
function l(f) {
const k = typeof f == "boolean" ? f : e.noErrorFocus !== !0, S = ++a, b = (y, L) => {
o(`validation${y === !0 ? "Success" : "Error"}`, L);
}, E = (y) => {
const L = y.validate();
return typeof L.then == "function" ? L.then(
(h) => ({ valid: h, comp: y }),
(h) => ({ valid: !1, comp: y, err: h })
) : Promise.resolve({ valid: L, comp: y });
};
return (e.greedy === !0 ? Promise.all(r.map(E)).then((y) => y.filter((L) => L.valid !== !0)) : r.reduce(
(y, L) => y.then(() => E(L).then((h) => {
if (h.valid === !1)
return Promise.reject(h);
})),
Promise.resolve()
).catch((y) => [y])).then((y) => {
if (y === void 0 || y.length === 0)
return S === a && b(!0), !0;
if (S === a) {
const { comp: L, err: h } = y[0];
if (h !== void 0 && console.error(h), b(!1, L), k === !0) {
const C = y.find(({ comp: P }) => typeof P.focus == "function" && Oe(P.$) === !1);
C !== void 0 && C.comp.focus();
}
}
return !1;
});
}
function v() {
a++, r.forEach((f) => {
typeof f.resetValidation == "function" && f.resetValidation();
});
}
function m(f) {
f !== void 0 && H(f);
const k = a + 1;
l().then((S) => {
k === a && S === !0 && (e.onSubmit !== void 0 ? o("submit", f) : (f == null ? void 0 : f.target) !== void 0 && typeof f.target.submit == "function" && f.target.submit());
});
}
function s(f) {
f !== void 0 && H(f), o("reset"), me(() => {
v(), e.autofocus === !0 && e.noResetFocus !== !0 && p();
});
}
function p() {
Lt(() => {
if (n.value === null) return;
const f = n.value.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]") || n.value.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]") || n.value.querySelector("[autofocus], [data-autofocus]") || Array.prototype.find.call(n.value.querySelectorAll("[tabindex]"), (k) => k.tabIndex !== -1);
f == null || f.focus({ preventScroll: !0 });
});
}
Ot(uo, {
bindComponent(f) {
r.push(f);
},
unbindComponent(f) {
const k = r.indexOf(f);
k !== -1 && r.splice(k, 1);
}
});
let c = !1;
return Me(() => {
c = !0;
}), Rt(() => {
c === !0 && e.autofocus === !0 && p();
}), dt(() => {
e.autofocus === !0 && p();
}), Object.assign(i.proxy, {
validate: l,
resetValidation: v,
submit: m,
reset: s,
focus: p,
getValidationComponents: () => r
}), () => w("form", {
class: "q-form",
ref: n,
onSubmit: m,
onReset: s
}, ae(t.default));
}
}), fo = { class: "font-bold text-2xl" }, mo = /* @__PURE__ */ ut({
__name: "AnqModalForm",
props: {
isLoading: {
type: Boolean,
default: !1
},
formIsLoading: {
type: Boolean,
default: !1
},
okLabel: {
type: String,
default: "Ok"
},
cancelLabel: {
type: String,
default: "Cancel"
},
title: {
type: String,
default: "Title"
},
btnsColor: {
type: Object,
default: "primary"
},
modalCardProps: {
type: Object,
required: !1
},
formProps: {
type: Object,
required: !1
}
},
emits: ["submit", "validation-error", "validation-success", "hide"],
setup(e, { expose: t, emit: o }) {
const i = o, n = e, a = ct({
open: !1
}), r = () => {
a.open = !0;
}, l = () => {
a.open = !1, i("hide");
};
return t({ show: r, hide: l }), (v, m) => (Ft(), jt(ao, {
modelValue: a.open,
"onUpdate:modelValue": m[3] || (m[3] = (s) => a.open = s),
persistent: n.isLoading || n.formIsLoading,
onHide: l
}, {
default: X(() => {
var s;
return [
D(Fe(so), ze(n.modalCardProps, {
class: `container ${((s = n.modalCardProps) == null ? void 0 : s.class) || ""}`
}), {
default: X(() => [
D(Se, { class: "flex items-center justify-between" }, {
default: X(() => [
zt("h2", fo, Vt(n.title), 1),
ue(v.$slots, "close-icon-btn", {
color: n.btnsColor,
disable: n.isLoading || n.formIsLoading
}, () => [
_e(D(qe, {
icon: "close",
color: n.btnsColor,
round: "",
flat: "",
disable: n.isLoading || n.formIsLoading
}, null, 8, ["color", "disable"]), [
[at]
])
])
]),
_: 3
}),
D(Fe(co), ze(n.formProps, {
onSubmit: m[0] || (m[0] = (p) => i("submit", p)),
onValidationError: m[1] || (m[1] = (p) => i("validation-error", p)),
onValidationSuccess: m[2] || (m[2] = () => i("validation-success")),
class: "flex flex-col"
}), {
default: X(() => [
D(Se, { class: "flex flex-col gap-2" }, {
default: X(() => [
ue(v.$slots, "content")
]),
_: 3
}),
D(Sn),
D(Se, { class: "flex items-center justify-end gap-2" }, {
default: X(() => [
ue(v.$slots, "cancel-btn", {
color: n.btnsColor,
disable: n.isLoading || n.formIsLoading,
label: n.cancelLabel
}, () => [
_e(D(qe, {
color: n.btnsColor,
type: "button",
unelevated: "",
flat: "",
class: "border border-solid",
disable: n.isLoading || n.formIsLoading,
label: n.cancelLabel,
"no-caps": ""
}, null, 8, ["color", "disable", "label"]), [
[at]
])
]),
ue(v.$slots, "ok-btn", {
color: n.btnsColor,
label: n.okLabel,
disable: n.isLoading,
loading: n.formIsLoading
}, () => [
D(qe, {
color: n.btnsColor,
type: "submit",
unelevated: "",
label: n.okLabel,
"no-caps": "",
disable: n.isLoading,
loading: n.formIsLoading
}, null, 8, ["color", "label", "disable", "loading"])
])
]),
_: 3
})
]),
_: 3
}, 16)
]),
_: 3
}, 16, ["class"])
];
}),
_: 3
}, 8, ["modelValue", "persistent"]));
}
});
export {
mo as AnqModalForm
};