import { d as K1, b as Q1, w as ew, h as tw, c as iw, m as rw, _ as nw, p as ow, E as Wu } from "./index-Dm_oomn1.js";
import { C as aw } from "./ContentMixin-Klv1uUY6.js";
import { ref as Ae, defineComponent as Ie, computed as ce, openBlock as ge, createElementBlock as Le, mergeProps as Or, unref as G, renderSlot as qe, useAttrs as sw, useSlots as au, shallowRef as Ci, watch as Ke, nextTick as wt, onMounted as ei, toRef as Di, createCommentVNode as Ve, Fragment as Vt, normalizeClass as Re, createElementVNode as ke, createBlock as Ue, withCtx as me, resolveDynamicComponent as Ni, withModifiers as ai, createVNode as le, toDisplayString as xt, normalizeStyle as Ot, provide as ci, reactive as Xi, onActivated as lw, onUpdated as rp, inject as ct, onBeforeUnmount as or, withDirectives as It, cloneVNode as cw, Text as o0, Comment as uw, Transition as hl, vShow as fi, readonly as a0, onDeactivated as hw, toHandlers as dw, withKeys as mr, createTextVNode as vt, createSlots as pw, toRefs as ln, getCurrentInstance as ri, h as ba, renderList as tr, onUnmounted as s0, markRaw as Mi, watchEffect as l0, warn as fw, onBeforeMount as mw, toRaw as np, getCurrentScope as c0, onScopeDispose as u0, isRef as Ro, isVNode as Qh, Teleport as gw, resolveComponent as Ei, resolveDirective as vw, toHandlerKey as yw, vModelText as bw, createApp as xw, hasInjectionContext as ww, effectScope as _w, isReactive as op, pushScopeId as Mw, popScopeId as Sw } from "vue";
const Jr = (i, e, { checkForDefaultPrevented: t = !0 } = {}) => (r) => {
const n = i == null ? void 0 : i(r);
if (t === !1 || !n)
return e == null ? void 0 : e(r);
};
var Tw = Object.defineProperty, Ew = Object.defineProperties, Aw = Object.getOwnPropertyDescriptors, Uf = Object.getOwnPropertySymbols, Cw = Object.prototype.hasOwnProperty, Lw = Object.prototype.propertyIsEnumerable, Gf = (i, e, t) => e in i ? Tw(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Rw = (i, e) => {
for (var t in e || (e = {}))
Cw.call(e, t) && Gf(i, t, e[t]);
if (Uf)
for (var t of Uf(e))
Lw.call(e, t) && Gf(i, t, e[t]);
return i;
}, Ow = (i, e) => Ew(i, Aw(e));
function Hf(i, e) {
var t;
const r = Ci();
return l0(() => {
r.value = i();
}, Ow(Rw({}, e), {
flush: (t = void 0) != null ? t : "sync"
})), a0(r);
}
var jf;
const Kt = typeof window < "u", Pw = (i) => typeof i == "string", h0 = () => {
}, ed = Kt && ((jf = window == null ? void 0 : window.navigator) == null ? void 0 : jf.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function d0(i) {
return typeof i == "function" ? i() : G(i);
}
function Iw(i) {
return i;
}
function su(i) {
return c0() ? (u0(i), !0) : !1;
}
function Dw(i, e = !0) {
ri() ? ei(i) : e ? i() : wt(i);
}
function tn(i) {
var e;
const t = d0(i);
return (e = t == null ? void 0 : t.$el) != null ? e : t;
}
const dl = Kt ? window : void 0, Nw = Kt ? window.document : void 0;
function si(...i) {
let e, t, r, n;
if (Pw(i[0]) || Array.isArray(i[0]) ? ([t, r, n] = i, e = dl) : [e, t, r, n] = i, !e)
return h0;
Array.isArray(t) || (t = [t]), Array.isArray(r) || (r = [r]);
const o = [], a = () => {
o.forEach((h) => h()), o.length = 0;
}, s = (h, u, p, g) => (h.addEventListener(u, p, g), () => h.removeEventListener(u, p, g)), c = Ke(() => [tn(e), d0(n)], ([h, u]) => {
a(), h && o.push(...t.flatMap((p) => r.map((g) => s(h, p, g, u))));
}, { immediate: !0, flush: "post" }), l = () => {
c(), a();
};
return su(l), l;
}
let Wf = !1;
function Bw(i, e, t = {}) {
const { window: r = dl, ignore: n = [], capture: o = !0, detectIframe: a = !1 } = t;
if (!r)
return;
ed && !Wf && (Wf = !0, Array.from(r.document.body.children).forEach((h) => h.addEventListener("click", h0)));
let s = !0;
const c = (h) => n.some((u) => {
if (typeof u == "string")
return Array.from(r.document.querySelectorAll(u)).some((p) => p === h.target || h.composedPath().includes(p));
{
const p = tn(u);
return p && (h.target === p || h.composedPath().includes(p));
}
}), l = [
si(r, "click", (h) => {
const u = tn(i);
if (!(!u || u === h.target || h.composedPath().includes(u))) {
if (h.detail === 0 && (s = !c(h)), !s) {
s = !0;
return;
}
e(h);
}
}, { passive: !0, capture: o }),
si(r, "pointerdown", (h) => {
const u = tn(i);
u && (s = !h.composedPath().includes(u) && !c(h));
}, { passive: !0 }),
a && si(r, "blur", (h) => {
var u;
const p = tn(i);
((u = r.document.activeElement) == null ? void 0 : u.tagName) === "IFRAME" && !(p != null && p.contains(r.document.activeElement)) && e(h);
})
].filter(Boolean);
return () => l.forEach((h) => h());
}
function p0(i, e = !1) {
const t = Ae(), r = () => t.value = !!i();
return r(), Dw(r, e), t;
}
const $f = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, qf = "__vueuse_ssr_handlers__";
$f[qf] = $f[qf] || {};
function kw({ document: i = Nw } = {}) {
if (!i)
return Ae("visible");
const e = Ae(i.visibilityState);
return si(i, "visibilitychange", () => {
e.value = i.visibilityState;
}), e;
}
var Xf = Object.getOwnPropertySymbols, zw = Object.prototype.hasOwnProperty, Fw = Object.prototype.propertyIsEnumerable, Vw = (i, e) => {
var t = {};
for (var r in i)
zw.call(i, r) && e.indexOf(r) < 0 && (t[r] = i[r]);
if (i != null && Xf)
for (var r of Xf(i))
e.indexOf(r) < 0 && Fw.call(i, r) && (t[r] = i[r]);
return t;
};
function er(i, e, t = {}) {
const r = t, { window: n = dl } = r, o = Vw(r, ["window"]);
let a;
const s = p0(() => n && "ResizeObserver" in n), c = () => {
a && (a.disconnect(), a = void 0);
}, l = Ke(() => tn(i), (u) => {
c(), s.value && n && u && (a = new ResizeObserver(e), a.observe(u, o));
}, { immediate: !0, flush: "post" }), h = () => {
c(), l();
};
return su(h), {
isSupported: s,
stop: h
};
}
var Zf = Object.getOwnPropertySymbols, Uw = Object.prototype.hasOwnProperty, Gw = Object.prototype.propertyIsEnumerable, Hw = (i, e) => {
var t = {};
for (var r in i)
Uw.call(i, r) && e.indexOf(r) < 0 && (t[r] = i[r]);
if (i != null && Zf)
for (var r of Zf(i))
e.indexOf(r) < 0 && Gw.call(i, r) && (t[r] = i[r]);
return t;
};
function jw(i, e, t = {}) {
const r = t, { window: n = dl } = r, o = Hw(r, ["window"]);
let a;
const s = p0(() => n && "MutationObserver" in n), c = () => {
a && (a.disconnect(), a = void 0);
}, l = Ke(() => tn(i), (u) => {
c(), s.value && n && u && (a = new MutationObserver(e), a.observe(u, o));
}, { immediate: !0 }), h = () => {
c(), l();
};
return su(h), {
isSupported: s,
stop: h
};
}
var Yf;
(function(i) {
i.UP = "UP", i.RIGHT = "RIGHT", i.DOWN = "DOWN", i.LEFT = "LEFT", i.NONE = "NONE";
})(Yf || (Yf = {}));
var Ww = Object.defineProperty, Jf = Object.getOwnPropertySymbols, $w = Object.prototype.hasOwnProperty, qw = Object.prototype.propertyIsEnumerable, Kf = (i, e, t) => e in i ? Ww(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Xw = (i, e) => {
for (var t in e || (e = {}))
$w.call(e, t) && Kf(i, t, e[t]);
if (Jf)
for (var t of Jf(e))
qw.call(e, t) && Kf(i, t, e[t]);
return i;
};
const Zw = {
easeInSine: [0.12, 0, 0.39, 0],
easeOutSine: [0.61, 1, 0.88, 1],
easeInOutSine: [0.37, 0, 0.63, 1],
easeInQuad: [0.11, 0, 0.5, 0],
easeOutQuad: [0.5, 1, 0.89, 1],
easeInOutQuad: [0.45, 0, 0.55, 1],
easeInCubic: [0.32, 0, 0.67, 0],
easeOutCubic: [0.33, 1, 0.68, 1],
easeInOutCubic: [0.65, 0, 0.35, 1],
easeInQuart: [0.5, 0, 0.75, 0],
easeOutQuart: [0.25, 1, 0.5, 1],
easeInOutQuart: [0.76, 0, 0.24, 1],
easeInQuint: [0.64, 0, 0.78, 0],
easeOutQuint: [0.22, 1, 0.36, 1],
easeInOutQuint: [0.83, 0, 0.17, 1],
easeInExpo: [0.7, 0, 0.84, 0],
easeOutExpo: [0.16, 1, 0.3, 1],
easeInOutExpo: [0.87, 0, 0.13, 1],
easeInCirc: [0.55, 0, 1, 0.45],
easeOutCirc: [0, 0.55, 0.45, 1],
easeInOutCirc: [0.85, 0, 0.15, 1],
easeInBack: [0.36, 0, 0.66, -0.56],
easeOutBack: [0.34, 1.56, 0.64, 1],
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
};
Xw({
linear: Iw
}, Zw);
function Yw({ window: i = dl } = {}) {
if (!i)
return Ae(!1);
const e = Ae(i.document.hasFocus());
return si(i, "blur", () => {
e.value = !1;
}), si(i, "focus", () => {
e.value = !0;
}), e;
}
const Jw = () => Kt && /firefox/i.test(window.navigator.userAgent);
/**
* @vue/shared v3.5.11
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
process.env.NODE_ENV !== "production" && Object.freeze({});
process.env.NODE_ENV !== "production" && Object.freeze([]);
const $s = () => {
}, Kw = Object.prototype.hasOwnProperty, Qf = (i, e) => Kw.call(i, e), Bi = Array.isArray, Si = (i) => typeof i == "function", Li = (i) => typeof i == "string", Ai = (i) => i !== null && typeof i == "object", Qw = Object.prototype.toString, e_ = (i) => Qw.call(i), $u = (i) => e_(i).slice(8, -1), ap = (i) => {
const e = /* @__PURE__ */ Object.create(null);
return (t) => e[t] || (e[t] = i(t));
}, t_ = /-(\w)/g, i_ = ap(
(i) => i.replace(t_, (e, t) => t ? t.toUpperCase() : "")
), r_ = /\B([A-Z])/g, n_ = ap(
(i) => i.replace(r_, "-$1").toLowerCase()
), o_ = ap((i) => i.charAt(0).toUpperCase() + i.slice(1));
var f0 = typeof global == "object" && global && global.Object === Object && global, a_ = typeof self == "object" && self && self.Object === Object && self, Vr = f0 || a_ || Function("return this")(), Nr = Vr.Symbol, m0 = Object.prototype, s_ = m0.hasOwnProperty, l_ = m0.toString, gs = Nr ? Nr.toStringTag : void 0;
function c_(i) {
var e = s_.call(i, gs), t = i[gs];
try {
i[gs] = void 0;
var r = !0;
} catch {
}
var n = l_.call(i);
return r && (e ? i[gs] = t : delete i[gs]), n;
}
var u_ = Object.prototype, h_ = u_.toString;
function d_(i) {
return h_.call(i);
}
var p_ = "[object Null]", f_ = "[object Undefined]", em = Nr ? Nr.toStringTag : void 0;
function ts(i) {
return i == null ? i === void 0 ? f_ : p_ : em && em in Object(i) ? c_(i) : d_(i);
}
function Ca(i) {
return i != null && typeof i == "object";
}
var m_ = "[object Symbol]";
function lu(i) {
return typeof i == "symbol" || Ca(i) && ts(i) == m_;
}
function g_(i, e) {
for (var t = -1, r = i == null ? 0 : i.length, n = Array(r); ++t < r; )
n[t] = e(i[t], t, i);
return n;
}
var yr = Array.isArray, v_ = 1 / 0, tm = Nr ? Nr.prototype : void 0, im = tm ? tm.toString : void 0;
function g0(i) {
if (typeof i == "string")
return i;
if (yr(i))
return g_(i, g0) + "";
if (lu(i))
return im ? im.call(i) : "";
var e = i + "";
return e == "0" && 1 / i == -v_ ? "-0" : e;
}
var y_ = /\s/;
function b_(i) {
for (var e = i.length; e-- && y_.test(i.charAt(e)); )
;
return e;
}
var x_ = /^\s+/;
function w_(i) {
return i && i.slice(0, b_(i) + 1).replace(x_, "");
}
function Hn(i) {
var e = typeof i;
return i != null && (e == "object" || e == "function");
}
var rm = NaN, __ = /^[-+]0x[0-9a-f]+$/i, M_ = /^0b[01]+$/i, S_ = /^0o[0-7]+$/i, T_ = parseInt;
function nm(i) {
if (typeof i == "number")
return i;
if (lu(i))
return rm;
if (Hn(i)) {
var e = typeof i.valueOf == "function" ? i.valueOf() : i;
i = Hn(e) ? e + "" : e;
}
if (typeof i != "string")
return i === 0 ? i : +i;
i = w_(i);
var t = M_.test(i);
return t || S_.test(i) ? T_(i.slice(2), t ? 2 : 8) : __.test(i) ? rm : +i;
}
function v0(i) {
return i;
}
var E_ = "[object AsyncFunction]", A_ = "[object Function]", C_ = "[object GeneratorFunction]", L_ = "[object Proxy]";
function y0(i) {
if (!Hn(i))
return !1;
var e = ts(i);
return e == A_ || e == C_ || e == E_ || e == L_;
}
var qu = Vr["__core-js_shared__"], om = function() {
var i = /[^.]+$/.exec(qu && qu.keys && qu.keys.IE_PROTO || "");
return i ? "Symbol(src)_1." + i : "";
}();
function R_(i) {
return !!om && om in i;
}
var O_ = Function.prototype, P_ = O_.toString;
function Uo(i) {
if (i != null) {
try {
return P_.call(i);
} catch {
}
try {
return i + "";
} catch {
}
}
return "";
}
var I_ = /[\\^$.*+?()[\]{}|]/g, D_ = /^\[object .+?Constructor\]$/, N_ = Function.prototype, B_ = Object.prototype, k_ = N_.toString, z_ = B_.hasOwnProperty, F_ = RegExp(
"^" + k_.call(z_).replace(I_, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function V_(i) {
if (!Hn(i) || R_(i))
return !1;
var e = y0(i) ? F_ : D_;
return e.test(Uo(i));
}
function U_(i, e) {
return i == null ? void 0 : i[e];
}
function Go(i, e) {
var t = U_(i, e);
return V_(t) ? t : void 0;
}
var td = Go(Vr, "WeakMap");
function G_(i, e, t) {
switch (t.length) {
case 0:
return i.call(e);
case 1:
return i.call(e, t[0]);
case 2:
return i.call(e, t[0], t[1]);
case 3:
return i.call(e, t[0], t[1], t[2]);
}
return i.apply(e, t);
}
var H_ = 800, j_ = 16, W_ = Date.now;
function $_(i) {
var e = 0, t = 0;
return function() {
var r = W_(), n = j_ - (r - t);
if (t = r, n > 0) {
if (++e >= H_)
return arguments[0];
} else
e = 0;
return i.apply(void 0, arguments);
};
}
function q_(i) {
return function() {
return i;
};
}
var Hc = function() {
try {
var i = Go(Object, "defineProperty");
return i({}, "", {}), i;
} catch {
}
}(), X_ = Hc ? function(i, e) {
return Hc(i, "toString", {
configurable: !0,
enumerable: !1,
value: q_(e),
writable: !0
});
} : v0, Z_ = $_(X_);
function Y_(i, e, t, r) {
i.length;
for (var n = t + 1; n--; )
if (e(i[n], n, i))
return n;
return -1;
}
var J_ = 9007199254740991, K_ = /^(?:0|[1-9]\d*)$/;
function sp(i, e) {
var t = typeof i;
return e = e ?? J_, !!e && (t == "number" || t != "symbol" && K_.test(i)) && i > -1 && i % 1 == 0 && i < e;
}
function Q_(i, e, t) {
e == "__proto__" && Hc ? Hc(i, e, {
configurable: !0,
enumerable: !0,
value: t,
writable: !0
}) : i[e] = t;
}
function lp(i, e) {
return i === e || i !== i && e !== e;
}
var eM = Object.prototype, tM = eM.hasOwnProperty;
function iM(i, e, t) {
var r = i[e];
(!(tM.call(i, e) && lp(r, t)) || t === void 0 && !(e in i)) && Q_(i, e, t);
}
var am = Math.max;
function rM(i, e, t) {
return e = am(e === void 0 ? i.length - 1 : e, 0), function() {
for (var r = arguments, n = -1, o = am(r.length - e, 0), a = Array(o); ++n < o; )
a[n] = r[e + n];
n = -1;
for (var s = Array(e + 1); ++n < e; )
s[n] = r[n];
return s[e] = t(a), G_(i, this, s);
};
}
var nM = 9007199254740991;
function cp(i) {
return typeof i == "number" && i > -1 && i % 1 == 0 && i <= nM;
}
function oM(i) {
return i != null && cp(i.length) && !y0(i);
}
var aM = Object.prototype;
function sM(i) {
var e = i && i.constructor, t = typeof e == "function" && e.prototype || aM;
return i === t;
}
function lM(i, e) {
for (var t = -1, r = Array(i); ++t < i; )
r[t] = e(t);
return r;
}
var cM = "[object Arguments]";
function sm(i) {
return Ca(i) && ts(i) == cM;
}
var b0 = Object.prototype, uM = b0.hasOwnProperty, hM = b0.propertyIsEnumerable, up = sm(/* @__PURE__ */ function() {
return arguments;
}()) ? sm : function(i) {
return Ca(i) && uM.call(i, "callee") && !hM.call(i, "callee");
};
function dM() {
return !1;
}
var x0 = typeof exports == "object" && exports && !exports.nodeType && exports, lm = x0 && typeof module == "object" && module && !module.nodeType && module, pM = lm && lm.exports === x0, cm = pM ? Vr.Buffer : void 0, fM = cm ? cm.isBuffer : void 0, id = fM || dM, mM = "[object Arguments]", gM = "[object Array]", vM = "[object Boolean]", yM = "[object Date]", bM = "[object Error]", xM = "[object Function]", wM = "[object Map]", _M = "[object Number]", MM = "[object Object]", SM = "[object RegExp]", TM = "[object Set]", EM = "[object String]", AM = "[object WeakMap]", CM = "[object ArrayBuffer]", LM = "[object DataView]", RM = "[object Float32Array]", OM = "[object Float64Array]", PM = "[object Int8Array]", IM = "[object Int16Array]", DM = "[object Int32Array]", NM = "[object Uint8Array]", BM = "[object Uint8ClampedArray]", kM = "[object Uint16Array]", zM = "[object Uint32Array]", Ct = {};
Ct[RM] = Ct[OM] = Ct[PM] = Ct[IM] = Ct[DM] = Ct[NM] = Ct[BM] = Ct[kM] = Ct[zM] = !0;
Ct[mM] = Ct[gM] = Ct[CM] = Ct[vM] = Ct[LM] = Ct[yM] = Ct[bM] = Ct[xM] = Ct[wM] = Ct[_M] = Ct[MM] = Ct[SM] = Ct[TM] = Ct[EM] = Ct[AM] = !1;
function FM(i) {
return Ca(i) && cp(i.length) && !!Ct[ts(i)];
}
function VM(i) {
return function(e) {
return i(e);
};
}
var w0 = typeof exports == "object" && exports && !exports.nodeType && exports, ks = w0 && typeof module == "object" && module && !module.nodeType && module, UM = ks && ks.exports === w0, Xu = UM && f0.process, um = function() {
try {
var i = ks && ks.require && ks.require("util").types;
return i || Xu && Xu.binding && Xu.binding("util");
} catch {
}
}(), hm = um && um.isTypedArray, _0 = hm ? VM(hm) : FM, GM = Object.prototype, HM = GM.hasOwnProperty;
function jM(i, e) {
var t = yr(i), r = !t && up(i), n = !t && !r && id(i), o = !t && !r && !n && _0(i), a = t || r || n || o, s = a ? lM(i.length, String) : [], c = s.length;
for (var l in i)
HM.call(i, l) && !(a && // Safari 9 has enumerable `arguments.length` in strict mode.
(l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
n && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
o && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties.
sp(l, c))) && s.push(l);
return s;
}
function WM(i, e) {
return function(t) {
return i(e(t));
};
}
var $M = WM(Object.keys, Object), qM = Object.prototype, XM = qM.hasOwnProperty;
function ZM(i) {
if (!sM(i))
return $M(i);
var e = [];
for (var t in Object(i))
XM.call(i, t) && t != "constructor" && e.push(t);
return e;
}
function M0(i) {
return oM(i) ? jM(i) : ZM(i);
}
var YM = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, JM = /^\w*$/;
function hp(i, e) {
if (yr(i))
return !1;
var t = typeof i;
return t == "number" || t == "symbol" || t == "boolean" || i == null || lu(i) ? !0 : JM.test(i) || !YM.test(i) || e != null && i in Object(e);
}
var qs = Go(Object, "create");
function KM() {
this.__data__ = qs ? qs(null) : {}, this.size = 0;
}
function QM(i) {
var e = this.has(i) && delete this.__data__[i];
return this.size -= e ? 1 : 0, e;
}
var eS = "__lodash_hash_undefined__", tS = Object.prototype, iS = tS.hasOwnProperty;
function rS(i) {
var e = this.__data__;
if (qs) {
var t = e[i];
return t === eS ? void 0 : t;
}
return iS.call(e, i) ? e[i] : void 0;
}
var nS = Object.prototype, oS = nS.hasOwnProperty;
function aS(i) {
var e = this.__data__;
return qs ? e[i] !== void 0 : oS.call(e, i);
}
var sS = "__lodash_hash_undefined__";
function lS(i, e) {
var t = this.__data__;
return this.size += this.has(i) ? 0 : 1, t[i] = qs && e === void 0 ? sS : e, this;
}
function Oo(i) {
var e = -1, t = i == null ? 0 : i.length;
for (this.clear(); ++e < t; ) {
var r = i[e];
this.set(r[0], r[1]);
}
}
Oo.prototype.clear = KM;
Oo.prototype.delete = QM;
Oo.prototype.get = rS;
Oo.prototype.has = aS;
Oo.prototype.set = lS;
function cS() {
this.__data__ = [], this.size = 0;
}
function cu(i, e) {
for (var t = i.length; t--; )
if (lp(i[t][0], e))
return t;
return -1;
}
var uS = Array.prototype, hS = uS.splice;
function dS(i) {
var e = this.__data__, t = cu(e, i);
if (t < 0)
return !1;
var r = e.length - 1;
return t == r ? e.pop() : hS.call(e, t, 1), --this.size, !0;
}
function pS(i) {
var e = this.__data__, t = cu(e, i);
return t < 0 ? void 0 : e[t][1];
}
function fS(i) {
return cu(this.__data__, i) > -1;
}
function mS(i, e) {
var t = this.__data__, r = cu(t, i);
return r < 0 ? (++this.size, t.push([i, e])) : t[r][1] = e, this;
}
function pn(i) {
var e = -1, t = i == null ? 0 : i.length;
for (this.clear(); ++e < t; ) {
var r = i[e];
this.set(r[0], r[1]);
}
}
pn.prototype.clear = cS;
pn.prototype.delete = dS;
pn.prototype.get = pS;
pn.prototype.has = fS;
pn.prototype.set = mS;
var Xs = Go(Vr, "Map");
function gS() {
this.size = 0, this.__data__ = {
hash: new Oo(),
map: new (Xs || pn)(),
string: new Oo()
};
}
function vS(i) {
var e = typeof i;
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? i !== "__proto__" : i === null;
}
function uu(i, e) {
var t = i.__data__;
return vS(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map;
}
function yS(i) {
var e = uu(this, i).delete(i);
return this.size -= e ? 1 : 0, e;
}
function bS(i) {
return uu(this, i).get(i);
}
function xS(i) {
return uu(this, i).has(i);
}
function wS(i, e) {
var t = uu(this, i), r = t.size;
return t.set(i, e), this.size += t.size == r ? 0 : 1, this;
}
function fn(i) {
var e = -1, t = i == null ? 0 : i.length;
for (this.clear(); ++e < t; ) {
var r = i[e];
this.set(r[0], r[1]);
}
}
fn.prototype.clear = gS;
fn.prototype.delete = yS;
fn.prototype.get = bS;
fn.prototype.has = xS;
fn.prototype.set = wS;
var _S = "Expected a function";
function dp(i, e) {
if (typeof i != "function" || e != null && typeof e != "function")
throw new TypeError(_S);
var t = function() {
var r = arguments, n = e ? e.apply(this, r) : r[0], o = t.cache;
if (o.has(n))
return o.get(n);
var a = i.apply(this, r);
return t.cache = o.set(n, a) || o, a;
};
return t.cache = new (dp.Cache || fn)(), t;
}
dp.Cache = fn;
var MS = 500;
function SS(i) {
var e = dp(i, function(r) {
return t.size === MS && t.clear(), r;
}), t = e.cache;
return e;
}
var TS = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ES = /\\(\\)?/g, AS = SS(function(i) {
var e = [];
return i.charCodeAt(0) === 46 && e.push(""), i.replace(TS, function(t, r, n, o) {
e.push(n ? o.replace(ES, "$1") : r || t);
}), e;
});
function CS(i) {
return i == null ? "" : g0(i);
}
function hu(i, e) {
return yr(i) ? i : hp(i, e) ? [i] : AS(CS(i));
}
var LS = 1 / 0;
function pl(i) {
if (typeof i == "string" || lu(i))
return i;
var e = i + "";
return e == "0" && 1 / i == -LS ? "-0" : e;
}
function pp(i, e) {
e = hu(e, i);
for (var t = 0, r = e.length; i != null && t < r; )
i = i[pl(e[t++])];
return t && t == r ? i : void 0;
}
function Kr(i, e, t) {
var r = i == null ? void 0 : pp(i, e);
return r === void 0 ? t : r;
}
function S0(i, e) {
for (var t = -1, r = e.length, n = i.length; ++t < r; )
i[n + t] = e[t];
return i;
}
var dm = Nr ? Nr.isConcatSpreadable : void 0;
function RS(i) {
return yr(i) || up(i) || !!(dm && i && i[dm]);
}
function OS(i, e, t, r, n) {
var o = -1, a = i.length;
for (t || (t = RS), n || (n = []); ++o < a; ) {
var s = i[o];
t(s) ? S0(n, s) : n[n.length] = s;
}
return n;
}
function PS(i) {
var e = i == null ? 0 : i.length;
return e ? OS(i) : [];
}
function IS(i) {
return Z_(rM(i, void 0, PS), i + "");
}
function Cr() {
if (!arguments.length)
return [];
var i = arguments[0];
return yr(i) ? i : [i];
}
function DS() {
this.__data__ = new pn(), this.size = 0;
}
function NS(i) {
var e = this.__data__, t = e.delete(i);
return this.size = e.size, t;
}
function BS(i) {
return this.__data__.get(i);
}
function kS(i) {
return this.__data__.has(i);
}
var zS = 200;
function FS(i, e) {
var t = this.__data__;
if (t instanceof pn) {
var r = t.__data__;
if (!Xs || r.length < zS - 1)
return r.push([i, e]), this.size = ++t.size, this;
t = this.__data__ = new fn(r);
}
return t.set(i, e), this.size = t.size, this;
}
function rn(i) {
var e = this.__data__ = new pn(i);
this.size = e.size;
}
rn.prototype.clear = DS;
rn.prototype.delete = NS;
rn.prototype.get = BS;
rn.prototype.has = kS;
rn.prototype.set = FS;
function VS(i, e) {
for (var t = -1, r = i == null ? 0 : i.length, n = 0, o = []; ++t < r; ) {
var a = i[t];
e(a, t, i) && (o[n++] = a);
}
return o;
}
function US() {
return [];
}
var GS = Object.prototype, HS = GS.propertyIsEnumerable, pm = Object.getOwnPropertySymbols, jS = pm ? function(i) {
return i == null ? [] : (i = Object(i), VS(pm(i), function(e) {
return HS.call(i, e);
}));
} : US;
function WS(i, e, t) {
var r = e(i);
return yr(i) ? r : S0(r, t(i));
}
function fm(i) {
return WS(i, M0, jS);
}
var rd = Go(Vr, "DataView"), nd = Go(Vr, "Promise"), od = Go(Vr, "Set"), mm = "[object Map]", $S = "[object Object]", gm = "[object Promise]", vm = "[object Set]", ym = "[object WeakMap]", bm = "[object DataView]", qS = Uo(rd), XS = Uo(Xs), ZS = Uo(nd), YS = Uo(od), JS = Uo(td), Dn = ts;
(rd && Dn(new rd(new ArrayBuffer(1))) != bm || Xs && Dn(new Xs()) != mm || nd && Dn(nd.resolve()) != gm || od && Dn(new od()) != vm || td && Dn(new td()) != ym) && (Dn = function(i) {
var e = ts(i), t = e == $S ? i.constructor : void 0, r = t ? Uo(t) : "";
if (r)
switch (r) {
case qS:
return bm;
case XS:
return mm;
case ZS:
return gm;
case YS:
return vm;
case JS:
return ym;
}
return e;
});
var xm = Vr.Uint8Array, KS = "__lodash_hash_undefined__";
function QS(i) {
return this.__data__.set(i, KS), this;
}
function eT(i) {
return this.__data__.has(i);
}
function jc(i) {
var e = -1, t = i == null ? 0 : i.length;
for (this.__data__ = new fn(); ++e < t; )
this.add(i[e]);
}
jc.prototype.add = jc.prototype.push = QS;
jc.prototype.has = eT;
function tT(i, e) {
for (var t = -1, r = i == null ? 0 : i.length; ++t < r; )
if (e(i[t], t, i))
return !0;
return !1;
}
function iT(i, e) {
return i.has(e);
}
var rT = 1, nT = 2;
function T0(i, e, t, r, n, o) {
var a = t & rT, s = i.length, c = e.length;
if (s != c && !(a && c > s))
return !1;
var l = o.get(i), h = o.get(e);
if (l && h)
return l == e && h == i;
var u = -1, p = !0, g = t & nT ? new jc() : void 0;
for (o.set(i, e), o.set(e, i); ++u < s; ) {
var m = i[u], d = e[u];
if (r)
var y = a ? r(d, m, u, e, i, o) : r(m, d, u, i, e, o);
if (y !== void 0) {
if (y)
continue;
p = !1;
break;
}
if (g) {
if (!tT(e, function(f, v) {
if (!iT(g, v) && (m === f || n(m, f, t, r, o)))
return g.push(v);
})) {
p = !1;
break;
}
} else if (!(m === d || n(m, d, t, r, o))) {
p = !1;
break;
}
}
return o.delete(i), o.delete(e), p;
}
function oT(i) {
var e = -1, t = Array(i.size);
return i.forEach(function(r, n) {
t[++e] = [n, r];
}), t;
}
function aT(i) {
var e = -1, t = Array(i.size);
return i.forEach(function(r) {
t[++e] = r;
}), t;
}
var sT = 1, lT = 2, cT = "[object Boolean]", uT = "[object Date]", hT = "[object Error]", dT = "[object Map]", pT = "[object Number]", fT = "[object RegExp]", mT = "[object Set]", gT = "[object String]", vT = "[object Symbol]", yT = "[object ArrayBuffer]", bT = "[object DataView]", wm = Nr ? Nr.prototype : void 0, Zu = wm ? wm.valueOf : void 0;
function xT(i, e, t, r, n, o, a) {
switch (t) {
case bT:
if (i.byteLength != e.byteLength || i.byteOffset != e.byteOffset)
return !1;
i = i.buffer, e = e.buffer;
case yT:
return !(i.byteLength != e.byteLength || !o(new xm(i), new xm(e)));
case cT:
case uT:
case pT:
return lp(+i, +e);
case hT:
return i.name == e.name && i.message == e.message;
case fT:
case gT:
return i == e + "";
case dT:
var s = oT;
case mT:
var c = r & sT;
if (s || (s = aT), i.size != e.size && !c)
return !1;
var l = a.get(i);
if (l)
return l == e;
r |= lT, a.set(i, e);
var h = T0(s(i), s(e), r, n, o, a);
return a.delete(i), h;
case vT:
if (Zu)
return Zu.call(i) == Zu.call(e);
}
return !1;
}
var wT = 1, _T = Object.prototype, MT = _T.hasOwnProperty;
function ST(i, e, t, r, n, o) {
var a = t & wT, s = fm(i), c = s.length, l = fm(e), h = l.length;
if (c != h && !a)
return !1;
for (var u = c; u--; ) {
var p = s[u];
if (!(a ? p in e : MT.call(e, p)))
return !1;
}
var g = o.get(i), m = o.get(e);
if (g && m)
return g == e && m == i;
var d = !0;
o.set(i, e), o.set(e, i);
for (var y = a; ++u < c; ) {
p = s[u];
var f = i[p], v = e[p];
if (r)
var M = a ? r(v, f, p, e, i, o) : r(f, v, p, i, e, o);
if (!(M === void 0 ? f === v || n(f, v, t, r, o) : M)) {
d = !1;
break;
}
y || (y = p == "constructor");
}
if (d && !y) {
var S = i.constructor, T = e.constructor;
S != T && "constructor" in i && "constructor" in e && !(typeof S == "function" && S instanceof S && typeof T == "function" && T instanceof T) && (d = !1);
}
return o.delete(i), o.delete(e), d;
}
var TT = 1, _m = "[object Arguments]", Mm = "[object Array]", Nl = "[object Object]", ET = Object.prototype, Sm = ET.hasOwnProperty;
function AT(i, e, t, r, n, o) {
var a = yr(i), s = yr(e), c = a ? Mm : Dn(i), l = s ? Mm : Dn(e);
c = c == _m ? Nl : c, l = l == _m ? Nl : l;
var h = c == Nl, u = l == Nl, p = c == l;
if (p && id(i)) {
if (!id(e))
return !1;
a = !0, h = !1;
}
if (p && !h)
return o || (o = new rn()), a || _0(i) ? T0(i, e, t, r, n, o) : xT(i, e, c, t, r, n, o);
if (!(t & TT)) {
var g = h && Sm.call(i, "__wrapped__"), m = u && Sm.call(e, "__wrapped__");
if (g || m) {
var d = g ? i.value() : i, y = m ? e.value() : e;
return o || (o = new rn()), n(d, y, t, r, o);
}
}
return p ? (o || (o = new rn()), ST(i, e, t, r, n, o)) : !1;
}
function du(i, e, t, r, n) {
return i === e ? !0 : i == null || e == null || !Ca(i) && !Ca(e) ? i !== i && e !== e : AT(i, e, t, r, du, n);
}
var CT = 1, LT = 2;
function RT(i, e, t, r) {
var n = t.length, o = n;
if (i == null)
return !o;
for (i = Object(i); n--; ) {
var a = t[n];
if (a[2] ? a[1] !== i[a[0]] : !(a[0] in i))
return !1;
}
for (; ++n < o; ) {
a = t[n];
var s = a[0], c = i[s], l = a[1];
if (a[2]) {
if (c === void 0 && !(s in i))
return !1;
} else {
var h = new rn(), u;
if (!(u === void 0 ? du(l, c, CT | LT, r, h) : u))
return !1;
}
}
return !0;
}
function E0(i) {
return i === i && !Hn(i);
}
function OT(i) {
for (var e = M0(i), t = e.length; t--; ) {
var r = e[t], n = i[r];
e[t] = [r, n, E0(n)];
}
return e;
}
function A0(i, e) {
return function(t) {
return t == null ? !1 : t[i] === e && (e !== void 0 || i in Object(t));
};
}
function PT(i) {
var e = OT(i);
return e.length == 1 && e[0][2] ? A0(e[0][0], e[0][1]) : function(t) {
return t === i || RT(t, i, e);
};
}
function IT(i, e) {
return i != null && e in Object(i);
}
function DT(i, e, t) {
e = hu(e, i);
for (var r = -1, n = e.length, o = !1; ++r < n; ) {
var a = pl(e[r]);
if (!(o = i != null && t(i, a)))
break;
i = i[a];
}
return o || ++r != n ? o : (n = i == null ? 0 : i.length, !!n && cp(n) && sp(a, n) && (yr(i) || up(i)));
}
function C0(i, e) {
return i != null && DT(i, e, IT);
}
var NT = 1, BT = 2;
function kT(i, e) {
return hp(i) && E0(e) ? A0(pl(i), e) : function(t) {
var r = Kr(t, i);
return r === void 0 && r === e ? C0(t, i) : du(e, r, NT | BT);
};
}
function zT(i) {
return function(e) {
return e == null ? void 0 : e[i];
};
}
function FT(i) {
return function(e) {
return pp(e, i);
};
}
function VT(i) {
return hp(i) ? zT(pl(i)) : FT(i);
}
function UT(i) {
return typeof i == "function" ? i : i == null ? v0 : typeof i == "object" ? yr(i) ? kT(i[0], i[1]) : PT(i) : VT(i);
}
var Yu = function() {
return Vr.Date.now();
}, GT = "Expected a function", HT = Math.max, jT = Math.min;
function ad(i, e, t) {
var r, n, o, a, s, c, l = 0, h = !1, u = !1, p = !0;
if (typeof i != "function")
throw new TypeError(GT);
e = nm(e) || 0, Hn(t) && (h = !!t.leading, u = "maxWait" in t, o = u ? HT(nm(t.maxWait) || 0, e) : o, p = "trailing" in t ? !!t.trailing : p);
function g(x) {
var w = r, A = n;
return r = n = void 0, l = x, a = i.apply(A, w), a;
}
function m(x) {
return l = x, s = setTimeout(f, e), h ? g(x) : a;
}
function d(x) {
var w = x - c, A = x - l, _ = e - w;
return u ? jT(_, o - A) : _;
}
function y(x) {
var w = x - c, A = x - l;
return c === void 0 || w >= e || w < 0 || u && A >= o;
}
function f() {
var x = Yu();
if (y(x))
return v(x);
s = setTimeout(f, d(x));
}
function v(x) {
return s = void 0, p && r ? g(x) : (r = n = void 0, a);
}
function M() {
s !== void 0 && clearTimeout(s), l = 0, r = c = n = s = void 0;
}
function S() {
return s === void 0 ? a : v(Yu());
}
function T() {
var x = Yu(), w = y(x);
if (r = arguments, n = this, c = x, w) {
if (s === void 0)
return m(c);
if (u)
return clearTimeout(s), s = setTimeout(f, e), g(c);
}
return s === void 0 && (s = setTimeout(f, e)), a;
}
return T.cancel = M, T.flush = S, T;
}
function WT(i, e, t) {
var r = i == null ? 0 : i.length;
if (!r)
return -1;
var n = r - 1;
return Y_(i, UT(e), n);
}
function Wc(i) {
for (var e = -1, t = i == null ? 0 : i.length, r = {}; ++e < t; ) {
var n = i[e];
r[n[0]] = n[1];
}
return r;
}
function sd(i, e) {
return du(i, e);
}
function nn(i) {
return i == null;
}
function $T(i) {
return i === void 0;
}
function qT(i, e, t, r) {
if (!Hn(i))
return i;
e = hu(e, i);
for (var n = -1, o = e.length, a = o - 1, s = i; s != null && ++n < o; ) {
var c = pl(e[n]), l = t;
if (c === "__proto__" || c === "constructor" || c === "prototype")
return i;
if (n != a) {
var h = s[c];
l = void 0, l === void 0 && (l = Hn(h) ? h : sp(e[n + 1]) ? [] : {});
}
iM(s, c, l), s = s[c];
}
return i;
}
function XT(i, e, t) {
for (var r = -1, n = e.length, o = {}; ++r < n; ) {
var a = e[r], s = pp(i, a);
t(s, a) && qT(o, hu(a, i), s);
}
return o;
}
function ZT(i, e) {
return XT(i, e, function(t, r) {
return C0(i, r);
});
}
var YT = IS(function(i, e) {
return i == null ? {} : ZT(i, e);
});
const gr = (i) => i === void 0, fp = (i) => typeof i == "boolean", _t = (i) => typeof i == "number", Mo = (i) => typeof Element > "u" ? !1 : i instanceof Element, JT = (i) => Li(i) ? !Number.isNaN(Number(i)) : !1, KT = (i = "") => i.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"), Bn = (i) => o_(i), Tm = (i) => Object.keys(i);
class L0 extends Error {
constructor(e) {
super(e), this.name = "ElementPlusError";
}
}
function is(i, e) {
throw new L0(`[${i}] ${e}`);
}
function Zt(i, e) {
if (process.env.NODE_ENV !== "production") {
const t = Li(i) ? new L0(`[${i}] ${e}`) : i;
console.warn(t);
}
}
const QT = "utils/dom/style", R0 = (i = "") => i.split(" ").filter((e) => !!e.trim()), Em = (i, e) => {
!i || !e.trim() || i.classList.add(...R0(e));
}, $c = (i, e) => {
!i || !e.trim() || i.classList.remove(...R0(e));
}, vs = (i, e) => {
var t;
if (!Kt || !i || !e)
return "";
let r = i_(e);
r === "float" && (r = "cssFloat");
try {
const n = i.style[r];
if (n)
return n;
const o = (t = document.defaultView) == null ? void 0 : t.getComputedStyle(i, "");
return o ? o[r] : "";
} catch {
return i.style[r];
}
};
function qc(i, e = "px") {
if (!i)
return "";
if (_t(i) || JT(i))
return `${i}${e}`;
if (Li(i))
return i;
Zt(QT, "binding value must be a string or number");
}
function eE(i, e) {
if (!Kt)
return;
if (!e) {
i.scrollTop = 0;
return;
}
const t = [];
let r = e.offsetParent;
for (; r !== null && i !== r && i.contains(r); )
t.push(r), r = r.offsetParent;
const n = e.offsetTop + t.reduce((c, l) => c + l.offsetTop, 0), o = n + e.offsetHeight, a = i.scrollTop, s = a + i.clientHeight;
n < a ? i.scrollTop = n : o > s && (i.scrollTop = o - i.clientHeight);
}
/*! Element Plus Icons Vue v2.3.1 */
var tE = /* @__PURE__ */ Ie({
name: "ArrowDown",
__name: "arrow-down",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"
})
]));
}
}), mp = tE, iE = /* @__PURE__ */ Ie({
name: "ArrowLeft",
__name: "arrow-left",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"
})
]));
}
}), jn = iE, rE = /* @__PURE__ */ Ie({
name: "ArrowRight",
__name: "arrow-right",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
})
]));
}
}), Wn = rE, nE = /* @__PURE__ */ Ie({
name: "ArrowUp",
__name: "arrow-up",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"
})
]));
}
}), oE = nE, aE = /* @__PURE__ */ Ie({
name: "CircleCheck",
__name: "circle-check",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
}),
ke("path", {
fill: "currentColor",
d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"
})
]));
}
}), sE = aE, lE = /* @__PURE__ */ Ie({
name: "CircleClose",
__name: "circle-close",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"
}),
ke("path", {
fill: "currentColor",
d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
})
]));
}
}), gp = lE, cE = /* @__PURE__ */ Ie({
name: "Close",
__name: "close",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
})
]));
}
}), ld = cE, uE = /* @__PURE__ */ Ie({
name: "Delete",
__name: "delete",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"
})
]));
}
}), Xc = uE, hE = /* @__PURE__ */ Ie({
name: "Hide",
__name: "hide",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"
}),
ke("path", {
fill: "currentColor",
d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"
})
]));
}
}), dE = hE, pE = /* @__PURE__ */ Ie({
name: "Loading",
__name: "loading",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"
})
]));
}
}), O0 = pE, fE = /* @__PURE__ */ Ie({
name: "Minus",
__name: "minus",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"
})
]));
}
}), mE = fE, gE = /* @__PURE__ */ Ie({
name: "Plus",
__name: "plus",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"
})
]));
}
}), pu = gE, vE = /* @__PURE__ */ Ie({
name: "View",
__name: "view",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"
})
]));
}
}), yE = vE, bE = /* @__PURE__ */ Ie({
name: "WarningFilled",
__name: "warning-filled",
setup(i) {
return (e, t) => (ge(), Le("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"
})
]));
}
}), P0 = bE;
const I0 = "__epPropKey", Ze = (i) => i, xE = (i) => Ai(i) && !!i[I0], fu = (i, e) => {
if (!Ai(i) || xE(i))
return i;
const { values: t, required: r, default: n, type: o, validator: a } = i, s = {
type: o,
required: !!r,
validator: t || a ? (c) => {
let l = !1, h = [];
if (t && (h = Array.from(t), Qf(i, "default") && h.push(n), l || (l = h.includes(c))), a && (l || (l = a(c))), !l && h.length > 0) {
const u = [...new Set(h)].map((p) => JSON.stringify(p)).join(", ");
fw(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${u}], got value ${JSON.stringify(c)}.`);
}
return l;
} : void 0,
[I0]: !0
};
return Qf(i, "default") && (s.default = n), s;
}, ht = (i) => Wc(Object.entries(i).map(([e, t]) => [
e,
fu(t, e)
])), $n = Ze([
String,
Object,
Function
]), D0 = {
validating: O0,
success: sE,
error: gp
}, ui = (i, e) => {
if (i.install = (t) => {
for (const r of [i, ...Object.values(e ?? {})])
t.component(r.name, r);
}, e)
for (const [t, r] of Object.entries(e))
i[t] = r;
return i;
}, wE = (i, e) => (i.install = (t) => {
t.directive(e, i);
}, i), mn = (i) => (i.install = $s, i), Pr = {
tab: "Tab",
enter: "Enter",
space: "Space",
left: "ArrowLeft",
up: "ArrowUp",
right: "ArrowRight",
down: "ArrowDown",
esc: "Escape",
delete: "Delete",
backspace: "Backspace",
numpadEnter: "NumpadEnter",
pageUp: "PageUp",
pageDown: "PageDown",
home: "Home",
end: "End"
}, Pt = "update:modelValue", Kn = "change", So = "input", N0 = ["", "default", "small", "large"], Bc = (i) => {
const e = Bi(i) ? i : [i], t = [];
return e.forEach((r) => {
var n;
Bi(r) ? t.push(...Bc(r)) : Qh(r) && Bi(r.children) ? t.push(...Bc(r.children)) : (t.push(r), Qh(r) && (n = r.component) != null && n.subTree && t.push(...Bc(r.component.subTree)));
}), t;
}, _E = (i) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(i), Qr = (i) => i, ME = ["class", "style"], SE = /^on[A-Z]/, TE = (i = {}) => {
const { excludeListeners: e = !1, excludeKeys: t } = i, r = ce(() => ((t == null ? void 0 : t.value) || []).concat(ME)), n = ri();
return n ? ce(() => {
var o;
return Wc(Object.entries((o = n.proxy) == null ? void 0 : o.$attrs).filter(([a]) => !r.value.includes(a) && !(e && SE.test(a))));
}) : (Zt("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), ce(() => ({})));
}, EE = ({ from: i, replacement: e, scope: t, version: r, ref: n, type: o = "API" }, a) => {
Ke(() => G(a), (s) => {
s && Zt(t, `[${o}] ${i} is about to be deprecated in version ${r}, please use ${e} instead.
For more detail, please visit: ${n}
`);
}, {
immediate: !0
});
};
var AE = {
name: "en",
el: {
breadcrumb: {
label: "Breadcrumb"
},
colorpicker: {
confirm: "OK",
clear: "Clear",
defaultLabel: "color picker",
description: "current color is {color}. press enter to select a new color.",
alphaLabel: "pick alpha value"
},
datepicker: {
now: "Now",
today: "Today",
cancel: "Cancel",
clear: "Clear",
confirm: "OK",
dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
monthTablePrompt: "Use the arrow keys and enter to select the month",
yearTablePrompt: "Use the arrow keys and enter to select the year",
selectedDate: "Selected date",
selectDate: "Select date",
selectTime: "Select time",
startDate: "Start Date",
startTime: "Start Time",
endDate: "End Date",
endTime: "End Time",
prevYear: "Previous Year",
nextYear: "Next Year",
prevMonth: "Previous Month",
nextMonth: "Next Month",
year: "",
month1: "January",
month2: "February",
month3: "March",
month4: "April",
month5: "May",
month6: "June",
month7: "July",
month8: "August",
month9: "September",
month10: "October",
month11: "November",
month12: "December",
week: "week",
weeks: {
sun: "Sun",
mon: "Mon",
tue: "Tue",
wed: "Wed",
thu: "Thu",
fri: "Fri",
sat: "Sat"
},
weeksFull: {
sun: "Sunday",
mon: "Monday",
tue: "Tuesday",
wed: "Wednesday",
thu: "Thursday",
fri: "Friday",
sat: "Saturday"
},
months: {
jan: "Jan",
feb: "Feb",
mar: "Mar",
apr: "Apr",
may: "May",
jun: "Jun",
jul: "Jul",
aug: "Aug",
sep: "Sep",
oct: "Oct",
nov: "Nov",
dec: "Dec"
}
},
inputNumber: {
decrease: "decrease number",
increase: "increase number"
},
select: {
loading: "Loading",
noMatch: "No matching data",
noData: "No data",
placeholder: "Select"
},
mention: {
loading: "Loading"
},
dropdown: {
toggleDropdown: "Toggle Dropdown"
},
cascader: {
noMatch: "No matching data",
loading: "Loading",
placeholder: "Select",
noData: "No data"
},
pagination: {
goto: "Go to",
pagesize: "/page",
total: "Total {total}",
pageClassifier: "",
page: "Page",
prev: "Go to previous page",
next: "Go to next page",
currentPage: "page {pager}",
prevPages: "Previous {pager} pages",
nextPages: "Next {pager} pages",
deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
},
dialog: {
close: "Close this dialog"
},
drawer: {
close: "Close this dialog"
},
messagebox: {
title: "Message",
confirm: "OK",
cancel: "Cancel",
error: "Illegal input",
close: "Close this dialog"
},
upload: {
deleteTip: "press delete to remove",
delete: "Delete",
preview: "Preview",
continue: "Continue"
},
slider: {
defaultLabel: "slider between {min} and {max}",
defaultRangeStartLabel: "pick start value",
defaultRangeEndLabel: "pick end value"
},
table: {
emptyText: "No Data",
confirmFilter: "Confirm",
resetFilter: "Reset",
clearFilter: "All",
sumText: "Sum"
},
tour: {
next: "Next",
previous: "Previous",
finish: "Finish"
},
tree: {
emptyText: "No Data"
},
transfer: {
noMatch: "No matching data",
noData: "No data",
titles: ["List 1", "List 2"],
filterPlaceholder: "Enter keyword",
noCheckedFormat: "{total} items",
hasCheckedFormat: "{checked}/{total} checked"
},
image: {
error: "FAILED"
},
pageHeader: {
title: "Back"
},
popconfirm: {
confirmButtonText: "Yes",
cancelButtonText: "No"
},
carousel: {
leftArrow: "Carousel arrow left",
rightArrow: "Carousel arrow right",
indicator: "Carousel switch to index {index}"
}
}
};
const CE = (i) => (e, t) => LE(e, t, G(i)), LE = (i, e, t) => Kr(t, i, i).replace(/\{(\w+)\}/g, (r, n) => {
var o;
return `${(o = e == null ? void 0 : e[n]) != null ? o : `{${n}}`}`;
}), RE = (i) => {
const e = ce(() => G(i).name), t = Ro(i) ? i : Ae(i);
return {
lang: e,
locale: t,
t: CE(i)
};
}, B0 = Symbol("localeContextKey"), mu = (i) => {
const e = i || ct(B0, Ae());
return RE(ce(() => e.value || AE));
}, kc = "el", OE = "is-", lo = (i, e, t, r, n) => {
let o = `${i}-${e}`;
return t && (o += `-${t}`), r && (o += `__${r}`), n && (o += `--${n}`), o;
}, k0 = Symbol("namespaceContextKey"), vp = (i) => {
const e = i || (ri() ? ct(k0, Ae(kc)) : Ae(kc));
return ce(() => G(e) || kc);
}, it = (i, e) => {
const t = vp(e);
return {
namespace: t,
b: (r = "") => lo(t.value, i, r, "", ""),
e: (r) => r ? lo(t.value, i, "", r, "") : "",
m: (r) => r ? lo(t.value, i, "", "", r) : "",
be: (r, n) => r && n ? lo(t.value, i, r, n, "") : "",
em: (r, n) => r && n ? lo(t.value, i, "", r, n) : "",
bm: (r, n) => r && n ? lo(t.value, i, r, "", n) : "",
bem: (r, n, o) => r && n && o ? lo(t.value, i, r, n, o) : "",
is: (r, ...n) => {
const o = n.length >= 1 ? n[0] : !0;
return r && o ? `${OE}${r}` : "";
},
cssVar: (r) => {
const n = {};
for (const o in r)
r[o] && (n[`--${t.value}-${o}`] = r[o]);
return n;
},
cssVarName: (r) => `--${t.value}-${r}`,
cssVarBlock: (r) => {
const n = {};
for (const o in r)
r[o] && (n[`--${t.value}-${i}-${o}`] = r[o]);
return n;
},
cssVarBlockName: (r) => `--${t.value}-${i}-${r}`
};
}, PE = fu({
type: Ze(Boolean),
default: null
}), IE = fu({
type: Ze(Function)
}), DE = (i) => {
const e = `update:${i}`, t = `onUpdate:${i}`, r = [e], n = {
[i]: PE,
[t]: IE
};
return {
useModelToggle: ({
indicator: o,
toggleReason: a,
shouldHideWhenRouteChanges: s,
shouldProceed: c,
onShow: l,
onHide: h
}) => {
const u = ri(), { emit: p } = u, g = u.props, m = ce(() => Si(g[t])), d = ce(() => g[i] === null), y = (x) => {
o.value !== !0 && (o.value = !0, a && (a.value = x), Si(l) && l(x));
}, f = (x) => {
o.value !== !1 && (o.value = !1, a && (a.value = x), Si(h) && h(x));
}, v = (x) => {
if (g.disabled === !0 || Si(c) && !c())
return;
const w = m.value && Kt;
w && p(e, !0), (d.value || !w) && y(x);
}, M = (x) => {
if (g.disabled === !0 || !Kt)
return;
const w = m.value && Kt;
w && p(e, !1), (d.value || !w) && f(x);
}, S = (x) => {
fp(x) && (g.disabled && x ? m.value && p(e, !1) : o.value !== x && (x ? y() : f()));
}, T = () => {
o.value ? M() : v();
};
return Ke(() => g[i], S), s && u.appContext.config.globalProperties.$route !== void 0 && Ke(() => ({
...u.proxy.$route
}), () => {
s.value && o.value && M();
}), ei(() => {
S(g[i]);
}), {
hide: M,
show: v,
toggle: T,
hasUpdateHandler: m
};
},
useModelToggleProps: n,
useModelToggleEmits: r
};
}, z0 = (i) => {
const e = ri();
return ce(() => {
var t, r;
return (r = (t = e == null ? void 0 : e.proxy) == null ? void 0 : t.$props) == null ? void 0 : r[i];
});
};
var zi = "top", rr = "bottom", nr = "right", Fi = "left", yp = "auto", fl = [zi, rr, nr, Fi], La = "start", Zs = "end", NE = "clippingParents", F0 = "viewport", ys = "popper", BE = "reference", Am = fl.reduce(function(i, e) {
return i.concat([e + "-" + La, e + "-" + Zs]);
}, []), rs = [].concat(fl, [yp]).reduce(function(i, e) {
return i.concat([e, e + "-" + La, e + "-" + Zs]);
}, []), kE = "beforeRead", zE = "read", FE = "afterRead", VE = "beforeMain", UE = "main", GE = "afterMain", HE = "beforeWrite", jE = "write", WE = "afterWrite", $E = [kE, zE, FE, VE, UE, GE, HE, jE, WE];
function Br(i) {
return i ? (i.nodeName || "").toLowerCase() : null;
}
function wr(i) {
if (i == null) return window;
if (i.toString() !== "[object Window]") {
var e = i.ownerDocument;
return e && e.defaultView || window;
}
return i;
}
function Ra(i) {
var e = wr(i).Element;
return i instanceof e || i instanceof Element;
}
function ir(i) {
var e = wr(i).HTMLElement;
return i instanceof e || i instanceof HTMLElement;
}
function bp(i) {
if (typeof ShadowRoot > "u") return !1;
var e = wr(i).ShadowRoot;
return i instanceof e || i instanceof ShadowRoot;
}
function qE(i) {
var e = i.state;
Object.keys(e.elements).forEach(function(t) {
var r = e.styles[t] || {}, n = e.attributes[t] || {}, o = e.elements[t];
!ir(o) || !Br(o) || (Object.assign(o.style, r), Object.keys(n).forEach(function(a) {
var s = n[a];
s === !1 ? o.removeAttribute(a) : o.setAttribute(a, s === !0 ? "" : s);
}));
});
}
function XE(i) {
var e = i.state, t = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} };
return Object.assign(e.elements.popper.style, t.popper), e.styles = t, e.elements.arrow && Object.assign(e.elements.arrow.style, t.arrow), function() {
Object.keys(e.elements).forEach(function(r) {
var n = e.elements[r], o = e.attributes[r] || {}, a = Object.keys(e.styles.hasOwnProperty(r) ? e.styles[r] : t[r]), s = a.reduce(function(c, l) {
return c[l] = "", c;
}, {});
!ir(n) || !Br(n) || (Object.assign(n.style, s), Object.keys(o).forEach(function(c) {
n.removeAttribute(c);
}));
});
};
}
var V0 = { name: "applyStyles", enabled: !0, phase: "write", fn: qE, effect: XE, requires: ["computeStyles"] };
function Ir(i) {
return i.split("-")[0];
}
var To = Math.max, Zc = Math.min, Oa = Math.round;
function Pa(i, e) {
e === void 0 && (e = !1);
var t = i.getBoundingClientRect(), r = 1, n = 1;
if (ir(i) && e) {
var o = i.offsetHeight, a = i.offsetWidth;
a > 0 && (r = Oa(t.width) / a || 1), o > 0 && (n = Oa(t.height) / o || 1);
}
return { width: t.width / r, height: t.height / n, top: t.top / n, right: t.right / r, bottom: t.bottom / n, left: t.left / r, x: t.left / r, y: t.top / n };
}
function xp(i) {
var e = Pa(i), t = i.offsetWidth, r = i.offsetHeight;
return Math.abs(e.width - t) <= 1 && (t = e.width), Math.abs(e.height - r) <= 1 && (r = e.height), { x: i.offsetLeft, y: i.offsetTop, width: t, height: r };
}
function U0(i, e) {
var t = e.getRootNode && e.getRootNode();
if (i.contains(e)) return !0;
if (t && bp(t)) {
var r = e;
do {
if (r && i.isSameNode(r)) return !0;
r = r.parentNode || r.host;
} while (r);
}
return !1;
}
function cn(i) {
return wr(i).getComputedStyle(i);
}
function ZE(i) {
return ["table", "td", "th"].indexOf(Br(i)) >= 0;
}
function Qn(i) {
return ((Ra(i) ? i.ownerDocument : i.document) || window.document).documentElement;
}
function gu(i) {
return Br(i) === "html" ? i : i.assignedSlot || i.parentNode || (bp(i) ? i.host : null) || Qn(i);
}
function Cm(i) {
return !ir(i) || cn(i).position === "fixed" ? null : i.offsetParent;
}
function YE(i) {
var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, t = navigator.userAgent.indexOf("Trident") !== -1;
if (t && ir(i)) {
var r = cn(i);
if (r.position === "fixed") return null;
}
var n = gu(i);
for (bp(n) && (n = n.host); ir(n) && ["html", "body"].indexOf(Br(n)) < 0; ) {
var o = cn(n);
if (o.transform !== "none" || o.perspective !== "none" || o.contain === "paint" || ["transform", "perspective"].indexOf(o.willChange) !== -1 || e && o.willChange === "filter" || e && o.filter && o.filter !== "none") return n;
n = n.parentNode;
}
return null;
}
function ml(i) {
for (var e = wr(i), t = Cm(i); t && ZE(t) && cn(t).position === "static"; ) t = Cm(t);
return t && (Br(t) === "html" || Br(t) === "body" && cn(t).position === "static") ? e : t || YE(i) || e;
}
function wp(i) {
return ["top", "bottom"].indexOf(i) >= 0 ? "x" : "y";
}
function zs(i, e, t) {
return To(i, Zc(e, t));
}
function JE(i, e, t) {
var r = zs(i, e, t);
return r > t ? t : r;
}
function G0() {
return { top: 0, right: 0, bottom: 0, left: 0 };
}
function H0(i) {
return Object.assign({}, G0(), i);
}
function j0(i, e) {
return e.reduce(function(t, r) {
return t[r] = i, t;
}, {});
}
var KE = function(i, e) {
return i = typeof i == "function" ? i(Object.assign({}, e.rects, { placement: e.placement })) : i, H0(typeof i != "number" ? i : j0(i, fl));
};
function QE(i) {
var e, t = i.state, r = i.name, n = i.options, o = t.elements.arrow, a = t.modifiersData.popperOffsets, s = Ir(t.placement), c = wp(s), l = [Fi, nr].indexOf(s) >= 0, h = l ? "height" : "width";
if (!(!o || !a)) {
var u = KE(n.padding, t), p = xp(o), g = c === "y" ? zi : Fi, m = c === "y" ? rr : nr, d = t.rects.reference[h] + t.rects.reference[c] - a[c] - t.rects.popper[h], y = a[c] - t.rects.reference[c], f = ml(o), v = f ? c === "y" ? f.clientHeight || 0 : f.clientWidth || 0 : 0, M = d / 2 - y / 2, S = u[g], T = v - p[h] - u[m], x = v / 2 - p[h] / 2 + M, w = zs(S, x, T), A = c;
t.modifiersData[r] = (e = {}, e[A] = w, e.centerOffset = w - x, e);
}
}
function eA(i) {
var e = i.state, t = i.options, r = t.element, n = r === void 0 ? "[data-popper-arrow]" : r;
n != null && (typeof n == "string" && (n = e.elements.popper.querySelector(n), !n) || !U0(e.elements.popper, n) || (e.elements.arrow = n));
}
var tA = { name: "arrow", enabled: !0, phase: "main", fn: QE, effect: eA, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] };
function Ia(i) {
return i.split("-")[1];
}
var iA = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
function rA(i) {
var e = i.x, t = i.y, r = window, n = r.devicePixelRatio || 1;
return { x: Oa(e * n) / n || 0, y: Oa(t * n) / n || 0 };
}
function Lm(i) {
var e, t = i.popper, r = i.popperRect, n = i.placement, o = i.variation, a = i.offsets, s = i.position, c = i.gpuAcceleration, l = i.adaptive, h = i.roundOffsets, u = i.isFixed, p = a.x, g = p === void 0 ? 0 : p, m = a.y, d = m === void 0 ? 0 : m, y = typeof h == "function" ? h({ x: g, y: d }) : { x: g, y: d };
g = y.x, d = y.y;
var f = a.hasOwnProperty("x"), v = a.hasOwnProperty("y"), M = Fi, S = zi, T = window;
if (l) {
var x = ml(t), w = "clientHeight", A = "clientWidth";
if (x === wr(t) && (x = Qn(t), cn(x).position !== "static" && s === "absolute" && (w = "scrollHeight", A = "scrollWidth")), x = x, n === zi || (n === Fi || n === nr) && o === Zs) {
S = rr;
var _ = u && x === T && T.visualViewport ? T.visualViewport.height : x[w];
d -= _ - r.height, d *= c ? 1 : -1;
}
if (n === Fi || (n === zi || n === rr) && o === Zs) {
M = nr;
var E = u && x === T && T.visualViewport ? T.visualViewport.width : x[A];
g -= E - r.width, g *= c ? 1 : -1;
}
}
var O = Object.assign({ position: s }, l && iA), L = h === !0 ? rA({ x: g, y: d }) : { x: g, y: d };
if (g = L.x, d = L.y, c) {
var C;
return Object.assign({}, O, (C = {}, C[S] = v ? "0" : "", C[M] = f ? "0" : "", C.transform = (T.devicePixelRatio || 1) <= 1 ? "translate(" + g + "px, " + d + "px)" : "translate3d(" + g + "px, " + d + "px, 0)", C));
}
return Object.assign({}, O, (e = {}, e[S] = v ? d + "px" : "", e[M] = f ? g + "px" : "", e.transform = "", e));
}
function nA(i) {
var e = i.state, t = i.options, r = t.gpuAcceleration, n = r === void 0 ? !0 : r, o = t.adaptive, a = o === void 0 ? !0 : o, s = t.roundOffsets, c = s === void 0 ? !0 : s, l = { placement: Ir(e.placement), variation: Ia(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: n, isFixed: e.options.strategy === "fixed" };
e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, Lm(Object.assign({}, l, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: a, roundOffsets: c })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, Lm(Object.assign({}, l, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: !1, roundOffsets: c })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement });
}
var W0 = { name: "computeStyles", enabled: !0, phase: "beforeWrite", fn: nA, data: {} }, Bl = { passive: !0 };
function oA(i) {
var e = i.state, t = i.instance, r = i.options, n = r.scroll, o = n === void 0 ? !0 : n, a = r.resize, s = a === void 0 ? !0 : a, c = wr(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper);
return o && l.forEach(function(h) {
h.addEventListener("scroll", t.update, Bl);
}), s && c.addEventListener("resize", t.update, Bl), function() {
o && l.forEach(function(h) {
h.removeEventListener("scroll", t.update, Bl);
}), s && c.removeEventListener("resize", t.update, Bl);
};
}
var $0 = { name: "eventListeners", enabled: !0, phase: "write", fn: function() {
}, effect: oA, data: {} }, aA = { left: "right", right: "left", bottom: "top", top: "bottom" };
function zc(i) {
return i.replace(/left|right|bottom|top/g, function(e) {
return aA[e];
});
}
var sA = { start: "end", end: "start" };
function Rm(i) {
return i.replace(/start|end/g, function(e) {
return sA[e];
});
}
function _p(i) {
var e = wr(i), t = e.pageXOffset, r = e.pageYOffset;
return { scrollLeft: t, scrollTop: r };
}
function Mp(i) {
return Pa(Qn(i)).left + _p(i).scrollLeft;
}
function lA(i) {
var e = wr(i), t = Qn(i), r = e.visualViewport, n = t.clientWidth, o = t.clientHeight, a = 0, s = 0;
return r && (n = r.width, o = r.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (a = r.offsetLeft, s = r.offsetTop)), { width: n, height: o, x: a + Mp(i), y: s };
}
function cA(i) {
var e, t = Qn(i), r = _p(i), n = (e = i.ownerDocument) == null ? void 0 : e.body, o = To(t.scrollWidth, t.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), a = To(t.scrollHeight, t.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0), s = -r.scrollLeft + Mp(i), c = -r.scrollTop;
return cn(n || t).direction === "rtl" && (s += To(t.clientWidth, n ? n.clientWidth : 0) - o), { width: o, height: a, x: s, y: c };
}
function Sp(i) {
var e = cn(i), t = e.overflow, r = e.overflowX, n = e.overflowY;
return /auto|scroll|overlay|hidden/.test(t + n + r);
}
function q0(i) {
return ["html", "body", "#document"].indexOf(Br(i)) >= 0 ? i.ownerDocument.body : ir(i) && Sp(i) ? i : q0(gu(i));
}
function Fs(i, e) {
var t;
e === void 0 && (e = []);
var r = q0(i), n = r === ((t = i.ownerDocument) == null ? void 0 : t.body), o = wr(r), a = n ? [o].concat(o.visualViewport || [], Sp(r) ? r : []) : r, s = e.concat(a);
return n ? s : s.concat(Fs(gu(a)));
}
function cd(i) {
return Object.assign({}, i, { left: i.x, top: i.y, right: i.x + i.width, bottom: i.y + i.height });
}
function uA(i) {
var e = Pa(i);
return e.top = e.top + i.clientTop, e.left = e.left + i.clientLeft, e.bottom = e.top + i.clientHeight, e.right = e.left + i.clientWidth, e.width = i.clientWidth, e.height = i.clientHeight, e.x = e.left, e.y = e.top, e;
}
function Om(i, e) {
return e === F0 ? cd(lA(i)) : Ra(e) ? uA(e) : cd(cA(Qn(i)));
}
function hA(i) {
var e = Fs(gu(i)), t = ["absolute", "fixed"].indexOf(cn(i).position) >= 0, r = t && ir(i) ? ml(i) : i;
return Ra(r) ? e.filter(function(n) {
return Ra(n) && U0(n, r) && Br(n) !== "body";
}) : [];
}
function dA(i, e, t) {
var r = e === "clippingParents" ? hA(i) : [].concat(e), n = [].concat(r, [t]), o = n[0], a = n.reduce(function(s, c) {
var l = Om(i, c);
return s.top = To(l.top, s.top), s.right = Zc(l.right, s.right), s.bottom = Zc(l.bottom, s.bottom), s.left = To(l.left, s.left), s;
}, Om(i, o));
return a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a;
}
function X0(i) {
var e = i.reference, t = i.element, r = i.placement, n = r ? Ir(r) : null, o = r ? Ia(r) : null, a = e.x + e.width / 2 - t.width / 2, s = e.y + e.height / 2 - t.height / 2, c;
switch (n) {
case zi:
c = { x: a, y: e.y - t.height };
break;
case rr:
c = { x: a, y: e.y + e.height };
break;
case nr:
c = { x: e.x + e.width, y: s };
break;
case Fi:
c = { x: e.x - t.width, y: s };
break;
default:
c = { x: e.x, y: e.y };
}
var l = n ? wp(n) : null;
if (l != null) {
var h = l === "y" ? "height" : "width";
switch (o) {
case La:
c[l] = c[l] - (e[h] / 2 - t[h] / 2);
break;
case Zs:
c[l] = c[l] + (e[h] / 2 - t[h] / 2);
break;
}
}
return c;
}
function Ys(i, e) {
e === void 0 && (e = {});
var t = e, r = t.placement, n = r === void 0 ? i.placement : r, o = t.boundary, a = o === void 0 ? NE : o, s = t.rootBoundary, c = s === void 0 ? F0 : s, l = t.elementContext, h = l === void 0 ? ys : l, u = t.altBoundary, p = u === void 0 ? !1 : u, g = t.padding, m = g === void 0 ? 0 : g, d = H0(typeof m != "number" ? m : j0(m, fl)), y = h === ys ? BE : ys, f = i.rects.popper, v = i.elements[p ? y : h], M = dA(Ra(v) ? v : v.contextElement || Qn(i.elements.popper), a, c), S = Pa(i.elements.reference), T = X0({ reference: S, element: f, strategy: "absolute", placement: n }), x = cd(Object.assign({}, f, T)), w = h === ys ? x : S, A = { top: M.top - w.top + d.top, bottom: w.bottom - M.bottom + d.bottom, left: M.left - w.left + d.left, right: w.right - M.right + d.right }, _ = i.modifiersData.offset;
if (h === ys && _) {
var E = _[n];
Object.keys(A).forEach(function(O) {
var L = [nr, rr].indexOf(O) >= 0 ? 1 : -1, C = [zi, rr].indexOf(O) >= 0 ? "y" : "x";
A[O] += E[C] * L;
});
}
return A;
}
function pA(i, e) {
e === void 0 && (e = {});
var t = e, r = t.placement, n = t.boundary, o = t.rootBoundary, a = t.padding, s = t.flipVariations, c = t.allowedAutoPlacements, l = c === void 0 ? rs : c, h = Ia(r), u = h ? s ? Am : Am.filter(function(m) {
return Ia(m) === h;
}) : fl, p = u.filter(function(m) {
return l.indexOf(m) >= 0;
});
p.length === 0 && (p = u);
var g = p.reduce(function(m, d) {
return m[d] = Ys(i, { placement: d, boundary: n, rootBoundary: o, padding: a })[Ir(d)], m;
}, {});
return Object.keys(g).sort(function(m, d) {
return g[m] - g[d];
});
}
function fA(i) {
if (Ir(i) === yp) return [];
var e = zc(i);
return [Rm(i), e, Rm(e)];
}
function mA(i) {
var e = i.state, t = i.options, r = i.name;
if (!e.modifiersData[r]._skip) {
for (var n = t.mainAxis, o = n === void 0 ? !0 : n, a = t.altAxis, s = a === void 0 ? !0 : a, c = t.fallbackPlacements, l = t.padding, h = t.boundary, u = t.rootBoundary, p = t.altBoundary, g = t.flipVariations, m = g === void 0 ? !0 : g, d = t.allowedAutoPlacements, y = e.options.placement, f = Ir(y), v = f === y, M = c || (v || !m ? [zc(y)] : fA(y)), S = [y].concat(M).reduce(function(ne, X) {
return ne.concat(Ir(X) === yp ? pA(e, { placement: X, boundary: h, rootBoundary: u, padding: l, flipVariations: m, allowedAutoPlacements: d }) : X);
}, []), T = e.rects.reference, x = e.rects.popper, w = /* @__PURE__ */ new Map(), A = !0, _ = S[0], E = 0; E < S.length; E++) {
var O = S[E], L = Ir(O), C = Ia(O) === La, I = [zi, rr].indexOf(L) >= 0, R = I ? "width" : "height", b = Ys(e, { placement: O, boundary: h, rootBoundary: u, altBoundary: p, padding: l }), P = I ? C ? nr : Fi : C ? rr : zi;
T[R] > x[R] && (P = zc(P));
var N = zc(P), D = [];
if (o && D.push(b[L] <= 0), s && D.push(b[P] <= 0, b[N] <= 0), D.every(function(ne) {
return ne;
})) {
_ = O, A = !1;
break;
}
w.set(O, D);
}
if (A) for (var k = m ? 3 : 1, V = function(ne) {
var X = S.find(function(z) {
var H = w.get(z);
if (H) return H.slice(0, ne).every(function(ee) {
return ee;
});
});
if (X) return _ = X, "break";
}, q = k; q > 0; q--) {
var Y = V(q);
if (Y === "break") break;
}
e.placement !== _ && (e.modifiersData[r]._skip = !0, e.placement = _, e.reset = !0);
}
}
var gA = { name: "flip", enabled: !0, phase: "main", fn: mA, requiresIfExists: ["offset"], data: { _skip: !1 } };
function Pm(i, e, t) {
return t === void 0 && (t = { x: 0, y: 0 }), { top: i.top - e.height - t.y, right: i.right - e.width + t.x, bottom: i.bottom - e.height + t.y, left: i.left - e.width - t.x };
}
function Im(i) {
return [zi, nr, rr, Fi].some(function(e) {
return i[e] >= 0;
});
}
function vA(i) {
var e = i.state, t = i.name, r = e.rects.reference, n = e.rects.popper, o = e.modifiersData.preventOverflow, a = Ys(e, { elementContext: "reference" }), s = Ys(e, { altBoundary: !0 }), c = Pm(a, r), l = Pm(s, n, o), h = Im(c), u = Im(l);
e.modifiersData[t] = { referenceClippingOffsets: c, popperEscapeOffsets: l, isReferenceHidden: h, hasPopperEscaped: u }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": h, "data-popper-escaped": u });
}
var yA = { name: "hide", enabled: !0, phase: "main", requiresIfExists: ["preventOverflow"], fn: vA };
function bA(i, e, t) {
var r = Ir(i), n = [Fi, zi].indexOf(r) >= 0 ? -1 : 1, o = typeof t == "function" ? t(Object.assign({}, e, { placement: i })) : t, a = o[0], s = o[1];
return a = a || 0, s = (s || 0) * n, [Fi, nr].indexOf(r) >= 0 ? { x: s, y: a } : { x: a, y: s };
}
function xA(i) {
var e = i.state, t = i.options, r = i.name, n = t.offset, o = n === void 0 ? [0, 0] : n, a = rs.reduce(function(h, u) {
return h[u] = bA(u, e.rects, o), h;
}, {}), s = a[e.placement], c = s.x, l = s.y;
e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += c, e.modifiersData.popperOffsets.y += l), e.modifiersData[r] = a;
}
var wA = { name: "offset", enabled: !0, phase: "main", requires: ["popperOffsets"], fn: xA };
function _A(i) {
var e = i.state, t = i.name;
e.modifiersData[t] = X0({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement });
}
var Z0 = { name: "popperOffsets", enabled: !0, phase: "read", fn: _A, data: {} };
function MA(i) {
return i === "x" ? "y" : "x";
}
function SA(i) {
var e = i.state, t = i.options, r = i.name, n = t.mainAxis, o = n === void 0 ? !0 : n, a = t.altAxis, s = a === void 0 ? !1 : a, c = t.boundary, l = t.rootBoundary, h = t.altBoundary, u = t.padding, p = t.tether, g = p === void 0 ? !0 : p, m = t.tetherOffset, d = m === void 0 ? 0 : m, y = Ys(e, { boundary: c, rootBoundary: l, padding: u, altBoundary: h }), f = Ir(e.placement), v = Ia(e.placement), M = !v, S = wp(f), T = MA(S), x = e.modifiersData.popperOffsets, w = e.rects.reference, A = e.rects.popper, _ = typeof d == "function" ? d(Object.assign({}, e.rects, { placement: e.placement })) : d, E = typeof _ == "number" ? { mainAxis: _, altAxis: _ } : Object.assign({ mainAxis: 0, altAxis: 0 }, _), O = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, L = { x: 0, y: 0 };
if (x) {
if (o) {
var C, I = S === "y" ? zi : Fi, R = S === "y" ? rr : nr, b = S === "y" ? "height" : "width", P = x[S], N = P + y[I], D = P - y[R], k = g ? -A[b] / 2 : 0, V = v === La ? w[b] : A[b], q = v === La ? -A[b] : -w[b], Y = e.elements.arrow, ne = g && Y ? xp(Y) : { width: 0, height: 0 }, X = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : G0(), z = X[I], H = X[R], ee = zs(0, w[b], ne[b]), Q = M ? w[b] / 2 - k - ee - z - E.mainAxis : V - ee - z - E.mainAxis, J = M ? -w[b] / 2 + k + ee + H + E.mainAxis : q + ee + H + E.mainAxis, W = e.elements.arrow && ml(e.elements.arrow), K = W ? S === "y" ? W.clientTop || 0 : W.clientLeft || 0 : 0, ie = (C = O == null ? void 0 : O[S]) != null ? C : 0, B = P + Q - ie - K, j = P + J - ie, re = zs(g ? Zc(N, B) : N, P, g ? To(D, j) : D);
x[S] = re, L[S] = re - P;
}
if (s) {
var F, U = S === "x" ? zi : Fi, se = S === "x" ? rr : nr, ue = x[T], fe = T === "y" ? "height" : "width", ve = ue + y[U], _e = ue - y[se], ae = [zi, Fi].indexOf(f) !== -1, Te = (F = O == null ? void 0 : O[T]) != null ? F : 0, Ee = ae ? ve : ue - w[fe] - A[fe] - Te + E.altAxis, oe = ae ? ue + w[fe] + A[fe] - Te - E.altAxis : _e, Me = g && ae ? JE(Ee, ue, oe) : zs(g ? Ee : ve, ue, g ? oe : _e);
x[T] = Me, L[T] = Me - ue;
}
e.modifiersData[r] = L;
}
}
var TA = { name: "preventOverflow", enabled: !0, phase: "main", fn: SA, requiresIfExists: ["offset"] };
function EA(i) {
return { scrollLeft: i.scrollLeft, scrollTop: i.scrollTop };
}
function AA(i) {
return i === wr(i) || !ir(i) ? _p(i) : EA(i);
}
function CA(i) {
var e = i.getBoundingClientRect(), t = Oa(e.width) / i.offsetWidth || 1, r = Oa(e.height) / i.offsetHeight || 1;
return t !== 1 || r !== 1;
}
function LA(i, e, t) {
t === void 0 && (t = !1);
var r = ir(e), n = ir(e) && CA(e), o = Qn(e), a = Pa(i, n), s = { scrollLeft: 0, scrollTop: 0 }, c = { x: 0, y: 0 };
return (r || !r && !t) && ((Br(e) !== "body" || Sp(o)) && (s = AA(e)), ir(e) ? (c = Pa(e, !0), c.x += e.clientLeft, c.y += e.clientTop) : o && (c.x = Mp(o))), { x: a.left + s.scrollLeft - c.x, y: a.top + s.scrollTop - c.y, width: a.width, height: a.height };
}
function RA(i) {
var e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), r = [];
i.forEach(function(o) {
e.set(o.name, o);
});
function n(o) {
t.add(o.name);
var a = [].concat(o.requires || [], o.requiresIfExists || []);
a.forEach(function(s) {
if (!t.has(s)) {
var c = e.get(s);
c && n(c);
}
}), r.push(o);
}
return i.forEach(function(o) {
t.has(o.name) || n(o);
}), r;
}
function OA(i) {
var e = RA(i);
return $E.reduce(function(t, r) {
return t.concat(e.filter(function(n) {
return n.phase === r;
}));
}, []);
}
function PA(i) {
var e;
return function() {
return e || (e = new Promise(function(t) {
Promise.resolve().then(function() {
e = void 0, t(i());
});
})), e;
};
}
function IA(i) {
var e = i.reduce(function(t, r) {
var n = t[r.name];
return t[r.name] = n ? Object.assign({}, n, r, { options: Object.assign({}, n.options, r.options), data: Object.assign({}, n.data, r.data) }) : r, t;
}, {});
return Object.keys(e).map(function(t) {
return e[t];
});
}
var Dm = { placement: "bottom", modifiers: [], strategy: "absolute" };
function Nm() {
for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++) e[t] = arguments[t];
return !e.some(function(r) {
return !(r && typeof r.getBoundingClientRect == "function");
});
}
function Tp(i) {
i === void 0 && (i = {});
var e = i, t = e.defaultModifiers, r = t === void 0 ? [] : t, n = e.defaultOptions, o = n === void 0 ? Dm : n;
return function(a, s, c) {
c === void 0 && (c = o);
var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Dm, o), modifiersData: {}, elements: { reference: a, popper: s }, attributes: {}, styles: {} }, h = [], u = !1, p = { state: l, setOptions: function(d) {
var y = typeof d == "function" ? d(l.options) : d;
m(), l.options = Object.assign({}, o, l.options, y), l.scrollParents = { reference: Ra(a) ? Fs(a) : a.contextElement ? Fs(a.contextElement) : [], popper: Fs(s) };
var f = OA(IA([].concat(r, l.options.modifiers)));
return l.orderedModifiers = f.filter(function(v) {
return v.enabled;
}), g(), p.update();
}, forceUpdate: function() {
if (!u) {
var d = l.elements, y = d.reference, f = d.popper;
if (Nm(y, f)) {
l.rects = { reference: LA(y, ml(f), l.options.strategy === "fixed"), popper: xp(f) }, l.reset = !1, l.placement = l.options.placement, l.orderedModifiers.forEach(function(A) {
return l.modifiersData[A.name] = Object.assign({}, A.data);
});
for (var v = 0; v < l.orderedModifiers.length; v++) {
if (l.reset === !0) {
l.reset = !1, v = -1;
continue;
}
var M = l.orderedModifiers[v], S = M.fn, T = M.options, x = T === void 0 ? {} : T, w = M.name;
typeof S == "function" && (l = S({ state: l, options: x, name: w, instance: p }) || l);
}
}
}
}, update: PA(function() {
return new Promise(function(d) {
p.forceUpdate(), d(l);
});
}), destroy: function() {
m(), u = !0;
} };
if (!Nm(a, s)) return p;
p.setOptions(c).then(function(d) {
!u && c.onFirstUpdate && c.onFirstUpdate(d);
});
function g() {
l.orderedModifiers.forEach(function(d) {
var y = d.name, f = d.options, v = f === void 0 ? {} : f, M = d.effect;
if (typeof M == "function") {
var S = M({ state: l, name: y, instance: p, options: v }), T = function() {
};
h.push(S || T);
}
});
}
function m() {
h.forEach(function(d) {
return d();
}), h = [];
}
return p;
};
}
Tp();
var DA = [$0, Z0, W0, V0];
Tp({ defaultModifiers: DA });
var NA = [$0, Z0, W0, V0, wA, gA, TA, tA, yA], BA = Tp({ defaultModifiers: NA });
const kA = (i, e, t = {}) => {
const r = {
name: "updateState",
enabled: !0,
phase: "write",
fn: ({ state: c }) => {
const l = zA(c);
Object.assign(a.value, l);
},
requires: ["computeStyles"]
}, n = ce(() => {
const { onFirstUpdate: c, placement: l, strategy: h, modifiers: u } = G(t);
return {
onFirstUpdate: c,
placement: l || "bottom",
strategy: h || "absolute",
modifiers: [
...u || [],
r,
{ name: "applyStyles", enabled: !1 }
]
};
}), o = Ci(), a = Ae({
styles: {
popper: {
position: G(n).strategy,
left: "0",
top: "0"
},
arrow: {
position: "absolute"
}
},
attributes: {}
}), s = () => {
o.value && (o.value.destroy(), o.value = void 0);
};
return Ke(n, (c) => {
const l = G(o);
l && l.setOptions(c);
}, {
deep: !0
}), Ke([i, e], ([c, l]) => {
s(), !(!c || !l) && (o.value = BA(c, l, G(n)));
}), or(() => {
s();
}), {
state: ce(() => {
var c;
return { ...((c = G(o)) == null ? void 0 : c.state) || {} };
}),
styles: ce(() => G(a).styles),
attributes: ce(() => G(a).attributes),
update: () => {
var c;
return (c = G(o)) == null ? void 0 : c.update();
},
forceUpdate: () => {
var c;
return (c = G(o)) == null ? void 0 : c.forceUpdate();
},
instanceRef: ce(() => G(o))
};
};
function zA(i) {
const e = Object.keys(i.elements), t = Wc(e.map((n) => [n, i.styles[n] || {}])), r = Wc(e.map((n) => [n, i.attributes[n]]));
return {
styles: t,
attributes: r
};
}
function Bm() {
let i;
const e = (r, n) => {
t(), i = window.setTimeout(r, n);
}, t = () => window.clearTimeout(i);
return su(() => t()), {
registerTimeout: e,
cancelTimeout: t
};
}
const ud = {
prefix: Math.floor(Math.random() * 1e4),
current: 0
}, FA = Symbol("elIdInjection"), Ep = () => ri() ? ct(FA, ud) : ud, vu = (i) => {
const e = Ep();
!Kt && e === ud && Zt("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
usage: app.provide(ID_INJECTION_KEY, {
prefix: number,
current: number,
})`);
const t = vp();
return ce(() => G(i) || `${t.value}-id-${e.prefix}-${e.current++}`);
};
let xa = [];
const km = (i) => {
const e = i;
e.key === Pr.esc && xa.forEach((t) => t(e));
}, VA = (i) => {
ei(() => {
xa.length === 0 && document.addEventListener("keydown", km), Kt && xa.push(i);
}), or(() => {
xa = xa.filter((e) => e !== i), xa.length === 0 && Kt && document.removeEventListener("keydown", km);
});
};
let zm;
const Y0 = () => {
const i = vp(), e = Ep(), t = ce(() => `${i.value}-popper-container-${e.prefix}`), r = ce(() => `#${t.value}`);
return {
id: t,
selector: r
};
}, UA = (i) => {
const e = document.createElement("div");
return e.id = i, document.body.appendChild(e), e;
}, GA = () => {
const { id: i, selector: e } = Y0();
return mw(() => {
Kt && (process.env.NODE_ENV === "test" || !zm || !document.body.querySelector(e.value)) && (zm = UA(i.value));
}), {
id: i,
selector: e
};
}, HA = ht({
showAfter: {
type: Number,
default: 0
},
hideAfter: {
type: Number,
default: 200
},
autoClose: {
type: Number,
default: 0
}
}), jA = ({
showAfter: i,
hideAfter: e,
autoClose: t,
open: r,
close: n
}) => {
const { registerTimeout: o } = Bm(), {
registerTimeout: a,
cancelTimeout: s
} = Bm();
return {
onOpen: (c) => {
o(() => {
r(c);
const l = G(t);
_t(l) && l > 0 && a(() => {
n(c);
}, l);
}, G(i));
},
onClose: (c) => {
s(), o(() => {
n(c);
}, G(e));
}
};
}, J0 = Symbol("elForwardRef"), WA = (i) => {
ci(J0, {
setForwardRef: (e) => {
i.value = e;
}
});
}, $A = (i) => ({
mounted(e) {
i(e);
},
updated(e) {
i(e);
},
unmounted() {
i(null);
}
}), Fm = {
current: 0
}, Vm = Ae(0), K0 = 2e3, Um = Symbol("elZIndexContextKey"), Q0 = Symbol("zIndexContextKey"), ey = (i) => {
const e = ri() ? ct(Um, Fm) : Fm, t = i || (ri() ? ct(Q0, void 0) : void 0), r = ce(() => {
const a = G(t);
return _t(a) ? a : K0;
}), n = ce(() => r.value + Vm.value), o = () => (e.current++, Vm.value = e.current, n.value);
return !Kt && !ct(Um) && Zt("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`), {
initialZIndex: r,
currentZIndex: n,
nextZIndex: o
};
};
function qA(i) {
let e;
function t() {
if (i.value == null)
return;
const { selectionStart: n, selectionEnd: o, value: a } = i.value;
if (n == null || o == null)
return;
const s = a.slice(0, Math.max(0, n)), c = a.slice(Math.max(0, o));
e = {
selectionStart: n,
selectionEnd: o,
value: a,
beforeTxt: s,
afterTxt: c
};
}
function r() {
if (i.value == null || e == null)
return;
const { value: n } = i.value, { beforeTxt: o, afterTxt: a, selectionStart: s } = e;
if (o == null || a == null || s == null)
return;
let c = n.length;
if (n.endsWith(a))
c = n.length - a.length;
else if (n.startsWith(o))
c = o.length;
else {
const l = o[s - 1], h = n.indexOf(l, s - 1);
h !== -1 && (c = h + 1);
}
i.value.setSelectionRange(c, c);
}
return [t, r];
}
const XA = (i, e, t) => Bc(i.subTree).filter((r) => {
var n;
return Qh(r) && ((n = r.type) == null ? void 0 : n.name) === e && !!r.component;
}).map((r) => r.component.uid).map((r) => t[r]).filter((r) => !!r), ZA = (i, e) => {
const t = {}, r = Ci([]);
return {
children: r,
addChild: (n) => {
t[n.uid] = n, r.value = XA(i, e, t);
},
removeChild: (n) => {
delete t[n], r.value = r.value.filter((o) => o.uid !== n);
}
};
}, Da = fu({
type: String,
values: N0,
required: !1
}), ty = Symbol("size"), YA = () => {
const i = ct(ty, {});
return ce(() => G(i.size) || "");
};
function iy(i, {
beforeFocus: e,
afterFocus: t,
beforeBlur: r,
afterBlur: n
} = {}) {
const o = ri(), { emit: a } = o, s = Ci(), c = Ae(!1), l = (p) => {
Si(e) && e(p) || c.value || (c.value = !0, a("focus", p), t == null || t());
}, h = (p) => {
var g;
Si(r) && r(p) || p.relatedTarget && (g = s.value) != null && g.contains(p.relatedTarget) || (c.value = !1, a("blur", p), n == null || n());
}, u = () => {
var p, g;
(p = s.value) != null && p.contains(document.activeElement) && s.value !== document.activeElement || (g = i.value) == null || g.focus();
};
return Ke(s, (p) => {
p && p.setAttribute("tabindex", "-1");
}), si(s, "focus", l, !0), si(s, "blur", h, !0), si(s, "click", u, !0), process.env.NODE_ENV === "test" && ei(() => {
const p = Mo(i.value) ? i.value : document.querySelector("input,textarea");
p && (si(p, "focus", l, !0), si(p, "blur", h, !0));
}), {
isFocused: c,
wrapperRef: s,
handleFocus: l,
handleBlur: h
};
}
function ry({
afterComposition: i,
emit: e
}) {
const t = Ae(!1), r = (a) => {
e == null || e("compositionstart", a), t.value = !0;
}, n = (a) => {
var s;
e == null || e("compositionupdate", a);
const c = (s = a.target) == null ? void 0 : s.value, l = c[c.length - 1] || "";
t.value = !_E(l);
}, o = (a) => {
e == null || e("compositionend", a), t.value && (t.value = !1, wt(() => i(a)));
};
return {
isComposing: t,
handleComposition: (a) => {
a.type === "compositionend" ? o(a) : n(a);
},
handleCompositionStart: r,
handleCompositionUpdate: n,
handleCompositionEnd: o
};
}
const ny = Symbol("emptyValuesContextKey"), JA = "use-empty-values", KA = ["", void 0, null], QA = void 0, e2 = ht({
emptyValues: Array,
valueOnClear: {
type: [String, Number, Boolean, Function],
default: void 0,
validator: (i) => Si(i) ? !i() : !i
}
}), t2 = (i, e) => {
const t = ri() ? ct(ny, Ae({})) : Ae({}), r = ce(() => i.emptyValues || t.value.emptyValues || KA), n = ce(() => Si(i.valueOnClear) ? i.valueOnClear() : i.valueOnClear !== void 0 ? i.valueOnClear : Si(t.value.valueOnClear) ? t.value.valueOnClear() : t.value.valueOnClear !== void 0 ? t.value.valueOnClear : QA), o = (a) => r.value.includes(a);
return r.value.includes(n.value) || Zt(JA, "value-on-clear should be a value of empty-values"), {
emptyValues: r,
valueOnClear: n,
isEmptyValue: o
};
}, i2 = ht({
ariaLabel: String,
ariaOrientation: {
type: String,
values: ["horizontal", "vertical", "undefined"]
},
ariaControls: String
}), Ho = (i) => YT(i2, i), oy = Symbol(), Yc = Ae();
function Ap(i, e = void 0) {
const t = ri() ? ct(oy, Yc) : Yc;
return i ? ce(() => {
var r, n;
return (n = (r = t.value) == null ? void 0 : r[i]) != null ? n : e;
}) : t;
}
function r2(i, e) {
const t = Ap(), r = it(i, ce(() => {
var s;
return ((s = t.value) == null ? void 0 : s.namespace) || kc;
})), n = mu(ce(() => {
var s;
return (s = t.value) == null ? void 0 : s.locale;
})), o = ey(ce(() => {
var s;
return ((s = t.value) == null ? void 0 : s.zIndex) || K0;
})), a = ce(() => {
var s;
return G(e) || ((s = t.value) == null ? void 0 : s.size) || "";
});
return n2(ce(() => G(t) || {})), {
ns: r,
locale: n,
zIndex: o,
size: a
};
}
const n2 = (i, e, t = !1) => {
var r;
const n = !!ri(), o = n ? Ap() : void 0, a = (r = void 0) != null ? r : n ? ci : void 0;
if (!a) {
Zt("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
return;
}
const s = ce(() => {
const c = G(i);
return o != null && o.value ? o2(o.value, c) : c;
});
return a(oy, s), a(B0, ce(() => s.value.locale)), a(k0, ce(() => s.value.namespace)), a(Q0, ce(() => s.value.zIndex)), a(ty, {
size: ce(() => s.value.size || "")
}), a(ny, ce(() => ({
emptyValues: s.value.emptyValues,
valueOnClear: s.value.valueOnClear
}))), (t || !Yc.value) && (Yc.value = s.value), s;
}, o2 = (i, e) => {
const t = [.../* @__PURE__ */ new Set([...Tm(i), ...Tm(e)])], r = {};
for (const n of t)
r[n] = e[n] !== void 0 ? e[n] : i[n];
return r;
};
var ot = (i, e) => {
const t = i.__vccOpts || i;
for (const [r, n] of e)
t[r] = n;
return t;
};
const a2 = ht({
size: {
type: Ze([Number, String])
},
color: {
type: String
}
}), s2 = Ie({
name: "ElIcon",
inheritAttrs: !1
}), l2 = /* @__PURE__ */ Ie({
...s2,
props: a2,
setup(i) {
const e = i, t = it("icon"), r = ce(() => {
const { size: n, color: o } = e;
return !n && !o ? {} : {
fontSize: gr(n) ? void 0 : qc(n),
"--color": o
};
});
return (n, o) => (ge(), Le("i", Or({
class: G(t).b(),
style: G(r)
}, n.$attrs), [
qe(n.$slots, "default")
], 16));
}
});
var c2 = /* @__PURE__ */ ot(l2, [["__file", "icon.vue"]]);
const Dt = ui(c2), Cp = Symbol("formContextKey"), Jc = Symbol("formItemContextKey"), ns = (i, e = {}) => {
const t = Ae(void 0), r = e.prop ? t : z0("size"), n = e.global ? t : YA(), o = e.form ? { size: void 0 } : ct(Cp, void 0), a = e.formItem ? { size: void 0 } : ct(Jc, void 0);
return ce(() => r.value || G(i) || (a == null ? void 0 : a.size) || (o == null ? void 0 : o.size) || n.value || "");
}, yu = (i) => {
const e = z0("disabled"), t = ct(Cp, void 0);
return ce(() => e.value || G(i) || (t == null ? void 0 : t.disabled) || !1);
}, gl = () => {
const i = ct(Cp, void 0), e = ct(Jc, void 0);
return {
form: i,
formItem: e
};
}, Lp = (i, {
formItemContext: e,
disableIdGeneration: t,
disableIdManagement: r
}) => {
t || (t = Ae(!1)), r || (r = Ae(!1));
const n = Ae();
let o;
const a = ce(() => {
var s;
return !!(!(i.label || i.ariaLabel) && e && e.inputIds && ((s = e.inputIds) == null ? void 0 : s.length) <= 1);
});
return ei(() => {
o = Ke([Di(i, "id"), t], ([s, c]) => {
const l = s ?? (c ? void 0 : vu().value);
l !== n.value && (e != null && e.removeInputId && (n.value && e.removeInputId(n.value), !(r != null && r.value) && !c && l && e.addInputId(l)), n.value = l);
}, { immediate: !0 });
}), s0(() => {
o && o(), e != null && e.removeInputId && n.value && e.removeInputId(n.value);
}), {
isLabeledByFormItem: a,
inputId: n
};
};
let lr;
const u2 = `
height:0 !important;
visibility:hidden !important;
${Jw() ? "" : "overflow:hidden !important;"}
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
`, h2 = [
"letter-spacing",
"line-height",
"padding-top",
"padding-bottom",
"font-family",
"font-weight",
"font-size",
"text-rendering",
"text-transform",
"width",
"text-indent",
"padding-left",
"padding-right",
"border-width",
"box-sizing"
];
function d2(i) {
const e = window.getComputedStyle(i), t = e.getPropertyValue("box-sizing"), r = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), n = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width"));
return { contextStyle: h2.map((o) => `${o}:${e.getPropertyValue(o)}`).join(";"), paddingSize: r, borderSize: n, boxSizing: t };
}
function Gm(i, e = 1, t) {
var r;
lr || (lr = document.createElement("textarea"), document.body.appendChild(lr));
const { paddingSize: n, borderSize: o, boxSizing: a, contextStyle: s } = d2(i);
lr.setAttribute("style", `${s};${u2}`), lr.value = i.value || i.placeholder || "";
let c = lr.scrollHeight;
const l = {};
a === "border-box" ? c = c + o : a === "content-box" && (c = c - n), lr.value = "";
const h = lr.scrollHeight - n;
if (_t(e)) {
let u = h * e;
a === "border-box" && (u = u + n + o), c = Math.max(u, c), l.minHeight = `${u}px`;
}
if (_t(t)) {
let u = h * t;
a === "border-box" && (u = u + n + o), c = Math.min(u, c);
}
return l.height = `${c}px`, (r = lr.parentNode) == null || r.removeChild(lr), lr = void 0, l;
}
const p2 = ht({
id: {
type: String,
default: void 0
},
size: Da,
disabled: Boolean,
modelValue: {
type: Ze([
String,
Number,
Object
]),
default: ""
},
maxlength: {
type: [String, Number]
},
minlength: {
type: [String, Number]
},
type: {
type: String,
default: "text"
},
resize: {
type: String,
values: ["none", "both", "horizontal", "vertical"]
},
autosize: {
type: Ze([Boolean, Object]),
default: !1
},
autocomplete: {
type: String,
default: "off"
},
formatter: {
type: Function
},
parser: {
type: Function
},
placeholder: {
type: String
},
form: {
type: String
},
readonly: Boolean,
clearable: Boolean,
showPassword: Boolean,
showWordLimit: Boolean,
suffixIcon: {
type: $n
},
prefixIcon: {
type: $n
},
containerRole: {
type: String,
default: void 0
},
tabindex: {
type: [String, Number],
default: 0
},
validateEvent: {
type: Boolean,
default: !0
},
inputStyle: {
type: Ze([Object, Array, String]),
default: () => Qr({})
},
autofocus: Boolean,
rows: {
type: Number,
default: 2
},
...Ho(["ariaLabel"])
}), f2 = {
[Pt]: (i) => Li(i),
input: (i) => Li(i),
change: (i) => Li(i),
focus: (i) => i instanceof FocusEvent,
blur: (i) => i instanceof FocusEvent,
clear: () => !0,
mouseleave: (i) => i instanceof MouseEvent,
mouseenter: (i) => i instanceof MouseEvent,
keydown: (i) => i instanceof Event,
compositionstart: (i) => i instanceof CompositionEvent,
compositionupdate: (i) => i instanceof CompositionEvent,
compositionend: (i) => i instanceof CompositionEvent
}, m2 = Ie({
name: "ElInput",
inheritAttrs: !1
}), g2 = /* @__PURE__ */ Ie({
...m2,
props: p2,
emits: f2,
setup(i, { expose: e, emit: t }) {
const r = i, n = sw(), o = au(), a = ce(() => {
const ae = {};
return r.containerRole === "combobox" && (ae["aria-haspopup"] = n["aria-haspopup"], ae["aria-owns"] = n["aria-owns"], ae["aria-expanded"] = n["aria-expanded"]), ae;
}), s = ce(() => [
r.type === "textarea" ? y.b() : d.b(),
d.m(g.value),
d.is("disabled", m.value),
d.is("exceed", Y.value),
{
[d.b("group")]: o.prepend || o.append,
[d.m("prefix")]: o.prefix || r.prefixIcon,
[d.m("suffix")]: o.suffix || r.suffixIcon || r.clearable || r.showPassword,
[d.bm("suffix", "password-clear")]: D.value && k.value,
[d.b("hidden")]: r.type === "hidden"
},
n.class
]), c = ce(() => [
d.e("wrapper"),
d.is("focus", _.value)
]), l = TE({
excludeKeys: ce(() => Object.keys(a.value))
}), { form: h, formItem: u } = gl(), { inputId: p } = Lp(r, {
formItemContext: u
}), g = ns(), m = yu(), d = it("input"), y = it("textarea"), f = Ci(), v = Ci(), M = Ae(!1), S = Ae(!1), T = Ae(), x = Ci(r.inputStyle), w = ce(() => f.value || v.value), { wrapperRef: A, isFocused: _, handleFocus: E, handleBlur: O } = iy(w, {
beforeFocus() {
return m.value;
},
afterBlur() {
var ae;
r.validateEvent && ((ae = u == null ? void 0 : u.validate) == null || ae.call(u, "blur").catch((Te) => Zt(Te)));
}
}), L = ce(() => {
var ae;
return (ae = h == null ? void 0 : h.statusIcon) != null ? ae : !1;
}), C = ce(() => (u == null ? void 0 : u.validateState) || ""), I = ce(() => C.value && D0[C.value]), R = ce(() => S.value ? yE : dE), b = ce(() => [
n.style
]), P = ce(() => [
r.inputStyle,
x.value,
{ resize: r.resize }
]), N = ce(() => nn(r.modelValue) ? "" : String(r.modelValue)), D = ce(() => r.clearable && !m.value && !r.readonly && !!N.value && (_.value || M.value)), k = ce(() => r.showPassword && !m.value && !r.readonly && !!N.value && (!!N.value || _.value)), V = ce(() => r.showWordLimit && !!r.maxlength && (r.type === "text" || r.type === "textarea") && !m.value && !r.readonly && !r.showPassword), q = ce(() => N.value.length), Y = ce(() => !!V.value && q.value > Number(r.maxlength)), ne = ce(() => !!o.suffix || !!r.suffixIcon || D.value || r.showPassword || V.value || !!C.value && L.value), [X, z] = qA(f);
er(v, (ae) => {
if (ee(), !V.value || r.resize !== "both")
return;
const Te = ae[0], { width: Ee } = Te.contentRect;
T.value = {
right: `calc(100% - ${Ee + 15 + 6}px)`
};
});
const H = () => {
const { type: ae, autosize: Te } = r;
if (!(!Kt || ae !== "textarea" || !v.value))
if (Te) {
const Ee = Ai(Te) ? Te.minRows : void 0, oe = Ai(Te) ? Te.maxRows : void 0, Me = Gm(v.value, Ee, oe);
x.value = {
overflowY: "hidden",
...Me
}, wt(() => {
v.value.offsetHeight, x.value = Me;
});
} else
x.value = {
minHeight: Gm(v.value).minHeight
};
}, ee = /* @__PURE__ */ ((ae) => {
let Te = !1;
return () => {
var Ee;
Te || !r.autosize || ((Ee = v.value) == null ? void 0 : Ee.offsetParent) === null || (ae(), Te = !0);
};
})(H), Q = () => {
const ae = w.value, Te = r.formatter ? r.formatter(N.value) : N.value;
!ae || ae.value === Te || (ae.value = Te);
}, J = async (ae) => {
X();
let { value: Te } = ae.target;
if (r.formatter && (Te = r.parser ? r.parser(Te) : Te), !K.value) {
if (Te === N.value) {
Q();
return;
}
t(Pt, Te), t("input", Te), await wt(), Q(), z();
}
}, W = (ae) => {
t("change", ae.target.value);
}, {
isComposing: K,
handleCompositionStart: ie,
handleCompositionUpdate: B,
handleCompositionEnd: j
} = ry({ emit: t, afterComposition: J }), re = () => {
S.value = !S.value, F();
}, F = async () => {
var ae;
await wt(), (ae = w.value) == null || ae.focus();
}, U = () => {
var ae;
return (ae = w.value) == null ? void 0 : ae.blur();
}, se = (ae) => {
M.value = !1, t("mouseleave", ae);
}, ue = (ae) => {
M.value = !0, t("mouseenter", ae);
}, fe = (ae) => {
t("keydown", ae);
}, ve = () => {
var ae;
(ae = w.value) == null || ae.select();
}, _e = () => {
t(Pt, ""), t("change", ""), t("clear"), t("input", "");
};
return Ke(() => r.modelValue, () => {
var ae;
wt(() => H()), r.validateEvent && ((ae = u == null ? void 0 : u.validate) == null || ae.call(u, "change").catch((Te) => Zt(Te)));
}), Ke(N, () => Q()), Ke(() => r.type, async () => {
await wt(), Q(), H();
}), ei(() => {
!r.formatter && r.parser && Zt("ElInput", "If you set the parser, you also need to set the formatter."), Q(), wt(H);
}), e({
input: f,
textarea: v,
ref: w,
textareaStyle: P,
autosize: Di(r, "autosize"),
isComposing: K,
focus: F,
blur: U,
select: ve,
clear: _e,
resizeTextarea: H
}), (ae, Te) => (ge(), Le("div", Or(G(a), {
class: [
G(s),
{
[G(d).bm("group", "append")]: ae.$slots.append,
[G(d).bm("group", "prepend")]: ae.$slots.prepend
}
],
style: G(b),
role: ae.containerRole,
onMouseenter: ue,
onMouseleave: se
}), [
Ve(" input "),
ae.type !== "textarea" ? (ge(), Le(Vt, { key: 0 }, [
Ve(" prepend slot "),
ae.$slots.prepend ? (ge(), Le("div", {
key: 0,
class: Re(G(d).be("group", "prepend"))
}, [
qe(ae.$slots, "prepend")
], 2)) : Ve("v-if", !0),
ke("div", {
ref_key: "wrapperRef",
ref: A,
class: Re(G(c))
}, [
Ve(" prefix slot "),
ae.$slots.prefix || ae.prefixIcon ? (ge(), Le("span", {
key: 0,
class: Re(G(d).e("prefix"))
}, [
ke("span", {
class: Re(G(d).e("prefix-inner"))
}, [
qe(ae.$slots, "prefix"),
ae.prefixIcon ? (ge(), Ue(G(Dt), {
key: 0,
class: Re(G(d).e("icon"))
}, {
default: me(() => [
(ge(), Ue(Ni(ae.prefixIcon)))
]),
_: 1
}, 8, ["class"])) : Ve("v-if", !0)
], 2)
], 2)) : Ve("v-if", !0),
ke("input", Or({
id: G(p),
ref_key: "input",
ref: f,
class: G(d).e("inner")
}, G(l), {
minlength: ae.minlength,
maxlength: ae.maxlength,
type: ae.showPassword ? S.value ? "text" : "password" : ae.type,
disabled: G(m),
readonly: ae.readonly,
autocomplete: ae.autocomplete,
tabindex: ae.tabindex,
"aria-label": ae.ariaLabel,
placeholder: ae.placeholder,
style: ae.inputStyle,
form: ae.form,
autofocus: ae.autofocus,
onCompositionstart: G(ie),
onCompositionupdate: G(B),
onCompositionend: G(j),
onInput: J,
onChange: W,
onKeydown: fe
}), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
Ve(" suffix slot "),
G(ne) ? (ge(), Le("span", {
key: 1,
class: Re(G(d).e("suffix"))
}, [
ke("span", {
class: Re(G(d).e("suffix-inner"))
}, [
!G(D) || !G(k) || !G(V) ? (ge(), Le(Vt, { key: 0 }, [
qe(ae.$slots, "suffix"),
ae.suffixIcon ? (ge(), Ue(G(Dt), {
key: 0,
class: Re(G(d).e("icon"))
}, {
default: me(() => [
(ge(), Ue(Ni(ae.suffixIcon)))
]),
_: 1
}, 8, ["class"])) : Ve("v-if", !0)
], 64)) : Ve("v-if", !0),
G(D) ? (ge(), Ue(G(Dt), {
key: 1,
class: Re([G(d).e("icon"), G(d).e("clear")]),
onMousedown: ai(G($s), ["prevent"]),
onClick: _e
}, {
default: me(() => [
le(G(gp))
]),
_: 1
}, 8, ["class", "onMousedown"])) : Ve("v-if", !0),
G(k) ? (ge(), Ue(G(Dt), {
key: 2,
class: Re([G(d).e("icon"), G(d).e("password")]),
onClick: re
}, {
default: me(() => [
(ge(), Ue(Ni(G(R))))
]),
_: 1
}, 8, ["class"])) : Ve("v-if", !0),
G(V) ? (ge(), Le("span", {
key: 3,
class: Re(G(d).e("count"))
}, [
ke("span", {
class: Re(G(d).e("count-inner"))
}, xt(G(q)) + " / " + xt(ae.maxlength), 3)
], 2)) : Ve("v-if", !0),
G(C) && G(I) && G(L) ? (ge(), Ue(G(Dt), {
key: 4,
class: Re([
G(d).e("icon"),
G(d).e("validateIcon"),
G(d).is("loading", G(C) === "validating")
])
}, {
default: me(() => [
(ge(), Ue(Ni(G(I))))
]),
_: 1
}, 8, ["class"])) : Ve("v-if", !0)
], 2)
], 2)) : Ve("v-if", !0)
], 2),
Ve(" append slot "),
ae.$slots.append ? (ge(), Le("div", {
key: 1,
class: Re(G(d).be("group", "append"))
}, [
qe(ae.$slots, "append")
], 2)) : Ve("v-if", !0)
], 64)) : (ge(), Le(Vt, { key: 1 }, [
Ve(" textarea "),
ke("textarea", Or({
id: G(p),
ref_key: "textarea",
ref: v,
class: [G(y).e("inner"), G(d).is("focus", G(_))]
}, G(l), {
minlength: ae.minlength,
maxlength: ae.maxlength,
tabindex: ae.tabindex,
disabled: G(m),
readonly: ae.readonly,
autocomplete: ae.autocomplete,
style: G(P),
"aria-label": ae.ariaLabel,
placeholder: ae.placeholder,
form: ae.form,
autofocus: ae.autofocus,
rows: ae.rows,
onCompositionstart: G(ie),
onCompositionupdate: G(B),
onCompositionend: G(j),
onInput: J,
onFocus: G(E),
onBlur: G(O),
onChange: W,
onKeydown: fe
}), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]),
G(V) ? (ge(), Le("span", {
key: 0,
style: Ot(T.value),
class: Re(G(d).e("count"))
}, xt(G(q)) + " / " + xt(ae.maxlength), 7)) : Ve("v-if", !0)
], 64))
], 16, ["role"]));
}
});
var v2 = /* @__PURE__ */ ot(g2, [["__file", "input.vue"]]);
const y2 = ui(v2), Yo = 4, b2 = {
vertical: {
offset: "offsetHeight",
scroll: "scrollTop",
scrollSize: "scrollHeight",
size: "height",
key: "vertical",
axis: "Y",
client: "clientY",
direction: "top"
},
horizontal: {
offset: "offsetWidth",
scroll: "scrollLeft",
scrollSize: "scrollWidth",
size: "width",
key: "horizontal",
axis: "X",
client: "clientX",
direction: "left"
}
}, x2 = ({
move: i,
size: e,
bar: t
}) => ({
[t.size]: e,
transform: `translate${t.axis}(${i}%)`
}), Rp = Symbol("scrollbarContextKey"), w2 = ht({
vertical: Boolean,
size: String,
move: Number,
ratio: {
type: Number,
required: !0
},
always: Boolean
}), _2 = "Thumb", M2 = /* @__PURE__ */ Ie({
__name: "thumb",
props: w2,
setup(i) {
const e = i, t = ct(Rp), r = it("scrollbar");
t || is(_2, "can not inject scrollbar context");
const n = Ae(), o = Ae(), a = Ae({}), s = Ae(!1);
let c = !1, l = !1, h = Kt ? document.onselectstart : null;
const u = ce(() => b2[e.vertical ? "vertical" : "horizontal"]), p = ce(() => x2({
size: e.size,
move: e.move,
bar: u.value
})), g = ce(() => n.value[u.value.offset] ** 2 / t.wrapElement[u.value.scrollSize] / e.ratio / o.value[u.value.offset]), m = (x) => {
var w;
if (x.stopPropagation(), x.ctrlKey || [1, 2].includes(x.button))
return;
(w = window.getSelection()) == null || w.removeAllRanges(), y(x);
const A = x.currentTarget;
A && (a.value[u.value.axis] = A[u.value.offset] - (x[u.value.client] - A.getBoundingClientRect()[u.value.direction]));
}, d = (x) => {
if (!o.value || !n.value || !t.wrapElement)
return;
const w = Math.abs(x.target.getBoundingClientRect()[u.value.direction] - x[u.value.client]), A = o.value[u.value.offset] / 2, _ = (w - A) * 100 * g.value / n.value[u.value.offset];
t.wrapElement[u.value.scroll] = _ * t.wrapElement[u.value.scrollSize] / 100;
}, y = (x) => {
x.stopImmediatePropagation(), c = !0, document.addEventListener("mousemove", f), document.addEventListener("mouseup", v), h = document.onselectstart, document.onselectstart = () => !1;
}, f = (x) => {
if (!n.value || !o.value || c === !1)
return;
const w = a.value[u.value.axis];
if (!w)
return;
const A = (n.value.getBoundingClientRect()[u.value.direction] - x[u.value.client]) * -1, _ = o.value[u.value.offset] - w, E = (A - _) * 100 * g.value / n.value[u.value.offset];
t.wrapElement[u.value.scroll] = E * t.wrapElement[u.value.scrollSize] / 100;
}, v = () => {
c = !1, a.value[u.value.axis] = 0, document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", v), T(), l && (s.value = !1);
}, M = () => {
l = !1, s.value = !!e.size;
}, S = () => {
l = !0, s.value = c;
};
or(() => {
T(), document.removeEventListener("mouseup", v);
});
const T = () => {
document.onselectstart !== h && (document.onselectstart = h);
};
return si(Di(t, "scrollbarElement"), "mousemove", M), si(Di(t, "scrollbarElement"), "mouseleave", S), (x, w) => (ge(), Ue(hl, {
name: G(r).b("fade"),
persisted: ""
}, {
default: me(() => [
It(ke("div", {
ref_key: "instance",
ref: n,
class: Re([G(r).e("bar"), G(r).is(G(u).key)]),
onMousedown: d
}, [
ke("div", {
ref_key: "thumb",
ref: o,
class: Re(G(r).e("thumb")),
style: Ot(G(p)),
onMousedown: m
}, null, 38)
], 34), [
[fi, x.always || s.value]
])
]),
_: 1
}, 8, ["name"]));
}
});
var Hm = /* @__PURE__ */ ot(M2, [["__file", "thumb.vue"]]);
const S2 = ht({
always: {
type: Boolean,
default: !0
},
minSize: {
type: Number,
required: !0
}
}), T2 = /* @__PURE__ */ Ie({
__name: "bar",
props: S2,
setup(i, { expose: e }) {
const t = i, r = ct(Rp), n = Ae(0), o = Ae(0), a = Ae(""), s = Ae(""), c = Ae(1), l = Ae(1);
return e({
handleScroll: (h) => {
if (h) {
const u = h.offsetHeight - Yo, p = h.offsetWidth - Yo;
o.value = h.scrollTop * 100 / u * c.value, n.value = h.scrollLeft * 100 / p * l.value;
}
},
update: () => {
const h = r == null ? void 0 : r.wrapElement;
if (!h)
return;
const u = h.offsetHeight - Yo, p = h.offsetWidth - Yo, g = u ** 2 / h.scrollHeight, m = p ** 2 / h.scrollWidth, d = Math.max(g, t.minSize), y = Math.max(m, t.minSize);
c.value = g / (u - g) / (d / (u - d)), l.value = m / (p - m) / (y / (p - y)), s.value = d + Yo < u ? `${d}px` : "", a.value = y + Yo < p ? `${y}px` : "";
}
}), (h, u) => (ge(), Le(Vt, null, [
le(Hm, {
move: n.value,
ratio: l.value,
size: a.value,
always: h.always
}, null, 8, ["move", "ratio", "size", "always"]),
le(Hm, {
move: o.value,
ratio: c.value,
size: s.value,
vertical: "",
always: h.always
}, null, 8, ["move", "ratio", "size", "always"])
], 64));
}
});
var E2 = /* @__PURE__ */ ot(T2, [["__file", "bar.vue"]]);
const A2 = ht({
height: {
type: [String, Number],
default: ""
},
maxHeight: {
type: [String, Number],
default: ""
},
native: {
type: Boolean,
default: !1
},
wrapStyle: {
type: Ze([String, Object, Array]),
default: ""
},
wrapClass: {
type: [String, Array],
default: ""
},
viewClass: {
type: [String, Array],
default: ""
},
viewStyle: {
type: [String, Array, Object],
default: ""
},
noresize: Boolean,
tag: {
type: String,
default: "div"
},
always: Boolean,
minSize: {
type: Number,
default: 20
},
tabindex: {
type: [String, Number],
default: void 0
},
id: String,
role: String,
...Ho(["ariaLabel", "ariaOrientation"])
}), C2 = {
scroll: ({
scrollTop: i,
scrollLeft: e
}) => [i, e].every(_t)
}, hd = "ElScrollbar", L2 = Ie({
name: hd
}), R2 = /* @__PURE__ */ Ie({
...L2,
props: A2,
emits: C2,
setup(i, { expose: e, emit: t }) {
const r = i, n = it("scrollbar");
let o, a, s = 0, c = 0;
const l = Ae(), h = Ae(), u = Ae(), p = Ae(), g = ce(() => {
const T = {};
return r.height && (T.height = qc(r.height)), r.maxHeight && (T.maxHeight = qc(r.maxHeight)), [r.wrapStyle, T];
}), m = ce(() => [
r.wrapClass,
n.e("wrap"),
{ [n.em("wrap", "hidden-default")]: !r.native }
]), d = ce(() => [n.e("view"), r.viewClass]), y = () => {
var T;
h.value && ((T = p.value) == null || T.handleScroll(h.value), s = h.value.scrollTop, c = h.value.scrollLeft, t("scroll", {
scrollTop: h.value.scrollTop,
scrollLeft: h.value.scrollLeft
}));
};
function f(T, x) {
Ai(T) ? h.value.scrollTo(T) : _t(T) && _t(x) && h.value.scrollTo(T, x);
}
const v = (T) => {
if (!_t(T)) {
Zt(hd, "value must be a number");
return;
}
h.value.scrollTop = T;
}, M = (T) => {
if (!_t(T)) {
Zt(hd, "value must be a number");
return;
}
h.value.scrollLeft = T;
}, S = () => {
var T;
(T = p.value) == null || T.update();
};
return Ke(() => r.noresize, (T) => {
T ? (o == null || o(), a == null || a()) : ({ stop: o } = er(u, S), a = si("resize", S));
}, { immediate: !0 }), Ke(() => [r.maxHeight, r.height], () => {
r.native || wt(() => {
var T;
S(), h.value && ((T = p.value) == null || T.handleScroll(h.value));
});
}), ci(Rp, Xi({
scrollbarElement: l,
wrapElement: h
})), lw(() => {
h.value && (h.value.scrollTop = s, h.value.scrollLeft = c);
}), ei(() => {
r.native || wt(() => {
S();
});
}), rp(() => S()), e({
wrapRef: h,
update: S,
scrollTo: f,
setScrollTop: v,
setScrollLeft: M,
handleScroll: y
}), (T, x) => (ge(), Le("div", {
ref_key: "scrollbarRef",
ref: l,
class: Re(G(n).b())
}, [
ke("div", {
ref_key: "wrapRef",
ref: h,
class: Re(G(m)),
style: Ot(G(g)),
tabindex: T.tabindex,
onScroll: y
}, [
(ge(), Ue(Ni(T.tag), {
id: T.id,
ref_key: "resizeRef",
ref: u,
class: Re(G(d)),
style: Ot(T.viewStyle),
role: T.role,
"aria-label": T.ariaLabel,
"aria-orientation": T.ariaOrientation
}, {
default: me(() => [
qe(T.$slots, "default")
]),
_: 3
}, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
], 46, ["tabindex"]),
T.native ? Ve("v-if", !0) : (ge(), Ue(E2, {
key: 0,
ref_key: "barRef",
ref: p,
always: T.always,
"min-size": T.minSize
}, null, 8, ["always", "min-size"]))
], 2));
}
});
var O2 = /* @__PURE__ */ ot(R2, [["__file", "scrollbar.vue"]]);
const P2 = ui(O2), Op = Symbol("popper"), ay = Symbol("popperContent"), I2 = [
"dialog",
"grid",
"group",
"listbox",
"menu",
"navigation",
"tooltip",
"tree"
], sy = ht({
role: {
type: String,
values: I2,
default: "tooltip"
}
}), D2 = Ie({
name: "ElPopper",
inheritAttrs: !1
}), N2 = /* @__PURE__ */ Ie({
...D2,
props: sy,
setup(i, { expose: e }) {
const t = i, r = Ae(), n = Ae(), o = Ae(), a = Ae(), s = ce(() => t.role), c = {
triggerRef: r,
popperInstanceRef: n,
contentRef: o,
referenceRef: a,
role: s
};
return e(c), ci(Op, c), (l, h) => qe(l.$slots, "default");
}
});
var B2 = /* @__PURE__ */ ot(N2, [["__file", "popper.vue"]]);
const ly = ht({
arrowOffset: {
type: Number,
default: 5
}
}), k2 = Ie({
name: "ElPopperArrow",
inheritAttrs: !1
}), z2 = /* @__PURE__ */ Ie({
...k2,
props: ly,
setup(i, { expose: e }) {
const t = i, r = it("popper"), { arrowOffset: n, arrowRef: o, arrowStyle: a } = ct(ay, void 0);
return Ke(() => t.arrowOffset, (s) => {
n.value = s;
}), or(() => {
o.value = void 0;
}), e({
arrowRef: o
}), (s, c) => (ge(), Le("span", {
ref_key: "arrowRef",
ref: o,
class: Re(G(r).e("arrow")),
style: Ot(G(a)),
"data-popper-arrow": ""
}, null, 6));
}
});
var F2 = /* @__PURE__ */ ot(z2, [["__file", "arrow.vue"]]);
const Ju = "ElOnlyChild", V2 = Ie({
name: Ju,
setup(i, {
slots: e,
attrs: t
}) {
var r;
const n = ct(J0), o = $A((r = n == null ? void 0 : n.setForwardRef) != null ? r : $s);
return () => {
var a;
const s = (a = e.default) == null ? void 0 : a.call(e, t);
if (!s)
return null;
if (s.length > 1)
return Zt(Ju, "requires exact only one valid child."), null;
const c = cy(s);
return c ? It(cw(c, t), [[o]]) : (Zt(Ju, "no valid child node found"), null);
};
}
});
function cy(i) {
if (!i)
return null;
const e = i;
for (const t of e) {
if (Ai(t))
switch (t.type) {
case uw:
continue;
case o0:
case "svg":
return jm(t);
case Vt:
return cy(t.children);
default:
return t;
}
return jm(t);
}
return null;
}
function jm(i) {
const e = it("only-child");
return le("span", {
class: e.e("content")
}, [i]);
}
const uy = ht({
virtualRef: {
type: Ze(Object)
},
virtualTriggering: Boolean,
onMouseenter: {
type: Ze(Function)
},
onMouseleave: {
type: Ze(Function)
},
onClick: {
type: Ze(Function)
},
onKeydown: {
type: Ze(Function)
},
onFocus: {
type: Ze(Function)
},
onBlur: {
type: Ze(Function)
},
onContextmenu: {
type: Ze(Function)
},
id: String,
open: Boolean
}), U2 = Ie({
name: "ElPopperTrigger",
inheritAttrs: !1
}), G2 = /* @__PURE__ */ Ie({
...U2,
props: uy,
setup(i, { expose: e }) {
const t = i, { role: r, triggerRef: n } = ct(Op, void 0);
WA(n);
const o = ce(() => s.value ? t.id : void 0), a = ce(() => {
if (r && r.value === "tooltip")
return t.open && t.id ? t.id : void 0;
}), s = ce(() => {
if (r && r.value !== "tooltip")
return r.value;
}), c = ce(() => s.value ? `${t.open}` : void 0);
let l;
const h = [
"onMouseenter",
"onMouseleave",
"onClick",
"onKeydown",
"onFocus",
"onBlur",
"onContextmenu"
];
return ei(() => {
Ke(() => t.virtualRef, (u) => {
u && (n.value = tn(u));
}, {
immediate: !0
}), Ke(n, (u, p) => {
l == null || l(), l = void 0, Mo(u) && (h.forEach((g) => {
var m;
const d = t[g];
d && (u.addEventListener(g.slice(2).toLowerCase(), d), (m = p == null ? void 0 : p.removeEventListener) == null || m.call(p, g.slice(2).toLowerCase(), d));
}), l = Ke([o, a, s, c], (g) => {
[
"aria-controls",
"aria-describedby",
"aria-haspopup",
"aria-expanded"
].forEach((m, d) => {
nn(g[d]) ? u.removeAttribute(m) : u.setAttribute(m, g[d]);
});
}, { immediate: !0 })), Mo(p) && [
"aria-controls",
"aria-describedby",
"aria-haspopup",
"aria-expanded"
].forEach((g) => p.removeAttribute(g));
}, {
immediate: !0
});
}), or(() => {
if (l == null || l(), l = void 0, n.value && Mo(n.value)) {
const u = n.value;
h.forEach((p) => {
const g = t[p];
g && u.removeEventListener(p.slice(2).toLowerCase(), g);
}), n.value = void 0;
}
}), e({
triggerRef: n
}), (u, p) => u.virtualTriggering ? Ve("v-if", !0) : (ge(), Ue(G(V2), Or({ key: 0 }, u.$attrs, {
"aria-controls": G(o),
"aria-describedby": G(a),
"aria-expanded": G(c),
"aria-haspopup": G(s)
}), {
default: me(() => [
qe(u.$slots, "default")
]),
_: 3
}, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"]));
}
});
var H2 = /* @__PURE__ */ ot(G2, [["__file", "trigger.vue"]]);
const Ku = "focus-trap.focus-after-trapped", Qu = "focus-trap.focus-after-released", j2 = "focus-trap.focusout-prevented", Wm = {
cancelable: !0,
bubbles: !1
}, W2 = {
cancelable: !0,
bubbles: !1
}, $m = "focusAfterTrapped", qm = "focusAfterReleased", $2 = Symbol("elFocusTrap"), Pp = Ae(), bu = Ae(0), Ip = Ae(0);
let kl = 0;
const hy = (i) => {
const e = [], t = document.createTreeWalker(i, NodeFilter.SHOW_ELEMENT, {
acceptNode: (r) => {
const n = r.tagName === "INPUT" && r.type === "hidden";
return r.disabled || r.hidden || n ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 || r === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
}
});
for (; t.nextNode(); )
e.push(t.currentNode);
return e;
}, Xm = (i, e) => {
for (const t of i)
if (!q2(t, e))
return t;
}, q2 = (i, e) => {
if (process.env.NODE_ENV === "test")
return !1;
if (getComputedStyle(i).visibility === "hidden")
return !0;
for (; i; ) {
if (e && i === e)
return !1;
if (getComputedStyle(i).display === "none")
return !0;
i = i.parentElement;
}
return !1;
}, X2 = (i) => {
const e = hy(i), t = Xm(e, i), r = Xm(e.reverse(), i);
return [t, r];
}, Z2 = (i) => i instanceof HTMLInputElement && "select" in i, On = (i, e) => {
if (i && i.focus) {
const t = document.activeElement;
i.focus({ preventScroll: !0 }), Ip.value = window.performance.now(), i !== t && Z2(i) && e && i.select();
}
};
function Zm(i, e) {
const t = [...i], r = i.indexOf(e);
return r !== -1 && t.splice(r, 1), t;
}
const Y2 = () => {
let i = [];
return {
push: (e) => {
const t = i[0];
t && e !== t && t.pause(), i = Zm(i, e), i.unshift(e);
},
remove: (e) => {
var t, r;
i = Zm(i, e), (r = (t = i[0]) == null ? void 0 : t.resume) == null || r.call(t);
}
};
}, J2 = (i, e = !1) => {
const t = document.activeElement;
for (const r of i)
if (On(r, e), document.activeElement !== t)
return;
}, Ym = Y2(), K2 = () => bu.value > Ip.value, zl = () => {
Pp.value = "pointer", bu.value = window.performance.now();
}, Jm = () => {
Pp.value = "keyboard", bu.value = window.performance.now();
}, Q2 = () => (ei(() => {
kl === 0 && (document.addEventListener("mousedown", zl), document.addEventListener("touchstart", zl), document.addEventListener("keydown", Jm)), kl++;
}), or(() => {
kl--, kl <= 0 && (document.removeEventListener("mousedown", zl), document.removeEventListener("touchstart", zl), document.removeEventListener("keydown", Jm));
}), {
focusReason: Pp,
lastUserFocusTimestamp: bu,
lastAutomatedFocusTimestamp: Ip
}), Fl = (i) => new CustomEvent(j2, {
...W2,
detail: i
}), eC = Ie({
name: "ElFocusTrap",
inheritAttrs: !1,
props: {
loop: Boolean,
trapped: Boolean,
focusTrapEl: Object,
focusStartEl: {
type: [Object, String],
default: "first"
}
},
emits: [
$m,
qm,
"focusin",
"focusout",
"focusout-prevented",
"release-requested"
],
setup(i, { emit: e }) {
const t = Ae();
let r, n;
const { focusReason: o } = Q2();
VA((m) => {
i.trapped && !a.paused && e("release-requested", m);
});
const a = {
paused: !1,
pause() {
this.paused = !0;
},
resume() {
this.paused = !1;
}
}, s = (m) => {
if (!i.loop && !i.trapped || a.paused)
return;
const { key: d, altKey: y, ctrlKey: f, metaKey: v, currentTarget: M, shiftKey: S } = m, { loop: T } = i, x = d === Pr.tab && !y && !f && !v, w = document.activeElement;
if (x && w) {
const A = M, [_, E] = X2(A);
if (_ && E) {
if (!S && w === E) {
const O = Fl({
focusReason: o.value
});
e("focusout-prevented", O), O.defaultPrevented || (m.preventDefault(), T && On(_, !0));
} else if (S && [_, A].includes(w)) {
const O = Fl({
focusReason: o.value
});
e("focusout-prevented", O), O.defaultPrevented || (m.preventDefault(), T && On(E, !0));
}
} else if (w === A) {
const O = Fl({
focusReason: o.value
});
e("focusout-prevented", O), O.defaultPrevented || m.preventDefault();
}
}
};
ci($2, {
focusTrapRef: t,
onKeydown: s
}), Ke(() => i.focusTrapEl, (m) => {
m && (t.value = m);
}, { immediate: !0 }), Ke([t], ([m], [d]) => {
m && (m.addEventListener("keydown", s), m.addEventListener("focusin", h), m.addEventListener("focusout", u)), d && (d.removeEventListener("keydown", s), d.removeEventListener("focusin", h), d.removeEventListener("focusout", u));
});
const c = (m) => {
e($m, m);
}, l = (m) => e(qm, m), h = (m) => {
const d = G(t);
if (!d)
return;
const y = m.target, f = m.relatedTarget, v = y && d.contains(y);
i.trapped || f && d.contains(f) || (r = f), v && e("focusin", m), !a.paused && i.trapped && (v ? n = y : On(n, !0));
}, u = (m) => {
const d = G(t);
if (!(a.paused || !d))
if (i.trapped) {
const y = m.relatedTarget;
!nn(y) && !d.contains(y) && setTimeout(() => {
if (!a.paused && i.trapped) {
const f = Fl({
focusReason: o.value
});
e("focusout-prevented", f), f.defaultPrevented || On(n, !0);
}
}, 0);
} else {
const y = m.target;
y && d.contains(y) || e("focusout", m);
}
};
async function p() {
await wt();
const m = G(t);
if (m) {
Ym.push(a);
const d = m.contains(document.activeElement) ? r : document.activeElement;
if (r = d, !m.contains(d)) {
const y = new Event(Ku, Wm);
m.addEventListener(Ku, c), m.dispatchEvent(y), y.defaultPrevented || wt(() => {
let f = i.focusStartEl;
Li(f) || (On(f), document.activeElement !== f && (f = "first")), f === "first" && J2(hy(m), !0), (document.activeElement === d || f === "container") && On(m);
});
}
}
}
function g() {
const m = G(t);
if (m) {
m.removeEventListener(Ku, c);
const d = new CustomEvent(Qu, {
...Wm,
detail: {
focusReason: o.value
}
});
m.addEventListener(Qu, l), m.dispatchEvent(d), !d.defaultPrevented && (o.value == "keyboard" || !K2() || m.contains(document.activeElement)) && On(r ?? document.body), m.removeEventListener(Qu, l), Ym.remove(a);
}
}
return ei(() => {
i.trapped && p(), Ke(() => i.trapped, (m) => {
m ? p() : g();
});
}), or(() => {
i.trapped && g(), t.value && (t.value.removeEventListener("keydown", s), t.value.removeEventListener("focusin", h), t.value.removeEventListener("focusout", u), t.value = void 0);
}), {
onKeydown: s
};
}
});
function tC(i, e, t, r, n, o) {
return qe(i.$slots, "default", { handleKeydown: i.onKeydown });
}
var iC = /* @__PURE__ */ ot(eC, [["render", tC], ["__file", "focus-trap.vue"]]);
const rC = ["fixed", "absolute"], nC = ht({
boundariesPadding: {
type: Number,
default: 0
},
fallbackPlacements: {
type: Ze(Array),
default: void 0
},
gpuAcceleration: {
type: Boolean,
default: !0
},
offset: {
type: Number,
default: 12
},
placement: {
type: String,
values: rs,
default: "bottom"
},
popperOptions: {
type: Ze(Object),
default: () => ({})
},
strategy: {
type: String,
values: rC,
default: "absolute"
}
}), dy = ht({
...nC,
id: String,
style: {
type: Ze([String, Array, Object])
},
className: {
type: Ze([String, Array, Object])
},
effect: {
type: Ze(String),
default: "dark"
},
visible: Boolean,
enterable: {
type: Boolean,
default: !0
},
pure: Boolean,
focusOnShow: {
type: Boolean,
default: !1
},
trapping: {
type: Boolean,
default: !1
},
popperClass: {
type: Ze([String, Array, Object])
},
popperStyle: {
type: Ze([String, Array, Object])
},
referenceEl: {
type: Ze(Object)
},
triggerTargetEl: {
type: Ze(Object)
},
stopPopperMouseEvent: {
type: Boolean,
default: !0
},
virtualTriggering: Boolean,
zIndex: Number,
...Ho(["ariaLabel"])
}), oC = {
mouseenter: (i) => i instanceof MouseEvent,
mouseleave: (i) => i instanceof MouseEvent,
focus: () => !0,
blur: () => !0,
close: () => !0
}, aC = (i, e = []) => {
const { placement: t, strategy: r, popperOptions: n } = i, o = {
placement: t,
strategy: r,
...n,
modifiers: [...lC(i), ...e]
};
return cC(o, n == null ? void 0 : n.modifiers), o;
}, sC = (i) => {
if (Kt)
return tn(i);
};
function lC(i) {
const { offset: e, gpuAcceleration: t, fallbackPlacements: r } = i;
return [
{
name: "offset",
options: {
offset: [0, e ?? 12]
}
},
{
name: "preventOverflow",
options: {
padding: {
top: 2,
bottom: 2,
left: 5,
right: 5
}
}
},
{
name: "flip",
options: {
padding: 5,
fallbackPlacements: r
}
},
{
name: "computeStyles",
options: {
gpuAcceleration: t
}
}
];
}
function cC(i, e) {
e && (i.modifiers = [...i.modifiers, ...e ?? []]);
}
const uC = 0, hC = (i) => {
const { popperInstanceRef: e, contentRef: t, triggerRef: r, role: n } = ct(Op, void 0), o = Ae(), a = Ae(), s = ce(() => ({
name: "eventListeners",
enabled: !!i.visible
})), c = ce(() => {
var f;
const v = G(o), M = (f = G(a)) != null ? f : uC;
return {
name: "arrow",
enabled: !$T(v),
options: {
element: v,
padding: M
}
};
}), l = ce(() => ({
onFirstUpdate: () => {
m();
},
...aC(i, [
G(c),
G(s)
])
})), h = ce(() => sC(i.referenceEl) || G(r)), { attributes: u, state: p, styles: g, update: m, forceUpdate: d, instanceRef: y } = kA(h, t, l);
return Ke(y, (f) => e.value = f), ei(() => {
Ke(() => {
var f;
return (f = G(h)) == null ? void 0 : f.getBoundingClientRect();
}, () => {
m();
});
}), {
attributes: u,
arrowRef: o,
contentRef: t,
instanceRef: y,
state: p,
styles: g,
role: n,
forceUpdate: d,
update: m
};
}, dC = (i, {
attributes: e,
styles: t,
role: r
}) => {
const { nextZIndex: n } = ey(), o = it("popper"), a = ce(() => G(e).popper), s = Ae(_t(i.zIndex) ? i.zIndex : n()), c = ce(() => [
o.b(),
o.is("pure", i.pure),
o.is(i.effect),
i.popperClass
]), l = ce(() => [
{ zIndex: G(s) },
G(t).popper,
i.popperStyle || {}
]), h = ce(() => r.value === "dialog" ? "false" : void 0), u = ce(() => G(t).arrow || {});
return {
ariaModal: h,
arrowStyle: u,
contentAttrs: a,
contentClass: c,
contentStyle: l,
contentZIndex: s,
updateZIndex: () => {
s.value = _t(i.zIndex) ? i.zIndex : n();
}
};
}, pC = (i, e) => {
const t = Ae(!1), r = Ae();
return {
focusStartRef: r,
trapped: t,
onFocusAfterReleased: (n) => {
var o;
((o = n.detail) == null ? void 0 : o.focusReason) !== "pointer" && (r.value = "first", e("blur"));
},
onFocusAfterTrapped: () => {
e("focus");
},
onFocusInTrap: (n) => {
i.visible && !t.value && (n.target && (r.value = n.target), t.value = !0);
},
onFocusoutPrevented: (n) => {
i.trapping || (n.detail.focusReason === "pointer" && n.preventDefault(), t.value = !1);
},
onReleaseRequested: () => {
t.value = !1, e("close");
}
};
}, fC = Ie({
name: "ElPopperContent"
}), mC = /* @__PURE__ */ Ie({
...fC,
props: dy,
emits: oC,
setup(i, { expose: e, emit: t }) {
const r = i, {
focusStartRef: n,
trapped: o,
onFocusAfterReleased: a,
onFocusAfterTrapped: s,
onFocusInTrap: c,
onFocusoutPrevented: l,
onReleaseRequested: h
} = pC(r, t), { attributes: u, arrowRef: p, contentRef: g, styles: m, instanceRef: d, role: y, update: f } = hC(r), {
ariaModal: v,
arrowStyle: M,
contentAttrs: S,
contentClass: T,
contentStyle: x,
updateZIndex: w
} = dC(r, {
styles: m,
attributes: u,
role: y
}), A = ct(Jc, void 0), _ = Ae();
ci(ay, {
arrowStyle: M,
arrowRef: p,
arrowOffset: _
}), A && ci(Jc, {
...A,
addInputId: $s,
removeInputId: $s
});
let E;
const O = (C = !0) => {
f(), C && w();
}, L = () => {
O(!1), r.visible && r.focusOnShow ? o.value = !0 : r.visible === !1 && (o.value = !1);
};
return ei(() => {
Ke(() => r.triggerTargetEl, (C, I) => {
E == null || E(), E = void 0;
const R = G(C || g.value), b = G(I || g.value);
Mo(R) && (E = Ke([y, () => r.ariaLabel, v, () => r.id], (P) => {
["role", "aria-label", "aria-modal", "id"].forEach((N, D) => {
nn(P[D]) ? R.removeAttribute(N) : R.setAttribute(N, P[D]);
});
}, { immediate: !0 })), b !== R && Mo(b) && ["role", "aria-label", "aria-modal", "id"].forEach((P) => {
b.removeAttribute(P);
});
}, { immediate: !0 }), Ke(() => r.visible, L, { immediate: !0 });
}), or(() => {
E == null || E(), E = void 0;
}), e({
popperContentRef: g,
popperInstanceRef: d,
updatePopper: O,
contentStyle: x
}), (C, I) => (ge(), Le("div", Or({
ref_key: "contentRef",
ref: g
}, G(S), {
style: G(x),
class: G(T),
tabindex: "-1",
onMouseenter: (R) => C.$emit("mouseenter", R),
onMouseleave: (R) => C.$emit("mouseleave", R)
}), [
le(G(iC), {
trapped: G(o),
"trap-on-focus-in": !0,
"focus-trap-el": G(g),
"focus-start-el": G(n),
onFocusAfterTrapped: G(s),
onFocusAfterReleased: G(a),
onFocusin: G(c),
onFocusoutPrevented: G(l),
onReleaseRequested: G(h)
}, {
default: me(() => [
qe(C.$slots, "default")
]),
_: 3
}, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
], 16, ["onMouseenter", "onMouseleave"]));
}
});
var gC = /* @__PURE__ */ ot(mC, [["__file", "content.vue"]]);
const vC = ui(B2), Dp = Symbol("elTooltip"), Wi = ht({
...HA,
...dy,
appendTo: {
type: Ze([String, Object])
},
content: {
type: String,
default: ""
},
rawContent: Boolean,
persistent: Boolean,
visible: {
type: Ze(Boolean),
default: null
},
transition: String,
teleported: {
type: Boolean,
default: !0
},
disabled: Boolean,
...Ho(["ariaLabel"])
}), Js = ht({
...uy,
disabled: Boolean,
trigger: {
type: Ze([String, Array]),
default: "hover"
},
triggerKeys: {
type: Ze(Array),
default: () => [Pr.enter, Pr.space]
}
}), {
useModelToggleProps: yC,
useModelToggleEmits: bC,
useModelToggle: xC
} = DE("visible"), wC = ht({
...sy,
...yC,
...Wi,
...Js,
...ly,
showArrow: {
type: Boolean,
default: !0
}
}), _C = [
...bC,
"before-show",
"before-hide",
"show",
"hide",
"open",
"close"
], MC = (i, e) => Bi(i) ? i.includes(e) : i === e, Jo = (i, e, t) => (r) => {
MC(G(i), e) && t(r);
}, SC = Ie({
name: "ElTooltipTrigger"
}), TC = /* @__PURE__ */ Ie({
...SC,
props: Js,
setup(i, { expose: e }) {
const t = i, r = it("tooltip"), { controlled: n, id: o, open: a, onOpen: s, onClose: c, onToggle: l } = ct(Dp, void 0), h = Ae(null), u = () => {
if (G(n) || t.disabled)
return !0;
}, p = Di(t, "trigger"), g = Jr(u, Jo(p, "hover", s)), m = Jr(u, Jo(p, "hover", c)), d = Jr(u, Jo(p, "click", (S) => {
S.button === 0 && l(S);
})), y = Jr(u, Jo(p, "focus", s)), f = Jr(u, Jo(p, "focus", c)), v = Jr(u, Jo(p, "contextmenu", (S) => {
S.preventDefault(), l(S);
})), M = Jr(u, (S) => {
const { code: T } = S;
t.triggerKeys.includes(T) && (S.preventDefault(), l(S));
});
return e({
triggerRef: h
}), (S, T) => (ge(), Ue(G(H2), {
id: G(o),
"virtual-ref": S.virtualRef,
open: G(a),
"virtual-triggering": S.virtualTriggering,
class: Re(G(r).e("trigger")),
onBlur: G(f),
onClick: G(d),
onContextmenu: G(v),
onFocus: G(y),
onMouseenter: G(g),
onMouseleave: G(m),
onKeydown: G(M)
}, {
default: me(() => [
qe(S.$slots, "default")
]),
_: 3
}, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]));
}
});
var EC = /* @__PURE__ */ ot(TC, [["__file", "trigger.vue"]]);
const AC = ht({
to: {
type: Ze([String, Object]),
required: !0
},
disabled: Boolean
}), CC = /* @__PURE__ */ Ie({
__name: "teleport",
props: AC,
setup(i) {
return (e, t) => e.disabled ? qe(e.$slots, "default", { key: 0 }) : (ge(), Ue(gw, {
key: 1,
to: e.to
}, [
qe(e.$slots, "default")
], 8, ["to"]));
}
});
var LC = /* @__PURE__ */ ot(CC, [["__file", "teleport.vue"]]);
const RC = ui(LC), OC = Ie({
name: "ElTooltipContent",
inheritAttrs: !1
}), PC = /* @__PURE__ */ Ie({
...OC,
props: Wi,
setup(i, { expose: e }) {
const t = i, { selector: r } = Y0(), n = it("tooltip"), o = Ae(null);
let a;
const {
controlled: s,
id: c,
open: l,
trigger: h,
onClose: u,
onOpen: p,
onShow: g,
onHide: m,
onBeforeShow: d,
onBeforeHide: y
} = ct(Dp, void 0), f = ce(() => t.transition || `${n.namespace.value}-fade-in-linear`), v = ce(() => process.env.NODE_ENV === "test" ? !0 : t.persistent);
or(() => {
a == null || a();
});
const M = ce(() => G(v) ? !0 : G(l)), S = ce(() => t.disabled ? !1 : G(l)), T = ce(() => t.appendTo || r.value), x = ce(() => {
var b;
return (b = t.style) != null ? b : {};
}), w = Ae(!0), A = () => {
m(), w.value = !0;
}, _ = () => {
if (G(s))
return !0;
}, E = Jr(_, () => {
t.enterable && G(h) === "hover" && p();
}), O = Jr(_, () => {
G(h) === "hover" && u();
}), L = () => {
var b, P;
(P = (b = o.value) == null ? void 0 : b.updatePopper) == null || P.call(b), d == null || d();
}, C = () => {
y == null || y();
}, I = () => {
g(), a = Bw(ce(() => {
var b;
return (b = o.value) == null ? void 0 : b.popperContentRef;
}), () => {
G(s) || G(h) !== "hover" && u();
});
}, R = () => {
t.virtualTriggering || u();
};
return Ke(() => G(l), (b) => {
b ? w.value = !1 : a == null || a();
}, {
flush: "post"
}), Ke(() => t.content, () => {
var b, P;
(P = (b = o.value) == null ? void 0 : b.updatePopper) == null || P.call(b);
}), e({
contentRef: o
}), (b, P) => (ge(), Ue(G(RC), {
disabled: !b.teleported,
to: G(T)
}, {
default: me(() => [
le(hl, {
name: G(f),
onAfterLeave: A,
onBeforeEnter: L,
onAfterEnter: I,
onBeforeLeave: C
}, {
default: me(() => [
G(M) ? It((ge(), Ue(G(gC), Or({
key: 0,
id: G(c),
ref_key: "contentRef",
ref: o
}, b.$attrs, {
"aria-label": b.ariaLabel,
"aria-hidden": w.value,
"boundaries-padding": b.boundariesPadding,
"fallback-placements": b.fallbackPlacements,
"gpu-acceleration": b.gpuAcceleration,
offset: b.offset,
placement: b.placement,
"popper-options": b.popperOptions,
strategy: b.strategy,
effect: b.effect,
enterable: b.enterable,
pure: b.pure,
"popper-class": b.popperClass,
"popper-style": [b.popperStyle, G(x)],
"reference-el": b.referenceEl,
"trigger-target-el": b.triggerTargetEl,
visible: G(S),
"z-index": b.zIndex,
onMouseenter: G(E),
onMouseleave: G(O),
onBlur: R,
onClose: G(u)
}), {
default: me(() => [
qe(b.$slots, "default")
]),
_: 3
}, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [
[fi, G(S)]
]) : Ve("v-if", !0)
]),
_: 3
}, 8, ["name"])
]),
_: 3
}, 8, ["disabled", "to"]));
}
});
var IC = /* @__PURE__ */ ot(PC, [["__file", "content.vue"]]);
const DC = Ie({
name: "ElTooltip"
}), NC = /* @__PURE__ */ Ie({
...DC,
props: wC,
emits: _C,
setup(i, { expose: e, emit: t }) {
const r = i;
GA();
const n = vu(), o = Ae(), a = Ae(), s = () => {
var f;
const v = G(o);
v && ((f = v.popperInstanceRef) == null || f.update());
}, c = Ae(!1), l = Ae(), { show: h, hide: u, hasUpdateHandler: p } = xC({
indicator: c,
toggleReason: l
}), { onOpen: g, onClose: m } = jA({
showAfter: Di(r, "showAfter"),
hideAfter: Di(r, "hideAfter"),
autoClose: Di(r, "autoClose"),
open: h,
close: u
}), d = ce(() => fp(r.visible) && !p.value);
ci(Dp, {
controlled: d,
id: n,
open: a0(c),
trigger: Di(r, "trigger"),
onOpen: (f) => {
g(f);
},
onClose: (f) => {
m(f);
},
onToggle: (f) => {
G(c) ? m(f) : g(f);
},
onShow: () => {
t("show", l.value);
},
onHide: () => {
t("hide", l.value);
},
onBeforeShow: () => {
t("before-show", l.value);
},
onBeforeHide: () => {
t("before-hide", l.value);
},
updatePopper: s
}), Ke(() => r.disabled, (f) => {
f && c.value && (c.value = !1);
});
const y = (f) => {
var v, M;
const S = (M = (v = a.value) == null ? void 0 : v.contentRef) == null ? void 0 : M.popperContentRef, T = (f == null ? void 0 : f.relatedTarget) || document.activeElement;
return S && S.contains(T);
};
return hw(() => c.value && u()), e({
popperRef: o,
contentRef: a,
isFocusInsideContent: y,
updatePopper: s,
onOpen: g,
onClose: m,
hide: u
}), (f, v) => (ge(), Ue(G(vC), {
ref_key: "popperRef",
ref: o,
role: f.role
}, {
default: me(() => [
le(EC, {
disabled: f.disabled,
trigger: f.trigger,
"trigger-keys": f.triggerKeys,
"virtual-ref": f.virtualRef,
"virtual-triggering": f.virtualTriggering
}, {
default: me(() => [
f.$slots.default ? qe(f.$slots, "default", { key: 0 }) : Ve("v-if", !0)
]),
_: 3
}, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]),
le(IC, {
ref_key: "contentRef",
ref: a,
"aria-label": f.ariaLabel,
"boundaries-padding": f.boundariesPadding,
content: f.content,
disabled: f.disabled,
effect: f.effect,
enterable: f.enterable,
"fallback-placements": f.fallbackPlacements,
"hide-after": f.hideAfter,
"gpu-acceleration": f.gpuAcceleration,
offset: f.offset,
persistent: f.persistent,
"popper-class": f.popperClass,
"popper-style": f.popperStyle,
placement: f.placement,
"popper-options": f.popperOptions,
pure: f.pure,
"raw-content": f.rawContent,
"reference-el": f.referenceEl,
"trigger-target-el": f.triggerTargetEl,
"show-after": f.showAfter,
strategy: f.strategy,
teleported: f.teleported,
transition: f.transition,
"virtual-triggering": f.virtualTriggering,
"z-index": f.zIndex,
"append-to": f.appendTo
}, {
default: me(() => [
qe(f.$slots, "content", {}, () => [
f.rawContent ? (ge(), Le("span", {
key: 0,
innerHTML: f.content
}, null, 8, ["innerHTML"])) : (ge(), Le("span", { key: 1 }, xt(f.content), 1))
]),
f.showArrow ? (ge(), Ue(G(F2), {
key: 0,
"arrow-offset": f.arrowOffset
}, null, 8, ["arrow-offset"])) : Ve("v-if", !0)
]),
_: 3
}, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"])
]),
_: 3
}, 8, ["role"]));
}
});
var BC = /* @__PURE__ */ ot(NC, [["__file", "tooltip.vue"]]);
const Np = ui(BC), py = Symbol("buttonGroupContextKey"), kC = (i, e) => {
EE({
from: "type.text",
replacement: "link",
version: "3.0.0",
scope: "props",
ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
}, ce(() => i.type === "text"));
const t = ct(py, void 0), r = Ap("button"), { form: n } = gl(), o = ns(ce(() => t == null ? void 0 : t.size)), a = yu(), s = Ae(), c = au(), l = ce(() => i.type || (t == null ? void 0 : t.type) || ""), h = ce(() => {
var g, m, d;
return (d = (m = i.autoInsertSpace) != null ? m : (g = r.value) == null ? void 0 : g.autoInsertSpace) != null ? d : !1;
}), u = ce(() => i.tag === "button" ? {
ariaDisabled: a.value || i.loading,
disabled: a.value || i.loading,
autofocus: i.autofocus,
type: i.nativeType
} : {}), p = ce(() => {
var g;
const m = (g = c.default) == null ? void 0 : g.call(c);
if (h.value && (m == null ? void 0 : m.length) === 1) {
const d = m[0];
if ((d == null ? void 0 : d.type) === o0) {
const y = d.children;
return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(y.trim());
}
}
return !1;
});
return {
_disabled: a,
_size: o,
_type: l,
_ref: s,
_props: u,
shouldAddSpace: p,
handleClick: (g) => {
if (a.value || i.loading) {
g.stopPropagation();
return;
}
i.nativeType === "reset" && (n == null || n.resetFields()), e("click", g);
}
};
}, zC = [
"default",
"primary",
"success",
"warning",
"info",
"danger",
"text",
""
], FC = ["button", "submit", "reset"], dd = ht({
size: Da,
disabled: Boolean,
type: {
type: String,
values: zC,
default: ""
},
icon: {
type: $n
},
nativeType: {
type: String,
values: FC,
default: "button"
},
loading: Boolean,
loadingIcon: {
type: $n,
default: () => O0
},
plain: Boolean,
text: Boolean,
link: Boolean,
bg: Boolean,
autofocus: Boolean,
round: Boolean,
circle: Boolean,
color: String,
dark: Boolean,
autoInsertSpace: {
type: Boolean,
default: void 0
},
tag: {
type: Ze([String, Object]),
default: "button"
}
}), VC = {
click: (i) => i instanceof MouseEvent
};
function gi(i, e) {
UC(i) && (i = "100%");
var t = GC(i);
return i = e === 360 ? i : Math.min(e, Math.max(0, parseFloat(i))), t && (i = parseInt(String(i * e), 10) / 100), Math.abs(i - e) < 1e-6 ? 1 : (e === 360 ? i = (i < 0 ? i % e + e : i % e) / parseFloat(String(e)) : i = i % e / parseFloat(String(e)), i);
}
function Vl(i) {
return Math.min(1, Math.max(0, i));
}
function UC(i) {
return typeof i == "string" && i.indexOf(".") !== -1 && parseFloat(i) === 1;
}
function GC(i) {
return typeof i == "string" && i.indexOf("%") !== -1;
}
function fy(i) {
return i = parseFloat(i), (isNaN(i) || i < 0 || i > 1) && (i = 1), i;
}
function Ul(i) {
return i <= 1 ? "".concat(Number(i) * 100, "%") : i;
}
function xo(i) {
return i.length === 1 ? "0" + i : String(i);
}
function HC(i, e, t) {
return {
r: gi(i, 255) * 255,
g: gi(e, 255) * 255,
b: gi(t, 255) * 255
};
}
function Km(i, e, t) {
i = gi(i, 255), e = gi(e, 255), t = gi(t, 255);
var r = Math.max(i, e, t), n = Math.min(i, e, t), o = 0, a = 0, s = (r + n) / 2;
if (r === n)
a = 0, o = 0;
else {
var c = r - n;
switch (a = s > 0.5 ? c / (2 - r - n) : c / (r + n), r) {
case i:
o = (e - t) / c + (e < t ? 6 : 0);
break;
case e:
o = (t - i) / c + 2;
break;
case t:
o = (i - e) / c + 4;
break;
}
o /= 6;
}
return { h: o, s: a, l: s };
}
function eh(i, e, t) {
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? i + (e - i) * (6 * t) : t < 1 / 2 ? e : t < 2 / 3 ? i + (e - i) * (2 / 3 - t) * 6 : i;
}
function jC(i, e, t) {
var r, n, o;
if (i = gi(i, 360), e = gi(e, 100), t = gi(t, 100), e === 0)
n = t, o = t, r = t;
else {
var a = t < 0.5 ? t * (1 + e) : t + e - t * e, s = 2 * t - a;
r = eh(s, a, i + 1 / 3), n = eh(s, a, i), o = eh(s, a, i - 1 / 3);
}
return { r: r * 255, g: n * 255, b: o * 255 };
}
function Qm(i, e, t) {
i = gi(i, 255), e = gi(e, 255), t = gi(t, 255);
var r = Math.max(i, e, t), n = Math.min(i, e, t), o = 0, a = r, s = r - n, c = r === 0 ? 0 : s / r;
if (r === n)
o = 0;
else {
switch (r) {
case i:
o = (e - t) / s + (e < t ? 6 : 0);
break;
case e:
o = (t - i) / s + 2;
break;
case t:
o = (i - e) / s + 4;
break;
}
o /= 6;
}
return { h: o, s: c, v: a };
}
function WC(i, e, t) {
i = gi(i, 360) * 6, e = gi(e, 100), t = gi(t, 100);
var r = Math.floor(i), n = i - r, o = t * (1 - e), a = t * (1 - n * e), s = t * (1 - (1 - n) * e), c = r % 6, l = [t, a, o, o, s, t][c], h = [s, t, t, a, o, o][c], u = [o, o, s, t, t, a][c];
return { r: l * 255, g: h * 255, b: u * 255 };
}
function eg(i, e, t, r) {
var n = [
xo(Math.round(i).toString(16)),
xo(Math.round(e).toString(16)),
xo(Math.round(t).toString(16))
];
return r && n[0].startsWith(n[0].charAt(1)) && n[1].startsWith(n[1].charAt(1)) && n[2].startsWith(n[2].charAt(1)) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join("");
}
function $C(i, e, t, r, n) {
var o = [
xo(Math.round(i).toString(16)),
xo(Math.round(e).toString(16)),
xo(Math.round(t).toString(16)),
xo(qC(r))
];
return n && o[0].startsWith(o[0].charAt(1)) && o[1].startsWith(o[1].charAt(1)) && o[2].startsWith(o[2].charAt(1)) && o[3].startsWith(o[3].charAt(1)) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) + o[3].charAt(0) : o.join("");
}
function qC(i) {
return Math.round(parseFloat(i) * 255).toString(16);
}
function tg(i) {
return ji(i) / 255;
}
function ji(i) {
return parseInt(i, 16);
}
function XC(i) {
return {
r: i >> 16,
g: (i & 65280) >> 8,
b: i & 255
};
}
var pd = {
aliceblue: "#f0f8ff",
antiquewhite: "#faebd7",
aqua: "#00ffff",
aquamarine: "#7fffd4",
azure: "#f0ffff",
beige: "#f5f5dc",
bisque: "#ffe4c4",
black: "#000000",
blanchedalmond: "#ffebcd",
blue: "#0000ff",
blueviolet: "#8a2be2",
brown: "#a52a2a",
burlywood: "#deb887",
cadetblue: "#5f9ea0",
chartreuse: "#7fff00",
chocolate: "#d2691e",
coral: "#ff7f50",
cornflowerblue: "#6495ed",
cornsilk: "#fff8dc",
crimson: "#dc143c",
cyan: "#00ffff",
darkblue: "#00008b",
darkcyan: "#008b8b",
darkgoldenrod: "#b8860b",
darkgray: "#a9a9a9",
darkgreen: "#006400",
darkgrey: "#a9a9a9",
darkkhaki: "#bdb76b",
darkmagenta: "#8b008b",
darkolivegreen: "#556b2f",
darkorange: "#ff8c00",
darkorchid: "#9932cc",
darkred: "#8b0000",
darksalmon: "#e9967a",
darkseagreen: "#8fbc8f",
darkslateblue: "#483d8b",
darkslategray: "#2f4f4f",
darkslategrey: "#2f4f4f",
darkturquoise: "#00ced1",
darkviolet: "#9400d3",
deeppink: "#ff1493",
deepskyblue: "#00bfff",
dimgray: "#696969",
dimgrey: "#696969",
dodgerblue: "#1e90ff",
firebrick: "#b22222",
floralwhite: "#fffaf0",
forestgreen: "#228b22",
fuchsia: "#ff00ff",
gainsboro: "#dcdcdc",
ghostwhite: "#f8f8ff",
goldenrod: "#daa520",
gold: "#ffd700",
gray: "#808080",
green: "#008000",
greenyellow: "#adff2f",
grey: "#808080",
honeydew: "#f0fff0",
hotpink: "#ff69b4",
indianred: "#cd5c5c",
indigo: "#4b0082",
ivory: "#fffff0",
khaki: "#f0e68c",
lavenderblush: "#fff0f5",
lavender: "#e6e6fa",
lawngreen: "#7cfc00",
lemonchiffon: "#fffacd",
lightblue: "#add8e6",
lightcoral: "#f08080",
lightcyan: "#e0ffff",
lightgoldenrodyellow: "#fafad2",
lightgray: "#d3d3d3",
lightgreen: "#90ee90",
lightgrey: "#d3d3d3",
lightpink: "#ffb6c1",
lightsalmon: "#ffa07a",
lightseagreen: "#20b2aa",
lightskyblue: "#87cefa",
lightslategray: "#778899",
lightslategrey: "#778899",
lightsteelblue: "#b0c4de",
lightyellow: "#ffffe0",
lime: "#00ff00",
limegreen: "#32cd32",
linen: "#faf0e6",
magenta: "#ff00ff",
maroon: "#800000",
mediumaquamarine: "#66cdaa",
mediumblue: "#0000cd",
mediumorchid: "#ba55d3",
mediumpurple: "#9370db",
mediumseagreen: "#3cb371",
mediumslateblue: "#7b68ee",
mediumspringgreen: "#00fa9a",
mediumturquoise: "#48d1cc",
mediumvioletred: "#c71585",
midnightblue: "#191970",
mintcream: "#f5fffa",
mistyrose: "#ffe4e1",
moccasin: "#ffe4b5",
navajowhite: "#ffdead",
navy: "#000080",
oldlace: "#fdf5e6",
olive: "#808000",
olivedrab: "#6b8e23",
orange: "#ffa500",
orangered: "#ff4500",
orchid: "#da70d6",
palegoldenrod: "#eee8aa",
palegreen: "#98fb98",
paleturquoise: "#afeeee",
palevioletred: "#db7093",
papayawhip: "#ffefd5",
peachpuff: "#ffdab9",
peru: "#cd853f",
pink: "#ffc0cb",
plum: "#dda0dd",
powderblue: "#b0e0e6",
purple: "#800080",
rebeccapurple: "#663399",
red: "#ff0000",
rosybrown: "#bc8f8f",
royalblue: "#4169e1",
saddlebrown: "#8b4513",
salmon: "#fa8072",
sandybrown: "#f4a460",
seagreen: "#2e8b57",
seashell: "#fff5ee",
sienna: "#a0522d",
silver: "#c0c0c0",
skyblue: "#87ceeb",
slateblue: "#6a5acd",
slategray: "#708090",
slategrey: "#708090",
snow: "#fffafa",
springgreen: "#00ff7f",
steelblue: "#4682b4",
tan: "#d2b48c",
teal: "#008080",
thistle: "#d8bfd8",
tomato: "#ff6347",
turquoise: "#40e0d0",
violet: "#ee82ee",
wheat: "#f5deb3",
white: "#ffffff",
whitesmoke: "#f5f5f5",
yellow: "#ffff00",
yellowgreen: "#9acd32"
};
function ZC(i) {
var e = { r: 0, g: 0, b: 0 }, t = 1, r = null, n = null, o = null, a = !1, s = !1;
return typeof i == "string" && (i = KC(i)), typeof i == "object" && (Hr(i.r) && Hr(i.g) && Hr(i.b) ? (e = HC(i.r, i.g, i.b), a = !0, s = String(i.r).substr(-1) === "%" ? "prgb" : "rgb") : Hr(i.h) && Hr(i.s) && Hr(i.v) ? (r = Ul(i.s), n = Ul(i.v), e = WC(i.h, r, n), a = !0, s = "hsv") : Hr(i.h) && Hr(i.s) && Hr(i.l) && (r = Ul(i.s), o = Ul(i.l), e = jC(i.h, r, o), a = !0, s = "hsl"), Object.prototype.hasOwnProperty.call(i, "a") && (t = i.a)), t = fy(t), {
ok: a,
format: i.format || s,
r: Math.min(255, Math.max(e.r, 0)),
g: Math.min(255, Math.max(e.g, 0)),
b: Math.min(255, Math.max(e.b, 0)),
a: t
};
}
var YC = "[-\\+]?\\d+%?", JC = "[-\\+]?\\d*\\.\\d+%?", kn = "(?:".concat(JC, ")|(?:").concat(YC, ")"), th = "[\\s|\\(]+(".concat(kn, ")[,|\\s]+(").concat(kn, ")[,|\\s]+(").concat(kn, ")\\s*\\)?"), ih = "[\\s|\\(]+(".concat(kn, ")[,|\\s]+(").concat(kn, ")[,|\\s]+(").concat(kn, ")[,|\\s]+(").concat(kn, ")\\s*\\)?"), pr = {
CSS_UNIT: new RegExp(kn),
rgb: new RegExp("rgb" + th),
rgba: new RegExp("rgba" + ih),
hsl: new RegExp("hsl" + th),
hsla: new RegExp("hsla" + ih),
hsv: new RegExp("hsv" + th),
hsva: new RegExp("hsva" + ih),
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
};
function KC(i) {
if (i = i.trim().toLowerCase(), i.length === 0)
return !1;
var e = !1;
if (pd[i])
i = pd[i], e = !0;
else if (i === "transparent")
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
var t = pr.rgb.exec(i);
return t ? { r: t[1], g: t[2], b: t[3] } : (t = pr.rgba.exec(i), t ? { r: t[1], g: t[2], b: t[3], a: t[4] } : (t = pr.hsl.exec(i), t ? { h: t[1], s: t[2], l: t[3] } : (t = pr.hsla.exec(i), t ? { h: t[1], s: t[2], l: t[3], a: t[4] } : (t = pr.hsv.exec(i), t ? { h: t[1], s: t[2], v: t[3] } : (t = pr.hsva.exec(i), t ? { h: t[1], s: t[2], v: t[3], a: t[4] } : (t = pr.hex8.exec(i), t ? {
r: ji(t[1]),
g: ji(t[2]),
b: ji(t[3]),
a: tg(t[4]),
format: e ? "name" : "hex8"
} : (t = pr.hex6.exec(i), t ? {
r: ji(t[1]),
g: ji(t[2]),
b: ji(t[3]),
format: e ? "name" : "hex"
} : (t = pr.hex4.exec(i), t ? {
r: ji(t[1] + t[1]),
g: ji(t[2] + t[2]),
b: ji(t[3] + t[3]),
a: tg(t[4] + t[4]),
format: e ? "name" : "hex8"
} : (t = pr.hex3.exec(i), t ? {
r: ji(t[1] + t[1]),
g: ji(t[2] + t[2]),
b: ji(t[3] + t[3]),
format: e ? "name" : "hex"
} : !1)))))))));
}
function Hr(i) {
return !!pr.CSS_UNIT.exec(String(i));
}
var QC = (
/** @class */
function() {
function i(e, t) {
e === void 0 && (e = ""), t === void 0 && (t = {});
var r;
if (e instanceof i)
return e;
typeof e == "number" && (e = XC(e)), this.originalInput = e;
var n = ZC(e);
this.originalInput = e, this.r = n.r, this.g = n.g, this.b = n.b, this.a = n.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (r = t.format) !== null && r !== void 0 ? r : n.format, this.gradientType = t.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = n.ok;
}
return i.prototype.isDark = function() {
return this.getBrightness() < 128;
}, i.prototype.isLight = function() {
return !this.isDark();
}, i.prototype.getBrightness = function() {
var e = this.toRgb();
return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3;
}, i.prototype.getLuminance = function() {
var e = this.toRgb(), t, r, n, o = e.r / 255, a = e.g / 255, s = e.b / 255;
return o <= 0.03928 ? t = o / 12.92 : t = Math.pow((o + 0.055) / 1.055, 2.4), a <= 0.03928 ? r = a / 12.92 : r = Math.pow((a + 0.055) / 1.055, 2.4), s <= 0.03928 ? n = s / 12.92 : n = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * t + 0.7152 * r + 0.0722 * n;
}, i.prototype.getAlpha = function() {
return this.a;
}, i.prototype.setAlpha = function(e) {
return this.a = fy(e), this.roundA = Math.round(100 * this.a) / 100, this;
}, i.prototype.isMonochrome = function() {
var e = this.toHsl().s;
return e === 0;
}, i.prototype.toHsv = function() {
var e = Qm(this.r, this.g, this.b);
return { h: e.h * 360, s: e.s, v: e.v, a: this.a };
}, i.prototype.toHsvString = function() {
var e = Qm(this.r, this.g, this.b), t = Math.round(e.h * 360), r = Math.round(e.s * 100), n = Math.round(e.v * 100);
return this.a === 1 ? "hsv(".concat(t, ", ").concat(r, "%, ").concat(n, "%)") : "hsva(".concat(t, ", ").concat(r, "%, ").concat(n, "%, ").concat(this.roundA, ")");
}, i.prototype.toHsl = function() {
var e = Km(this.r, this.g, this.b);
return { h: e.h * 360, s: e.s, l: e.l, a: this.a };
}, i.prototype.toHslString = function() {
var e = Km(this.r, this.g, this.b), t = Math.round(e.h * 360), r = Math.round(e.s * 100), n = Math.round(e.l * 100);
return this.a === 1 ? "hsl(".concat(t, ", ").concat(r, "%, ").concat(n, "%)") : "hsla(".concat(t, ", ").concat(r, "%, ").concat(n, "%, ").concat(this.roundA, ")");
}, i.prototype.toHex = function(e) {
return e === void 0 && (e = !1), eg(this.r, this.g, this.b, e);
}, i.prototype.toHexString = function(e) {
return e === void 0 && (e = !1), "#" + this.toHex(e);
}, i.prototype.toHex8 = function(e) {
return e === void 0 && (e = !1), $C(this.r, this.g, this.b, this.a, e);
}, i.prototype.toHex8String = function(e) {
return e === void 0 && (e = !1), "#" + this.toHex8(e);
}, i.prototype.toHexShortString = function(e) {
return e === void 0 && (e = !1), this.a === 1 ? this.toHexString(e) : this.toHex8String(e);
}, i.prototype.toRgb = function() {
return {
r: Math.round(this.r),
g: Math.round(this.g),
b: Math.round(this.b),
a: this.a
};
}, i.prototype.toRgbString = function() {
var e = Math.round(this.r), t = Math.round(this.g), r = Math.round(this.b);
return this.a === 1 ? "rgb(".concat(e, ", ").concat(t, ", ").concat(r, ")") : "rgba(".concat(e, ", ").concat(t, ", ").concat(r, ", ").concat(this.roundA, ")");
}, i.prototype.toPercentageRgb = function() {
var e = function(t) {
return "".concat(Math.round(gi(t, 255) * 100), "%");
};
return {
r: e(this.r),
g: e(this.g),
b: e(this.b),
a: this.a
};
}, i.prototype.toPercentageRgbString = function() {
var e = function(t) {
return Math.round(gi(t, 255) * 100);
};
return this.a === 1 ? "rgb(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%)") : "rgba(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%, ").concat(this.roundA, ")");
}, i.prototype.toName = function() {
if (this.a === 0)
return "transparent";
if (this.a < 1)
return !1;
for (var e = "#" + eg(this.r, this.g, this.b, !1), t = 0, r = Object.entries(pd); t < r.length; t++) {
var n = r[t], o = n[0], a = n[1];
if (e === a)
return o;
}
return !1;
}, i.prototype.toString = function(e) {
var t = !!e;
e = e ?? this.format;
var r = !1, n = this.a < 1 && this.a >= 0, o = !t && n && (e.startsWith("hex") || e === "name");
return o ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (r = this.toRgbString()), e === "prgb" && (r = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (r = this.toHexString()), e === "hex3" && (r = this.toHexString(!0)), e === "hex4" && (r = this.toHex8String(!0)), e === "hex8" && (r = this.toHex8String()), e === "name" && (r = this.toName()), e === "hsl" && (r = this.toHslString()), e === "hsv" && (r = this.toHsvString()), r || this.toHexString());
}, i.prototype.toNumber = function() {
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
}, i.prototype.clone = function() {
return new i(this.toString());
}, i.prototype.lighten = function(e) {
e === void 0 && (e = 10);
var t = this.toHsl();
return t.l += e / 100, t.l = Vl(t.l), new i(t);
}, i.prototype.brighten = function(e) {
e === void 0 && (e = 10);
var t = this.toRgb();
return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(e / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(e / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(e / 100)))), new i(t);
}, i.prototype.darken = function(e) {
e === void 0 && (e = 10);
var t = this.toHsl();
return t.l -= e / 100, t.l = Vl(t.l), new i(t);
}, i.prototype.tint = function(e) {
return e === void 0 && (e = 10), this.mix("white", e);
}, i.prototype.shade = function(e) {
return e === void 0 && (e = 10), this.mix("black", e);
}, i.prototype.desaturate = function(e) {
e === void 0 && (e = 10);
var t = this.toHsl();
return t.s -= e / 100, t.s = Vl(t.s), new i(t);
}, i.prototype.saturate = function(e) {
e === void 0 && (e = 10);
var t = this.toHsl();
return t.s += e / 100, t.s = Vl(t.s), new i(t);
}, i.prototype.greyscale = function() {
return this.desaturate(100);
}, i.prototype.spin = function(e) {
var t = this.toHsl(), r = (t.h + e) % 360;
return t.h = r < 0 ? 360 + r : r, new i(t);
}, i.prototype.mix = function(e, t) {
t === void 0 && (t = 50);
var r = this.toRgb(), n = new i(e).toRgb(), o = t / 100, a = {
r: (n.r - r.r) * o + r.r,
g: (n.g - r.g) * o + r.g,
b: (n.b - r.b) * o + r.b,
a: (n.a - r.a) * o + r.a
};
return new i(a);
}, i.prototype.analogous = function(e, t) {
e === void 0 && (e = 6), t === void 0 && (t = 30);
var r = this.toHsl(), n = 360 / t, o = [this];
for (r.h = (r.h - (n * e >> 1) + 720) % 360; --e; )
r.h = (r.h + n) % 360, o.push(new i(r));
return o;
}, i.prototype.complement = function() {
var e = this.toHsl();
return e.h = (e.h + 180) % 360, new i(e);
}, i.prototype.monochromatic = function(e) {
e === void 0 && (e = 6);
for (var t = this.toHsv(), r = t.h, n = t.s, o = t.v, a = [], s = 1 / e; e--; )
a.push(new i({ h: r, s: n, v: o })), o = (o + s) % 1;
return a;
}, i.prototype.splitcomplement = function() {
var e = this.toHsl(), t = e.h;
return [
this,
new i({ h: (t + 72) % 360, s: e.s, l: e.l }),
new i({ h: (t + 216) % 360, s: e.s, l: e.l })
];
}, i.prototype.onBackground = function(e) {
var t = this.toRgb(), r = new i(e).toRgb(), n = t.a + r.a * (1 - t.a);
return new i({
r: (t.r * t.a + r.r * r.a * (1 - t.a)) / n,
g: (t.g * t.a + r.g * r.a * (1 - t.a)) / n,
b: (t.b * t.a + r.b * r.a * (1 - t.a)) / n,
a: n
});
}, i.prototype.triad = function() {
return this.polyad(3);
}, i.prototype.tetrad = function() {
return this.polyad(4);
}, i.prototype.polyad = function(e) {
for (var t = this.toHsl(), r = t.h, n = [this], o = 360 / e, a = 1; a < e; a++)
n.push(new i({ h: (r + a * o) % 360, s: t.s, l: t.l }));
return n;
}, i.prototype.equals = function(e) {
return this.toRgbString() === new i(e).toRgbString();
}, i;
}()
);
function wn(i, e = 20) {
return i.mix("#141414", e).toString();
}
function eL(i) {
const e = yu(), t = it("button");
return ce(() => {
let r = {}, n = i.color;
if (n) {
const o = n.match(/var\((.*?)\)/);
o && (n = window.getComputedStyle(window.document.documentElement).getPropertyValue(o[1]));
const a = new QC(n), s = i.dark ? a.tint(20).toString() : wn(a, 20);
if (i.plain)
r = t.cssVarBlock({
"bg-color": i.dark ? wn(a, 90) : a.tint(90).toString(),
"text-color": n,
"border-color": i.dark ? wn(a, 50) : a.tint(50).toString(),
"hover-text-color": `var(${t.cssVarName("color-white")})`,
"hover-bg-color": n,
"hover-border-color": n,
"active-bg-color": s,
"active-text-color": `var(${t.cssVarName("color-white")})`,
"active-border-color": s
}), e.value && (r[t.cssVarBlockName("disabled-bg-color")] = i.dark ? wn(a, 90) : a.tint(90).toString(), r[t.cssVarBlockName("disabled-text-color")] = i.dark ? wn(a, 50) : a.tint(50).toString(), r[t.cssVarBlockName("disabled-border-color")] = i.dark ? wn(a, 80) : a.tint(80).toString());
else {
const c = i.dark ? wn(a, 30) : a.tint(30).toString(), l = a.isDark() ? `var(${t.cssVarName("color-white")})` : `var(${t.cssVarName("color-black")})`;
if (r = t.cssVarBlock({
"bg-color": n,
"text-color": l,
"border-color": n,
"hover-bg-color": c,
"hover-text-color": l,
"hover-border-color": c,
"active-bg-color": s,
"active-border-color": s
}), e.value) {
const h = i.dark ? wn(a, 50) : a.tint(50).toString();
r[t.cssVarBlockName("disabled-bg-color")] = h, r[t.cssVarBlockName("disabled-text-color")] = i.dark ? "rgba(255, 255, 255, 0.5)" : `var(${t.cssVarName("color-white")})`, r[t.cssVarBlockName("disabled-border-color")] = h;
}
}
}
return r;
});
}
const tL = Ie({
name: "ElButton"
}), iL = /* @__PURE__ */ Ie({
...tL,
props: dd,
emits: VC,
setup(i, { expose: e, emit: t }) {
const r = i, n = eL(r), o = it("button"), { _ref: a, _size: s, _type: c, _disabled: l, _props: h, shouldAddSpace: u, handleClick: p } = kC(r, t), g = ce(() => [
o.b(),
o.m(c.value),
o.m(s.value),
o.is("disabled", l.value),
o.is("loading", r.loading),
o.is("plain", r.plain),
o.is("round", r.round),
o.is("circle", r.circle),
o.is("text", r.text),
o.is("link", r.link),
o.is("has-bg", r.bg)
]);
return e({
ref: a,
size: s,
type: c,
disabled: l,
shouldAddSpace: u
}), (m, d) => (ge(), Ue(Ni(m.tag), Or({
ref_key: "_ref",
ref: a
}, G(h), {
class: G(g),
style: G(n),
onClick: G(p)
}), {
default: me(() => [
m.loading ? (ge(), Le(Vt, { key: 0 }, [
m.$slots.loading ? qe(m.$slots, "loading", { key: 0 }) : (ge(), Ue(G(Dt), {
key: 1,
class: Re(G(o).is("loading"))
}, {
default: me(() => [
(ge(), Ue(Ni(m.loadingIcon)))
]),
_: 1
}, 8, ["class"]))
], 64)) : m.icon || m.$slots.icon ? (ge(), Ue(G(Dt), { key: 1 }, {
default: me(() => [
m.icon ? (ge(), Ue(Ni(m.icon), { key: 0 })) : qe(m.$slots, "icon", { key: 1 })
]),
_: 3
})) : Ve("v-if", !0),
m.$slots.default ? (ge(), Le("span", {
key: 2,
class: Re({ [G(o).em("text", "expand")]: G(u) })
}, [
qe(m.$slots, "default")
], 2)) : Ve("v-if", !0)
]),
_: 3
}, 16, ["class", "style", "onClick"]));
}
});
var rL = /* @__PURE__ */ ot(iL, [["__file", "button.vue"]]);
const nL = {
size: dd.size,
type: dd.type
}, oL = Ie({
name: "ElButtonGroup"
}), aL = /* @__PURE__ */ Ie({
...oL,
props: nL,
setup(i) {
const e = i;
ci(py, Xi({
size: Di(e, "size"),
type: Di(e, "type")
}));
const t = it("button");
return (r, n) => (ge(), Le("div", {
class: Re(G(t).b("group"))
}, [
qe(r.$slots, "default")
], 2));
}
});
var my = /* @__PURE__ */ ot(aL, [["__file", "button-group.vue"]]);
const os = ui(rL, {
ButtonGroup: my
});
mn(my);
var Nn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function sL(i) {
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
}
function xu(i) {
if (i.__esModule) return i;
var e = i.default;
if (typeof e == "function") {
var t = function r() {
return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
};
t.prototype = e.prototype;
} else t = {};
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(i).forEach(function(r) {
var n = Object.getOwnPropertyDescriptor(i, r);
Object.defineProperty(t, r, n.get ? n : {
enumerable: !0,
get: function() {
return i[r];
}
});
}), t;
}
const Pn = /* @__PURE__ */ new Map();
if (Kt) {
let i;
document.addEventListener("mousedown", (e) => i = e), document.addEventListener("mouseup", (e) => {
if (i) {
for (const t of Pn.values())
for (const { documentHandler: r } of t)
r(e, i);
i = void 0;
}
});
}
function ig(i, e) {
let t = [];
return Array.isArray(e.arg) ? t = e.arg : Mo(e.arg) && t.push(e.arg), function(r, n) {
const o = e.instance.popperRef, a = r.target, s = n == null ? void 0 : n.target, c = !e || !e.instance, l = !a || !s, h = i.contains(a) || i.contains(s), u = i === a, p = t.length && t.some((m) => m == null ? void 0 : m.contains(a)) || t.length && t.includes(s), g = o && (o.contains(a) || o.contains(s));
c || l || h || u || p || g || e.value(r, n);
};
}
const lL = {
beforeMount(i, e) {
Pn.has(i) || Pn.set(i, []), Pn.get(i).push({
documentHandler: ig(i, e),
bindingFn: e.value
});
},
updated(i, e) {
Pn.has(i) || Pn.set(i, []);
const t = Pn.get(i), r = t.findIndex((o) => o.bindingFn === e.oldValue), n = {
documentHandler: ig(i, e),
bindingFn: e.value
};
r >= 0 ? t.splice(r, 1, n) : t.push(n);
},
unmounted(i) {
Pn.delete(i);
}
}, cL = 100, uL = 600, rg = {
beforeMount(i, e) {
const t = e.value, { interval: r = cL, delay: n = uL } = Si(t) ? {} : t;
let o, a;
const s = () => Si(t) ? t() : t.handler(), c = () => {
a && (clearTimeout(a), a = void 0), o && (clearInterval(o), o = void 0);
};
i.addEventListener("mousedown", (l) => {
l.button === 0 && (c(), s(), document.addEventListener("mouseup", () => c(), {
once: !0
}), a = setTimeout(() => {
o = setInterval(() => {
s();
}, r);
}, n));
});
}
}, fd = ht({
type: {
type: String,
values: ["primary", "success", "info", "warning", "danger"],
default: "primary"
},
closable: Boolean,
disableTransitions: Boolean,
hit: Boolean,
color: String,
size: {
type: String,
values: N0
},
effect: {
type: String,
values: ["dark", "light", "plain"],
default: "light"
},
round: Boolean
}), hL = {
close: (i) => i instanceof MouseEvent,
click: (i) => i instanceof MouseEvent
}, dL = Ie({
name: "ElTag"
}), pL = /* @__PURE__ */ Ie({
...dL,
props: fd,
emits: hL,
setup(i, { emit: e }) {
const t = i, r = ns(), n = it("tag"), o = ce(() => {
const { type: l, hit: h, effect: u, closable: p, round: g } = t;
return [
n.b(),
n.is("closable", p),
n.m(l || "primary"),
n.m(r.value),
n.m(u),
n.is("hit", h),
n.is("round", g)
];
}), a = (l) => {
e("close", l);
}, s = (l) => {
e("click", l);
}, c = (l) => {
l.component.subTree.component.bum = null;
};
return (l, h) => l.disableTransitions ? (ge(), Le("span", {
key: 0,
class: Re(G(o)),
style: Ot({ backgroundColor: l.color }),
onClick: s
}, [
ke("span", {
class: Re(G(n).e("content"))
}, [
qe(l.$slots, "default")
], 2),
l.closable ? (ge(), Ue(G(Dt), {
key: 0,
class: Re(G(n).e("close")),
onClick: ai(a, ["stop"])
}, {
default: me(() => [
le(G(ld))
]),
_: 1
}, 8, ["class", "onClick"])) : Ve("v-if", !0)
], 6)) : (ge(), Ue(hl, {
key: 1,
name: `${G(n).namespace.value}-zoom-in-center`,
appear: "",
onVnodeMounted: c
}, {
default: me(() => [
ke("span", {
class: Re(G(o)),
style: Ot({ backgroundColor: l.color }),
onClick: s
}, [
ke("span", {
class: Re(G(n).e("content"))
}, [
qe(l.$slots, "default")
], 2),
l.closable ? (ge(), Ue(G(Dt), {
key: 0,
class: Re(G(n).e("close")),
onClick: ai(a, ["stop"])
}, {
default: me(() => [
le(G(ld))
]),
_: 1
}, 8, ["class", "onClick"])) : Ve("v-if", !0)
], 6)
]),
_: 3
}, 8, ["name"]));
}
});
var fL = /* @__PURE__ */ ot(pL, [["__file", "tag.vue"]]);
const mL = ui(fL), gy = Symbol("rowContextKey"), gL = [
"start",
"center",
"end",
"space-around",
"space-between",
"space-evenly"
], vL = ["top", "middle", "bottom"], yL = ht({
tag: {
type: String,
default: "div"
},
gutter: {
type: Number,
default: 0
},
justify: {
type: String,
values: gL,
default: "start"
},
align: {
type: String,
values: vL
}
}), bL = Ie({
name: "ElRow"
}), xL = /* @__PURE__ */ Ie({
...bL,
props: yL,
setup(i) {
const e = i, t = it("row"), r = ce(() => e.gutter);
ci(gy, {
gutter: r
});
const n = ce(() => {
const a = {};
return e.gutter && (a.marginRight = a.marginLeft = `-${e.gutter / 2}px`), a;
}), o = ce(() => [
t.b(),
t.is(`justify-${e.justify}`, e.justify !== "start"),
t.is(`align-${e.align}`, !!e.align)
]);
return (a, s) => (ge(), Ue(Ni(a.tag), {
class: Re(G(o)),
style: Ot(G(n))
}, {
default: me(() => [
qe(a.$slots, "default")
]),
_: 3
}, 8, ["class", "style"]));
}
});
var wL = /* @__PURE__ */ ot(xL, [["__file", "row.vue"]]);
const Ur = ui(wL), _L = ht({
tag: {
type: String,
default: "div"
},
span: {
type: Number,
default: 24
},
offset: {
type: Number,
default: 0
},
pull: {
type: Number,
default: 0
},
push: {
type: Number,
default: 0
},
xs: {
type: Ze([Number, Object]),
default: () => Qr({})
},
sm: {
type: Ze([Number, Object]),
default: () => Qr({})
},
md: {
type: Ze([Number, Object]),
default: () => Qr({})
},
lg: {
type: Ze([Number, Object]),
default: () => Qr({})
},
xl: {
type: Ze([Number, Object]),
default: () => Qr({})
}
}), ML = Ie({
name: "ElCol"
}), SL = /* @__PURE__ */ Ie({
...ML,
props: _L,
setup(i) {
const e = i, { gutter: t } = ct(gy, { gutter: ce(() => 0) }), r = it("col"), n = ce(() => {
const a = {};
return t.value && (a.paddingLeft = a.paddingRight = `${t.value / 2}px`), a;
}), o = ce(() => {
const a = [];
return ["span", "offset", "pull", "push"].forEach((s) => {
const c = e[s];
_t(c) && (s === "span" ? a.push(r.b(`${e[s]}`)) : c > 0 && a.push(r.b(`${s}-${e[s]}`)));
}), ["xs", "sm", "md", "lg", "xl"].forEach((s) => {
_t(e[s]) ? a.push(r.b(`${s}-${e[s]}`)) : Ai(e[s]) && Object.entries(e[s]).forEach(([c, l]) => {
a.push(c !== "span" ? r.b(`${s}-${c}-${l}`) : r.b(`${s}-${l}`));
});
}), t.value && a.push(r.is("guttered")), [r.b(), a];
});
return (a, s) => (ge(), Ue(Ni(a.tag), {
class: Re(G(o)),
style: Ot(G(n))
}, {
default: me(() => [
qe(a.$slots, "default")
]),
_: 3
}, 8, ["class", "style"]));
}
});
var TL = /* @__PURE__ */ ot(SL, [["__file", "col.vue"]]);
const _r = ui(TL), ng = (i) => _t(i) || Li(i) || Bi(i), EL = ht({
accordion: Boolean,
modelValue: {
type: Ze([Array, String, Number]),
default: () => Qr([])
}
}), AL = {
[Pt]: ng,
[Kn]: ng
}, vy = Symbol("collapseContextKey"), CL = (i, e) => {
const t = Ae(Cr(i.modelValue)), r = (o) => {
t.value = o;
const a = i.accordion ? t.value[0] : t.value;
e(Pt, a), e(Kn, a);
}, n = (o) => {
if (i.accordion)
r([t.value[0] === o ? "" : o]);
else {
const a = [...t.value], s = a.indexOf(o);
s > -1 ? a.splice(s, 1) : a.push(o), r(a);
}
};
return Ke(() => i.modelValue, () => t.value = Cr(i.modelValue), { deep: !0 }), ci(vy, {
activeNames: t,
handleItemClick: n
}), {
activeNames: t,
setActiveNames: r
};
}, LL = () => {
const i = it("collapse");
return {
rootKls: ce(() => i.b())
};
}, RL = Ie({
name: "ElCollapse"
}), OL = /* @__PURE__ */ Ie({
...RL,
props: EL,
emits: AL,
setup(i, { expose: e, emit: t }) {
const r = i, { activeNames: n, setActiveNames: o } = CL(r, t), { rootKls: a } = LL();
return e({
activeNames: n,
setActiveNames: o
}), (s, c) => (ge(), Le("div", {
class: Re(G(a))
}, [
qe(s.$slots, "default")
], 2));
}
});
var PL = /* @__PURE__ */ ot(OL, [["__file", "collapse.vue"]]);
const IL = Ie({
name: "ElCollapseTransition"
}), DL = /* @__PURE__ */ Ie({
...IL,
setup(i) {
const e = it("collapse-transition"), t = (n) => {
n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom;
}, r = {
beforeEnter(n) {
n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.style.height && (n.dataset.elExistsHeight = n.style.height), n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0;
},
enter(n) {
requestAnimationFrame(() => {
n.dataset.oldOverflow = n.style.overflow, n.dataset.elExistsHeight ? n.style.maxHeight = n.dataset.elExistsHeight : n.scrollHeight !== 0 ? n.style.maxHeight = `${n.scrollHeight}px` : n.style.maxHeight = 0, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom, n.style.overflow = "hidden";
});
},
afterEnter(n) {
n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow;
},
enterCancelled(n) {
t(n);
},
beforeLeave(n) {
n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.dataset.oldOverflow = n.style.overflow, n.style.maxHeight = `${n.scrollHeight}px`, n.style.overflow = "hidden";
},
leave(n) {
n.scrollHeight !== 0 && (n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0);
},
afterLeave(n) {
t(n);
},
leaveCancelled(n) {
t(n);
}
};
return (n, o) => (ge(), Ue(hl, Or({
name: G(e).b()
}, dw(r)), {
default: me(() => [
qe(n.$slots, "default")
]),
_: 3
}, 16, ["name"]));
}
});
var NL = /* @__PURE__ */ ot(DL, [["__file", "collapse-transition.vue"]]);
const BL = ui(NL), kL = ht({
title: {
type: String,
default: ""
},
name: {
type: Ze([String, Number]),
default: void 0
},
icon: {
type: $n,
default: Wn
},
disabled: Boolean
}), zL = (i) => {
const e = ct(vy), { namespace: t } = it("collapse"), r = Ae(!1), n = Ae(!1), o = Ep(), a = ce(() => o.current++), s = ce(() => {
var l;
return (l = i.name) != null ? l : `${t.value}-id-${o.prefix}-${G(a)}`;
}), c = ce(() => e == null ? void 0 : e.activeNames.value.includes(G(s)));
return {
focusing: r,
id: a,
isActive: c,
handleFocus: () => {
setTimeout(() => {
n.value ? n.value = !1 : r.value = !0;
}, 50);
},
handleHeaderClick: () => {
i.disabled || (e == null || e.handleItemClick(G(s)), r.value = !1, n.value = !0);
},
handleEnterClick: () => {
e == null || e.handleItemClick(G(s));
}
};
}, FL = (i, { focusing: e, isActive: t, id: r }) => {
const n = it("collapse"), o = ce(() => [
n.b("item"),
n.is("active", G(t)),
n.is("disabled", i.disabled)
]), a = ce(() => [
n.be("item", "header"),
n.is("active", G(t)),
{ focusing: G(e) && !i.disabled }
]), s = ce(() => [
n.be("item", "arrow"),
n.is("active", G(t))
]), c = ce(() => n.be("item", "wrap")), l = ce(() => n.be("item", "content")), h = ce(() => n.b(`content-${G(r)}`)), u = ce(() => n.b(`head-${G(r)}`));
return {
arrowKls: s,
headKls: a,
rootKls: o,
itemWrapperKls: c,
itemContentKls: l,
scopedContentId: h,
scopedHeadId: u
};
}, VL = Ie({
name: "ElCollapseItem"
}), UL = /* @__PURE__ */ Ie({
...VL,
props: kL,
setup(i, { expose: e }) {
const t = i, {
focusing: r,
id: n,
isActive: o,
handleFocus: a,
handleHeaderClick: s,
handleEnterClick: c
} = zL(t), {
arrowKls: l,
headKls: h,
rootKls: u,
itemWrapperKls: p,
itemContentKls: g,
scopedContentId: m,
scopedHeadId: d
} = FL(t, { focusing: r, isActive: o, id: n });
return e({
isActive: o
}), (y, f) => (ge(), Le("div", {
class: Re(G(u))
}, [
ke("button", {
id: G(d),
class: Re(G(h)),
"aria-expanded": G(o),
"aria-controls": G(m),
"aria-describedby": G(m),
tabindex: y.disabled ? -1 : 0,
type: "button",
onClick: G(s),
onKeydown: mr(ai(G(c), ["stop", "prevent"]), ["space", "enter"]),
onFocus: G(a),
onBlur: (v) => r.value = !1
}, [
qe(y.$slots, "title", {}, () => [
vt(xt(y.title), 1)
]),
qe(y.$slots, "icon", { isActive: G(o) }, () => [
le(G(Dt), {
class: Re(G(l))
}, {
default: me(() => [
(ge(), Ue(Ni(y.icon)))
]),
_: 1
}, 8, ["class"])
])
], 42, ["id", "aria-expanded", "aria-controls", "aria-describedby", "tabindex", "onClick", "onKeydown", "onFocus", "onBlur"]),
le(G(BL), null, {
default: me(() => [
It(ke("div", {
id: G(m),
role: "region",
class: Re(G(p)),
"aria-hidden": !G(o),
"aria-labelledby": G(d)
}, [
ke("div", {
class: Re(G(g))
}, [
qe(y.$slots, "default")
], 2)
], 10, ["id", "aria-hidden", "aria-labelledby"]), [
[fi, G(o)]
])
]),
_: 3
})
], 2));
}
});
var yy = /* @__PURE__ */ ot(UL, [["__file", "collapse-item.vue"]]);
const by = ui(PL, {
CollapseItem: yy
}), xy = mn(yy), GL = Ie({
name: "ElContainer"
}), HL = /* @__PURE__ */ Ie({
...GL,
props: {
direction: {
type: String
}
},
setup(i) {
const e = i, t = au(), r = it("container"), n = ce(() => e.direction === "vertical" ? !0 : e.direction === "horizontal" ? !1 : t && t.default ? t.default().some((o) => {
const a = o.type.name;
return a === "ElHeader" || a === "ElFooter";
}) : !1);
return (o, a) => (ge(), Le("section", {
class: Re([G(r).b(), G(r).is("vertical", G(n))])
}, [
qe(o.$slots, "default")
], 2));
}
});
var jL = /* @__PURE__ */ ot(HL, [["__file", "container.vue"]]);
const WL = Ie({
name: "ElAside"
}), $L = /* @__PURE__ */ Ie({
...WL,
props: {
width: {
type: String,
default: null
}
},
setup(i) {
const e = i, t = it("aside"), r = ce(() => e.width ? t.cssVarBlock({ width: e.width }) : {});
return (n, o) => (ge(), Le("aside", {
class: Re(G(t).b()),
style: Ot(G(r))
}, [
qe(n.$slots, "default")
], 6));
}
});
var wy = /* @__PURE__ */ ot($L, [["__file", "aside.vue"]]);
const qL = Ie({
name: "ElFooter"
}), XL = /* @__PURE__ */ Ie({
...qL,
props: {
height: {
type: String,
default: null
}
},
setup(i) {
const e = i, t = it("footer"), r = ce(() => e.height ? t.cssVarBlock({ height: e.height }) : {});
return (n, o) => (ge(), Le("footer", {
class: Re(G(t).b()),
style: Ot(G(r))
}, [
qe(n.$slots, "default")
], 6));
}
});
var _y = /* @__PURE__ */ ot(XL, [["__file", "footer.vue"]]);
const ZL = Ie({
name: "ElHeader"
}), YL = /* @__PURE__ */ Ie({
...ZL,
props: {
height: {
type: String,
default: null
}
},
setup(i) {
const e = i, t = it("header"), r = ce(() => e.height ? t.cssVarBlock({
height: e.height
}) : {});
return (n, o) => (ge(), Le("header", {
class: Re(G(t).b()),
style: Ot(G(r))
}, [
qe(n.$slots, "default")
], 6));
}
});
var My = /* @__PURE__ */ ot(YL, [["__file", "header.vue"]]);
const JL = Ie({
name: "ElMain"
}), KL = /* @__PURE__ */ Ie({
...JL,
setup(i) {
const e = it("main");
return (t, r) => (ge(), Le("main", {
class: Re(G(e).b())
}, [
qe(t.$slots, "default")
], 2));
}
});
var Sy = /* @__PURE__ */ ot(KL, [["__file", "main.vue"]]);
const Gr = ui(jL, {
Aside: wy,
Footer: _y,
Header: My,
Main: Sy
});
mn(wy);
const Ty = mn(_y), QL = mn(My), gn = mn(Sy), eR = /* @__PURE__ */ Ie({
inheritAttrs: !1
});
function tR(i, e, t, r, n, o) {
return qe(i.$slots, "default");
}
var iR = /* @__PURE__ */ ot(eR, [["render", tR], ["__file", "collection.vue"]]);
const rR = /* @__PURE__ */ Ie({
name: "ElCollectionItem",
inheritAttrs: !1
});
function nR(i, e, t, r, n, o) {
return qe(i.$slots, "default");
}
var oR = /* @__PURE__ */ ot(rR, [["render", nR], ["__file", "collection-item.vue"]]);
const aR = "data-el-collection-item", sR = (i) => {
const e = `El${i}Collection`, t = `${e}Item`, r = Symbol(e), n = Symbol(t), o = {
...iR,
name: e,
setup() {
const s = Ae(null), c = /* @__PURE__ */ new Map();
ci(r, {
itemMap: c,
getItems: () => {
const l = G(s);
if (!l)
return [];
const h = Array.from(l.querySelectorAll(`[${aR}]`));
return [...c.values()].sort((u, p) => h.indexOf(u.ref) - h.indexOf(p.ref));
},
collectionRef: s
});
}
}, a = {
...oR,
name: t,
setup(s, { attrs: c }) {
const l = Ae(null), h = ct(r, void 0);
ci(n, {
collectionItemRef: l
}), ei(() => {
const u = G(l);
u && h.itemMap.set(u, {
ref: u,
...c
});
}), or(() => {
const u = G(l);
h.itemMap.delete(u);
});
}
};
return {
COLLECTION_INJECTION_KEY: r,
COLLECTION_ITEM_INJECTION_KEY: n,
ElCollection: o,
ElCollectionItem: a
};
}, rh = ht({
trigger: Js.trigger,
effect: {
...Wi.effect,
default: "light"
},
type: {
type: Ze(String)
},
placement: {
type: Ze(String),
default: "bottom"
},
popperOptions: {
type: Ze(Object),
default: () => ({})
},
id: String,
size: {
type: String,
default: ""
},
splitButton: Boolean,
hideOnClick: {
type: Boolean,
default: !0
},
loop: {
type: Boolean,
default: !0
},
showTimeout: {
type: Number,
default: 150
},
hideTimeout: {
type: Number,
default: 150
},
tabindex: {
type: Ze([Number, String]),
default: 0
},
maxHeight: {
type: Ze([Number, String]),
default: ""
},
popperClass: {
type: String,
default: ""
},
disabled: Boolean,
role: {
type: String,
default: "menu"
},
buttonProps: {
type: Ze(Object)
},
teleported: Wi.teleported
});
ht({
command: {
type: [Object, String, Number],
default: () => ({})
},
disabled: Boolean,
divided: Boolean,
textValue: String,
icon: {
type: $n
}
});
ht({
onKeydown: { type: Ze(Function) }
});
sR("Dropdown");
const lR = ht({
id: {
type: String,
default: void 0
},
step: {
type: Number,
default: 1
},
stepStrictly: Boolean,
max: {
type: Number,
default: Number.POSITIVE_INFINITY
},
min: {
type: Number,
default: Number.NEGATIVE_INFINITY
},
modelValue: Number,
readonly: Boolean,
disabled: Boolean,
size: Da,
controls: {
type: Boolean,
default: !0
},
controlsPosition: {
type: String,
default: "",
values: ["", "right"]
},
valueOnClear: {
type: [String, Number, null],
validator: (i) => i === null || _t(i) || ["min", "max"].includes(i),
default: null
},
name: String,
placeholder: String,
precision: {
type: Number,
validator: (i) => i >= 0 && i === Number.parseInt(`${i}`, 10)
},
validateEvent: {
type: Boolean,
default: !0
},
...Ho(["ariaLabel"])
}), cR = {
[Kn]: (i, e) => e !== i,
blur: (i) => i instanceof FocusEvent,
focus: (i) => i instanceof FocusEvent,
[So]: (i) => _t(i) || nn(i),
[Pt]: (i) => _t(i) || nn(i)
}, uR = Ie({
name: "ElInputNumber"
}), hR = /* @__PURE__ */ Ie({
...uR,
props: lR,
emits: cR,
setup(i, { expose: e, emit: t }) {
const r = i, { t: n } = mu(), o = it("input-number"), a = Ae(), s = Xi({
currentValue: r.modelValue,
userInput: null
}), { formItem: c } = gl(), l = ce(() => _t(r.modelValue) && r.modelValue <= r.min), h = ce(() => _t(r.modelValue) && r.modelValue >= r.max), u = ce(() => {
const R = f(r.step);
return gr(r.precision) ? Math.max(f(r.modelValue), R) : (R > r.precision && Zt("InputNumber", "precision should not be less than the decimal places of step"), r.precision);
}), p = ce(() => r.controls && r.controlsPosition === "right"), g = ns(), m = yu(), d = ce(() => {
if (s.userInput !== null)
return s.userInput;
let R = s.currentValue;
if (nn(R))
return "";
if (_t(R)) {
if (Number.isNaN(R))
return "";
gr(r.precision) || (R = R.toFixed(r.precision));
}
return R;
}), y = (R, b) => {
if (gr(b) && (b = u.value), b === 0)
return Math.round(R);
let P = String(R);
const N = P.indexOf(".");
if (N === -1 || !P.replace(".", "").split("")[N + b])
return R;
const D = P.length;
return P.charAt(D - 1) === "5" && (P = `${P.slice(0, Math.max(0, D - 1))}6`), Number.parseFloat(Number(P).toFixed(b));
}, f = (R) => {
if (nn(R))
return 0;
const b = R.toString(), P = b.indexOf(".");
let N = 0;
return P !== -1 && (N = b.length - P - 1), N;
}, v = (R, b = 1) => _t(R) ? y(R + r.step * b) : s.currentValue, M = () => {
if (r.readonly || m.value || h.value)
return;
const R = Number(d.value) || 0, b = v(R);
x(b), t(So, s.currentValue), C();
}, S = () => {
if (r.readonly || m.value || l.value)
return;
const R = Number(d.value) || 0, b = v(R, -1);
x(b), t(So, s.currentValue), C();
}, T = (R, b) => {
const { max: P, min: N, step: D, precision: k, stepStrictly: V, valueOnClear: q } = r;
P < N && is("InputNumber", "min should not be greater than max.");
let Y = Number(R);
if (nn(R) || Number.isNaN(Y))
return null;
if (R === "") {
if (q === null)
return null;
Y = Li(q) ? { min: N, max: P }[q] : q;
}
return V && (Y = y(Math.round(Y / D) * D, k), Y !== R && b && t(Pt, Y)), gr(k) || (Y = y(Y, k)), (Y > P || Y < N) && (Y = Y > P ? P : N, b && t(Pt, Y)), Y;
}, x = (R, b = !0) => {
var P;
const N = s.currentValue, D = T(R);
if (!b) {
t(Pt, D);
return;
}
N === D && R || (s.userInput = null, t(Pt, D), N !== D && t(Kn, D, N), r.validateEvent && ((P = c == null ? void 0 : c.validate) == null || P.call(c, "change").catch((k) => Zt(k))), s.currentValue = D);
}, w = (R) => {
s.userInput = R;
const b = R === "" ? null : Number(R);
t(So, b), x(b, !1);
}, A = (R) => {
const b = R !== "" ? Number(R) : "";
(_t(b) && !Number.isNaN(b) || R === "") && x(b), C(), s.userInput = null;
}, _ = () => {
var R, b;
(b = (R = a.value) == null ? void 0 : R.focus) == null || b.call(R);
}, E = () => {
var R, b;
(b = (R = a.value) == null ? void 0 : R.blur) == null || b.call(R);
}, O = (R) => {
t("focus", R);
}, L = (R) => {
var b;
s.userInput = null, t("blur", R), r.validateEvent && ((b = c == null ? void 0 : c.validate) == null || b.call(c, "blur").catch((P) => Zt(P)));
}, C = () => {
s.currentValue !== r.modelValue && (s.currentValue = r.modelValue);
}, I = (R) => {
document.activeElement === R.target && R.preventDefault();
};
return Ke(() => r.modelValue, (R, b) => {
const P = T(R, !0);
s.userInput === null && P !== b && (s.currentValue = P);
}, { immediate: !0 }), ei(() => {
var R;
const { min: b, max: P, modelValue: N } = r, D = (R = a.value) == null ? void 0 : R.input;
if (D.setAttribute("role", "spinbutton"), Number.isFinite(P) ? D.setAttribute("aria-valuemax", String(P)) : D.removeAttribute("aria-valuemax"), Number.isFinite(b) ? D.setAttribute("aria-valuemin", String(b)) : D.removeAttribute("aria-valuemin"), D.setAttribute("aria-valuenow", s.currentValue || s.currentValue === 0 ? String(s.currentValue) : ""), D.setAttribute("aria-disabled", String(m.value)), !_t(N) && N != null) {
let k = Number(N);
Number.isNaN(k) && (k = null), t(Pt, k);
}
D.addEventListener("wheel", I, { passive: !1 });
}), rp(() => {
var R, b;
const P = (R = a.value) == null ? void 0 : R.input;
P == null || P.setAttribute("aria-valuenow", `${(b = s.currentValue) != null ? b : ""}`);
}), e({
focus: _,
blur: E
}), (R, b) => (ge(), Le("div", {
class: Re([
G(o).b(),
G(o).m(G(g)),
G(o).is("disabled", G(m)),
G(o).is("without-controls", !R.controls),
G(o).is("controls-right", G(p))
]),
onDragstart: ai(() => {
}, ["prevent"])
}, [
R.controls ? It((ge(), Le("span", {
key: 0,
role: "button",
"aria-label": G(n)("el.inputNumber.decrease"),
class: Re([G(o).e("decrease"), G(o).is("disabled", G(l))]),
onKeydown: mr(S, ["enter"])
}, [
qe(R.$slots, "decrease-icon", {}, () => [
le(G(Dt), null, {
default: me(() => [
G(p) ? (ge(), Ue(G(mp), { key: 0 })) : (ge(), Ue(G(mE), { key: 1 }))
]),
_: 1
})
])
], 42, ["aria-label", "onKeydown"])), [
[G(rg), S]
]) : Ve("v-if", !0),
R.controls ? It((ge(), Le("span", {
key: 1,
role: "button",
"aria-label": G(n)("el.inputNumber.increase"),
class: Re([G(o).e("increase"), G(o).is("disabled", G(h))]),
onKeydown: mr(M, ["enter"])
}, [
qe(R.$slots, "increase-icon", {}, () => [
le(G(Dt), null, {
default: me(() => [
G(p) ? (ge(), Ue(G(oE), { key: 0 })) : (ge(), Ue(G(pu), { key: 1 }))
]),
_: 1
})
])
], 42, ["aria-label", "onKeydown"])), [
[G(rg), M]
]) : Ve("v-if", !0),
le(G(y2), {
id: R.id,
ref_key: "input",
ref: a,
type: "number",
step: R.step,
"model-value": G(d),
placeholder: R.placeholder,
readonly: R.readonly,
disabled: G(m),
size: G(g),
max: R.max,
min: R.min,
name: R.name,
"aria-label": R.ariaLabel,
"validate-event": !1,
onKeydown: [
mr(ai(M, ["prevent"]), ["up"]),
mr(ai(S, ["prevent"]), ["down"])
],
onBlur: L,
onFocus: O,
onInput: w,
onChange: A
}, pw({ _: 2 }, [
R.$slots.prefix ? {
name: "prefix",
fn: me(() => [
qe(R.$slots, "prefix")
])
} : void 0,
R.$slots.suffix ? {
name: "suffix",
fn: me(() => [
qe(R.$slots, "suffix")
])
} : void 0
]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"])
], 42, ["onDragstart"]));
}
});
var dR = /* @__PURE__ */ ot(hR, [["__file", "input-number.vue"]]);
const vn = ui(dR), Ey = Symbol("ElSelectGroup"), wu = Symbol("ElSelect");
function pR(i, e) {
const t = ct(wu), r = ct(Ey, { disabled: !1 }), n = ce(() => h(Cr(t.props.modelValue), i.value)), o = ce(() => {
var g;
if (t.props.multiple) {
const m = Cr((g = t.props.modelValue) != null ? g : []);
return !n.value && m.length >= t.props.multipleLimit && t.props.multipleLimit > 0;
} else
return !1;
}), a = ce(() => i.label || (Ai(i.value) ? "" : i.value)), s = ce(() => i.value || i.label || ""), c = ce(() => i.disabled || e.groupDisabled || o.value), l = ri(), h = (g = [], m) => {
if (Ai(i.value)) {
const d = t.props.valueKey;
return g && g.some((y) => np(Kr(y, d)) === Kr(m, d));
} else
return g && g.includes(m);
}, u = () => {
!i.disabled && !r.disabled && (t.states.hoveringIndex = t.optionsArray.indexOf(l.proxy));
}, p = (g) => {
const m = new RegExp(KT(g), "i");
e.visible = m.test(a.value) || i.created;
};
return Ke(() => a.value, () => {
!i.created && !t.props.remote && t.setSelected();
}), Ke(() => i.value, (g, m) => {
const { remote: d, valueKey: y } = t.props;
if (g !== m && (t.onOptionDestroy(m, l.proxy), t.onOptionCreate(l.proxy)), !i.created && !d) {
if (y && Ai(g) && Ai(m) && g[y] === m[y])
return;
t.setSelected();
}
}), Ke(() => r.disabled, () => {
e.groupDisabled = r.disabled;
}, { immediate: !0 }), {
select: t,
currentLabel: a,
currentValue: s,
itemSelected: n,
isDisabled: c,
hoverItem: u,
updateOption: p
};
}
const fR = Ie({
name: "ElOption",
componentName: "ElOption",
props: {
value: {
required: !0,
type: [String, Number, Boolean, Object]
},
label: [String, Number],
created: Boolean,
disabled: Boolean
},
setup(i) {
const e = it("select"), t = vu(), r = ce(() => [
e.be("dropdown", "item"),
e.is("disabled", G(s)),
e.is("selected", G(a)),
e.is("hovering", G(p))
]), n = Xi({
index: -1,
groupDisabled: !1,
visible: !0,
hover: !1
}), {
currentLabel: o,
itemSelected: a,
isDisabled: s,
select: c,
hoverItem: l,
updateOption: h
} = pR(i, n), { visible: u, hover: p } = ln(n), g = ri().proxy;
c.onOptionCreate(g), or(() => {
const d = g.value, { selected: y } = c.states, f = (c.props.multiple ? y : [y]).some((v) => v.value === g.value);
wt(() => {
c.states.cachedOptions.get(d) === g && !f && c.states.cachedOptions.delete(d);
}), c.onOptionDestroy(d, g);
});
function m() {
s.value || c.handleOptionSelect(g);
}
return {
ns: e,
id: t,
containerKls: r,
currentLabel: o,
itemSelected: a,
isDisabled: s,
select: c,
hoverItem: l,
updateOption: h,
visible: u,
hover: p,
selectOptionClick: m,
states: n
};
}
});
function mR(i, e, t, r, n, o) {
return It((ge(), Le("li", {
id: i.id,
class: Re(i.containerKls),
role: "option",
"aria-disabled": i.isDisabled || void 0,
"aria-selected": i.itemSelected,
onMouseenter: i.hoverItem,
onClick: ai(i.selectOptionClick, ["stop"])
}, [
qe(i.$slots, "default", {}, () => [
ke("span", null, xt(i.currentLabel), 1)
])
], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [
[fi, i.visible]
]);
}
var Bp = /* @__PURE__ */ ot(fR, [["render", mR], ["__file", "option.vue"]]);
const gR = Ie({
name: "ElSelectDropdown",
componentName: "ElSelectDropdown",
setup() {
const i = ct(wu), e = it("select"), t = ce(() => i.props.popperClass), r = ce(() => i.props.multiple), n = ce(() => i.props.fitInputWidth), o = Ae("");
function a() {
var s;
o.value = `${(s = i.selectRef) == null ? void 0 : s.offsetWidth}px`;
}
return ei(() => {
a(), er(i.selectRef, a);
}), {
ns: e,
minWidth: o,
popperClass: t,
isMultiple: r,
isFitInputWidth: n
};
}
});
function vR(i, e, t, r, n, o) {
return ge(), Le("div", {
class: Re([i.ns.b("dropdown"), i.ns.is("multiple", i.isMultiple), i.popperClass]),
style: Ot({ [i.isFitInputWidth ? "width" : "minWidth"]: i.minWidth })
}, [
i.$slots.header ? (ge(), Le("div", {
key: 0,
class: Re(i.ns.be("dropdown", "header"))
}, [
qe(i.$slots, "header")
], 2)) : Ve("v-if", !0),
qe(i.$slots, "default"),
i.$slots.footer ? (ge(), Le("div", {
key: 1,
class: Re(i.ns.be("dropdown", "footer"))
}, [
qe(i.$slots, "footer")
], 2)) : Ve("v-if", !0)
], 6);
}
var yR = /* @__PURE__ */ ot(gR, [["render", vR], ["__file", "select-dropdown.vue"]]);
const bR = 11, xR = (i, e) => {
const { t } = mu(), r = vu(), n = it("select"), o = it("input"), a = Xi({
inputValue: "",
options: /* @__PURE__ */ new Map(),
cachedOptions: /* @__PURE__ */ new Map(),
disabledOptions: /* @__PURE__ */ new Map(),
optionValues: [],
selected: [],
selectionWidth: 0,
calculatorWidth: 0,
collapseItemWidth: 0,
selectedLabel: "",
hoveringIndex: -1,
previousQuery: null,
inputHovering: !1,
menuVisibleOnFocus: !1,
isBeforeHide: !1
}), s = Ae(null), c = Ae(null), l = Ae(null), h = Ae(null), u = Ae(null), p = Ae(null), g = Ae(null), m = Ae(null), d = Ae(null), y = Ae(null), f = Ae(null), v = Ae(null), {
isComposing: M,
handleCompositionStart: S,
handleCompositionUpdate: T,
handleCompositionEnd: x
} = ry({
afterComposition: (he) => oe(he)
}), { wrapperRef: w, isFocused: A } = iy(u, {
beforeFocus() {
return b.value;
},
afterFocus() {
i.automaticDropdown && !_.value && (_.value = !0, a.menuVisibleOnFocus = !0);
},
beforeBlur(he) {
var xe, Ne;
return ((xe = l.value) == null ? void 0 : xe.isFocusInsideContent(he)) || ((Ne = h.value) == null ? void 0 : Ne.isFocusInsideContent(he));
},
afterBlur() {
_.value = !1, a.menuVisibleOnFocus = !1;
}
}), _ = Ae(!1), E = Ae(), { form: O, formItem: L } = gl(), { inputId: C } = Lp(i, {
formItemContext: L
}), { valueOnClear: I, isEmptyValue: R } = t2(i), b = ce(() => i.disabled || (O == null ? void 0 : O.disabled)), P = ce(() => Bi(i.modelValue) ? i.modelValue.length > 0 : !R(i.modelValue)), N = ce(() => i.clearable && !b.value && a.inputHovering && P.value), D = ce(() => i.remote && i.filterable && !i.remoteShowSuffix ? "" : i.suffixIcon), k = ce(() => n.is("reverse", D.value && _.value)), V = ce(() => (L == null ? void 0 : L.validateState) || ""), q = ce(() => D0[V.value]), Y = ce(() => i.remote ? 300 : 0), ne = ce(() => i.loading ? i.loadingText || t("el.select.loading") : i.remote && !a.inputValue && a.options.size === 0 ? !1 : i.filterable && a.inputValue && a.options.size > 0 && X.value === 0 ? i.noMatchText || t("el.select.noMatch") : a.options.size === 0 ? i.noDataText || t("el.select.noData") : null), X = ce(() => z.value.filter((he) => he.visible).length), z = ce(() => {
const he = Array.from(a.options.values()), xe = [];
return a.optionValues.forEach((Ne) => {
const He = he.findIndex((Xe) => Xe.value === Ne);
He > -1 && xe.push(he[He]);
}), xe.length >= he.length ? xe : he;
}), H = ce(() => Array.from(a.cachedOptions.values())), ee = ce(() => {
const he = z.value.filter((xe) => !xe.created).some((xe) => xe.currentLabel === a.inputValue);
return i.filterable && i.allowCreate && a.inputValue !== "" && !he;
}), Q = () => {
i.filterable && Si(i.filterMethod) || i.filterable && i.remote && Si(i.remoteMethod) || z.value.forEach((he) => {
var xe;
(xe = he.updateOption) == null || xe.call(he, a.inputValue);
});
}, J = ns(), W = ce(() => ["small"].includes(J.value) ? "small" : "default"), K = ce({
get() {
return _.value && ne.value !== !1;
},
set(he) {
_.value = he;
}
}), ie = ce(() => {
if (i.multiple && !gr(i.modelValue))
return Cr(i.modelValue).length === 0 && !a.inputValue;
const he = Bi(i.modelValue) ? i.modelValue[0] : i.modelValue;
return i.filterable || gr(he) ? !a.inputValue : !0;
}), B = ce(() => {
var he;
const xe = (he = i.placeholder) != null ? he : t("el.select.placeholder");
return i.multiple || !P.value ? xe : a.selectedLabel;
}), j = ce(() => ed ? null : "mouseenter");
Ke(() => i.modelValue, (he, xe) => {
i.multiple && i.filterable && !i.reserveKeyword && (a.inputValue = "", re("")), U(), !sd(he, xe) && i.validateEvent && (L == null || L.validate("change").catch((Ne) => Zt(Ne)));
}, {
flush: "post",
deep: !0
}), Ke(() => _.value, (he) => {
he ? re(a.inputValue) : (a.inputValue = "", a.previousQuery = null, a.isBeforeHide = !0), e("visible-change", he);
}), Ke(() => a.options.entries(), () => {
var he;
if (!Kt)
return;
const xe = ((he = s.value) == null ? void 0 : he.querySelectorAll("input")) || [];
(!i.filterable && !i.defaultFirstOption && !gr(i.modelValue) || !Array.from(xe).includes(document.activeElement)) && U(), i.defaultFirstOption && (i.filterable || i.remote) && X.value && F();
}, {
flush: "post"
}), Ke(() => a.hoveringIndex, (he) => {
_t(he) && he > -1 ? E.value = z.value[he] || {} : E.value = {}, z.value.forEach((xe) => {
xe.hover = E.value === xe;
});
}), l0(() => {
a.isBeforeHide || Q();
});
const re = (he) => {
a.previousQuery === he || M.value || (a.previousQuery = he, i.filterable && Si(i.filterMethod) ? i.filterMethod(he) : i.filterable && i.remote && Si(i.remoteMethod) && i.remoteMethod(he), i.defaultFirstOption && (i.filterable || i.remote) && X.value ? wt(F) : wt(ue));
}, F = () => {
const he = z.value.filter((He) => He.visible && !He.disabled && !He.states.groupDisabled), xe = he.find((He) => He.created), Ne = he[0];
a.hoveringIndex = bt(z.value, xe || Ne);
}, U = () => {
if (i.multiple)
a.selectedLabel = "";
else {
const xe = Bi(i.modelValue) ? i.modelValue[0] : i.modelValue, Ne = se(xe);
a.selectedLabel = Ne.currentLabel, a.selected = [Ne];
return;
}
const he = [];
gr(i.modelValue) || Cr(i.modelValue).forEach((xe) => {
he.push(se(xe));
}), a.selected = he;
}, se = (he) => {
let xe;
const Ne = $u(he).toLowerCase() === "object", He = $u(he).toLowerCase() === "null", Xe = $u(he).toLowerCase() === "undefined";
for (let Ye = a.cachedOptions.size - 1; Ye >= 0; Ye--) {
const pt = H.value[Ye];
if (Ne ? Kr(pt.value, i.valueKey) === Kr(he, i.valueKey) : pt.value === he) {
xe = {
value: he,
currentLabel: pt.currentLabel,
get isDisabled() {
return pt.isDisabled;
}
};
break;
}
}
if (xe)
return xe;
const Qe = Ne ? he.label : !He && !Xe ? he : "";
return {
value: he,
currentLabel: Qe
};
}, ue = () => {
a.hoveringIndex = z.value.findIndex((he) => a.selected.some((xe) => Se(xe) === Se(he)));
}, fe = () => {
a.selectionWidth = c.value.getBoundingClientRect().width;
}, ve = () => {
a.calculatorWidth = p.value.getBoundingClientRect().width;
}, _e = () => {
a.collapseItemWidth = f.value.getBoundingClientRect().width;
}, ae = () => {
var he, xe;
(xe = (he = l.value) == null ? void 0 : he.updatePopper) == null || xe.call(he);
}, Te = () => {
var he, xe;
(xe = (he = h.value) == null ? void 0 : he.updatePopper) == null || xe.call(he);
}, Ee = () => {
a.inputValue.length > 0 && !_.value && (_.value = !0), re(a.inputValue);
}, oe = (he) => {
if (a.inputValue = he.target.value, i.remote)
Me();
else
return Ee();
}, Me = ad(() => {
Ee();
}, Y.value), ye = (he) => {
sd(i.modelValue, he) || e(Kn, he);
}, we = (he) => WT(he, (xe) => !a.disabledOptions.has(xe)), Pe = (he) => {
if (i.multiple && he.code !== Pr.delete && he.target.value.length <= 0) {
const xe = Cr(i.modelValue).slice(), Ne = we(xe);
if (Ne < 0)
return;
const He = xe[Ne];
xe.splice(Ne, 1), e(Pt, xe), ye(xe), e("remove-tag", He);
}
}, ut = (he, xe) => {
const Ne = a.selected.indexOf(xe);
if (Ne > -1 && !b.value) {
const He = Cr(i.modelValue).slice();
He.splice(Ne, 1), e(Pt, He), ye(He), e("remove-tag", xe.value);
}
he.stopPropagation(), kt();
}, mt = (he) => {
he.stopPropagation();
const xe = i.multiple ? [] : I.value;
if (i.multiple)
for (const Ne of a.selected)
Ne.isDisabled && xe.push(Ne.value);
e(Pt, xe), ye(xe), a.hoveringIndex = -1, _.value = !1, e("clear"), kt();
}, Ge = (he) => {
var xe;
if (i.multiple) {
const Ne = Cr((xe = i.modelValue) != null ? xe : []).slice(), He = bt(Ne, he.value);
He > -1 ? Ne.splice(He, 1) : (i.multipleLimit <= 0 || Ne.length < i.multipleLimit) && Ne.push(he.value), e(Pt, Ne), ye(Ne), he.created && re(""), i.filterable && !i.reserveKeyword && (a.inputValue = "");
} else
e(Pt, he.value), ye(he.value), _.value = !1;
kt(), !_.value && wt(() => {
ze(he);
});
}, bt = (he = [], xe) => {
if (!Ai(xe))
return he.indexOf(xe);
const Ne = i.valueKey;
let He = -1;
return he.some((Xe, Qe) => np(Kr(Xe, Ne)) === Kr(xe, Ne) ? (He = Qe, !0) : !1), He;
}, ze = (he) => {
var xe, Ne, He, Xe, Qe;
const Ye = Bi(he) ? he[0] : he;
let pt = null;
if (Ye != null && Ye.value) {
const bi = z.value.filter((hi) => hi.value === Ye.value);
bi.length > 0 && (pt = bi[0].$el);
}
if (l.value && pt) {
const bi = (Xe = (He = (Ne = (xe = l.value) == null ? void 0 : xe.popperRef) == null ? void 0 : Ne.contentRef) == null ? void 0 : He.querySelector) == null ? void 0 : Xe.call(He, `.${n.be("dropdown", "wrap")}`);
bi && eE(bi, pt);
}
(Qe = v.value) == null || Qe.handleScroll();
}, at = (he) => {
a.options.set(he.value, he), a.cachedOptions.set(he.value, he), he.disabled && a.disabledOptions.set(he.value, he);
}, et = (he, xe) => {
a.options.get(he) === xe && a.options.delete(he);
}, yt = ce(() => {
var he, xe;
return (xe = (he = l.value) == null ? void 0 : he.popperRef) == null ? void 0 : xe.contentRef;
}), dt = () => {
a.isBeforeHide = !1, wt(() => ze(a.selected));
}, kt = () => {
var he;
(he = u.value) == null || he.focus();
}, Rt = () => {
var he;
(he = u.value) == null || he.blur();
}, Ii = (he) => {
mt(he);
}, Ui = () => {
_.value = !1, A.value && Rt();
}, sr = () => {
a.inputValue.length > 0 ? a.inputValue = "" : _.value = !1;
}, oo = () => {
b.value || (ed && (a.inputHovering = !0), a.menuVisibleOnFocus ? a.menuVisibleOnFocus = !1 : _.value = !_.value);
}, te = () => {
_.value ? z.value[a.hoveringIndex] && Ge(z.value[a.hoveringIndex]) : oo();
}, Se = (he) => Ai(he.value) ? Kr(he.value, i.valueKey) : he.value, De = ce(() => z.value.filter((he) => he.visible).every((he) => he.disabled)), We = ce(() => i.multiple ? i.collapseTags ? a.selected.slice(0, i.maxCollapseTags) : a.selected : []), st = ce(() => i.multiple ? i.collapseTags ? a.selected.slice(i.maxCollapseTags) : [] : []), $ = (he) => {
if (!_.value) {
_.value = !0;
return;
}
if (!(a.options.size === 0 || a.filteredOptionsCount === 0 || M.value) && !De.value) {
he === "next" ? (a.hoveringIndex++, a.hoveringIndex === a.options.size && (a.hoveringIndex = 0)) : he === "prev" && (a.hoveringIndex--, a.hoveringIndex < 0 && (a.hoveringIndex = a.options.size - 1));
const xe = z.value[a.hoveringIndex];
(xe.disabled === !0 || xe.states.groupDisabled === !0 || !xe.visible) && $(he), wt(() => ze(E.value));
}
}, pe = () => {
if (!c.value)
return 0;
const he = window.getComputedStyle(c.value);
return Number.parseFloat(he.gap || "6px");
}, de = ce(() => {
const he = pe();
return { maxWidth: `${f.value && i.maxCollapseTags === 1 ? a.selectionWidth - a.collapseItemWidth - he : a.selectionWidth}px` };
}), be = ce(() => ({ maxWidth: `${a.selectionWidth}px` })), Ce = ce(() => ({
width: `${Math.max(a.calculatorWidth, bR)}px`
}));
return er(c, fe), er(p, ve), er(d, ae), er(w, ae), er(y, Te), er(f, _e), ei(() => {
U();
}), {
inputId: C,
contentId: r,
nsSelect: n,
nsInput: o,
states: a,
isFocused: A,
expanded: _,
optionsArray: z,
hoverOption: E,
selectSize: J,
filteredOptionsCount: X,
resetCalculatorWidth: ve,
updateTooltip: ae,
updateTagTooltip: Te,
debouncedOnInputChange: Me,
onInput: oe,
deletePrevTag: Pe,
deleteTag: ut,
deleteSelected: mt,
handleOptionSelect: Ge,
scrollToOption: ze,
hasModelValue: P,
shouldShowPlaceholder: ie,
currentPlaceholder: B,
mouseEnterEventName: j,
showClose: N,
iconComponent: D,
iconReverse: k,
validateState: V,
validateIcon: q,
showNewOption: ee,
updateOptions: Q,
collapseTagSize: W,
setSelected: U,
selectDisabled: b,
emptyText: ne,
handleCompositionStart: S,
handleCompositionUpdate: T,
handleCompositionEnd: x,
onOptionCreate: at,
onOptionDestroy: et,
handleMenuEnter: dt,
focus: kt,
blur: Rt,
handleClearClick: Ii,
handleClickOutside: Ui,
handleEsc: sr,
toggleMenu: oo,
selectOption: te,
getValueKey: Se,
navigateOptions: $,
dropdownMenuVisible: K,
showTagList: We,
collapseTagList: st,
tagStyle: de,
collapseTagStyle: be,
inputStyle: Ce,
popperRef: yt,
inputRef: u,
tooltipRef: l,
tagTooltipRef: h,
calculatorRef: p,
prefixRef: g,
suffixRef: m,
selectRef: s,
wrapperRef: w,
selectionRef: c,
scrollbarRef: v,
menuRef: d,
tagMenuRef: y,
collapseItemRef: f
};
};
var wR = Ie({
name: "ElOptions",
setup(i, { slots: e }) {
const t = ct(wu);
let r = [];
return () => {
var n, o;
const a = (n = e.default) == null ? void 0 : n.call(e), s = [];
function c(l) {
Bi(l) && l.forEach((h) => {
var u, p, g, m;
const d = (u = (h == null ? void 0 : h.type) || {}) == null ? void 0 : u.name;
d === "ElOptionGroup" ? c(!Li(h.children) && !Bi(h.children) && Si((p = h.children) == null ? void 0 : p.default) ? (g = h.children) == null ? void 0 : g.default() : h.children) : d === "ElOption" ? s.push((m = h.props) == null ? void 0 : m.value) : Bi(h.children) && c(h.children);
});
}
return a.length && c((o = a[0]) == null ? void 0 : o.children), sd(s, r) || (r = s, t && (t.states.optionValues = s)), a;
};
}
});
const _R = ht({
name: String,
id: String,
modelValue: {
type: [Array, String, Number, Boolean, Object],
default: void 0
},
autocomplete: {
type: String,
default: "off"
},
automaticDropdown: Boolean,
size: Da,
effect: {
type: Ze(String),
default: "light"
},
disabled: Boolean,
clearable: Boolean,
filterable: Boolean,
allowCreate: Boolean,
loading: Boolean,
popperClass: {
type: String,
default: ""
},
popperOptions: {
type: Ze(Object),
default: () => ({})
},
remote: Boolean,
loadingText: String,
noMatchText: String,
noDataText: String,
remoteMethod: Function,
filterMethod: Function,
multiple: Boolean,
multipleLimit: {
type: Number,
default: 0
},
placeholder: {
type: String
},
defaultFirstOption: Boolean,
reserveKeyword: {
type: Boolean,
default: !0
},
valueKey: {
type: String,
default: "value"
},
collapseTags: Boolean,
collapseTagsTooltip: Boolean,
maxCollapseTags: {
type: Number,
default: 1
},
teleported: Wi.teleported,
persistent: {
type: Boolean,
default: !0
},
clearIcon: {
type: $n,
default: gp
},
fitInputWidth: Boolean,
suffixIcon: {
type: $n,
default: mp
},
tagType: { ...fd.type, default: "info" },
tagEffect: { ...fd.effect, default: "light" },
validateEvent: {
type: Boolean,
default: !0
},
remoteShowSuffix: Boolean,
placement: {
type: Ze(String),
values: rs,
default: "bottom-start"
},
fallbackPlacements: {
type: Ze(Array),
default: ["bottom-start", "top-start", "right", "left"]
},
appendTo: String,
...e2,
...Ho(["ariaLabel"])
}), og = "ElSelect", MR = Ie({
name: og,
componentName: og,
components: {
ElSelectMenu: yR,
ElOption: Bp,
ElOptions: wR,
ElTag: mL,
ElScrollbar: P2,
ElTooltip: Np,
ElIcon: Dt
},
directives: { ClickOutside: lL },
props: _R,
emits: [
Pt,
Kn,
"remove-tag",
"clear",
"visible-change",
"focus",
"blur"
],
setup(i, { emit: e }) {
const t = ce(() => {
const { modelValue: o, multiple: a } = i, s = a ? [] : void 0;
return Bi(o) ? a ? o : s : a ? s : o;
}), r = Xi({
...ln(i),
modelValue: t
}), n = xR(r, e);
return ci(wu, Xi({
props: r,
states: n.states,
optionsArray: n.optionsArray,
handleOptionSelect: n.handleOptionSelect,
onOptionCreate: n.onOptionCreate,
onOptionDestroy: n.onOptionDestroy,
selectRef: n.selectRef,
setSelected: n.setSelected
})), {
...n,
modelValue: t
};
}
});
function SR(i, e, t, r, n, o) {
const a = Ei("el-tag"), s = Ei("el-tooltip"), c = Ei("el-icon"), l = Ei("el-option"), h = Ei("el-options"), u = Ei("el-scrollbar"), p = Ei("el-select-menu"), g = vw("click-outside");
return It((ge(), Le("div", {
ref: "selectRef",
class: Re([i.nsSelect.b(), i.nsSelect.m(i.selectSize)]),
[yw(i.mouseEnterEventName)]: (m) => i.states.inputHovering = !0,
onMouseleave: (m) => i.states.inputHovering = !1
}, [
le(s, {
ref: "tooltipRef",
visible: i.dropdownMenuVisible,
placement: i.placement,
teleported: i.teleported,
"popper-class": [i.nsSelect.e("popper"), i.popperClass],
"popper-options": i.popperOptions,
"fallback-placements": i.fallbackPlacements,
effect: i.effect,
pure: "",
trigger: "click",
transition: `${i.nsSelect.namespace.value}-zoom-in-top`,
"stop-popper-mouse-event": !1,
"gpu-acceleration": !1,
persistent: i.persistent,
"append-to": i.appendTo,
onBeforeShow: i.handleMenuEnter,
onHide: (m) => i.states.isBeforeHide = !1
}, {
default: me(() => {
var m;
return [
ke("div", {
ref: "wrapperRef",
class: Re([
i.nsSelect.e("wrapper"),
i.nsSelect.is("focused", i.isFocused),
i.nsSelect.is("hovering", i.states.inputHovering),
i.nsSelect.is("filterable", i.filterable),
i.nsSelect.is("disabled", i.selectDisabled)
]),
onClick: ai(i.toggleMenu, ["prevent"])
}, [
i.$slots.prefix ? (ge(), Le("div", {
key: 0,
ref: "prefixRef",
class: Re(i.nsSelect.e("prefix"))
}, [
qe(i.$slots, "prefix")
], 2)) : Ve("v-if", !0),
ke("div", {
ref: "selectionRef",
class: Re([
i.nsSelect.e("selection"),
i.nsSelect.is("near", i.multiple && !i.$slots.prefix && !!i.states.selected.length)
])
}, [
i.multiple ? qe(i.$slots, "tag", { key: 0 }, () => [
(ge(!0), Le(Vt, null, tr(i.showTagList, (d) => (ge(), Le("div", {
key: i.getValueKey(d),
class: Re(i.nsSelect.e("selected-item"))
}, [
le(a, {
closable: !i.selectDisabled && !d.isDisabled,
size: i.collapseTagSize,
type: i.tagType,
effect: i.tagEffect,
"disable-transitions": "",
style: Ot(i.tagStyle),
onClose: (y) => i.deleteTag(y, d)
}, {
default: me(() => [
ke("span", {
class: Re(i.nsSelect.e("tags-text"))
}, [
qe(i.$slots, "label", {
label: d.currentLabel,
value: d.value
}, () => [
vt(xt(d.currentLabel), 1)
])
], 2)
]),
_: 2
}, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
], 2))), 128)),
i.collapseTags && i.states.selected.length > i.maxCollapseTags ? (ge(), Ue(s, {
key: 0,
ref: "tagTooltipRef",
disabled: i.dropdownMenuVisible || !i.collapseTagsTooltip,
"fallback-placements": ["bottom", "top", "right", "left"],
effect: i.effect,
placement: "bottom",
teleported: i.teleported
}, {
default: me(() => [
ke("div", {
ref: "collapseItemRef",
class: Re(i.nsSelect.e("selected-item"))
}, [
le(a, {
closable: !1,
size: i.collapseTagSize,
type: i.tagType,
effect: i.tagEffect,
"disable-transitions": "",
style: Ot(i.collapseTagStyle)
}, {
default: me(() => [
ke("span", {
class: Re(i.nsSelect.e("tags-text"))
}, " + " + xt(i.states.selected.length - i.maxCollapseTags), 3)
]),
_: 1
}, 8, ["size", "type", "effect", "style"])
], 2)
]),
content: me(() => [
ke("div", {
ref: "tagMenuRef",
class: Re(i.nsSelect.e("selection"))
}, [
(ge(!0), Le(Vt, null, tr(i.collapseTagList, (d) => (ge(), Le("div", {
key: i.getValueKey(d),
class: Re(i.nsSelect.e("selected-item"))
}, [
le(a, {
class: "in-tooltip",
closable: !i.selectDisabled && !d.isDisabled,
size: i.collapseTagSize,
type: i.tagType,
effect: i.tagEffect,
"disable-transitions": "",
onClose: (y) => i.deleteTag(y, d)
}, {
default: me(() => [
ke("span", {
class: Re(i.nsSelect.e("tags-text"))
}, [
qe(i.$slots, "label", {
label: d.currentLabel,
value: d.value
}, () => [
vt(xt(d.currentLabel), 1)
])
], 2)
]),
_: 2
}, 1032, ["closable", "size", "type", "effect", "onClose"])
], 2))), 128))
], 2)
]),
_: 3
}, 8, ["disabled", "effect", "teleported"])) : Ve("v-if", !0)
]) : Ve("v-if", !0),
i.selectDisabled ? Ve("v-if", !0) : (ge(), Le("div", {
key: 1,
class: Re([
i.nsSelect.e("selected-item"),
i.nsSelect.e("input-wrapper"),
i.nsSelect.is("hidden", !i.filterable)
])
}, [
It(ke("input", {
id: i.inputId,
ref: "inputRef",
"onUpdate:modelValue": (d) => i.states.inputValue = d,
type: "text",
name: i.name,
class: Re([i.nsSelect.e("input"), i.nsSelect.is(i.selectSize)]),
disabled: i.selectDisabled,
autocomplete: i.autocomplete,
style: Ot(i.inputStyle),
role: "combobox",
readonly: !i.filterable,
spellcheck: "false",
"aria-activedescendant": ((m = i.hoverOption) == null ? void 0 : m.id) || "",
"aria-controls": i.contentId,
"aria-expanded": i.dropdownMenuVisible,
"aria-label": i.ariaLabel,
"aria-autocomplete": "none",
"aria-haspopup": "listbox",
onKeydown: [
mr(ai((d) => i.navigateOptions("next"), ["stop", "prevent"]), ["down"]),
mr(ai((d) => i.navigateOptions("prev"), ["stop", "prevent"]), ["up"]),
mr(ai(i.handleEsc, ["stop", "prevent"]), ["esc"]),
mr(ai(i.selectOption, ["stop", "prevent"]), ["enter"]),
mr(ai(i.deletePrevTag, ["stop"]), ["delete"])
],
onCompositionstart: i.handleCompositionStart,
onCompositionupdate: i.handleCompositionUpdate,
onCompositionend: i.handleCompositionEnd,
onInput: i.onInput,
onClick: ai(i.toggleMenu, ["stop"])
}, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [
[bw, i.states.inputValue]
]),
i.filterable ? (ge(), Le("span", {
key: 0,
ref: "calculatorRef",
"aria-hidden": "true",
class: Re(i.nsSelect.e("input-calculator")),
textContent: xt(i.states.inputValue)
}, null, 10, ["textContent"])) : Ve("v-if", !0)
], 2)),
i.shouldShowPlaceholder ? (ge(), Le("div", {
key: 2,
class: Re([
i.nsSelect.e("selected-item"),
i.nsSelect.e("placeholder"),
i.nsSelect.is("transparent", !i.hasModelValue || i.expanded && !i.states.inputValue)
])
}, [
i.hasModelValue ? qe(i.$slots, "label", {
key: 0,
label: i.currentPlaceholder,
value: i.modelValue
}, () => [
ke("span", null, xt(i.currentPlaceholder), 1)
]) : (ge(), Le("span", { key: 1 }, xt(i.currentPlaceholder), 1))
], 2)) : Ve("v-if", !0)
], 2),
ke("div", {
ref: "suffixRef",
class: Re(i.nsSelect.e("suffix"))
}, [
i.iconComponent && !i.showClose ? (ge(), Ue(c, {
key: 0,
class: Re([i.nsSelect.e("caret"), i.nsSelect.e("icon"), i.iconReverse])
}, {
default: me(() => [
(ge(), Ue(Ni(i.iconComponent)))
]),
_: 1
}, 8, ["class"])) : Ve("v-if", !0),
i.showClose && i.clearIcon ? (ge(), Ue(c, {
key: 1,
class: Re([
i.nsSelect.e("caret"),
i.nsSelect.e("icon"),
i.nsSelect.e("clear")
]),
onClick: i.handleClearClick
}, {
default: me(() => [
(ge(), Ue(Ni(i.clearIcon)))
]),
_: 1
}, 8, ["class", "onClick"])) : Ve("v-if", !0),
i.validateState && i.validateIcon ? (ge(), Ue(c, {
key: 2,
class: Re([i.nsInput.e("icon"), i.nsInput.e("validateIcon")])
}, {
default: me(() => [
(ge(), Ue(Ni(i.validateIcon)))
]),
_: 1
}, 8, ["class"])) : Ve("v-if", !0)
], 2)
], 10, ["onClick"])
];
}),
content: me(() => [
le(p, { ref: "menuRef" }, {
default: me(() => [
i.$slots.header ? (ge(), Le("div", {
key: 0,
class: Re(i.nsSelect.be("dropdown", "header")),
onClick: ai(() => {
}, ["stop"])
}, [
qe(i.$slots, "header")
], 10, ["onClick"])) : Ve("v-if", !0),
It(le(u, {
id: i.contentId,
ref: "scrollbarRef",
tag: "ul",
"wrap-class": i.nsSelect.be("dropdown", "wrap"),
"view-class": i.nsSelect.be("dropdown", "list"),
class: Re([i.nsSelect.is("empty", i.filteredOptionsCount === 0)]),
role: "listbox",
"aria-label": i.ariaLabel,
"aria-orientation": "vertical"
}, {
default: me(() => [
i.showNewOption ? (ge(), Ue(l, {
key: 0,
value: i.states.inputValue,
created: !0
}, null, 8, ["value"])) : Ve("v-if", !0),
le(h, null, {
default: me(() => [
qe(i.$slots, "default")
]),
_: 3
})
]),
_: 3
}, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [
[fi, i.states.options.size > 0 && !i.loading]
]),
i.$slots.loading && i.loading ? (ge(), Le("div", {
key: 1,
class: Re(i.nsSelect.be("dropdown", "loading"))
}, [
qe(i.$slots, "loading")
], 2)) : i.loading || i.filteredOptionsCount === 0 ? (ge(), Le("div", {
key: 2,
class: Re(i.nsSelect.be("dropdown", "empty"))
}, [
qe(i.$slots, "empty", {}, () => [
ke("span", null, xt(i.emptyText), 1)
])
], 2)) : Ve("v-if", !0),
i.$slots.footer ? (ge(), Le("div", {
key: 3,
class: Re(i.nsSelect.be("dropdown", "footer")),
onClick: ai(() => {
}, ["stop"])
}, [
qe(i.$slots, "footer")
], 10, ["onClick"])) : Ve("v-if", !0)
]),
_: 3
}, 512)
]),
_: 3
}, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"])
], 16, ["onMouseleave"])), [
[g, i.handleClickOutside, i.popperRef]
]);
}
var TR = /* @__PURE__ */ ot(MR, [["render", SR], ["__file", "select.vue"]]);
const ER = Ie({
name: "ElOptionGroup",
componentName: "ElOptionGroup",
props: {
label: String,
disabled: Boolean
},
setup(i) {
const e = it("select"), t = Ae(null), r = ri(), n = Ae([]);
ci(Ey, Xi({
...ln(i)
}));
const o = ce(() => n.value.some((l) => l.visible === !0)), a = (l) => {
var h, u;
return ((h = l.type) == null ? void 0 : h.name) === "ElOption" && !!((u = l.component) != null && u.proxy);
}, s = (l) => {
const h = Cr(l), u = [];
return h.forEach((p) => {
var g, m;
a(p) ? u.push(p.component.proxy) : (g = p.children) != null && g.length ? u.push(...s(p.children)) : (m = p.component) != null && m.subTree && u.push(...s(p.component.subTree));
}), u;
}, c = () => {
n.value = s(r.subTree);
};
return ei(() => {
c();
}), jw(t, c, {
attributes: !0,
subtree: !0,
childList: !0
}), {
groupRef: t,
visible: o,
ns: e
};
}
});
function AR(i, e, t, r, n, o) {
return It((ge(), Le("ul", {
ref: "groupRef",
class: Re(i.ns.be("group", "wrap"))
}, [
ke("li", {
class: Re(i.ns.be("group", "title"))
}, xt(i.label), 3),
ke("li", null, [
ke("ul", {
class: Re(i.ns.b("group"))
}, [
qe(i.$slots, "default")
], 2)
])
], 2)), [
[fi, i.visible]
]);
}
var Ay = /* @__PURE__ */ ot(ER, [["render", AR], ["__file", "option-group.vue"]]);
const as = ui(TR, {
Option: Bp,
OptionGroup: Ay
}), ss = mn(Bp);
mn(Ay);
const CR = ht({
trigger: Js.trigger,
placement: rh.placement,
disabled: Js.disabled,
visible: Wi.visible,
transition: Wi.transition,
popperOptions: rh.popperOptions,
tabindex: rh.tabindex,
content: Wi.content,
popperStyle: Wi.popperStyle,
popperClass: Wi.popperClass,
enterable: {
...Wi.enterable,
default: !0
},
effect: {
...Wi.effect,
default: "light"
},
teleported: Wi.teleported,
title: String,
width: {
type: [String, Number],
default: 150
},
offset: {
type: Number,
default: void 0
},
showAfter: {
type: Number,
default: 0
},
hideAfter: {
type: Number,
default: 200
},
autoClose: {
type: Number,
default: 0
},
showArrow: {
type: Boolean,
default: !0
},
persistent: {
type: Boolean,
default: !0
},
"onUpdate:visible": {
type: Function
}
}), LR = {
"update:visible": (i) => fp(i),
"before-enter": () => !0,
"before-leave": () => !0,
"after-enter": () => !0,
"after-leave": () => !0
}, RR = "onUpdate:visible", OR = Ie({
name: "ElPopover"
}), PR = /* @__PURE__ */ Ie({
...OR,
props: CR,
emits: LR,
setup(i, { expose: e, emit: t }) {
const r = i, n = ce(() => r[RR]), o = it("popover"), a = Ae(), s = ce(() => {
var y;
return (y = G(a)) == null ? void 0 : y.popperRef;
}), c = ce(() => [
{
width: qc(r.width)
},
r.popperStyle
]), l = ce(() => [o.b(), r.popperClass, { [o.m("plain")]: !!r.content }]), h = ce(() => r.transition === `${o.namespace.value}-fade-in-linear`), u = () => {
var y;
(y = a.value) == null || y.hide();
}, p = () => {
t("before-enter");
}, g = () => {
t("before-leave");
}, m = () => {
t("after-enter");
}, d = () => {
t("update:visible", !1), t("after-leave");
};
return e({
popperRef: s,
hide: u
}), (y, f) => (ge(), Ue(G(Np), Or({
ref_key: "tooltipRef",
ref: a
}, y.$attrs, {
trigger: y.trigger,
placement: y.placement,
disabled: y.disabled,
visible: y.visible,
transition: y.transition,
"popper-options": y.popperOptions,
tabindex: y.tabindex,
content: y.content,
offset: y.offset,
"show-after": y.showAfter,
"hide-after": y.hideAfter,
"auto-close": y.autoClose,
"show-arrow": y.showArrow,
"aria-label": y.title,
effect: y.effect,
enterable: y.enterable,
"popper-class": G(l),
"popper-style": G(c),
teleported: y.teleported,
persistent: y.persistent,
"gpu-acceleration": G(h),
"onUpdate:visible": G(n),
onBeforeShow: p,
onBeforeHide: g,
onShow: m,
onHide: d
}), {
content: me(() => [
y.title ? (ge(), Le("div", {
key: 0,
class: Re(G(o).e("title")),
role: "title"
}, xt(y.title), 3)) : Ve("v-if", !0),
qe(y.$slots, "default", {}, () => [
vt(xt(y.content), 1)
])
]),
default: me(() => [
y.$slots.reference ? qe(y.$slots, "reference", { key: 0 }) : Ve("v-if", !0)
]),
_: 3
}, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"]));
}
});
var IR = /* @__PURE__ */ ot(PR, [["__file", "popover.vue"]]);
const ag = (i, e) => {
const t = e.arg || e.value, r = t == null ? void 0 : t.popperRef;
r && (r.triggerRef = i);
};
var DR = {
mounted(i, e) {
ag(i, e);
},
updated(i, e) {
ag(i, e);
}
};
const NR = "popover", BR = wE(DR, NR), _u = ui(IR, {
directive: BR
}), Cy = Symbol("sliderContextKey"), kR = ht({
modelValue: {
type: Ze([Number, Array]),
default: 0
},
id: {
type: String,
default: void 0
},
min: {
type: Number,
default: 0
},
max: {
type: Number,
default: 100
},
step: {
type: Number,
default: 1
},
showInput: Boolean,
showInputControls: {
type: Boolean,
default: !0
},
size: Da,
inputSize: Da,
showStops: Boolean,
showTooltip: {
type: Boolean,
default: !0
},
formatTooltip: {
type: Ze(Function),
default: void 0
},
disabled: Boolean,
range: Boolean,
vertical: Boolean,
height: String,
debounce: {
type: Number,
default: 300
},
rangeStartLabel: {
type: String,
default: void 0
},
rangeEndLabel: {
type: String,
default: void 0
},
formatValueText: {
type: Ze(Function),
default: void 0
},
tooltipClass: {
type: String,
default: void 0
},
placement: {
type: String,
values: rs,
default: "top"
},
marks: {
type: Ze(Object)
},
validateEvent: {
type: Boolean,
default: !0
},
...Ho(["ariaLabel"])
}), nh = (i) => _t(i) || Bi(i) && i.every(_t), zR = {
[Pt]: nh,
[So]: nh,
[Kn]: nh
}, FR = (i, e, t) => {
const r = Ae();
return ei(async () => {
i.range ? (Array.isArray(i.modelValue) ? (e.firstValue = Math.max(i.min, i.modelValue[0]), e.secondValue = Math.min(i.max, i.modelValue[1])) : (e.firstValue = i.min, e.secondValue = i.max), e.oldValue = [e.firstValue, e.secondValue]) : (typeof i.modelValue != "number" || Number.isNaN(i.modelValue) ? e.firstValue = i.min : e.firstValue = Math.min(i.max, Math.max(i.min, i.modelValue)), e.oldValue = e.firstValue), si(window, "resize", t), await wt(), t();
}), {
sliderWrapper: r
};
}, VR = (i) => ce(() => i.marks ? Object.keys(i.marks).map(Number.parseFloat).sort((e, t) => e - t).filter((e) => e <= i.max && e >= i.min).map((e) => ({
point: e,
position: (e - i.min) * 100 / (i.max - i.min),
mark: i.marks[e]
})) : []), UR = (i, e, t) => {
const { form: r, formItem: n } = gl(), o = Ci(), a = Ae(), s = Ae(), c = {
firstButton: a,
secondButton: s
}, l = ce(() => i.disabled || (r == null ? void 0 : r.disabled) || !1), h = ce(() => Math.min(e.firstValue, e.secondValue)), u = ce(() => Math.max(e.firstValue, e.secondValue)), p = ce(() => i.range ? `${100 * (u.value - h.value) / (i.max - i.min)}%` : `${100 * (e.firstValue - i.min) / (i.max - i.min)}%`), g = ce(() => i.range ? `${100 * (h.value - i.min) / (i.max - i.min)}%` : "0%"), m = ce(() => i.vertical ? { height: i.height } : {}), d = ce(() => i.vertical ? {
height: p.value,
bottom: g.value
} : {
width: p.value,
left: g.value
}), y = () => {
o.value && (e.sliderSize = o.value[`client${i.vertical ? "Height" : "Width"}`]);
}, f = (A) => {
const _ = i.min + A * (i.max - i.min) / 100;
if (!i.range)
return a;
let E;
return Math.abs(h.value - _) < Math.abs(u.value - _) ? E = e.firstValue < e.secondValue ? "firstButton" : "secondButton" : E = e.firstValue > e.secondValue ? "firstButton" : "secondButton", c[E];
}, v = (A) => {
const _ = f(A);
return _.value.setPosition(A), _;
}, M = (A) => {
e.firstValue = A ?? i.min, T(i.range ? [h.value, u.value] : A ?? i.min);
}, S = (A) => {
e.secondValue = A, i.range && T([h.value, u.value]);
}, T = (A) => {
t(Pt, A), t(So, A);
}, x = async () => {
await wt(), t(Kn, i.range ? [h.value, u.value] : i.modelValue);
}, w = (A) => {
var _, E, O, L, C, I;
if (l.value || e.dragging)
return;
y();
let R = 0;
if (i.vertical) {
const b = (O = (E = (_ = A.touches) == null ? void 0 : _.item(0)) == null ? void 0 : E.clientY) != null ? O : A.clientY;
R = (o.value.getBoundingClientRect().bottom - b) / e.sliderSize * 100;
} else {
const b = (I = (C = (L = A.touches) == null ? void 0 : L.item(0)) == null ? void 0 : C.clientX) != null ? I : A.clientX, P = o.value.getBoundingClientRect().left;
R = (b - P) / e.sliderSize * 100;
}
if (!(R < 0 || R > 100))
return v(R);
};
return {
elFormItem: n,
slider: o,
firstButton: a,
secondButton: s,
sliderDisabled: l,
minValue: h,
maxValue: u,
runwayStyle: m,
barStyle: d,
resetSize: y,
setPosition: v,
emitChange: x,
onSliderWrapperPrevent: (A) => {
var _, E;
((_ = c.firstButton.value) != null && _.dragging || (E = c.secondButton.value) != null && E.dragging) && A.preventDefault();
},
onSliderClick: (A) => {
w(A) && x();
},
onSliderDown: async (A) => {
const _ = w(A);
_ && (await wt(), _.value.onButtonDown(A));
},
onSliderMarkerDown: (A) => {
l.value || e.dragging || v(A);
},
setFirstValue: M,
setSecondValue: S
};
}, { left: GR, down: HR, right: jR, up: WR, home: $R, end: qR, pageUp: XR, pageDown: ZR } = Pr, YR = (i, e, t) => {
const r = Ae(), n = Ae(!1), o = ce(() => e.value instanceof Function), a = ce(() => o.value && e.value(i.modelValue) || i.modelValue), s = ad(() => {
t.value && (n.value = !0);
}, 50), c = ad(() => {
t.value && (n.value = !1);
}, 50);
return {
tooltip: r,
tooltipVisible: n,
formatValue: a,
displayTooltip: s,
hideTooltip: c
};
}, JR = (i, e, t) => {
const {
disabled: r,
min: n,
max: o,
step: a,
showTooltip: s,
precision: c,
sliderSize: l,
formatTooltip: h,
emitChange: u,
resetSize: p,
updateDragging: g
} = ct(Cy), { tooltip: m, tooltipVisible: d, formatValue: y, displayTooltip: f, hideTooltip: v } = YR(i, h, s), M = Ae(), S = ce(() => `${(i.modelValue - n.value) / (o.value - n.value) * 100}%`), T = ce(() => i.vertical ? { bottom: S.value } : { left: S.value }), x = () => {
e.hovering = !0, f();
}, w = () => {
e.hovering = !1, e.dragging || v();
}, A = (q) => {
r.value || (q.preventDefault(), N(q), window.addEventListener("mousemove", D), window.addEventListener("touchmove", D), window.addEventListener("mouseup", k), window.addEventListener("touchend", k), window.addEventListener("contextmenu", k), M.value.focus());
}, _ = (q) => {
r.value || (e.newPosition = Number.parseFloat(S.value) + q / (o.value - n.value) * 100, V(e.newPosition), u());
}, E = () => {
_(-a.value);
}, O = () => {
_(a.value);
}, L = () => {
_(-a.value * 4);
}, C = () => {
_(a.value * 4);
}, I = () => {
r.value || (V(0), u());
}, R = () => {
r.value || (V(100), u());
}, b = (q) => {
let Y = !0;
[GR, HR].includes(q.key) ? E() : [jR, WR].includes(q.key) ? O() : q.key === $R ? I() : q.key === qR ? R() : q.key === ZR ? L() : q.key === XR ? C() : Y = !1, Y && q.preventDefault();
}, P = (q) => {
let Y, ne;
return q.type.startsWith("touch") ? (ne = q.touches[0].clientY, Y = q.touches[0].clientX) : (ne = q.clientY, Y = q.clientX), {
clientX: Y,
clientY: ne
};
}, N = (q) => {
e.dragging = !0, e.isClick = !0;
const { clientX: Y, clientY: ne } = P(q);
i.vertical ? e.startY = ne : e.startX = Y, e.startPosition = Number.parseFloat(S.value), e.newPosition = e.startPosition;
}, D = (q) => {
if (e.dragging) {
e.isClick = !1, f(), p();
let Y;
const { clientX: ne, clientY: X } = P(q);
i.vertical ? (e.currentY = X, Y = (e.startY - e.currentY) / l.value * 100) : (e.currentX = ne, Y = (e.currentX - e.startX) / l.value * 100), e.newPosition = e.startPosition + Y, V(e.newPosition);
}
}, k = () => {
e.dragging && (setTimeout(() => {
e.dragging = !1, e.hovering || v(), e.isClick || V(e.newPosition), u();
}, 0), window.removeEventListener("mousemove", D), window.removeEventListener("touchmove", D), window.removeEventListener("mouseup", k), window.removeEventListener("touchend", k), window.removeEventListener("contextmenu", k));
}, V = async (q) => {
if (q === null || Number.isNaN(+q))
return;
q < 0 ? q = 0 : q > 100 && (q = 100);
const Y = 100 / ((o.value - n.value) / a.value);
let ne = Math.round(q / Y) * Y * (o.value - n.value) * 0.01 + n.value;
ne = Number.parseFloat(ne.toFixed(c.value)), ne !== i.modelValue && t(Pt, ne), !e.dragging && i.modelValue !== e.oldValue && (e.oldValue = i.modelValue), await wt(), e.dragging && f(), m.value.updatePopper();
};
return Ke(() => e.dragging, (q) => {
g(q);
}), si(M, "touchstart", A, { passive: !1 }), {
disabled: r,
button: M,
tooltip: m,
tooltipVisible: d,
showTooltip: s,
wrapperStyle: T,
formatValue: y,
handleMouseEnter: x,
handleMouseLeave: w,
onButtonDown: A,
onKeyDown: b,
setPosition: V
};
}, KR = (i, e, t, r) => ({
stops: ce(() => {
if (!i.showStops || i.min > i.max)
return [];
if (i.step === 0)
return Zt("ElSlider", "step should not be 0."), [];
const n = (i.max - i.min) / i.step, o = 100 * i.step / (i.max - i.min), a = Array.from({ length: n - 1 }).map((s, c) => (c + 1) * o);
return i.range ? a.filter((s) => s < 100 * (t.value - i.min) / (i.max - i.min) || s > 100 * (r.value - i.min) / (i.max - i.min)) : a.filter((s) => s > 100 * (e.firstValue - i.min) / (i.max - i.min));
}),
getStopStyle: (n) => i.vertical ? { bottom: `${n}%` } : { left: `${n}%` }
}), QR = (i, e, t, r, n, o) => {
const a = (l) => {
n(Pt, l), n(So, l);
}, s = () => i.range ? ![t.value, r.value].every((l, h) => l === e.oldValue[h]) : i.modelValue !== e.oldValue, c = () => {
var l, h;
i.min > i.max && is("Slider", "min should not be greater than max.");
const u = i.modelValue;
i.range && Array.isArray(u) ? u[1] < i.min ? a([i.min, i.min]) : u[0] > i.max ? a([i.max, i.max]) : u[0] < i.min ? a([i.min, u[1]]) : u[1] > i.max ? a([u[0], i.max]) : (e.firstValue = u[0], e.secondValue = u[1], s() && (i.validateEvent && ((l = o == null ? void 0 : o.validate) == null || l.call(o, "change").catch((p) => Zt(p))), e.oldValue = u.slice())) : !i.range && typeof u == "number" && !Number.isNaN(u) && (u < i.min ? a(i.min) : u > i.max ? a(i.max) : (e.firstValue = u, s() && (i.validateEvent && ((h = o == null ? void 0 : o.validate) == null || h.call(o, "change").catch((p) => Zt(p))), e.oldValue = u)));
};
c(), Ke(() => e.dragging, (l) => {
l || c();
}), Ke(() => i.modelValue, (l, h) => {
e.dragging || Array.isArray(l) && Array.isArray(h) && l.every((u, p) => u === h[p]) && e.firstValue === l[0] && e.secondValue === l[1] || c();
}, {
deep: !0
}), Ke(() => [i.min, i.max], () => {
c();
});
}, e3 = ht({
modelValue: {
type: Number,
default: 0
},
vertical: Boolean,
tooltipClass: String,
placement: {
type: String,
values: rs,
default: "top"
}
}), t3 = {
[Pt]: (i) => _t(i)
}, i3 = Ie({
name: "ElSliderButton"
}), r3 = /* @__PURE__ */ Ie({
...i3,
props: e3,
emits: t3,
setup(i, { expose: e, emit: t }) {
const r = i, n = it("slider"), o = Xi({
hovering: !1,
dragging: !1,
isClick: !1,
startX: 0,
currentX: 0,
startY: 0,
currentY: 0,
startPosition: 0,
newPosition: 0,
oldValue: r.modelValue
}), {
disabled: a,
button: s,
tooltip: c,
showTooltip: l,
tooltipVisible: h,
wrapperStyle: u,
formatValue: p,
handleMouseEnter: g,
handleMouseLeave: m,
onButtonDown: d,
onKeyDown: y,
setPosition: f
} = JR(r, o, t), { hovering: v, dragging: M } = ln(o);
return e({
onButtonDown: d,
onKeyDown: y,
setPosition: f,
hovering: v,
dragging: M
}), (S, T) => (ge(), Le("div", {
ref_key: "button",
ref: s,
class: Re([G(n).e("button-wrapper"), { hover: G(v), dragging: G(M) }]),
style: Ot(G(u)),
tabindex: G(a) ? -1 : 0,
onMouseenter: G(g),
onMouseleave: G(m),
onMousedown: G(d),
onFocus: G(g),
onBlur: G(m),
onKeydown: G(y)
}, [
le(G(Np), {
ref_key: "tooltip",
ref: c,
visible: G(h),
placement: S.placement,
"fallback-placements": ["top", "bottom", "right", "left"],
"stop-popper-mouse-event": !1,
"popper-class": S.tooltipClass,
disabled: !G(l),
persistent: ""
}, {
content: me(() => [
ke("span", null, xt(G(p)), 1)
]),
default: me(() => [
ke("div", {
class: Re([G(n).e("button"), { hover: G(v), dragging: G(M) }])
}, null, 2)
]),
_: 1
}, 8, ["visible", "placement", "popper-class", "disabled"])
], 46, ["tabindex", "onMouseenter", "onMouseleave", "onMousedown", "onFocus", "onBlur", "onKeydown"]));
}
});
var sg = /* @__PURE__ */ ot(r3, [["__file", "button.vue"]]);
const n3 = ht({
mark: {
type: Ze([String, Object]),
default: void 0
}
});
var o3 = Ie({
name: "ElSliderMarker",
props: n3,
setup(i) {
const e = it("slider"), t = ce(() => Li(i.mark) ? i.mark : i.mark.label), r = ce(() => Li(i.mark) ? void 0 : i.mark.style);
return () => ba("div", {
class: e.e("marks-text"),
style: r.value
}, t.value);
}
});
const a3 = Ie({
name: "ElSlider"
}), s3 = /* @__PURE__ */ Ie({
...a3,
props: kR,
emits: zR,
setup(i, { expose: e, emit: t }) {
const r = i, n = it("slider"), { t: o } = mu(), a = Xi({
firstValue: 0,
secondValue: 0,
oldValue: 0,
dragging: !1,
sliderSize: 1
}), {
elFormItem: s,
slider: c,
firstButton: l,
secondButton: h,
sliderDisabled: u,
minValue: p,
maxValue: g,
runwayStyle: m,
barStyle: d,
resetSize: y,
emitChange: f,
onSliderWrapperPrevent: v,
onSliderClick: M,
onSliderDown: S,
onSliderMarkerDown: T,
setFirstValue: x,
setSecondValue: w
} = UR(r, a, t), { stops: A, getStopStyle: _ } = KR(r, a, p, g), { inputId: E, isLabeledByFormItem: O } = Lp(r, {
formItemContext: s
}), L = ns(), C = ce(() => r.inputSize || L.value), I = ce(() => r.ariaLabel || o("el.slider.defaultLabel", {
min: r.min,
max: r.max
})), R = ce(() => r.range ? r.rangeStartLabel || o("el.slider.defaultRangeStartLabel") : I.value), b = ce(() => r.formatValueText ? r.formatValueText(Y.value) : `${Y.value}`), P = ce(() => r.rangeEndLabel || o("el.slider.defaultRangeEndLabel")), N = ce(() => r.formatValueText ? r.formatValueText(ne.value) : `${ne.value}`), D = ce(() => [
n.b(),
n.m(L.value),
n.is("vertical", r.vertical),
{ [n.m("with-input")]: r.showInput }
]), k = VR(r);
QR(r, a, p, g, t, s);
const V = ce(() => {
const H = [r.min, r.max, r.step].map((ee) => {
const Q = `${ee}`.split(".")[1];
return Q ? Q.length : 0;
});
return Math.max.apply(null, H);
}), { sliderWrapper: q } = FR(r, a, y), { firstValue: Y, secondValue: ne, sliderSize: X } = ln(a), z = (H) => {
a.dragging = H;
};
return si(q, "touchstart", v, {
passive: !1
}), si(q, "touchmove", v, {
passive: !1
}), ci(Cy, {
...ln(r),
sliderSize: X,
disabled: u,
precision: V,
emitChange: f,
resetSize: y,
updateDragging: z
}), e({
onSliderClick: M
}), (H, ee) => {
var Q, J;
return ge(), Le("div", {
id: H.range ? G(E) : void 0,
ref_key: "sliderWrapper",
ref: q,
class: Re(G(D)),
role: H.range ? "group" : void 0,
"aria-label": H.range && !G(O) ? G(I) : void 0,
"aria-labelledby": H.range && G(O) ? (Q = G(s)) == null ? void 0 : Q.labelId : void 0
}, [
ke("div", {
ref_key: "slider",
ref: c,
class: Re([
G(n).e("runway"),
{ "show-input": H.showInput && !H.range },
G(n).is("disabled", G(u))
]),
style: Ot(G(m)),
onMousedown: G(S),
onTouchstartPassive: G(S)
}, [
ke("div", {
class: Re(G(n).e("bar")),
style: Ot(G(d))
}, null, 6),
le(sg, {
id: H.range ? void 0 : G(E),
ref_key: "firstButton",
ref: l,
"model-value": G(Y),
vertical: H.vertical,
"tooltip-class": H.tooltipClass,
placement: H.placement,
role: "slider",
"aria-label": H.range || !G(O) ? G(R) : void 0,
"aria-labelledby": !H.range && G(O) ? (J = G(s)) == null ? void 0 : J.labelId : void 0,
"aria-valuemin": H.min,
"aria-valuemax": H.range ? G(ne) : H.max,
"aria-valuenow": G(Y),
"aria-valuetext": G(b),
"aria-orientation": H.vertical ? "vertical" : "horizontal",
"aria-disabled": G(u),
"onUpdate:modelValue": G(x)
}, null, 8, ["id", "model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"]),
H.range ? (ge(), Ue(sg, {
key: 0,
ref_key: "secondButton",
ref: h,
"model-value": G(ne),
vertical: H.vertical,
"tooltip-class": H.tooltipClass,
placement: H.placement,
role: "slider",
"aria-label": G(P),
"aria-valuemin": G(Y),
"aria-valuemax": H.max,
"aria-valuenow": G(ne),
"aria-valuetext": G(N),
"aria-orientation": H.vertical ? "vertical" : "horizontal",
"aria-disabled": G(u),
"onUpdate:modelValue": G(w)
}, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : Ve("v-if", !0),
H.showStops ? (ge(), Le("div", { key: 1 }, [
(ge(!0), Le(Vt, null, tr(G(A), (W, K) => (ge(), Le("div", {
key: K,
class: Re(G(n).e("stop")),
style: Ot(G(_)(W))
}, null, 6))), 128))
])) : Ve("v-if", !0),
G(k).length > 0 ? (ge(), Le(Vt, { key: 2 }, [
ke("div", null, [
(ge(!0), Le(Vt, null, tr(G(k), (W, K) => (ge(), Le("div", {
key: K,
style: Ot(G(_)(W.position)),
class: Re([G(n).e("stop"), G(n).e("marks-stop")])
}, null, 6))), 128))
]),
ke("div", {
class: Re(G(n).e("marks"))
}, [
(ge(!0), Le(Vt, null, tr(G(k), (W, K) => (ge(), Ue(G(o3), {
key: K,
mark: W.mark,
style: Ot(G(_)(W.position)),
onMousedown: ai((ie) => G(T)(W.position), ["stop"])
}, null, 8, ["mark", "style", "onMousedown"]))), 128))
], 2)
], 64)) : Ve("v-if", !0)
], 46, ["onMousedown", "onTouchstartPassive"]),
H.showInput && !H.range ? (ge(), Ue(G(vn), {
key: 0,
ref: "input",
"model-value": G(Y),
class: Re(G(n).e("input")),
step: H.step,
disabled: G(u),
controls: H.showInputControls,
min: H.min,
max: H.max,
precision: G(V),
debounce: H.debounce,
size: G(C),
"onUpdate:modelValue": G(x),
onChange: G(f)
}, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "precision", "debounce", "size", "onUpdate:modelValue", "onChange"])) : Ve("v-if", !0)
], 10, ["id", "role", "aria-label", "aria-labelledby"]);
};
}
});
var l3 = /* @__PURE__ */ ot(s3, [["__file", "slider.vue"]]);
const ar = ui(l3), Mu = Symbol("tabsRootContextKey"), c3 = ht({
tabs: {
type: Ze(Array),
default: () => Qr([])
}
}), Ly = "ElTabBar", u3 = Ie({
name: Ly
}), h3 = /* @__PURE__ */ Ie({
...u3,
props: c3,
setup(i, { expose: e }) {
const t = i, r = ri(), n = ct(Mu);
n || is(Ly, "");
const o = it("tabs"), a = Ae(), s = Ae(), c = () => {
let g = 0, m = 0;
const d = ["top", "bottom"].includes(n.props.tabPosition) ? "width" : "height", y = d === "width" ? "x" : "y", f = y === "x" ? "left" : "top";
return t.tabs.every((v) => {
var M, S;
const T = (S = (M = r.parent) == null ? void 0 : M.refs) == null ? void 0 : S[`tab-${v.uid}`];
if (!T)
return !1;
if (!v.active)
return !0;
g = T[`offset${Bn(f)}`], m = T[`client${Bn(d)}`];
const x = window.getComputedStyle(T);
return d === "width" && (m -= Number.parseFloat(x.paddingLeft) + Number.parseFloat(x.paddingRight), g += Number.parseFloat(x.paddingLeft)), !1;
}), {
[d]: `${m}px`,
transform: `translate${Bn(y)}(${g}px)`
};
}, l = () => s.value = c(), h = [], u = () => {
var g;
h.forEach((d) => d.stop()), h.length = 0;
const m = (g = r.parent) == null ? void 0 : g.refs;
if (m) {
for (const d in m)
if (d.startsWith("tab-")) {
const y = m[d];
y && h.push(er(y, l));
}
}
};
Ke(() => t.tabs, async () => {
await wt(), l(), u();
}, { immediate: !0 });
const p = er(a, () => l());
return or(() => {
h.forEach((g) => g.stop()), h.length = 0, p.stop();
}), e({
ref: a,
update: l
}), (g, m) => (ge(), Le("div", {
ref_key: "barRef",
ref: a,
class: Re([G(o).e("active-bar"), G(o).is(G(n).props.tabPosition)]),
style: Ot(s.value)
}, null, 6));
}
});
var d3 = /* @__PURE__ */ ot(h3, [["__file", "tab-bar.vue"]]);
const p3 = ht({
panes: {
type: Ze(Array),
default: () => Qr([])
},
currentName: {
type: [String, Number],
default: ""
},
editable: Boolean,
type: {
type: String,
values: ["card", "border-card", ""],
default: ""
},
stretch: Boolean
}), f3 = {
tabClick: (i, e, t) => t instanceof Event,
tabRemove: (i, e) => e instanceof Event
}, lg = "ElTabNav", m3 = Ie({
name: lg,
props: p3,
emits: f3,
setup(i, {
expose: e,
emit: t
}) {
const r = ct(Mu);
r || is(lg, "");
const n = it("tabs"), o = kw(), a = Yw(), s = Ae(), c = Ae(), l = Ae(), h = Ae(), u = Ae(!1), p = Ae(0), g = Ae(!1), m = Ae(!0), d = ce(() => ["top", "bottom"].includes(r.props.tabPosition) ? "width" : "height"), y = ce(() => ({
transform: `translate${d.value === "width" ? "X" : "Y"}(-${p.value}px)`
})), f = () => {
if (!s.value)
return;
const A = s.value[`offset${Bn(d.value)}`], _ = p.value;
if (!_)
return;
const E = _ > A ? _ - A : 0;
p.value = E;
}, v = () => {
if (!s.value || !c.value)
return;
const A = c.value[`offset${Bn(d.value)}`], _ = s.value[`offset${Bn(d.value)}`], E = p.value;
if (A - E <= _)
return;
const O = A - E > _ * 2 ? E + _ : A - _;
p.value = O;
}, M = async () => {
const A = c.value;
if (!u.value || !l.value || !s.value || !A)
return;
await wt();
const _ = l.value.querySelector(".is-active");
if (!_)
return;
const E = s.value, O = ["top", "bottom"].includes(r.props.tabPosition), L = _.getBoundingClientRect(), C = E.getBoundingClientRect(), I = O ? A.offsetWidth - C.width : A.offsetHeight - C.height, R = p.value;
let b = R;
O ? (L.left < C.left && (b = R - (C.left - L.left)), L.right > C.right && (b = R + L.right - C.right)) : (L.top < C.top && (b = R - (C.top - L.top)), L.bottom > C.bottom && (b = R + (L.bottom - C.bottom))), b = Math.max(b, 0), p.value = Math.min(b, I);
}, S = () => {
var A;
if (!c.value || !s.value)
return;
i.stretch && ((A = h.value) == null || A.update());
const _ = c.value[`offset${Bn(d.value)}`], E = s.value[`offset${Bn(d.value)}`], O = p.value;
E < _ ? (u.value = u.value || {}, u.value.prev = O, u.value.next = O + E < _, _ - O < E && (p.value = _ - E)) : (u.value = !1, O > 0 && (p.value = 0));
}, T = (A) => {
const _ = A.code, {
up: E,
down: O,
left: L,
right: C
} = Pr;
if (![E, O, L, C].includes(_))
return;
const I = Array.from(A.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")), R = I.indexOf(A.target);
let b;
_ === L || _ === E ? R === 0 ? b = I.length - 1 : b = R - 1 : R < I.length - 1 ? b = R + 1 : b = 0, I[b].focus({
preventScroll: !0
}), I[b].click(), x();
}, x = () => {
m.value && (g.value = !0);
}, w = () => g.value = !1;
return Ke(o, (A) => {
A === "hidden" ? m.value = !1 : A === "visible" && setTimeout(() => m.value = !0, 50);
}), Ke(a, (A) => {
A ? setTimeout(() => m.value = !0, 50) : m.value = !1;
}), er(l, S), ei(() => setTimeout(() => M(), 0)), rp(() => S()), e({
scrollToActiveTab: M,
removeFocus: w
}), () => {
const A = u.value ? [le("span", {
class: [n.e("nav-prev"), n.is("disabled", !u.value.prev)],
onClick: f
}, [le(Dt, null, {
default: () => [le(jn, null, null)]
})]), le("span", {
class: [n.e("nav-next"), n.is("disabled", !u.value.next)],
onClick: v
}, [le(Dt, null, {
default: () => [le(Wn, null, null)]
})])] : null, _ = i.panes.map((E, O) => {
var L, C, I, R;
const b = E.uid, P = E.props.disabled, N = (C = (L = E.props.name) != null ? L : E.index) != null ? C : `${O}`, D = !P && (E.isClosable || i.editable);
E.index = `${O}`;
const k = D ? le(Dt, {
class: "is-icon-close",
onClick: (Y) => t("tabRemove", E, Y)
}, {
default: () => [le(ld, null, null)]
}) : null, V = ((R = (I = E.slots).label) == null ? void 0 : R.call(I)) || E.props.label, q = !P && E.active ? 0 : -1;
return le("div", {
ref: `tab-${b}`,
class: [n.e("item"), n.is(r.props.tabPosition), n.is("active", E.active), n.is("disabled", P), n.is("closable", D), n.is("focus", g.value)],
id: `tab-${N}`,
key: `tab-${b}`,
"aria-controls": `pane-${N}`,
role: "tab",
"aria-selected": E.active,
tabindex: q,
onFocus: () => x(),
onBlur: () => w(),
onClick: (Y) => {
w(), t("tabClick", E, N, Y);
},
onKeydown: (Y) => {
D && (Y.code === Pr.delete || Y.code === Pr.backspace) && t("tabRemove", E, Y);
}
}, [V, k]);
});
return le("div", {
ref: l,
class: [n.e("nav-wrap"), n.is("scrollable", !!u.value), n.is(r.props.tabPosition)]
}, [A, le("div", {
class: n.e("nav-scroll"),
ref: s
}, [le("div", {
class: [n.e("nav"), n.is(r.props.tabPosition), n.is("stretch", i.stretch && ["top", "bottom"].includes(r.props.tabPosition))],
ref: c,
style: y.value,
role: "tablist",
onKeydown: T
}, [i.type ? null : le(d3, {
ref: h,
tabs: [...i.panes]
}, null), _])])]);
};
}
}), g3 = ht({
type: {
type: String,
values: ["card", "border-card", ""],
default: ""
},
closable: Boolean,
addable: Boolean,
modelValue: {
type: [String, Number]
},
editable: Boolean,
tabPosition: {
type: String,
values: ["top", "right", "bottom", "left"],
default: "top"
},
beforeLeave: {
type: Ze(Function),
default: () => !0
},
stretch: Boolean
}), oh = (i) => Li(i) || _t(i), v3 = {
[Pt]: (i) => oh(i),
tabClick: (i, e) => e instanceof Event,
tabChange: (i) => oh(i),
edit: (i, e) => ["remove", "add"].includes(e),
tabRemove: (i) => oh(i),
tabAdd: () => !0
}, y3 = Ie({
name: "ElTabs",
props: g3,
emits: v3,
setup(i, {
emit: e,
slots: t,
expose: r
}) {
var n;
const o = it("tabs"), a = ce(() => ["left", "right"].includes(i.tabPosition)), {
children: s,
addChild: c,
removeChild: l
} = ZA(ri(), "ElTabPane"), h = Ae(), u = Ae((n = i.modelValue) != null ? n : "0"), p = async (f, v = !1) => {
var M, S, T;
if (!(u.value === f || gr(f)))
try {
await ((M = i.beforeLeave) == null ? void 0 : M.call(i, f, u.value)) !== !1 && (u.value = f, v && (e(Pt, f), e("tabChange", f)), (T = (S = h.value) == null ? void 0 : S.removeFocus) == null || T.call(S));
} catch {
}
}, g = (f, v, M) => {
f.props.disabled || (p(v, !0), e("tabClick", f, M));
}, m = (f, v) => {
f.props.disabled || gr(f.props.name) || (v.stopPropagation(), e("edit", f.props.name, "remove"), e("tabRemove", f.props.name));
}, d = () => {
e("edit", void 0, "add"), e("tabAdd");
};
Ke(() => i.modelValue, (f) => p(f)), Ke(u, async () => {
var f;
await wt(), (f = h.value) == null || f.scrollToActiveTab();
}), ci(Mu, {
props: i,
currentName: u,
registerPane: (f) => {
s.value.push(f);
},
sortPane: c,
unregisterPane: l
}), r({
currentName: u
});
const y = ({
render: f
}) => f();
return () => {
const f = t["add-icon"], v = i.editable || i.addable ? le("div", {
class: [o.e("new-tab"), a.value && o.e("new-tab-vertical")],
tabindex: "0",
onClick: d,
onKeydown: (T) => {
T.code === Pr.enter && d();
}
}, [f ? qe(t, "add-icon") : le(Dt, {
class: o.is("icon-plus")
}, {
default: () => [le(pu, null, null)]
})]) : null, M = le("div", {
class: [o.e("header"), a.value && o.e("header-vertical"), o.is(i.tabPosition)]
}, [le(y, {
render: () => {
const T = s.value.some((x) => x.slots.label);
return le(m3, {
ref: h,
currentName: u.value,
editable: i.editable,
type: i.type,
panes: s.value,
stretch: i.stretch,
onTabClick: g,
onTabRemove: m
}, {
$stable: !T
});
}
}, null), v]), S = le("div", {
class: o.e("content")
}, [qe(t, "default")]);
return le("div", {
class: [o.b(), o.m(i.tabPosition), {
[o.m("card")]: i.type === "card",
[o.m("border-card")]: i.type === "border-card"
}]
}, [S, M]);
};
}
}), b3 = ht({
label: {
type: String,
default: ""
},
name: {
type: [String, Number]
},
closable: Boolean,
disabled: Boolean,
lazy: Boolean
}), Ry = "ElTabPane", x3 = Ie({
name: Ry
}), w3 = /* @__PURE__ */ Ie({
...x3,
props: b3,
setup(i) {
const e = i, t = ri(), r = au(), n = ct(Mu);
n || is(Ry, "usage: ");
const o = it("tab-pane"), a = Ae(), s = ce(() => e.closable || n.props.closable), c = Hf(() => {
var g;
return n.currentName.value === ((g = e.name) != null ? g : a.value);
}), l = Ae(c.value), h = ce(() => {
var g;
return (g = e.name) != null ? g : a.value;
}), u = Hf(() => !e.lazy || l.value || c.value);
Ke(c, (g) => {
g && (l.value = !0);
});
const p = Xi({
uid: t.uid,
slots: r,
props: e,
paneName: h,
active: c,
index: a,
isClosable: s
});
return n.registerPane(p), ei(() => {
n.sortPane(p);
}), s0(() => {
n.unregisterPane(p.uid);
}), (g, m) => G(u) ? It((ge(), Le("div", {
key: 0,
id: `pane-${G(h)}`,
class: Re(G(o).b()),
role: "tabpanel",
"aria-hidden": !G(c),
"aria-labelledby": `tab-${G(h)}`
}, [
qe(g.$slots, "default")
], 10, ["id", "aria-hidden", "aria-labelledby"])), [
[fi, G(c)]
]) : Ve("v-if", !0);
}
});
var Oy = /* @__PURE__ */ ot(w3, [["__file", "tab-pane.vue"]]);
const Py = ui(y3, {
TabPane: Oy
}), Iy = mn(Oy);
function _3(i) {
let e;
const t = Ae(!1), r = Xi({
...i,
originalPosition: "",
originalOverflow: "",
visible: !1
});
function n(p) {
r.text = p;
}
function o() {
const p = r.parent, g = u.ns;
if (!p.vLoadingAddClassList) {
let m = p.getAttribute("loading-number");
m = Number.parseInt(m) - 1, m ? p.setAttribute("loading-number", m.toString()) : ($c(p, g.bm("parent", "relative")), p.removeAttribute("loading-number")), $c(p, g.bm("parent", "hidden"));
}
a(), h.unmount();
}
function a() {
var p, g;
(g = (p = u.$el) == null ? void 0 : p.parentNode) == null || g.removeChild(u.$el);
}
function s() {
var p;
i.beforeClose && !i.beforeClose() || (t.value = !0, clearTimeout(e), e = setTimeout(c, 400), r.visible = !1, (p = i.closed) == null || p.call(i));
}
function c() {
if (!t.value)
return;
const p = r.parent;
t.value = !1, p.vLoadingAddClassList = void 0, o();
}
const l = Ie({
name: "ElLoading",
setup(p, { expose: g }) {
const { ns: m, zIndex: d } = r2("loading");
return g({
ns: m,
zIndex: d
}), () => {
const y = r.spinner || r.svg, f = ba("svg", {
class: "circular",
viewBox: r.svgViewBox ? r.svgViewBox : "0 0 50 50",
...y ? { innerHTML: y } : {}
}, [
ba("circle", {
class: "path",
cx: "25",
cy: "25",
r: "20",
fill: "none"
})
]), v = r.text ? ba("p", { class: m.b("text") }, [r.text]) : void 0;
return ba(hl, {
name: m.b("fade"),
onAfterLeave: c
}, {
default: me(() => [
It(le("div", {
style: {
backgroundColor: r.background || ""
},
class: [
m.b("mask"),
r.customClass,
r.fullscreen ? "is-fullscreen" : ""
]
}, [
ba("div", {
class: m.b("spinner")
}, [f, v])
]), [[fi, r.visible]])
])
});
};
}
}), h = xw(l), u = h.mount(document.createElement("div"));
return {
...ln(r),
setText: n,
removeElLoadingChild: a,
close: s,
handleAfterLeave: c,
vm: u,
get $el() {
return u.$el;
}
};
}
let Gl;
const md = function(i = {}) {
if (!Kt)
return;
const e = M3(i);
if (e.fullscreen && Gl)
return Gl;
const t = _3({
...e,
closed: () => {
var n;
(n = e.closed) == null || n.call(e), e.fullscreen && (Gl = void 0);
}
});
S3(e, e.parent, t), cg(e, e.parent, t), e.parent.vLoadingAddClassList = () => cg(e, e.parent, t);
let r = e.parent.getAttribute("loading-number");
return r ? r = `${Number.parseInt(r) + 1}` : r = "1", e.parent.setAttribute("loading-number", r), e.parent.appendChild(t.$el), wt(() => t.visible.value = e.visible), e.fullscreen && (Gl = t), t;
}, M3 = (i) => {
var e, t, r, n;
let o;
return Li(i.target) ? o = (e = document.querySelector(i.target)) != null ? e : document.body : o = i.target || document.body, {
parent: o === document.body || i.body ? document.body : o,
background: i.background || "",
svg: i.svg || "",
svgViewBox: i.svgViewBox || "",
spinner: i.spinner || !1,
text: i.text || "",
fullscreen: o === document.body && ((t = i.fullscreen) != null ? t : !0),
lock: (r = i.lock) != null ? r : !1,
customClass: i.customClass || "",
visible: (n = i.visible) != null ? n : !0,
beforeClose: i.beforeClose,
closed: i.closed,
target: o
};
}, S3 = async (i, e, t) => {
const { nextZIndex: r } = t.vm.zIndex || t.vm._.exposed.zIndex, n = {};
if (i.fullscreen)
t.originalPosition.value = vs(document.body, "position"), t.originalOverflow.value = vs(document.body, "overflow"), n.zIndex = r();
else if (i.parent === document.body) {
t.originalPosition.value = vs(document.body, "position"), await wt();
for (const o of ["top", "left"]) {
const a = o === "top" ? "scrollTop" : "scrollLeft";
n[o] = `${i.target.getBoundingClientRect()[o] + document.body[a] + document.documentElement[a] - Number.parseInt(vs(document.body, `margin-${o}`), 10)}px`;
}
for (const o of ["height", "width"])
n[o] = `${i.target.getBoundingClientRect()[o]}px`;
} else
t.originalPosition.value = vs(e, "position");
for (const [o, a] of Object.entries(n))
t.$el.style[o] = a;
}, cg = (i, e, t) => {
const r = t.vm.ns || t.vm._.exposed.ns;
["absolute", "fixed", "sticky"].includes(t.originalPosition.value) ? $c(e, r.bm("parent", "relative")) : Em(e, r.bm("parent", "relative")), i.fullscreen && i.lock ? Em(e, r.bm("parent", "hidden")) : $c(e, r.bm("parent", "hidden"));
}, Fc = Symbol("ElLoading"), ug = (i, e) => {
var t, r, n, o;
const a = e.instance, s = (p) => Ai(e.value) ? e.value[p] : void 0, c = (p) => {
const g = Li(p) && (a == null ? void 0 : a[p]) || p;
return g && Ae(g);
}, l = (p) => c(s(p) || i.getAttribute(`element-loading-${n_(p)}`)), h = (t = s("fullscreen")) != null ? t : e.modifiers.fullscreen, u = {
text: l("text"),
svg: l("svg"),
svgViewBox: l("svgViewBox"),
spinner: l("spinner"),
background: l("background"),
customClass: l("customClass"),
fullscreen: h,
target: (r = s("target")) != null ? r : h ? void 0 : i,
body: (n = s("body")) != null ? n : e.modifiers.body,
lock: (o = s("lock")) != null ? o : e.modifiers.lock
};
i[Fc] = {
options: u,
instance: md(u)
};
}, T3 = (i, e) => {
for (const t of Object.keys(e))
Ro(e[t]) && (e[t].value = i[t]);
}, gd = {
mounted(i, e) {
e.value && ug(i, e);
},
updated(i, e) {
const t = i[Fc];
e.oldValue !== e.value && (e.value && !e.oldValue ? ug(i, e) : e.value && e.oldValue ? Ai(e.value) && T3(e.value, t.options) : t == null || t.instance.close());
},
unmounted(i) {
var e;
(e = i[Fc]) == null || e.instance.close(), i[Fc] = null;
}
}, E3 = {
install(i) {
i.directive("loading", gd), i.config.globalProperties.$loading = md;
},
directive: gd,
service: md
};
var Dy = { exports: {} }, A3 = {}, hg;
function C3() {
return hg || (hg = 1, function(i) {
var e = function() {
try {
return !!Symbol.iterator;
} catch {
return !1;
}
}, t = e(), r = function(l) {
var h = {
next: function() {
var u = l.shift();
return { done: u === void 0, value: u };
}
};
return t && (h[Symbol.iterator] = function() {
return h;
}), h;
}, n = function(l) {
return encodeURIComponent(l).replace(/%20/g, "+");
}, o = function(l) {
return decodeURIComponent(String(l).replace(/\+/g, " "));
}, a = function() {
var l = function(u) {
Object.defineProperty(this, "_entries", { writable: !0, value: {} });
var p = typeof u;
if (p !== "undefined") if (p === "string")
u !== "" && this._fromString(u);
else if (u instanceof l) {
var g = this;
u.forEach(function(f, v) {
g.append(v, f);
});
} else if (u !== null && p === "object")
if (Object.prototype.toString.call(u) === "[object Array]")
for (var m = 0; m < u.length; m++) {
var d = u[m];
if (Object.prototype.toString.call(d) === "[object Array]" || d.length !== 2)
this.append(d[0], d[1]);
else
throw new TypeError("Expected [string, any] as entry at index " + m + " of URLSearchParams's input");
}
else
for (var y in u)
u.hasOwnProperty(y) && this.append(y, u[y]);
else
throw new TypeError("Unsupported input's type for URLSearchParams");
}, h = l.prototype;
h.append = function(u, p) {
u in this._entries ? this._entries[u].push(String(p)) : this._entries[u] = [String(p)];
}, h.delete = function(u) {
delete this._entries[u];
}, h.get = function(u) {
return u in this._entries ? this._entries[u][0] : null;
}, h.getAll = function(u) {
return u in this._entries ? this._entries[u].slice(0) : [];
}, h.has = function(u) {
return u in this._entries;
}, h.set = function(u, p) {
this._entries[u] = [String(p)];
}, h.forEach = function(u, p) {
var g;
for (var m in this._entries)
if (this._entries.hasOwnProperty(m)) {
g = this._entries[m];
for (var d = 0; d < g.length; d++)
u.call(p, g[d], m, this);
}
}, h.keys = function() {
var u = [];
return this.forEach(function(p, g) {
u.push(g);
}), r(u);
}, h.values = function() {
var u = [];
return this.forEach(function(p) {
u.push(p);
}), r(u);
}, h.entries = function() {
var u = [];
return this.forEach(function(p, g) {
u.push([g, p]);
}), r(u);
}, t && (h[Symbol.iterator] = h.entries), h.toString = function() {
var u = [];
return this.forEach(function(p, g) {
u.push(n(g) + "=" + n(p));
}), u.join("&");
}, i.URLSearchParams = l;
}, s = function() {
try {
var l = i.URLSearchParams;
return new l("?a=1").toString() === "a=1" && typeof l.prototype.set == "function" && typeof l.prototype.entries == "function";
} catch {
return !1;
}
};
s() || a();
var c = i.URLSearchParams.prototype;
typeof c.sort != "function" && (c.sort = function() {
var l = this, h = [];
this.forEach(function(p, g) {
h.push([g, p]), l._entries || l.delete(g);
}), h.sort(function(p, g) {
return p[0] < g[0] ? -1 : p[0] > g[0] ? 1 : 0;
}), l._entries && (l._entries = {});
for (var u = 0; u < h.length; u++)
this.append(h[u][0], h[u][1]);
}), typeof c._fromString != "function" && Object.defineProperty(c, "_fromString", {
enumerable: !1,
configurable: !1,
writable: !1,
value: function(l) {
if (this._entries)
this._entries = {};
else {
var h = [];
this.forEach(function(m, d) {
h.push(d);
});
for (var u = 0; u < h.length; u++)
this.delete(h[u]);
}
l = l.replace(/^\?/, "");
for (var p = l.split("&"), g, u = 0; u < p.length; u++)
g = p[u].split("="), this.append(
o(g[0]),
g.length > 1 ? o(g[1]) : ""
);
}
});
}(
typeof Nn < "u" ? Nn : typeof window < "u" ? window : typeof self < "u" ? self : Nn
), function(i) {
var e = function() {
try {
var n = new i.URL("b", "http://a");
return n.pathname = "c d", n.href === "http://a/c%20d" && n.searchParams;
} catch {
return !1;
}
}, t = function() {
var n = i.URL, o = function(c, l) {
typeof c != "string" && (c = String(c)), l && typeof l != "string" && (l = String(l));
var h = document, u;
if (l && (i.location === void 0 || l !== i.location.href)) {
l = l.toLowerCase(), h = document.implementation.createHTMLDocument(""), u = h.createElement("base"), u.href = l, h.head.appendChild(u);
try {
if (u.href.indexOf(l) !== 0) throw new Error(u.href);
} catch (M) {
throw new Error("URL unable to set base " + l + " due to " + M);
}
}
var p = h.createElement("a");
p.href = c, u && (h.body.appendChild(p), p.href = p.href);
var g = h.createElement("input");
if (g.type = "url", g.value = c, p.protocol === ":" || !/:/.test(p.href) || !g.checkValidity() && !l)
throw new TypeError("Invalid URL");
Object.defineProperty(this, "_anchorElement", {
value: p
});
var m = new i.URLSearchParams(this.search), d = !0, y = !0, f = this;
["append", "delete", "set"].forEach(function(M) {
var S = m[M];
m[M] = function() {
S.apply(m, arguments), d && (y = !1, f.search = m.toString(), y = !0);
};
}), Object.defineProperty(this, "searchParams", {
value: m,
enumerable: !0
});
var v = void 0;
Object.defineProperty(this, "_updateSearchParams", {
enumerable: !1,
configurable: !1,
writable: !1,
value: function() {
this.search !== v && (v = this.search, y && (d = !1, this.searchParams._fromString(this.search), d = !0));
}
});
}, a = o.prototype, s = function(c) {
Object.defineProperty(a, c, {
get: function() {
return this._anchorElement[c];
},
set: function(l) {
this._anchorElement[c] = l;
},
enumerable: !0
});
};
["hash", "host", "hostname", "port", "protocol"].forEach(function(c) {
s(c);
}), Object.defineProperty(a, "search", {
get: function() {
return this._anchorElement.search;
},
set: function(c) {
this._anchorElement.search = c, this._updateSearchParams();
},
enumerable: !0
}), Object.defineProperties(a, {
toString: {
get: function() {
var c = this;
return function() {
return c.href;
};
}
},
href: {
get: function() {
return this._anchorElement.href.replace(/\?$/, "");
},
set: function(c) {
this._anchorElement.href = c, this._updateSearchParams();
},
enumerable: !0
},
pathname: {
get: function() {
return this._anchorElement.pathname.replace(/(^\/?)/, "/");
},
set: function(c) {
this._anchorElement.pathname = c;
},
enumerable: !0
},
origin: {
get: function() {
var c = { "http:": 80, "https:": 443, "ftp:": 21 }[this._anchorElement.protocol], l = this._anchorElement.port != c && this._anchorElement.port !== "";
return this._anchorElement.protocol + "//" + this._anchorElement.hostname + (l ? ":" + this._anchorElement.port : "");
},
enumerable: !0
},
password: {
// TODO
get: function() {
return "";
},
set: function(c) {
},
enumerable: !0
},
username: {
// TODO
get: function() {
return "";
},
set: function(c) {
},
enumerable: !0
}
}), o.createObjectURL = function(c) {
return n.createObjectURL.apply(n, arguments);
}, o.revokeObjectURL = function(c) {
return n.revokeObjectURL.apply(n, arguments);
}, i.URL = o;
};
if (e() || t(), i.location !== void 0 && !("origin" in i.location)) {
var r = function() {
return i.location.protocol + "//" + i.location.hostname + (i.location.port ? ":" + i.location.port : "");
};
try {
Object.defineProperty(i.location, "origin", {
get: r,
enumerable: !0
});
} catch {
setInterval(function() {
i.location.origin = r();
}, 100);
}
}
}(
typeof Nn < "u" ? Nn : typeof window < "u" ? window : typeof self < "u" ? self : Nn
)), A3;
}
/**
* @license
* Copyright 2010-2021 Three.js Authors
* SPDX-License-Identifier: MIT
*/
const kp = "130", L3 = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }, R3 = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, Ny = 0, vd = 1, By = 2, O3 = 3, P3 = 0, zp = 1, ky = 2, wa = 3, qn = 0, $t = 1, Xn = 2, Fp = 1, I3 = 2, on = 0, Sa = 1, yd = 2, bd = 3, xd = 4, zy = 5, bo = 100, Fy = 101, Vy = 102, wd = 103, _d = 104, Uy = 200, Gy = 201, Hy = 202, jy = 203, Vp = 204, Up = 205, Wy = 206, $y = 207, qy = 208, Xy = 209, Zy = 210, Yy = 0, Jy = 1, Ky = 2, Kc = 3, Qy = 4, eb = 5, tb = 6, ib = 7, vl = 0, rb = 1, nb = 2, Fn = 0, ob = 1, ab = 2, sb = 3, lb = 4, cb = 5, Su = 300, yl = 301, bl = 302, Qc = 303, eu = 304, ls = 306, xl = 307, Zn = 1e3, li = 1001, Na = 1002, qt = 1003, Ks = 1004, D3 = 1004, Qs = 1005, N3 = 1005, Ut = 1006, Tu = 1007, B3 = 1007, yn = 1008, k3 = 1008, Po = 1009, ub = 1010, hb = 1011, el = 1012, db = 1013, Vs = 1014, en = 1015, Eo = 1016, pb = 1017, fb = 1018, mb = 1019, Ta = 1020, gb = 1021, an = 1022, $i = 1023, vb = 1024, yb = 1025, bb = $i, Ao = 1026, Ba = 1027, xb = 1028, wb = 1029, _b = 1030, Mb = 1031, Sb = 1032, Tb = 1033, Md = 33776, Sd = 33777, Td = 33778, Ed = 33779, Ad = 35840, Cd = 35841, Ld = 35842, Rd = 35843, Eb = 36196, Od = 37492, Pd = 37496, Ab = 37808, Cb = 37809, Lb = 37810, Rb = 37811, Ob = 37812, Pb = 37813, Ib = 37814, Db = 37815, Nb = 37816, Bb = 37817, kb = 37818, zb = 37819, Fb = 37820, Vb = 37821, Ub = 36492, Gb = 37840, Hb = 37841, jb = 37842, Wb = 37843, $b = 37844, qb = 37845, Xb = 37846, Zb = 37847, Yb = 37848, Jb = 37849, Kb = 37850, Qb = 37851, ex = 37852, tx = 37853, ix = 2200, rx = 2201, nx = 2202, ka = 2300, Io = 2301, Vc = 2302, wo = 2400, _o = 2401, tl = 2402, Eu = 2500, Gp = 2501, ox = 0, ax = 1, Hp = 2, Ri = 3e3, Do = 3001, Au = 3007, Cu = 3002, sx = 3003, jp = 3004, Wp = 3005, $p = 3006, lx = 3200, cx = 3201, eo = 0, ux = 1, z3 = 0, Uc = 7680, F3 = 7681, V3 = 7682, U3 = 7683, G3 = 34055, H3 = 34056, j3 = 5386, W3 = 512, $3 = 513, q3 = 514, X3 = 515, Z3 = 516, Y3 = 517, J3 = 518, hx = 519, za = 35044, Fa = 35048, K3 = 35040, Q3 = 35045, eO = 35049, tO = 35041, iO = 35046, rO = 35050, nO = 35042, oO = "100", Id = "300 es";
class to {
addEventListener(e, t) {
this._listeners === void 0 && (this._listeners = {});
const r = this._listeners;
r[e] === void 0 && (r[e] = []), r[e].indexOf(t) === -1 && r[e].push(t);
}
hasEventListener(e, t) {
if (this._listeners === void 0) return !1;
const r = this._listeners;
return r[e] !== void 0 && r[e].indexOf(t) !== -1;
}
removeEventListener(e, t) {
if (this._listeners === void 0) return;
const r = this._listeners[e];
if (r !== void 0) {
const n = r.indexOf(t);
n !== -1 && r.splice(n, 1);
}
}
dispatchEvent(e) {
if (this._listeners === void 0) return;
const t = this._listeners[e.type];
if (t !== void 0) {
e.target = this;
const r = t.slice(0);
for (let n = 0, o = r.length; n < o; n++)
r[n].call(this, e);
e.target = null;
}
}
}
const di = [];
for (let i = 0; i < 256; i++)
di[i] = (i < 16 ? "0" : "") + i.toString(16);
let Hl = 1234567;
const Co = Math.PI / 180, il = 180 / Math.PI;
function qi() {
const i = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, r = Math.random() * 4294967295 | 0;
return (di[i & 255] + di[i >> 8 & 255] + di[i >> 16 & 255] + di[i >> 24 & 255] + "-" + di[e & 255] + di[e >> 8 & 255] + "-" + di[e >> 16 & 15 | 64] + di[e >> 24 & 255] + "-" + di[t & 63 | 128] + di[t >> 8 & 255] + "-" + di[t >> 16 & 255] + di[t >> 24 & 255] + di[r & 255] + di[r >> 8 & 255] + di[r >> 16 & 255] + di[r >> 24 & 255]).toUpperCase();
}
function mi(i, e, t) {
return Math.max(e, Math.min(t, i));
}
function qp(i, e) {
return (i % e + e) % e;
}
function aO(i, e, t, r, n) {
return r + (i - e) * (n - r) / (t - e);
}
function sO(i, e, t) {
return i !== e ? (t - i) / (e - i) : 0;
}
function Us(i, e, t) {
return (1 - t) * i + t * e;
}
function lO(i, e, t, r) {
return Us(i, e, 1 - Math.exp(-t * r));
}
function cO(i, e = 1) {
return e - Math.abs(qp(i, e * 2) - e);
}
function uO(i, e, t) {
return i <= e ? 0 : i >= t ? 1 : (i = (i - e) / (t - e), i * i * (3 - 2 * i));
}
function hO(i, e, t) {
return i <= e ? 0 : i >= t ? 1 : (i = (i - e) / (t - e), i * i * i * (i * (i * 6 - 15) + 10));
}
function dO(i, e) {
return i + Math.floor(Math.random() * (e - i + 1));
}
function pO(i, e) {
return i + Math.random() * (e - i);
}
function fO(i) {
return i * (0.5 - Math.random());
}
function mO(i) {
return i !== void 0 && (Hl = i % 2147483647), Hl = Hl * 16807 % 2147483647, (Hl - 1) / 2147483646;
}
function gO(i) {
return i * Co;
}
function vO(i) {
return i * il;
}
function Dd(i) {
return (i & i - 1) === 0 && i !== 0;
}
function dx(i) {
return Math.pow(2, Math.ceil(Math.log(i) / Math.LN2));
}
function px(i) {
return Math.pow(2, Math.floor(Math.log(i) / Math.LN2));
}
function yO(i, e, t, r, n) {
const o = Math.cos, a = Math.sin, s = o(t / 2), c = a(t / 2), l = o((e + r) / 2), h = a((e + r) / 2), u = o((e - r) / 2), p = a((e - r) / 2), g = o((r - e) / 2), m = a((r - e) / 2);
switch (n) {
case "XYX":
i.set(s * h, c * u, c * p, s * l);
break;
case "YZY":
i.set(c * p, s * h, c * u, s * l);
break;
case "ZXZ":
i.set(c * u, c * p, s * h, s * l);
break;
case "XZX":
i.set(s * h, c * m, c * g, s * l);
break;
case "YXY":
i.set(c * g, s * h, c * m, s * l);
break;
case "ZYZ":
i.set(c * m, c * g, s * h, s * l);
break;
default:
console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + n);
}
}
var Nd = /* @__PURE__ */ Object.freeze({
__proto__: null,
DEG2RAD: Co,
RAD2DEG: il,
generateUUID: qi,
clamp: mi,
euclideanModulo: qp,
mapLinear: aO,
inverseLerp: sO,
lerp: Us,
damp: lO,
pingpong: cO,
smoothstep: uO,
smootherstep: hO,
randInt: dO,
randFloat: pO,
randFloatSpread: fO,
seededRandom: mO,
degToRad: gO,
radToDeg: vO,
isPowerOfTwo: Dd,
ceilPowerOfTwo: dx,
floorPowerOfTwo: px,
setQuaternionFromProperEuler: yO
});
class Oe {
constructor(e = 0, t = 0) {
this.x = e, this.y = t;
}
get width() {
return this.x;
}
set width(e) {
this.x = e;
}
get height() {
return this.y;
}
set height(e) {
this.y = e;
}
set(e, t) {
return this.x = e, this.y = t, this;
}
setScalar(e) {
return this.x = e, this.y = e, this;
}
setX(e) {
return this.x = e, this;
}
setY(e) {
return this.y = e, this;
}
setComponent(e, t) {
switch (e) {
case 0:
this.x = t;
break;
case 1:
this.y = t;
break;
default:
throw new Error("index is out of range: " + e);
}
return this;
}
getComponent(e) {
switch (e) {
case 0:
return this.x;
case 1:
return this.y;
default:
throw new Error("index is out of range: " + e);
}
}
clone() {
return new this.constructor(this.x, this.y);
}
copy(e) {
return this.x = e.x, this.y = e.y, this;
}
add(e, t) {
return t !== void 0 ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this);
}
addScalar(e) {
return this.x += e, this.y += e, this;
}
addVectors(e, t) {
return this.x = e.x + t.x, this.y = e.y + t.y, this;
}
addScaledVector(e, t) {
return this.x += e.x * t, this.y += e.y * t, this;
}
sub(e, t) {
return t !== void 0 ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this);
}
subScalar(e) {
return this.x -= e, this.y -= e, this;
}
subVectors(e, t) {
return this.x = e.x - t.x, this.y = e.y - t.y, this;
}
multiply(e) {
return this.x *= e.x, this.y *= e.y, this;
}
multiplyScalar(e) {
return this.x *= e, this.y *= e, this;
}
divide(e) {
return this.x /= e.x, this.y /= e.y, this;
}
divideScalar(e) {
return this.multiplyScalar(1 / e);
}
applyMatrix3(e) {
const t = this.x, r = this.y, n = e.elements;
return this.x = n[0] * t + n[3] * r + n[6], this.y = n[1] * t + n[4] * r + n[7], this;
}
min(e) {
return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this;
}
max(e) {
return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this;
}
clamp(e, t) {
return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this;
}
clampScalar(e, t) {
return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this;
}
clampLength(e, t) {
const r = this.length();
return this.divideScalar(r || 1).multiplyScalar(Math.max(e, Math.min(t, r)));
}
floor() {
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this;
}
ceil() {
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this;
}
round() {
return this.x = Math.round(this.x), this.y = Math.round(this.y), this;
}
roundToZero() {
return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this;
}
negate() {
return this.x = -this.x, this.y = -this.y, this;
}
dot(e) {
return this.x * e.x + this.y * e.y;
}
cross(e) {
return this.x * e.y - this.y * e.x;
}
lengthSq() {
return this.x * this.x + this.y * this.y;
}
length() {
return Math.sqrt(this.x * this.x + this.y * this.y);
}
manhattanLength() {
return Math.abs(this.x) + Math.abs(this.y);
}
normalize() {
return this.divideScalar(this.length() || 1);
}
angle() {
return Math.atan2(-this.y, -this.x) + Math.PI;
}
distanceTo(e) {
return Math.sqrt(this.distanceToSquared(e));
}
distanceToSquared(e) {
const t = this.x - e.x, r = this.y - e.y;
return t * t + r * r;
}
manhattanDistanceTo(e) {
return Math.abs(this.x - e.x) + Math.abs(this.y - e.y);
}
setLength(e) {
return this.normalize().multiplyScalar(e);
}
lerp(e, t) {
return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this;
}
lerpVectors(e, t, r) {
return this.x = e.x + (t.x - e.x) * r, this.y = e.y + (t.y - e.y) * r, this;
}
equals(e) {
return e.x === this.x && e.y === this.y;
}
fromArray(e, t = 0) {
return this.x = e[t], this.y = e[t + 1], this;
}
toArray(e = [], t = 0) {
return e[t] = this.x, e[t + 1] = this.y, e;
}
fromBufferAttribute(e, t, r) {
return r !== void 0 && console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t), this.y = e.getY(t), this;
}
rotateAround(e, t) {
const r = Math.cos(t), n = Math.sin(t), o = this.x - e.x, a = this.y - e.y;
return this.x = o * r - a * n + e.x, this.y = o * n + a * r + e.y, this;
}
random() {
return this.x = Math.random(), this.y = Math.random(), this;
}
}
Oe.prototype.isVector2 = !0;
class ii {
constructor() {
this.elements = [
1,
0,
0,
0,
1,
0,
0,
0,
1
], arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.");
}
set(e, t, r, n, o, a, s, c, l) {
const h = this.elements;
return h[0] = e, h[1] = n, h[2] = s, h[3] = t, h[4] = o, h[5] = c, h[6] = r, h[7] = a, h[8] = l, this;
}
identity() {
return this.set(
1,
0,
0,
0,
1,
0,
0,
0,
1
), this;
}
copy(e) {
const t = this.elements, r = e.elements;
return t[0] = r[0], t[1] = r[1], t[2] = r[2], t[3] = r[3], t[4] = r[4], t[5] = r[5], t[6] = r[6], t[7] = r[7], t[8] = r[8], this;
}
extractBasis(e, t, r) {
return e.setFromMatrix3Column(this, 0), t.setFromMatrix3Column(this, 1), r.setFromMatrix3Column(this, 2), this;
}
setFromMatrix4(e) {
const t = e.elements;
return this.set(
t[0],
t[4],
t[8],
t[1],
t[5],
t[9],
t[2],
t[6],
t[10]
), this;
}
multiply(e) {
return this.multiplyMatrices(this, e);
}
premultiply(e) {
return this.multiplyMatrices(e, this);
}
multiplyMatrices(e, t) {
const r = e.elements, n = t.elements, o = this.elements, a = r[0], s = r[3], c = r[6], l = r[1], h = r[4], u = r[7], p = r[2], g = r[5], m = r[8], d = n[0], y = n[3], f = n[6], v = n[1], M = n[4], S = n[7], T = n[2], x = n[5], w = n[8];
return o[0] = a * d + s * v + c * T, o[3] = a * y + s * M + c * x, o[6] = a * f + s * S + c * w, o[1] = l * d + h * v + u * T, o[4] = l * y + h * M + u * x, o[7] = l * f + h * S + u * w, o[2] = p * d + g * v + m * T, o[5] = p * y + g * M + m * x, o[8] = p * f + g * S + m * w, this;
}
multiplyScalar(e) {
const t = this.elements;
return t[0] *= e, t[3] *= e, t[6] *= e, t[1] *= e, t[4] *= e, t[7] *= e, t[2] *= e, t[5] *= e, t[8] *= e, this;
}
determinant() {
const e = this.elements, t = e[0], r = e[1], n = e[2], o = e[3], a = e[4], s = e[5], c = e[6], l = e[7], h = e[8];
return t * a * h - t * s * l - r * o * h + r * s * c + n * o * l - n * a * c;
}
invert() {
const e = this.elements, t = e[0], r = e[1], n = e[2], o = e[3], a = e[4], s = e[5], c = e[6], l = e[7], h = e[8], u = h * a - s * l, p = s * c - h * o, g = l * o - a * c, m = t * u + r * p + n * g;
if (m === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
const d = 1 / m;
return e[0] = u * d, e[1] = (n * l - h * r) * d, e[2] = (s * r - n * a) * d, e[3] = p * d, e[4] = (h * t - n * c) * d, e[5] = (n * o - s * t) * d, e[6] = g * d, e[7] = (r * c - l * t) * d, e[8] = (a * t - r * o) * d, this;
}
transpose() {
let e;
const t = this.elements;
return e = t[1], t[1] = t[3], t[3] = e, e = t[2], t[2] = t[6], t[6] = e, e = t[5], t[5] = t[7], t[7] = e, this;
}
getNormalMatrix(e) {
return this.setFromMatrix4(e).invert().transpose();
}
transposeIntoArray(e) {
const t = this.elements;
return e[0] = t[0], e[1] = t[3], e[2] = t[6], e[3] = t[1], e[4] = t[4], e[5] = t[7], e[6] = t[2], e[7] = t[5], e[8] = t[8], this;
}
setUvTransform(e, t, r, n, o, a, s) {
const c = Math.cos(o), l = Math.sin(o);
return this.set(
r * c,
r * l,
-r * (c * a + l * s) + a + e,
-n * l,
n * c,
-n * (-l * a + c * s) + s + t,
0,
0,
1
), this;
}
scale(e, t) {
const r = this.elements;
return r[0] *= e, r[3] *= e, r[6] *= e, r[1] *= t, r[4] *= t, r[7] *= t, this;
}
rotate(e) {
const t = Math.cos(e), r = Math.sin(e), n = this.elements, o = n[0], a = n[3], s = n[6], c = n[1], l = n[4], h = n[7];
return n[0] = t * o + r * c, n[3] = t * a + r * l, n[6] = t * s + r * h, n[1] = -r * o + t * c, n[4] = -r * a + t * l, n[7] = -r * s + t * h, this;
}
translate(e, t) {
const r = this.elements;
return r[0] += e * r[2], r[3] += e * r[5], r[6] += e * r[8], r[1] += t * r[2], r[4] += t * r[5], r[7] += t * r[8], this;
}
equals(e) {
const t = this.elements, r = e.elements;
for (let n = 0; n < 9; n++)
if (t[n] !== r[n]) return !1;
return !0;
}
fromArray(e, t = 0) {
for (let r = 0; r < 9; r++)
this.elements[r] = e[r + t];
return this;
}
toArray(e = [], t = 0) {
const r = this.elements;
return e[t] = r[0], e[t + 1] = r[1], e[t + 2] = r[2], e[t + 3] = r[3], e[t + 4] = r[4], e[t + 5] = r[5], e[t + 6] = r[6], e[t + 7] = r[7], e[t + 8] = r[8], e;
}
clone() {
return new this.constructor().fromArray(this.elements);
}
}
ii.prototype.isMatrix3 = !0;
let Ko;
class jo {
static getDataURL(e) {
if (/^data:/i.test(e.src) || typeof HTMLCanvasElement > "u")
return e.src;
let t;
if (e instanceof HTMLCanvasElement)
t = e;
else {
Ko === void 0 && (Ko = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas")), Ko.width = e.width, Ko.height = e.height;
const r = Ko.getContext("2d");
e instanceof ImageData ? r.putImageData(e, 0, 0) : r.drawImage(e, 0, 0, e.width, e.height), t = Ko;
}
return t.width > 2048 || t.height > 2048 ? (console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons", e), t.toDataURL("image/jpeg", 0.6)) : t.toDataURL("image/png");
}
}
let bO = 0;
class Jt extends to {
constructor(e = Jt.DEFAULT_IMAGE, t = Jt.DEFAULT_MAPPING, r = li, n = li, o = Ut, a = yn, s = $i, c = Po, l = 1, h = Ri) {
super(), Object.defineProperty(this, "id", { value: bO++ }), this.uuid = qi(), this.name = "", this.image = e, this.mipmaps = [], this.mapping = t, this.wrapS = r, this.wrapT = n, this.magFilter = o, this.minFilter = a, this.anisotropy = l, this.format = s, this.internalFormat = null, this.type = c, this.offset = new Oe(0, 0), this.repeat = new Oe(1, 1), this.center = new Oe(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new ii(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.encoding = h, this.version = 0, this.onUpdate = null;
}
updateMatrix() {
this.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y);
}
clone() {
return new this.constructor().copy(this);
}
copy(e) {
return this.name = e.name, this.image = e.image, this.mipmaps = e.mipmaps.slice(0), this.mapping = e.mapping, this.wrapS = e.wrapS, this.wrapT = e.wrapT, this.magFilter = e.magFilter, this.minFilter = e.minFilter, this.anisotropy = e.anisotropy, this.format = e.format, this.internalFormat = e.internalFormat, this.type = e.type, this.offset.copy(e.offset), this.repeat.copy(e.repeat), this.center.copy(e.center), this.rotation = e.rotation, this.matrixAutoUpdate = e.matrixAutoUpdate, this.matrix.copy(e.matrix), this.generateMipmaps = e.generateMipmaps, this.premultiplyAlpha = e.premultiplyAlpha, this.flipY = e.flipY, this.unpackAlignment = e.unpackAlignment, this.encoding = e.encoding, this;
}
toJSON(e) {
const t = e === void 0 || typeof e == "string";
if (!t && e.textures[this.uuid] !== void 0)
return e.textures[this.uuid];
const r = {
metadata: {
version: 4.5,
type: "Texture",
generator: "Texture.toJSON"
},
uuid: this.uuid,
name: this.name,
mapping: this.mapping,
repeat: [this.repeat.x, this.repeat.y],
offset: [this.offset.x, this.offset.y],
center: [this.center.x, this.center.y],
rotation: this.rotation,
wrap: [this.wrapS, this.wrapT],
format: this.format,
type: this.type,
encoding: this.encoding,
minFilter: this.minFilter,
magFilter: this.magFilter,
anisotropy: this.anisotropy,
flipY: this.flipY,
premultiplyAlpha: this.premultiplyAlpha,
unpackAlignment: this.unpackAlignment
};
if (this.image !== void 0) {
const n = this.image;
if (n.uuid === void 0 && (n.uuid = qi()), !t && e.images[n.uuid] === void 0) {
let o;
if (Array.isArray(n)) {
o = [];
for (let a = 0, s = n.length; a < s; a++)
n[a].isDataTexture ? o.push(ah(n[a].image)) : o.push(ah(n[a]));
} else
o = ah(n);
e.images[n.uuid] = {
uuid: n.uuid,
url: o
};
}
r.image = n.uuid;
}
return t || (e.textures[this.uuid] = r), r;
}
dispose() {
this.dispatchEvent({ type: "dispose" });
}
transformUv(e) {
if (this.mapping !== Su) return e;
if (e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1)
switch (this.wrapS) {
case Zn:
e.x = e.x - Math.floor(e.x);
break;
case li:
e.x = e.x < 0 ? 0 : 1;
break;
case Na:
Math.abs(Math.floor(e.x) % 2) === 1 ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x);
break;
}
if (e.y < 0 || e.y > 1)
switch (this.wrapT) {
case Zn:
e.y = e.y - Math.floor(e.y);
break;
case li:
e.y = e.y < 0 ? 0 : 1;
break;
case Na:
Math.abs(Math.floor(e.y) % 2) === 1 ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y);
break;
}
return this.flipY && (e.y = 1 - e.y), e;
}
set needsUpdate(e) {
e === !0 && this.version++;
}
}
Jt.DEFAULT_IMAGE = void 0;
Jt.DEFAULT_MAPPING = Su;
Jt.prototype.isTexture = !0;
function ah(i) {
return typeof HTMLImageElement < "u" && i instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && i instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && i instanceof ImageBitmap ? jo.getDataURL(i) : i.data ? {
data: Array.prototype.slice.call(i.data),
width: i.width,
height: i.height,
type: i.data.constructor.name
} : (console.warn("THREE.Texture: Unable to serialize Texture."), {});
}
class Mt {
constructor(e = 0, t = 0, r = 0, n = 1) {
this.x = e, this.y = t, this.z = r, this.w = n;
}
get width() {
return this.z;
}
set width(e) {
this.z = e;
}
get height() {
return this.w;
}
set height(e) {
this.w = e;
}
set(e, t, r, n) {
return this.x = e, this.y = t, this.z = r, this.w = n, this;
}
setScalar(e) {
return this.x = e, this.y = e, this.z = e, this.w = e, this;
}
setX(e) {
return this.x = e, this;
}
setY(e) {
return this.y = e, this;
}
setZ(e) {
return this.z = e, this;
}
setW(e) {
return this.w = e, this;
}
setComponent(e, t) {
switch (e) {
case 0:
this.x = t;
break;
case 1:
this.y = t;
break;
case 2:
this.z = t;
break;
case 3:
this.w = t;
break;
default:
throw new Error("index is out of range: " + e);
}
return this;
}
getComponent(e) {
switch (e) {
case 0:
return this.x;
case 1:
return this.y;
case 2:
return this.z;
case 3:
return this.w;
default:
throw new Error("index is out of range: " + e);
}
}
clone() {
return new this.constructor(this.x, this.y, this.z, this.w);
}
copy(e) {
return this.x = e.x, this.y = e.y, this.z = e.z, this.w = e.w !== void 0 ? e.w : 1, this;
}
add(e, t) {
return t !== void 0 ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this.z += e.z, this.w += e.w, this);
}
addScalar(e) {
return this.x += e, this.y += e, this.z += e, this.w += e, this;
}
addVectors(e, t) {
return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this.w = e.w + t.w, this;
}
addScaledVector(e, t) {
return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this.w += e.w * t, this;
}
sub(e, t) {
return t !== void 0 ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this.z -= e.z, this.w -= e.w, this);
}
subScalar(e) {
return this.x -= e, this.y -= e, this.z -= e, this.w -= e, this;
}
subVectors(e, t) {
return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this.w = e.w - t.w, this;
}
multiply(e) {
return this.x *= e.x, this.y *= e.y, this.z *= e.z, this.w *= e.w, this;
}
multiplyScalar(e) {
return this.x *= e, this.y *= e, this.z *= e, this.w *= e, this;
}
applyMatrix4(e) {
const t = this.x, r = this.y, n = this.z, o = this.w, a = e.elements;
return this.x = a[0] * t + a[4] * r + a[8] * n + a[12] * o, this.y = a[1] * t + a[5] * r + a[9] * n + a[13] * o, this.z = a[2] * t + a[6] * r + a[10] * n + a[14] * o, this.w = a[3] * t + a[7] * r + a[11] * n + a[15] * o, this;
}
divideScalar(e) {
return this.multiplyScalar(1 / e);
}
setAxisAngleFromQuaternion(e) {
this.w = 2 * Math.acos(e.w);
const t = Math.sqrt(1 - e.w * e.w);
return t < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = e.x / t, this.y = e.y / t, this.z = e.z / t), this;
}
setAxisAngleFromRotationMatrix(e) {
let t, r, n, o;
const a = e.elements, s = a[0], c = a[4], l = a[8], h = a[1], u = a[5], p = a[9], g = a[2], m = a[6], d = a[10];
if (Math.abs(c - h) < 0.01 && Math.abs(l - g) < 0.01 && Math.abs(p - m) < 0.01) {
if (Math.abs(c + h) < 0.1 && Math.abs(l + g) < 0.1 && Math.abs(p + m) < 0.1 && Math.abs(s + u + d - 3) < 0.1)
return this.set(1, 0, 0, 0), this;
t = Math.PI;
const f = (s + 1) / 2, v = (u + 1) / 2, M = (d + 1) / 2, S = (c + h) / 4, T = (l + g) / 4, x = (p + m) / 4;
return f > v && f > M ? f < 0.01 ? (r = 0, n = 0.707106781, o = 0.707106781) : (r = Math.sqrt(f), n = S / r, o = T / r) : v > M ? v < 0.01 ? (r = 0.707106781, n = 0, o = 0.707106781) : (n = Math.sqrt(v), r = S / n, o = x / n) : M < 0.01 ? (r = 0.707106781, n = 0.707106781, o = 0) : (o = Math.sqrt(M), r = T / o, n = x / o), this.set(r, n, o, t), this;
}
let y = Math.sqrt((m - p) * (m - p) + (l - g) * (l - g) + (h - c) * (h - c));
return Math.abs(y) < 1e-3 && (y = 1), this.x = (m - p) / y, this.y = (l - g) / y, this.z = (h - c) / y, this.w = Math.acos((s + u + d - 1) / 2), this;
}
min(e) {
return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this.w = Math.min(this.w, e.w), this;
}
max(e) {
return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this.w = Math.max(this.w, e.w), this;
}
clamp(e, t) {
return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this.z = Math.max(e.z, Math.min(t.z, this.z)), this.w = Math.max(e.w, Math.min(t.w, this.w)), this;
}
clampScalar(e, t) {
return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this.z = Math.max(e, Math.min(t, this.z)), this.w = Math.max(e, Math.min(t, this.w)), this;
}
clampLength(e, t) {
const r = this.length();
return this.divideScalar(r || 1).multiplyScalar(Math.max(e, Math.min(t, r)));
}
floor() {
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this;
}
ceil() {
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this;
}
round() {
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this;
}
roundToZero() {
return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w), this;
}
negate() {
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this;
}
dot(e) {
return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w;
}
lengthSq() {
return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
}
length() {
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
}
manhattanLength() {
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);
}
normalize() {
return this.divideScalar(this.length() || 1);
}
setLength(e) {
return this.normalize().multiplyScalar(e);
}
lerp(e, t) {
return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this.w += (e.w - this.w) * t, this;
}
lerpVectors(e, t, r) {
return this.x = e.x + (t.x - e.x) * r, this.y = e.y + (t.y - e.y) * r, this.z = e.z + (t.z - e.z) * r, this.w = e.w + (t.w - e.w) * r, this;
}
equals(e) {
return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w;
}
fromArray(e, t = 0) {
return this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this.w = e[t + 3], this;
}
toArray(e = [], t = 0) {
return e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e[t + 3] = this.w, e;
}
fromBufferAttribute(e, t, r) {
return r !== void 0 && console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this.w = e.getW(t), this;
}
random() {
return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this;
}
}
Mt.prototype.isVector4 = !0;
class vr extends to {
constructor(e, t, r = {}) {
super(), this.width = e, this.height = t, this.depth = 1, this.scissor = new Mt(0, 0, e, t), this.scissorTest = !1, this.viewport = new Mt(0, 0, e, t), this.texture = new Jt(void 0, r.mapping, r.wrapS, r.wrapT, r.magFilter, r.minFilter, r.format, r.type, r.anisotropy, r.encoding), this.texture.image = { width: e, height: t, depth: 1 }, this.texture.generateMipmaps = r.generateMipmaps !== void 0 ? r.generateMipmaps : !1, this.texture.minFilter = r.minFilter !== void 0 ? r.minFilter : Ut, this.depthBuffer = r.depthBuffer !== void 0 ? r.depthBuffer : !0, this.stencilBuffer = r.stencilBuffer !== void 0 ? r.stencilBuffer : !1, this.depthTexture = r.depthTexture !== void 0 ? r.depthTexture : null;
}
setTexture(e) {
e.image = {
width: this.width,
height: this.height,
depth: this.depth
}, this.texture = e;
}
setSize(e, t, r = 1) {
(this.width !== e || this.height !== t || this.depth !== r) && (this.width = e, this.height = t, this.depth = r, this.texture.image.width = e, this.texture.image.height = t, this.texture.image.depth = r, this.dispose()), this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t);
}
clone() {
return new this.constructor().copy(this);
}
copy(e) {
return this.width = e.width, this.height = e.height, this.depth = e.depth, this.viewport.copy(e.viewport), this.texture = e.texture.clone(), this.texture.image = { ...this.texture.image }, this.depthBuffer = e.depthBuffer, this.stencilBuffer = e.stencilBuffer, this.depthTexture = e.depthTexture, this;
}
dispose() {
this.dispatchEvent({ type: "dispose" });
}
}
vr.prototype.isWebGLRenderTarget = !0;
class fx extends vr {
constructor(e, t, r) {
super(e, t);
const n = this.texture;
this.texture = [];
for (let o = 0; o < r; o++)
this.texture[o] = n.clone();
}
setSize(e, t, r = 1) {
if (this.width !== e || this.height !== t || this.depth !== r) {
this.width = e, this.height = t, this.depth = r;
for (let n = 0, o = this.texture.length; n < o; n++)
this.texture[n].image.width = e, this.texture[n].image.height = t, this.texture[n].image.depth = r;
this.dispose();
}
return this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t), this;
}
copy(e) {
this.dispose(), this.width = e.width, this.height = e.height, this.depth = e.depth, this.viewport.set(0, 0, this.width, this.height), this.scissor.set(0, 0, this.width, this.height), this.depthBuffer = e.depthBuffer, this.stencilBuffer = e.stencilBuffer, this.depthTexture = e.depthTexture, this.texture.length = 0;
for (let t = 0, r = e.texture.length; t < r; t++)
this.texture[t] = e.texture[t].clone();
return this;
}
}
fx.prototype.isWebGLMultipleRenderTargets = !0;
class Xp extends vr {
constructor(e, t, r) {
super(e, t, r), this.samples = 4;
}
copy(e) {
return super.copy.call(this, e), this.samples = e.samples, this;
}
}
Xp.prototype.isWebGLMultisampleRenderTarget = !0;
class vi {
constructor(e = 0, t = 0, r = 0, n = 1) {
this._x = e, this._y = t, this._z = r, this._w = n;
}
static slerp(e, t, r, n) {
return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."), r.slerpQuaternions(e, t, n);
}
static slerpFlat(e, t, r, n, o, a, s) {
let c = r[n + 0], l = r[n + 1], h = r[n + 2], u = r[n + 3];
const p = o[a + 0], g = o[a + 1], m = o[a + 2], d = o[a + 3];
if (s === 0) {
e[t + 0] = c, e[t + 1] = l, e[t + 2] = h, e[t + 3] = u;
return;
}
if (s === 1) {
e[t + 0] = p, e[t + 1] = g, e[t + 2] = m, e[t + 3] = d;
return;
}
if (u !== d || c !== p || l !== g || h !== m) {
let y = 1 - s;
const f = c * p + l * g + h * m + u * d, v = f >= 0 ? 1 : -1, M = 1 - f * f;
if (M > Number.EPSILON) {
const T = Math.sqrt(M), x = Math.atan2(T, f * v);
y = Math.sin(y * x) / T, s = Math.sin(s * x) / T;
}
const S = s * v;
if (c = c * y + p * S, l = l * y + g * S, h = h * y + m * S, u = u * y + d * S, y === 1 - s) {
const T = 1 / Math.sqrt(c * c + l * l + h * h + u * u);
c *= T, l *= T, h *= T, u *= T;
}
}
e[t] = c, e[t + 1] = l, e[t + 2] = h, e[t + 3] = u;
}
static multiplyQuaternionsFlat(e, t, r, n, o, a) {
const s = r[n], c = r[n + 1], l = r[n + 2], h = r[n + 3], u = o[a], p = o[a + 1], g = o[a + 2], m = o[a + 3];
return e[t] = s * m + h * u + c * g - l * p, e[t + 1] = c * m + h * p + l * u - s * g, e[t + 2] = l * m + h * g + s * p - c * u, e[t + 3] = h * m - s * u - c * p - l * g, e;
}
get x() {
return this._x;
}
set x(e) {
this._x = e, this._onChangeCallback();
}
get y() {
return this._y;
}
set y(e) {
this._y = e, this._onChangeCallback();
}
get z() {
return this._z;
}
set z(e) {
this._z = e, this._onChangeCallback();
}
get w() {
return this._w;
}
set w(e) {
this._w = e, this._onChangeCallback();
}
set(e, t, r, n) {
return this._x = e, this._y = t, this._z = r, this._w = n, this._onChangeCallback(), this;
}
clone() {
return new this.constructor(this._x, this._y, this._z, this._w);
}
copy(e) {
return this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w, this._onChangeCallback(), this;
}
setFromEuler(e, t) {
if (!(e && e.isEuler))
throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");
const r = e._x, n = e._y, o = e._z, a = e._order, s = Math.cos, c = Math.sin, l = s(r / 2), h = s(n / 2), u = s(o / 2), p = c(r / 2), g = c(n / 2), m = c(o / 2);
switch (a) {
case "XYZ":
this._x = p * h * u + l * g * m, this._y = l * g * u - p * h * m, this._z = l * h * m + p * g * u, this._w = l * h * u - p * g * m;
break;
case "YXZ":
this._x = p * h * u + l * g * m, this._y = l * g * u - p * h * m, this._z = l * h * m - p * g * u, this._w = l * h * u + p * g * m;
break;
case "ZXY":
this._x = p * h * u - l * g * m, this._y = l * g * u + p * h * m, this._z = l * h * m + p * g * u, this._w = l * h * u - p * g * m;
break;
case "ZYX":
this._x = p * h * u - l * g * m, this._y = l * g * u + p * h * m, this._z = l * h * m - p * g * u, this._w = l * h * u + p * g * m;
break;
case "YZX":
this._x = p * h * u + l * g * m, this._y = l * g * u + p * h * m, this._z = l * h * m - p * g * u, this._w = l * h * u - p * g * m;
break;
case "XZY":
this._x = p * h * u - l * g * m, this._y = l * g * u - p * h * m, this._z = l * h * m + p * g * u, this._w = l * h * u + p * g * m;
break;
default:
console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
}
return t !== !1 && this._onChangeCallback(), this;
}
setFromAxisAngle(e, t) {
const r = t / 2, n = Math.sin(r);
return this._x = e.x * n, this._y = e.y * n, this._z = e.z * n, this._w = Math.cos(r), this._onChangeCallback(), this;
}
setFromRotationMatrix(e) {
const t = e.elements, r = t[0], n = t[4], o = t[8], a = t[1], s = t[5], c = t[9], l = t[2], h = t[6], u = t[10], p = r + s + u;
if (p > 0) {
const g = 0.5 / Math.sqrt(p + 1);
this._w = 0.25 / g, this._x = (h - c) * g, this._y = (o - l) * g, this._z = (a - n) * g;
} else if (r > s && r > u) {
const g = 2 * Math.sqrt(1 + r - s - u);
this._w = (h - c) / g, this._x = 0.25 * g, this._y = (n + a) / g, this._z = (o + l) / g;
} else if (s > u) {
const g = 2 * Math.sqrt(1 + s - r - u);
this._w = (o - l) / g, this._x = (n + a) / g, this._y = 0.25 * g, this._z = (c + h) / g;
} else {
const g = 2 * Math.sqrt(1 + u - r - s);
this._w = (a - n) / g, this._x = (o + l) / g, this._y = (c + h) / g, this._z = 0.25 * g;
}
return this._onChangeCallback(), this;
}
setFromUnitVectors(e, t) {
let r = e.dot(t) + 1;
return r < Number.EPSILON ? (r = 0, Math.abs(e.x) > Math.abs(e.z) ? (this._x = -e.y, this._y = e.x, this._z = 0, this._w = r) : (this._x = 0, this._y = -e.z, this._z = e.y, this._w = r)) : (this._x = e.y * t.z - e.z * t.y, this._y = e.z * t.x - e.x * t.z, this._z = e.x * t.y - e.y * t.x, this._w = r), this.normalize();
}
angleTo(e) {
return 2 * Math.acos(Math.abs(mi(this.dot(e), -1, 1)));
}
rotateTowards(e, t) {
const r = this.angleTo(e);
if (r === 0) return this;
const n = Math.min(1, t / r);
return this.slerp(e, n), this;
}
identity() {
return this.set(0, 0, 0, 1);
}
invert() {
return this.conjugate();
}
conjugate() {
return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this;
}
dot(e) {
return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w;
}
lengthSq() {
return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
}
length() {
return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
}
normalize() {
let e = this.length();
return e === 0 ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (e = 1 / e, this._x = this._x * e, this._y = this._y * e, this._z = this._z * e, this._w = this._w * e), this._onChangeCallback(), this;
}
multiply(e, t) {
return t !== void 0 ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."), this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e);
}
premultiply(e) {
return this.multiplyQuaternions(e, this);
}
multiplyQuaternions(e, t) {
const r = e._x, n = e._y, o = e._z, a = e._w, s = t._x, c = t._y, l = t._z, h = t._w;
return this._x = r * h + a * s + n * l - o * c, this._y = n * h + a * c + o * s - r * l, this._z = o * h + a * l + r * c - n * s, this._w = a * h - r * s - n * c - o * l, this._onChangeCallback(), this;
}
slerp(e, t) {
if (t === 0) return this;
if (t === 1) return this.copy(e);
const r = this._x, n = this._y, o = this._z, a = this._w;
let s = a * e._w + r * e._x + n * e._y + o * e._z;
if (s < 0 ? (this._w = -e._w, this._x = -e._x, this._y = -e._y, this._z = -e._z, s = -s) : this.copy(e), s >= 1)
return this._w = a, this._x = r, this._y = n, this._z = o, this;
const c = 1 - s * s;
if (c <= Number.EPSILON) {
const g = 1 - t;
return this._w = g * a + t * this._w, this._x = g * r + t * this._x, this._y = g * n + t * this._y, this._z = g * o + t * this._z, this.normalize(), this._onChangeCallback(), this;
}
const l = Math.sqrt(c), h = Math.atan2(l, s), u = Math.sin((1 - t) * h) / l, p = Math.sin(t * h) / l;
return this._w = a * u + this._w * p, this._x = r * u + this._x * p, this._y = n * u + this._y * p, this._z = o * u + this._z * p, this._onChangeCallback(), this;
}
slerpQuaternions(e, t, r) {
this.copy(e).slerp(t, r);
}
equals(e) {
return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w;
}
fromArray(e, t = 0) {
return this._x = e[t], this._y = e[t + 1], this._z = e[t + 2], this._w = e[t + 3], this._onChangeCallback(), this;
}
toArray(e = [], t = 0) {
return e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._w, e;
}
fromBufferAttribute(e, t) {
return this._x = e.getX(t), this._y = e.getY(t), this._z = e.getZ(t), this._w = e.getW(t), this;
}
_onChange(e) {
return this._onChangeCallback = e, this;
}
_onChangeCallback() {
}
}
vi.prototype.isQuaternion = !0;
class Z {
constructor(e = 0, t = 0, r = 0) {
this.x = e, this.y = t, this.z = r;
}
set(e, t, r) {
return r === void 0 && (r = this.z), this.x = e, this.y = t, this.z = r, this;
}
setScalar(e) {
return this.x = e, this.y = e, this.z = e, this;
}
setX(e) {
return this.x = e, this;
}
setY(e) {
return this.y = e, this;
}
setZ(e) {
return this.z = e, this;
}
setComponent(e, t) {
switch (e) {
case 0:
this.x = t;
break;
case 1:
this.y = t;
break;
case 2:
this.z = t;
break;
default:
throw new Error("index is out of range: " + e);
}
return this;
}
getComponent(e) {
switch (e) {
case 0:
return this.x;
case 1:
return this.y;
case 2:
return this.z;
default:
throw new Error("index is out of range: " + e);
}
}
clone() {
return new this.constructor(this.x, this.y, this.z);
}
copy(e) {
return this.x = e.x, this.y = e.y, this.z = e.z, this;
}
add(e, t) {
return t !== void 0 ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this.z += e.z, this);
}
addScalar(e) {
return this.x += e, this.y += e, this.z += e, this;
}
addVectors(e, t) {
return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this;
}
addScaledVector(e, t) {
return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this;
}
sub(e, t) {
return t !== void 0 ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this.z -= e.z, this);
}
subScalar(e) {
return this.x -= e, this.y -= e, this.z -= e, this;
}
subVectors(e, t) {
return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this;
}
multiply(e, t) {
return t !== void 0 ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."), this.multiplyVectors(e, t)) : (this.x *= e.x, this.y *= e.y, this.z *= e.z, this);
}
multiplyScalar(e) {
return this.x *= e, this.y *= e, this.z *= e, this;
}
multiplyVectors(e, t) {
return this.x = e.x * t.x, this.y = e.y * t.y, this.z = e.z * t.z, this;
}
applyEuler(e) {
return e && e.isEuler || console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."), this.applyQuaternion(dg.setFromEuler(e));
}
applyAxisAngle(e, t) {
return this.applyQuaternion(dg.setFromAxisAngle(e, t));
}
applyMatrix3(e) {
const t = this.x, r = this.y, n = this.z, o = e.elements;
return this.x = o[0] * t + o[3] * r + o[6] * n, this.y = o[1] * t + o[4] * r + o[7] * n, this.z = o[2] * t + o[5] * r + o[8] * n, this;
}
applyNormalMatrix(e) {
return this.applyMatrix3(e).normalize();
}
applyMatrix4(e) {
const t = this.x, r = this.y, n = this.z, o = e.elements, a = 1 / (o[3] * t + o[7] * r + o[11] * n + o[15]);
return this.x = (o[0] * t + o[4] * r + o[8] * n + o[12]) * a, this.y = (o[1] * t + o[5] * r + o[9] * n + o[13]) * a, this.z = (o[2] * t + o[6] * r + o[10] * n + o[14]) * a, this;
}
applyQuaternion(e) {
const t = this.x, r = this.y, n = this.z, o = e.x, a = e.y, s = e.z, c = e.w, l = c * t + a * n - s * r, h = c * r + s * t - o * n, u = c * n + o * r - a * t, p = -o * t - a * r - s * n;
return this.x = l * c + p * -o + h * -s - u * -a, this.y = h * c + p * -a + u * -o - l * -s, this.z = u * c + p * -s + l * -a - h * -o, this;
}
project(e) {
return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix);
}
unproject(e) {
return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld);
}
transformDirection(e) {
const t = this.x, r = this.y, n = this.z, o = e.elements;
return this.x = o[0] * t + o[4] * r + o[8] * n, this.y = o[1] * t + o[5] * r + o[9] * n, this.z = o[2] * t + o[6] * r + o[10] * n, this.normalize();
}
divide(e) {
return this.x /= e.x, this.y /= e.y, this.z /= e.z, this;
}
divideScalar(e) {
return this.multiplyScalar(1 / e);
}
min(e) {
return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this;
}
max(e) {
return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this;
}
clamp(e, t) {
return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this.z = Math.max(e.z, Math.min(t.z, this.z)), this;
}
clampScalar(e, t) {
return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this.z = Math.max(e, Math.min(t, this.z)), this;
}
clampLength(e, t) {
const r = this.length();
return this.divideScalar(r || 1).multiplyScalar(Math.max(e, Math.min(t, r)));
}
floor() {
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;
}
ceil() {
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;
}
round() {
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;
}
roundToZero() {
return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this;
}
negate() {
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this;
}
dot(e) {
return this.x * e.x + this.y * e.y + this.z * e.z;
}
// TODO lengthSquared?
lengthSq() {
return this.x * this.x + this.y * this.y + this.z * this.z;
}
length() {
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
}
manhattanLength() {
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
}
normalize() {
return this.divideScalar(this.length() || 1);
}
setLength(e) {
return this.normalize().multiplyScalar(e);
}
lerp(e, t) {
return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this;
}
lerpVectors(e, t, r) {
return this.x = e.x + (t.x - e.x) * r, this.y = e.y + (t.y - e.y) * r, this.z = e.z + (t.z - e.z) * r, this;
}
cross(e, t) {
return t !== void 0 ? (console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."), this.crossVectors(e, t)) : this.crossVectors(this, e);
}
crossVectors(e, t) {
const r = e.x, n = e.y, o = e.z, a = t.x, s = t.y, c = t.z;
return this.x = n * c - o * s, this.y = o * a - r * c, this.z = r * s - n * a, this;
}
projectOnVector(e) {
const t = e.lengthSq();
if (t === 0) return this.set(0, 0, 0);
const r = e.dot(this) / t;
return this.copy(e).multiplyScalar(r);
}
projectOnPlane(e) {
return sh.copy(this).projectOnVector(e), this.sub(sh);
}
reflect(e) {
return this.sub(sh.copy(e).multiplyScalar(2 * this.dot(e)));
}
angleTo(e) {
const t = Math.sqrt(this.lengthSq() * e.lengthSq());
if (t === 0) return Math.PI / 2;
const r = this.dot(e) / t;
return Math.acos(mi(r, -1, 1));
}
distanceTo(e) {
return Math.sqrt(this.distanceToSquared(e));
}
distanceToSquared(e) {
const t = this.x - e.x, r = this.y - e.y, n = this.z - e.z;
return t * t + r * r + n * n;
}
manhattanDistanceTo(e) {
return Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z);
}
setFromSpherical(e) {
return this.setFromSphericalCoords(e.radius, e.phi, e.theta);
}
setFromSphericalCoords(e, t, r) {
const n = Math.sin(t) * e;
return this.x = n * Math.sin(r), this.y = Math.cos(t) * e, this.z = n * Math.cos(r), this;
}
setFromCylindrical(e) {
return this.setFromCylindricalCoords(e.radius, e.theta, e.y);
}
setFromCylindricalCoords(e, t, r) {
return this.x = e * Math.sin(t), this.y = r, this.z = e * Math.cos(t), this;
}
setFromMatrixPosition(e) {
const t = e.elements;
return this.x = t[12], this.y = t[13], this.z = t[14], this;
}
setFromMatrixScale(e) {
const t = this.setFromMatrixColumn(e, 0).length(), r = this.setFromMatrixColumn(e, 1).length(), n = this.setFromMatrixColumn(e, 2).length();
return this.x = t, this.y = r, this.z = n, this;
}
setFromMatrixColumn(e, t) {
return this.fromArray(e.elements, t * 4);
}
setFromMatrix3Column(e, t) {
return this.fromArray(e.elements, t * 3);
}
equals(e) {
return e.x === this.x && e.y === this.y && e.z === this.z;
}
fromArray(e, t = 0) {
return this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this;
}
toArray(e = [], t = 0) {
return e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e;
}
fromBufferAttribute(e, t, r) {
return r !== void 0 && console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this;
}
random() {
return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
}
}
Z.prototype.isVector3 = !0;
const sh = /* @__PURE__ */ new Z(), dg = /* @__PURE__ */ new vi();
class Vi {
constructor(e = new Z(1 / 0, 1 / 0, 1 / 0), t = new Z(-1 / 0, -1 / 0, -1 / 0)) {
this.min = e, this.max = t;
}
set(e, t) {
return this.min.copy(e), this.max.copy(t), this;
}
setFromArray(e) {
let t = 1 / 0, r = 1 / 0, n = 1 / 0, o = -1 / 0, a = -1 / 0, s = -1 / 0;
for (let c = 0, l = e.length; c < l; c += 3) {
const h = e[c], u = e[c + 1], p = e[c + 2];
h < t && (t = h), u < r && (r = u), p < n && (n = p), h > o && (o = h), u > a && (a = u), p > s && (s = p);
}
return this.min.set(t, r, n), this.max.set(o, a, s), this;
}
setFromBufferAttribute(e) {
let t = 1 / 0, r = 1 / 0, n = 1 / 0, o = -1 / 0, a = -1 / 0, s = -1 / 0;
for (let c = 0, l = e.count; c < l; c++) {
const h = e.getX(c), u = e.getY(c), p = e.getZ(c);
h < t && (t = h), u < r && (r = u), p < n && (n = p), h > o && (o = h), u > a && (a = u), p > s && (s = p);
}
return this.min.set(t, r, n), this.max.set(o, a, s), this;
}
setFromPoints(e) {
this.makeEmpty();
for (let t = 0, r = e.length; t < r; t++)
this.expandByPoint(e[t]);
return this;
}
setFromCenterAndSize(e, t) {
const r = bs.copy(t).multiplyScalar(0.5);
return this.min.copy(e).sub(r), this.max.copy(e).add(r), this;
}
setFromObject(e) {
return this.makeEmpty(), this.expandByObject(e);
}
clone() {
return new this.constructor().copy(this);
}
copy(e) {
return this.min.copy(e.min), this.max.copy(e.max), this;
}
makeEmpty() {
return this.min.x = this.min.y = this.min.z = 1 / 0, this.max.x = this.max.y = this.max.z = -1 / 0, this;
}
isEmpty() {
return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;
}
getCenter(e) {
return this.isEmpty() ? e.set(0, 0, 0) : e.addVectors(this.min, this.max).multiplyScalar(0.5);
}
getSize(e) {
return this.isEmpty() ? e.set(0, 0, 0) : e.subVectors(this.max, this.min);
}
expandByPoint(e) {
return this.min.min(e), this.max.max(e), this;
}
expandByVector(e) {
return this.min.sub(e), this.max.add(e), this;
}
expandByScalar(e) {
return this.min.addScalar(-e), this.max.addScalar(e), this;
}
expandByObject(e) {
e.updateWorldMatrix(!1, !1);
const t = e.geometry;
t !== void 0 && (t.boundingBox === null && t.computeBoundingBox(), lh.copy(t.boundingBox), lh.applyMatrix4(e.matrixWorld), this.union(lh));
const r = e.children;
for (let n = 0, o = r.length; n < o; n++)
this.expandByObject(r[n]);
return this;
}
containsPoint(e) {
return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y || e.z < this.min.z || e.z > this.max.z);
}
containsBox(e) {
return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z;
}
getParameter(e, t) {
return t.set(
(e.x - this.min.x) / (this.max.x - this.min.x),
(e.y - this.min.y) / (this.max.y - this.min.y),
(e.z - this.min.z) / (this.max.z - this.min.z)
);
}
intersectsBox(e) {
return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y || e.max.z < this.min.z || e.min.z > this.max.z);
}
intersectsSphere(e) {
return this.clampPoint(e.center, bs), bs.distanceToSquared(e.center) <= e.radius * e.radius;
}
intersectsPlane(e) {
let t, r;
return e.normal.x > 0 ? (t = e.normal.x * this.min.x, r = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x, r = e.normal.x * this.min.x), e.normal.y > 0 ? (t += e.normal.y * this.min.y, r += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y, r += e.normal.y * this.min.y), e.normal.z > 0 ? (t += e.normal.z * this.min.z, r += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z, r += e.normal.z * this.min.z), t <= -e.constant && r >= -e.constant;
}
intersectsTriangle(e) {
if (this.isEmpty())
return !1;
this.getCenter(xs), jl.subVectors(this.max, xs), Qo.subVectors(e.a, xs), ea.subVectors(e.b, xs), ta.subVectors(e.c, xs), _n.subVectors(ea, Qo), Mn.subVectors(ta, ea), co.subVectors(Qo, ta);
let t = [
0,
-_n.z,
_n.y,
0,
-Mn.z,
Mn.y,
0,
-co.z,
co.y,
_n.z,
0,
-_n.x,
Mn.z,
0,
-Mn.x,
co.z,
0,
-co.x,
-_n.y,
_n.x,
0,
-Mn.y,
Mn.x,
0,
-co.y,
co.x,
0
];
return !ch(t, Qo, ea, ta, jl) || (t = [1, 0, 0, 0, 1, 0, 0, 0, 1], !ch(t, Qo, ea, ta, jl)) ? !1 : (Wl.crossVectors(_n, Mn), t = [Wl.x, Wl.y, Wl.z], ch(t, Qo, ea, ta, jl));
}
clampPoint(e, t) {
return t.copy(e).clamp(this.min, this.max);
}
distanceToPoint(e) {
return bs.copy(e).clamp(this.min, this.max).sub(e).length();
}
getBoundingSphere(e) {
return this.getCenter(e.center), e.radius = this.getSize(bs).length() * 0.5, e;
}
intersect(e) {
return this.min.max(e.min), this.max.min(e.max), this.isEmpty() && this.makeEmpty(), this;
}
union(e) {
return this.min.min(e.min), this.max.max(e.max), this;
}
applyMatrix4(e) {
return this.isEmpty() ? this : (jr[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), jr[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), jr[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), jr[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), jr[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), jr[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), jr[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), jr[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(jr), this);
}
translate(e) {
return this.min.add(e), this.max.add(e), this;
}
equals(e) {
return e.min.equals(this.min) && e.max.equals(this.max);
}
}
Vi.prototype.isBox3 = !0;
const jr = [
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z()
], bs = /* @__PURE__ */ new Z(), lh = /* @__PURE__ */ new Vi(), Qo = /* @__PURE__ */ new Z(), ea = /* @__PURE__ */ new Z(), ta = /* @__PURE__ */ new Z(), _n = /* @__PURE__ */ new Z(), Mn = /* @__PURE__ */ new Z(), co = /* @__PURE__ */ new Z(), xs = /* @__PURE__ */ new Z(), jl = /* @__PURE__ */ new Z(), Wl = /* @__PURE__ */ new Z(), uo = /* @__PURE__ */ new Z();
function ch(i, e, t, r, n) {
for (let o = 0, a = i.length - 3; o <= a; o += 3) {
uo.fromArray(i, o);
const s = n.x * Math.abs(uo.x) + n.y * Math.abs(uo.y) + n.z * Math.abs(uo.z), c = e.dot(uo), l = t.dot(uo), h = r.dot(uo);
if (Math.max(-Math.max(c, l, h), Math.min(c, l, h)) > s)
return !1;
}
return !0;
}
const xO = /* @__PURE__ */ new Vi(), pg = /* @__PURE__ */ new Z(), uh = /* @__PURE__ */ new Z(), hh = /* @__PURE__ */ new Z();
class bn {
constructor(e = new Z(), t = -1) {
this.center = e, this.radius = t;
}
set(e, t) {
return this.center.copy(e), this.radius = t, this;
}
setFromPoints(e, t) {
const r = this.center;
t !== void 0 ? r.copy(t) : xO.setFromPoints(e).getCenter(r);
let n = 0;
for (let o = 0, a = e.length; o < a; o++)
n = Math.max(n, r.distanceToSquared(e[o]));
return this.radius = Math.sqrt(n), this;
}
copy(e) {
return this.center.copy(e.center), this.radius = e.radius, this;
}
isEmpty() {
return this.radius < 0;
}
makeEmpty() {
return this.center.set(0, 0, 0), this.radius = -1, this;
}
containsPoint(e) {
return e.distanceToSquared(this.center) <= this.radius * this.radius;
}
distanceToPoint(e) {
return e.distanceTo(this.center) - this.radius;
}
intersectsSphere(e) {
const t = this.radius + e.radius;
return e.center.distanceToSquared(this.center) <= t * t;
}
intersectsBox(e) {
return e.intersectsSphere(this);
}
intersectsPlane(e) {
return Math.abs(e.distanceToPoint(this.center)) <= this.radius;
}
clampPoint(e, t) {
const r = this.center.distanceToSquared(e);
return t.copy(e), r > this.radius * this.radius && (t.sub(this.center).normalize(), t.multiplyScalar(this.radius).add(this.center)), t;
}
getBoundingBox(e) {
return this.isEmpty() ? (e.makeEmpty(), e) : (e.set(this.center, this.center), e.expandByScalar(this.radius), e);
}
applyMatrix4(e) {
return this.center.applyMatrix4(e), this.radius = this.radius * e.getMaxScaleOnAxis(), this;
}
translate(e) {
return this.center.add(e), this;
}
expandByPoint(e) {
hh.subVectors(e, this.center);
const t = hh.lengthSq();
if (t > this.radius * this.radius) {
const r = Math.sqrt(t), n = (r - this.radius) * 0.5;
this.center.add(hh.multiplyScalar(n / r)), this.radius += n;
}
return this;
}
union(e) {
return uh.subVectors(e.center, this.center).normalize().multiplyScalar(e.radius), this.expandByPoint(pg.copy(e.center).add(uh)), this.expandByPoint(pg.copy(e.center).sub(uh)), this;
}
equals(e) {
return e.center.equals(this.center) && e.radius === this.radius;
}
clone() {
return new this.constructor().copy(this);
}
}
const Wr = /* @__PURE__ */ new Z(), dh = /* @__PURE__ */ new Z(), $l = /* @__PURE__ */ new Z(), Sn = /* @__PURE__ */ new Z(), ph = /* @__PURE__ */ new Z(), ql = /* @__PURE__ */ new Z(), fh = /* @__PURE__ */ new Z();
class io {
constructor(e = new Z(), t = new Z(0, 0, -1)) {
this.origin = e, this.direction = t;
}
set(e, t) {
return this.origin.copy(e), this.direction.copy(t), this;
}
copy(e) {
return this.origin.copy(e.origin), this.direction.copy(e.direction), this;
}
at(e, t) {
return t.copy(this.direction).multiplyScalar(e).add(this.origin);
}
lookAt(e) {
return this.direction.copy(e).sub(this.origin).normalize(), this;
}
recast(e) {
return this.origin.copy(this.at(e, Wr)), this;
}
closestPointToPoint(e, t) {
t.subVectors(e, this.origin);
const r = t.dot(this.direction);
return r < 0 ? t.copy(this.origin) : t.copy(this.direction).multiplyScalar(r).add(this.origin);
}
distanceToPoint(e) {
return Math.sqrt(this.distanceSqToPoint(e));
}
distanceSqToPoint(e) {
const t = Wr.subVectors(e, this.origin).dot(this.direction);
return t < 0 ? this.origin.distanceToSquared(e) : (Wr.copy(this.direction).multiplyScalar(t).add(this.origin), Wr.distanceToSquared(e));
}
distanceSqToSegment(e, t, r, n) {
dh.copy(e).add(t).multiplyScalar(0.5), $l.copy(t).sub(e).normalize(), Sn.copy(this.origin).sub(dh);
const o = e.distanceTo(t) * 0.5, a = -this.direction.dot($l), s = Sn.dot(this.direction), c = -Sn.dot($l), l = Sn.lengthSq(), h = Math.abs(1 - a * a);
let u, p, g, m;
if (h > 0)
if (u = a * c - s, p = a * s - c, m = o * h, u >= 0)
if (p >= -m)
if (p <= m) {
const d = 1 / h;
u *= d, p *= d, g = u * (u + a * p + 2 * s) + p * (a * u + p + 2 * c) + l;
} else
p = o, u = Math.max(0, -(a * p + s)), g = -u * u + p * (p + 2 * c) + l;
else
p = -o, u = Math.max(0, -(a * p + s)), g = -u * u + p * (p + 2 * c) + l;
else
p <= -m ? (u = Math.max(0, -(-a * o + s)), p = u > 0 ? -o : Math.min(Math.max(-o, -c), o), g = -u * u + p * (p + 2 * c) + l) : p <= m ? (u = 0, p = Math.min(Math.max(-o, -c), o), g = p * (p + 2 * c) + l) : (u = Math.max(0, -(a * o + s)), p = u > 0 ? o : Math.min(Math.max(-o, -c), o), g = -u * u + p * (p + 2 * c) + l);
else
p = a > 0 ? -o : o, u = Math.max(0, -(a * p + s)), g = -u * u + p * (p + 2 * c) + l;
return r && r.copy(this.direction).multiplyScalar(u).add(this.origin), n && n.copy($l).multiplyScalar(p).add(dh), g;
}
intersectSphere(e, t) {
Wr.subVectors(e.center, this.origin);
const r = Wr.dot(this.direction), n = Wr.dot(Wr) - r * r, o = e.radius * e.radius;
if (n > o) return null;
const a = Math.sqrt(o - n), s = r - a, c = r + a;
return s < 0 && c < 0 ? null : s < 0 ? this.at(c, t) : this.at(s, t);
}
intersectsSphere(e) {
return this.distanceSqToPoint(e.center) <= e.radius * e.radius;
}
distanceToPlane(e) {
const t = e.normal.dot(this.direction);
if (t === 0)
return e.distanceToPoint(this.origin) === 0 ? 0 : null;
const r = -(this.origin.dot(e.normal) + e.constant) / t;
return r >= 0 ? r : null;
}
intersectPlane(e, t) {
const r = this.distanceToPlane(e);
return r === null ? null : this.at(r, t);
}
intersectsPlane(e) {
const t = e.distanceToPoint(this.origin);
return t === 0 || e.normal.dot(this.direction) * t < 0;
}
intersectBox(e, t) {
let r, n, o, a, s, c;
const l = 1 / this.direction.x, h = 1 / this.direction.y, u = 1 / this.direction.z, p = this.origin;
return l >= 0 ? (r = (e.min.x - p.x) * l, n = (e.max.x - p.x) * l) : (r = (e.max.x - p.x) * l, n = (e.min.x - p.x) * l), h >= 0 ? (o = (e.min.y - p.y) * h, a = (e.max.y - p.y) * h) : (o = (e.max.y - p.y) * h, a = (e.min.y - p.y) * h), r > a || o > n || ((o > r || r !== r) && (r = o), (a < n || n !== n) && (n = a), u >= 0 ? (s = (e.min.z - p.z) * u, c = (e.max.z - p.z) * u) : (s = (e.max.z - p.z) * u, c = (e.min.z - p.z) * u), r > c || s > n) || ((s > r || r !== r) && (r = s), (c < n || n !== n) && (n = c), n < 0) ? null : this.at(r >= 0 ? r : n, t);
}
intersectsBox(e) {
return this.intersectBox(e, Wr) !== null;
}
intersectTriangle(e, t, r, n, o) {
ph.subVectors(t, e), ql.subVectors(r, e), fh.crossVectors(ph, ql);
let a = this.direction.dot(fh), s;
if (a > 0) {
if (n) return null;
s = 1;
} else if (a < 0)
s = -1, a = -a;
else
return null;
Sn.subVectors(this.origin, e);
const c = s * this.direction.dot(ql.crossVectors(Sn, ql));
if (c < 0)
return null;
const l = s * this.direction.dot(ph.cross(Sn));
if (l < 0 || c + l > a)
return null;
const h = -s * Sn.dot(fh);
return h < 0 ? null : this.at(h / a, o);
}
applyMatrix4(e) {
return this.origin.applyMatrix4(e), this.direction.transformDirection(e), this;
}
equals(e) {
return e.origin.equals(this.origin) && e.direction.equals(this.direction);
}
clone() {
return new this.constructor().copy(this);
}
}
class $e {
constructor() {
this.elements = [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
], arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.");
}
set(e, t, r, n, o, a, s, c, l, h, u, p, g, m, d, y) {
const f = this.elements;
return f[0] = e, f[4] = t, f[8] = r, f[12] = n, f[1] = o, f[5] = a, f[9] = s, f[13] = c, f[2] = l, f[6] = h, f[10] = u, f[14] = p, f[3] = g, f[7] = m, f[11] = d, f[15] = y, this;
}
identity() {
return this.set(
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
), this;
}
clone() {
return new $e().fromArray(this.elements);
}
copy(e) {
const t = this.elements, r = e.elements;
return t[0] = r[0], t[1] = r[1], t[2] = r[2], t[3] = r[3], t[4] = r[4], t[5] = r[5], t[6] = r[6], t[7] = r[7], t[8] = r[8], t[9] = r[9], t[10] = r[10], t[11] = r[11], t[12] = r[12], t[13] = r[13], t[14] = r[14], t[15] = r[15], this;
}
copyPosition(e) {
const t = this.elements, r = e.elements;
return t[12] = r[12], t[13] = r[13], t[14] = r[14], this;
}
setFromMatrix3(e) {
const t = e.elements;
return this.set(
t[0],
t[3],
t[6],
0,
t[1],
t[4],
t[7],
0,
t[2],
t[5],
t[8],
0,
0,
0,
0,
1
), this;
}
extractBasis(e, t, r) {
return e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), r.setFromMatrixColumn(this, 2), this;
}
makeBasis(e, t, r) {
return this.set(
e.x,
t.x,
r.x,
0,
e.y,
t.y,
r.y,
0,
e.z,
t.z,
r.z,
0,
0,
0,
0,
1
), this;
}
extractRotation(e) {
const t = this.elements, r = e.elements, n = 1 / ia.setFromMatrixColumn(e, 0).length(), o = 1 / ia.setFromMatrixColumn(e, 1).length(), a = 1 / ia.setFromMatrixColumn(e, 2).length();
return t[0] = r[0] * n, t[1] = r[1] * n, t[2] = r[2] * n, t[3] = 0, t[4] = r[4] * o, t[5] = r[5] * o, t[6] = r[6] * o, t[7] = 0, t[8] = r[8] * a, t[9] = r[9] * a, t[10] = r[10] * a, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this;
}
makeRotationFromEuler(e) {
e && e.isEuler || console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
const t = this.elements, r = e.x, n = e.y, o = e.z, a = Math.cos(r), s = Math.sin(r), c = Math.cos(n), l = Math.sin(n), h = Math.cos(o), u = Math.sin(o);
if (e.order === "XYZ") {
const p = a * h, g = a * u, m = s * h, d = s * u;
t[0] = c * h, t[4] = -c * u, t[8] = l, t[1] = g + m * l, t[5] = p - d * l, t[9] = -s * c, t[2] = d - p * l, t[6] = m + g * l, t[10] = a * c;
} else if (e.order === "YXZ") {
const p = c * h, g = c * u, m = l * h, d = l * u;
t[0] = p + d * s, t[4] = m * s - g, t[8] = a * l, t[1] = a * u, t[5] = a * h, t[9] = -s, t[2] = g * s - m, t[6] = d + p * s, t[10] = a * c;
} else if (e.order === "ZXY") {
const p = c * h, g = c * u, m = l * h, d = l * u;
t[0] = p - d * s, t[4] = -a * u, t[8] = m + g * s, t[1] = g + m * s, t[5] = a * h, t[9] = d - p * s, t[2] = -a * l, t[6] = s, t[10] = a * c;
} else if (e.order === "ZYX") {
const p = a * h, g = a * u, m = s * h, d = s * u;
t[0] = c * h, t[4] = m * l - g, t[8] = p * l + d, t[1] = c * u, t[5] = d * l + p, t[9] = g * l - m, t[2] = -l, t[6] = s * c, t[10] = a * c;
} else if (e.order === "YZX") {
const p = a * c, g = a * l, m = s * c, d = s * l;
t[0] = c * h, t[4] = d - p * u, t[8] = m * u + g, t[1] = u, t[5] = a * h, t[9] = -s * h, t[2] = -l * h, t[6] = g * u + m, t[10] = p - d * u;
} else if (e.order === "XZY") {
const p = a * c, g = a * l, m = s * c, d = s * l;
t[0] = c * h, t[4] = -u, t[8] = l * h, t[1] = p * u + d, t[5] = a * h, t[9] = g * u - m, t[2] = m * u - g, t[6] = s * h, t[10] = d * u + p;
}
return t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this;
}
makeRotationFromQuaternion(e) {
return this.compose(wO, e, _O);
}
lookAt(e, t, r) {
const n = this.elements;
return Gi.subVectors(e, t), Gi.lengthSq() === 0 && (Gi.z = 1), Gi.normalize(), Tn.crossVectors(r, Gi), Tn.lengthSq() === 0 && (Math.abs(r.z) === 1 ? Gi.x += 1e-4 : Gi.z += 1e-4, Gi.normalize(), Tn.crossVectors(r, Gi)), Tn.normalize(), Xl.crossVectors(Gi, Tn), n[0] = Tn.x, n[4] = Xl.x, n[8] = Gi.x, n[1] = Tn.y, n[5] = Xl.y, n[9] = Gi.y, n[2] = Tn.z, n[6] = Xl.z, n[10] = Gi.z, this;
}
multiply(e, t) {
return t !== void 0 ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."), this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e);
}
premultiply(e) {
return this.multiplyMatrices(e, this);
}
multiplyMatrices(e, t) {
const r = e.elements, n = t.elements, o = this.elements, a = r[0], s = r[4], c = r[8], l = r[12], h = r[1], u = r[5], p = r[9], g = r[13], m = r[2], d = r[6], y = r[10], f = r[14], v = r[3], M = r[7], S = r[11], T = r[15], x = n[0], w = n[4], A = n[8], _ = n[12], E = n[1], O = n[5], L = n[9], C = n[13], I = n[2], R = n[6], b = n[10], P = n[14], N = n[3], D = n[7], k = n[11], V = n[15];
return o[0] = a * x + s * E + c * I + l * N, o[4] = a * w + s * O + c * R + l * D, o[8] = a * A + s * L + c * b + l * k, o[12] = a * _ + s * C + c * P + l * V, o[1] = h * x + u * E + p * I + g * N, o[5] = h * w + u * O + p * R + g * D, o[9] = h * A + u * L + p * b + g * k, o[13] = h * _ + u * C + p * P + g * V, o[2] = m * x + d * E + y * I + f * N, o[6] = m * w + d * O + y * R + f * D, o[10] = m * A + d * L + y * b + f * k, o[14] = m * _ + d * C + y * P + f * V, o[3] = v * x + M * E + S * I + T * N, o[7] = v * w + M * O + S * R + T * D, o[11] = v * A + M * L + S * b + T * k, o[15] = v * _ + M * C + S * P + T * V, this;
}
multiplyScalar(e) {
const t = this.elements;
return t[0] *= e, t[4] *= e, t[8] *= e, t[12] *= e, t[1] *= e, t[5] *= e, t[9] *= e, t[13] *= e, t[2] *= e, t[6] *= e, t[10] *= e, t[14] *= e, t[3] *= e, t[7] *= e, t[11] *= e, t[15] *= e, this;
}
determinant() {
const e = this.elements, t = e[0], r = e[4], n = e[8], o = e[12], a = e[1], s = e[5], c = e[9], l = e[13], h = e[2], u = e[6], p = e[10], g = e[14], m = e[3], d = e[7], y = e[11], f = e[15];
return m * (+o * c * u - n * l * u - o * s * p + r * l * p + n * s * g - r * c * g) + d * (+t * c * g - t * l * p + o * a * p - n * a * g + n * l * h - o * c * h) + y * (+t * l * u - t * s * g - o * a * u + r * a * g + o * s * h - r * l * h) + f * (-n * s * h - t * c * u + t * s * p + n * a * u - r * a * p + r * c * h);
}
transpose() {
const e = this.elements;
let t;
return t = e[1], e[1] = e[4], e[4] = t, t = e[2], e[2] = e[8], e[8] = t, t = e[6], e[6] = e[9], e[9] = t, t = e[3], e[3] = e[12], e[12] = t, t = e[7], e[7] = e[13], e[13] = t, t = e[11], e[11] = e[14], e[14] = t, this;
}
setPosition(e, t, r) {
const n = this.elements;
return e.isVector3 ? (n[12] = e.x, n[13] = e.y, n[14] = e.z) : (n[12] = e, n[13] = t, n[14] = r), this;
}
invert() {
const e = this.elements, t = e[0], r = e[1], n = e[2], o = e[3], a = e[4], s = e[5], c = e[6], l = e[7], h = e[8], u = e[9], p = e[10], g = e[11], m = e[12], d = e[13], y = e[14], f = e[15], v = u * y * l - d * p * l + d * c * g - s * y * g - u * c * f + s * p * f, M = m * p * l - h * y * l - m * c * g + a * y * g + h * c * f - a * p * f, S = h * d * l - m * u * l + m * s * g - a * d * g - h * s * f + a * u * f, T = m * u * c - h * d * c - m * s * p + a * d * p + h * s * y - a * u * y, x = t * v + r * M + n * S + o * T;
if (x === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
const w = 1 / x;
return e[0] = v * w, e[1] = (d * p * o - u * y * o - d * n * g + r * y * g + u * n * f - r * p * f) * w, e[2] = (s * y * o - d * c * o + d * n * l - r * y * l - s * n * f + r * c * f) * w, e[3] = (u * c * o - s * p * o - u * n * l + r * p * l + s * n * g - r * c * g) * w, e[4] = M * w, e[5] = (h * y * o - m * p * o + m * n * g - t * y * g - h * n * f + t * p * f) * w, e[6] = (m * c * o - a * y * o - m * n * l + t * y * l + a * n * f - t * c * f) * w, e[7] = (a * p * o - h * c * o + h * n * l - t * p * l - a * n * g + t * c * g) * w, e[8] = S * w, e[9] = (m * u * o - h * d * o - m * r * g + t * d * g + h * r * f - t * u * f) * w, e[10] = (a * d * o - m * s * o + m * r * l - t * d * l - a * r * f + t * s * f) * w, e[11] = (h * s * o - a * u * o - h * r * l + t * u * l + a * r * g - t * s * g) * w, e[12] = T * w, e[13] = (h * d * n - m * u * n + m * r * p - t * d * p - h * r * y + t * u * y) * w, e[14] = (m * s * n - a * d * n - m * r * c + t * d * c + a * r * y - t * s * y) * w, e[15] = (a * u * n - h * s * n + h * r * c - t * u * c - a * r * p + t * s * p) * w, this;
}
scale(e) {
const t = this.elements, r = e.x, n = e.y, o = e.z;
return t[0] *= r, t[4] *= n, t[8] *= o, t[1] *= r, t[5] *= n, t[9] *= o, t[2] *= r, t[6] *= n, t[10] *= o, t[3] *= r, t[7] *= n, t[11] *= o, this;
}
getMaxScaleOnAxis() {
const e = this.elements, t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2], r = e[4] * e[4] + e[5] * e[5] + e[6] * e[6], n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
return Math.sqrt(Math.max(t, r, n));
}
makeTranslation(e, t, r) {
return this.set(
1,
0,
0,
e,
0,
1,
0,
t,
0,
0,
1,
r,
0,
0,
0,
1
), this;
}
makeRotationX(e) {
const t = Math.cos(e), r = Math.sin(e);
return this.set(
1,
0,
0,
0,
0,
t,
-r,
0,
0,
r,
t,
0,
0,
0,
0,
1
), this;
}
makeRotationY(e) {
const t = Math.cos(e), r = Math.sin(e);
return this.set(
t,
0,
r,
0,
0,
1,
0,
0,
-r,
0,
t,
0,
0,
0,
0,
1
), this;
}
makeRotationZ(e) {
const t = Math.cos(e), r = Math.sin(e);
return this.set(
t,
-r,
0,
0,
r,
t,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
), this;
}
makeRotationAxis(e, t) {
const r = Math.cos(t), n = Math.sin(t), o = 1 - r, a = e.x, s = e.y, c = e.z, l = o * a, h = o * s;
return this.set(
l * a + r,
l * s - n * c,
l * c + n * s,
0,
l * s + n * c,
h * s + r,
h * c - n * a,
0,
l * c - n * s,
h * c + n * a,
o * c * c + r,
0,
0,
0,
0,
1
), this;
}
makeScale(e, t, r) {
return this.set(
e,
0,
0,
0,
0,
t,
0,
0,
0,
0,
r,
0,
0,
0,
0,
1
), this;
}
makeShear(e, t, r, n, o, a) {
return this.set(
1,
r,
o,
0,
e,
1,
a,
0,
t,
n,
1,
0,
0,
0,
0,
1
), this;
}
compose(e, t, r) {
const n = this.elements, o = t._x, a = t._y, s = t._z, c = t._w, l = o + o, h = a + a, u = s + s, p = o * l, g = o * h, m = o * u, d = a * h, y = a * u, f = s * u, v = c * l, M = c * h, S = c * u, T = r.x, x = r.y, w = r.z;
return n[0] = (1 - (d + f)) * T, n[1] = (g + S) * T, n[2] = (m - M) * T, n[3] = 0, n[4] = (g - S) * x, n[5] = (1 - (p + f)) * x, n[6] = (y + v) * x, n[7] = 0, n[8] = (m + M) * w, n[9] = (y - v) * w, n[10] = (1 - (p + d)) * w, n[11] = 0, n[12] = e.x, n[13] = e.y, n[14] = e.z, n[15] = 1, this;
}
decompose(e, t, r) {
const n = this.elements;
let o = ia.set(n[0], n[1], n[2]).length();
const a = ia.set(n[4], n[5], n[6]).length(), s = ia.set(n[8], n[9], n[10]).length();
this.determinant() < 0 && (o = -o), e.x = n[12], e.y = n[13], e.z = n[14], cr.copy(this);
const c = 1 / o, l = 1 / a, h = 1 / s;
return cr.elements[0] *= c, cr.elements[1] *= c, cr.elements[2] *= c, cr.elements[4] *= l, cr.elements[5] *= l, cr.elements[6] *= l, cr.elements[8] *= h, cr.elements[9] *= h, cr.elements[10] *= h, t.setFromRotationMatrix(cr), r.x = o, r.y = a, r.z = s, this;
}
makePerspective(e, t, r, n, o, a) {
a === void 0 && console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");
const s = this.elements, c = 2 * o / (t - e), l = 2 * o / (r - n), h = (t + e) / (t - e), u = (r + n) / (r - n), p = -(a + o) / (a - o), g = -2 * a * o / (a - o);
return s[0] = c, s[4] = 0, s[8] = h, s[12] = 0, s[1] = 0, s[5] = l, s[9] = u, s[13] = 0, s[2] = 0, s[6] = 0, s[10] = p, s[14] = g, s[3] = 0, s[7] = 0, s[11] = -1, s[15] = 0, this;
}
makeOrthographic(e, t, r, n, o, a) {
const s = this.elements, c = 1 / (t - e), l = 1 / (r - n), h = 1 / (a - o), u = (t + e) * c, p = (r + n) * l, g = (a + o) * h;
return s[0] = 2 * c, s[4] = 0, s[8] = 0, s[12] = -u, s[1] = 0, s[5] = 2 * l, s[9] = 0, s[13] = -p, s[2] = 0, s[6] = 0, s[10] = -2 * h, s[14] = -g, s[3] = 0, s[7] = 0, s[11] = 0, s[15] = 1, this;
}
equals(e) {
const t = this.elements, r = e.elements;
for (let n = 0; n < 16; n++)
if (t[n] !== r[n]) return !1;
return !0;
}
fromArray(e, t = 0) {
for (let r = 0; r < 16; r++)
this.elements[r] = e[r + t];
return this;
}
toArray(e = [], t = 0) {
const r = this.elements;
return e[t] = r[0], e[t + 1] = r[1], e[t + 2] = r[2], e[t + 3] = r[3], e[t + 4] = r[4], e[t + 5] = r[5], e[t + 6] = r[6], e[t + 7] = r[7], e[t + 8] = r[8], e[t + 9] = r[9], e[t + 10] = r[10], e[t + 11] = r[11], e[t + 12] = r[12], e[t + 13] = r[13], e[t + 14] = r[14], e[t + 15] = r[15], e;
}
}
$e.prototype.isMatrix4 = !0;
const ia = /* @__PURE__ */ new Z(), cr = /* @__PURE__ */ new $e(), wO = /* @__PURE__ */ new Z(0, 0, 0), _O = /* @__PURE__ */ new Z(1, 1, 1), Tn = /* @__PURE__ */ new Z(), Xl = /* @__PURE__ */ new Z(), Gi = /* @__PURE__ */ new Z(), fg = /* @__PURE__ */ new $e(), mg = /* @__PURE__ */ new vi();
class Wo {
constructor(e = 0, t = 0, r = 0, n = Wo.DefaultOrder) {
this._x = e, this._y = t, this._z = r, this._order = n;
}
get x() {
return this._x;
}
set x(e) {
this._x = e, this._onChangeCallback();
}
get y() {
return this._y;
}
set y(e) {
this._y = e, this._onChangeCallback();
}
get z() {
return this._z;
}
set z(e) {
this._z = e, this._onChangeCallback();
}
get order() {
return this._order;
}
set order(e) {
this._order = e, this._onChangeCallback();
}
set(e, t, r, n = this._order) {
return this._x = e, this._y = t, this._z = r, this._order = n, this._onChangeCallback(), this;
}
clone() {
return new this.constructor(this._x, this._y, this._z, this._order);
}
copy(e) {
return this._x = e._x, this._y = e._y, this._z = e._z, this._order = e._order, this._onChangeCallback(), this;
}
setFromRotationMatrix(e, t = this._order, r = !0) {
const n = e.elements, o = n[0], a = n[4], s = n[8], c = n[1], l = n[5], h = n[9], u = n[2], p = n[6], g = n[10];
switch (t) {
case "XYZ":
this._y = Math.asin(mi(s, -1, 1)), Math.abs(s) < 0.9999999 ? (this._x = Math.atan2(-h, g), this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(p, l), this._z = 0);
break;
case "YXZ":
this._x = Math.asin(-mi(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._y = Math.atan2(s, g), this._z = Math.atan2(c, l)) : (this._y = Math.atan2(-u, o), this._z = 0);
break;
case "ZXY":
this._x = Math.asin(mi(p, -1, 1)), Math.abs(p) < 0.9999999 ? (this._y = Math.atan2(-u, g), this._z = Math.atan2(-a, l)) : (this._y = 0, this._z = Math.atan2(c, o));
break;
case "ZYX":
this._y = Math.asin(-mi(u, -1, 1)), Math.abs(u) < 0.9999999 ? (this._x = Math.atan2(p, g), this._z = Math.atan2(c, o)) : (this._x = 0, this._z = Math.atan2(-a, l));
break;
case "YZX":
this._z = Math.asin(mi(c, -1, 1)), Math.abs(c) < 0.9999999 ? (this._x = Math.atan2(-h, l), this._y = Math.atan2(-u, o)) : (this._x = 0, this._y = Math.atan2(s, g));
break;
case "XZY":
this._z = Math.asin(-mi(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(p, l), this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, g), this._y = 0);
break;
default:
console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + t);
}
return this._order = t, r === !0 && this._onChangeCallback(), this;
}
setFromQuaternion(e, t, r) {
return fg.makeRotationFromQuaternion(e), this.setFromRotationMatrix(fg, t, r);
}
setFromVector3(e, t = this._order) {
return this.set(e.x, e.y, e.z, t);
}
reorder(e) {
return mg.setFromEuler(this), this.setFromQuaternion(mg, e);
}
equals(e) {
return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order;
}
fromArray(e) {
return this._x = e[0], this._y = e[1], this._z = e[2], e[3] !== void 0 && (this._order = e[3]), this._onChangeCallback(), this;
}
toArray(e = [], t = 0) {
return e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._order, e;
}
toVector3(e) {
return e ? e.set(this._x, this._y, this._z) : new Z(this._x, this._y, this._z);
}
_onChange(e) {
return this._onChangeCallback = e, this;
}
_onChangeCallback() {
}
}
Wo.prototype.isEuler = !0;
Wo.DefaultOrder = "XYZ";
Wo.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"];
class Zp {
constructor() {
this.mask = 1;
}
set(e) {
this.mask = 1 << e | 0;
}
enable(e) {
this.mask |= 1 << e | 0;
}
enableAll() {
this.mask = -1;
}
toggle(e) {
this.mask ^= 1 << e | 0;
}
disable(e) {
this.mask &= ~(1 << e | 0);
}
disableAll() {
this.mask = 0;
}
test(e) {
return (this.mask & e.mask) !== 0;
}
}
let MO = 0;
const gg = /* @__PURE__ */ new Z(), ra = /* @__PURE__ */ new vi(), $r = /* @__PURE__ */ new $e(), Zl = /* @__PURE__ */ new Z(), ws = /* @__PURE__ */ new Z(), SO = /* @__PURE__ */ new Z(), TO = /* @__PURE__ */ new vi(), vg = /* @__PURE__ */ new Z(1, 0, 0), yg = /* @__PURE__ */ new Z(0, 1, 0), bg = /* @__PURE__ */ new Z(0, 0, 1), EO = { type: "added" }, xg = { type: "removed" };
class nt extends to {
constructor() {
super(), Object.defineProperty(this, "id", { value: MO++ }), this.uuid = qi(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = nt.DefaultUp.clone();
const e = new Z(), t = new Wo(), r = new vi(), n = new Z(1, 1, 1);
function o() {
r.setFromEuler(t, !1);
}
function a() {
t.setFromQuaternion(r, void 0, !1);
}
t._onChange(o), r._onChange(a), Object.defineProperties(this, {
position: {
configurable: !0,
enumerable: !0,
value: e
},
rotation: {
configurable: !0,
enumerable: !0,
value: t
},
quaternion: {
configurable: !0,
enumerable: !0,
value: r
},
scale: {
configurable: !0,
enumerable: !0,
value: n
},
modelViewMatrix: {
value: new $e()
},
normalMatrix: {
value: new ii()
}
}), this.matrix = new $e(), this.matrixWorld = new $e(), this.matrixAutoUpdate = nt.DefaultMatrixAutoUpdate, this.matrixWorldNeedsUpdate = !1, this.layers = new Zp(), this.visible = !0, this.castShadow = !1, this.receiveShadow = !1, this.frustumCulled = !0, this.renderOrder = 0, this.animations = [], this.userData = {};
}
onBeforeRender() {
}
onAfterRender() {
}
applyMatrix4(e) {
this.matrixAutoUpdate && this.updateMatrix(), this.matrix.premultiply(e), this.matrix.decompose(this.position, this.quaternion, this.scale);
}
applyQuaternion(e) {
return this.quaternion.premultiply(e), this;
}
setRotationFromAxisAngle(e, t) {
this.quaternion.setFromAxisAngle(e, t);
}
setRotationFromEuler(e) {
this.quaternion.setFromEuler(e, !0);
}
setRotationFromMatrix(e) {
this.quaternion.setFromRotationMatrix(e);
}
setRotationFromQuaternion(e) {
this.quaternion.copy(e);
}
rotateOnAxis(e, t) {
return ra.setFromAxisAngle(e, t), this.quaternion.multiply(ra), this;
}
rotateOnWorldAxis(e, t) {
return ra.setFromAxisAngle(e, t), this.quaternion.premultiply(ra), this;
}
rotateX(e) {
return this.rotateOnAxis(vg, e);
}
rotateY(e) {
return this.rotateOnAxis(yg, e);
}
rotateZ(e) {
return this.rotateOnAxis(bg, e);
}
translateOnAxis(e, t) {
return gg.copy(e).applyQuaternion(this.quaternion), this.position.add(gg.multiplyScalar(t)), this;
}
translateX(e) {
return this.translateOnAxis(vg, e);
}
translateY(e) {
return this.translateOnAxis(yg, e);
}
translateZ(e) {
return this.translateOnAxis(bg, e);
}
localToWorld(e) {
return e.applyMatrix4(this.matrixWorld);
}
worldToLocal(e) {
return e.applyMatrix4($r.copy(this.matrixWorld).invert());
}
lookAt(e, t, r) {
e.isVector3 ? Zl.copy(e) : Zl.set(e, t, r);
const n = this.parent;
this.updateWorldMatrix(!0, !1), ws.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? $r.lookAt(ws, Zl, this.up) : $r.lookAt(Zl, ws, this.up), this.quaternion.setFromRotationMatrix($r), n && ($r.extractRotation(n.matrixWorld), ra.setFromRotationMatrix($r), this.quaternion.premultiply(ra.invert()));
}
add(e) {
if (arguments.length > 1) {
for (let t = 0; t < arguments.length; t++)
this.add(arguments[t]);
return this;
}
return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e), this) : (e && e.isObject3D ? (e.parent !== null && e.parent.remove(e), e.parent = this, this.children.push(e), e.dispatchEvent(EO)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e), this);
}
remove(e) {
if (arguments.length > 1) {
for (let r = 0; r < arguments.length; r++)
this.remove(arguments[r]);
return this;
}
const t = this.children.indexOf(e);
return t !== -1 && (e.parent = null, this.children.splice(t, 1), e.dispatchEvent(xg)), this;
}
removeFromParent() {
const e = this.parent;
return e !== null && e.remove(this), this;
}
clear() {
for (let e = 0; e < this.children.length; e++) {
const t = this.children[e];
t.parent = null, t.dispatchEvent(xg);
}
return this.children.length = 0, this;
}
attach(e) {
return this.updateWorldMatrix(!0, !1), $r.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), $r.multiply(e.parent.matrixWorld)), e.applyMatrix4($r), this.add(e), e.updateWorldMatrix(!1, !0), this;
}
getObjectById(e) {
return this.getObjectByProperty("id", e);
}
getObjectByName(e) {
return this.getObjectByProperty("name", e);
}
getObjectByProperty(e, t) {
if (this[e] === t) return this;
for (let r = 0, n = this.children.length; r < n; r++) {
const o = this.children[r].getObjectByProperty(e, t);
if (o !== void 0)
return o;
}
}
getWorldPosition(e) {
return this.updateWorldMatrix(!0, !1), e.setFromMatrixPosition(this.matrixWorld);
}
getWorldQuaternion(e) {
return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(ws, e, SO), e;
}
getWorldScale(e) {
return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(ws, TO, e), e;
}
getWorldDirection(e) {
this.updateWorldMatrix(!0, !1);
const t = this.matrixWorld.elements;
return e.set(t[8], t[9], t[10]).normalize();
}
raycast() {
}
traverse(e) {
e(this);
const t = this.children;
for (let r = 0, n = t.length; r < n; r++)
t[r].traverse(e);
}
traverseVisible(e) {
if (this.visible === !1) return;
e(this);
const t = this.children;
for (let r = 0, n = t.length; r < n; r++)
t[r].traverseVisible(e);
}
traverseAncestors(e) {
const t = this.parent;
t !== null && (e(t), t.traverseAncestors(e));
}
updateMatrix() {
this.matrix.compose(this.position, this.quaternion, this.scale), this.matrixWorldNeedsUpdate = !0;
}
updateMatrixWorld(e) {
this.matrixAutoUpdate && this.updateMatrix(), (this.matrixWorldNeedsUpdate || e) && (this.parent === null ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), this.matrixWorldNeedsUpdate = !1, e = !0);
const t = this.children;
for (let r = 0, n = t.length; r < n; r++)
t[r].updateMatrixWorld(e);
}
updateWorldMatrix(e, t) {
const r = this.parent;
if (e === !0 && r !== null && r.updateWorldMatrix(!0, !1), this.matrixAutoUpdate && this.updateMatrix(), this.parent === null ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), t === !0) {
const n = this.children;
for (let o = 0, a = n.length; o < a; o++)
n[o].updateWorldMatrix(!1, !0);
}
}
toJSON(e) {
const t = e === void 0 || typeof e == "string", r = {};
t && (e = {
geometries: {},
materials: {},
textures: {},
images: {},
shapes: {},
skeletons: {},
animations: {}
}, r.metadata = {
version: 4.5,
type: "Object",
generator: "Object3D.toJSON"
});
const n = {};
n.uuid = this.uuid, n.type = this.type, this.name !== "" && (n.name = this.name), this.castShadow === !0 && (n.castShadow = !0), this.receiveShadow === !0 && (n.receiveShadow = !0), this.visible === !1 && (n.visible = !1), this.frustumCulled === !1 && (n.frustumCulled = !1), this.renderOrder !== 0 && (n.renderOrder = this.renderOrder), JSON.stringify(this.userData) !== "{}" && (n.userData = this.userData), n.layers = this.layers.mask, n.matrix = this.matrix.toArray(), this.matrixAutoUpdate === !1 && (n.matrixAutoUpdate = !1), this.isInstancedMesh && (n.type = "InstancedMesh", n.count = this.count, n.instanceMatrix = this.instanceMatrix.toJSON(), this.instanceColor !== null && (n.instanceColor = this.instanceColor.toJSON()));
function o(s, c) {
return s[c.uuid] === void 0 && (s[c.uuid] = c.toJSON(e)), c.uuid;
}
if (this.isScene)
this.background && (this.background.isColor ? n.background = this.background.toJSON() : this.background.isTexture && (n.background = this.background.toJSON(e).uuid)), this.environment && this.environment.isTexture && (n.environment = this.environment.toJSON(e).uuid);
else if (this.isMesh || this.isLine || this.isPoints) {
n.geometry = o(e.geometries, this.geometry);
const s = this.geometry.parameters;
if (s !== void 0 && s.shapes !== void 0) {
const c = s.shapes;
if (Array.isArray(c))
for (let l = 0, h = c.length; l < h; l++) {
const u = c[l];
o(e.shapes, u);
}
else
o(e.shapes, c);
}
}
if (this.isSkinnedMesh && (n.bindMode = this.bindMode, n.bindMatrix = this.bindMatrix.toArray(), this.skeleton !== void 0 && (o(e.skeletons, this.skeleton), n.skeleton = this.skeleton.uuid)), this.material !== void 0)
if (Array.isArray(this.material)) {
const s = [];
for (let c = 0, l = this.material.length; c < l; c++)
s.push(o(e.materials, this.material[c]));
n.material = s;
} else
n.material = o(e.materials, this.material);
if (this.children.length > 0) {
n.children = [];
for (let s = 0; s < this.children.length; s++)
n.children.push(this.children[s].toJSON(e).object);
}
if (this.animations.length > 0) {
n.animations = [];
for (let s = 0; s < this.animations.length; s++) {
const c = this.animations[s];
n.animations.push(o(e.animations, c));
}
}
if (t) {
const s = a(e.geometries), c = a(e.materials), l = a(e.textures), h = a(e.images), u = a(e.shapes), p = a(e.skeletons), g = a(e.animations);
s.length > 0 && (r.geometries = s), c.length > 0 && (r.materials = c), l.length > 0 && (r.textures = l), h.length > 0 && (r.images = h), u.length > 0 && (r.shapes = u), p.length > 0 && (r.skeletons = p), g.length > 0 && (r.animations = g);
}
return r.object = n, r;
function a(s) {
const c = [];
for (const l in s) {
const h = s[l];
delete h.metadata, c.push(h);
}
return c;
}
}
clone(e) {
return new this.constructor().copy(this, e);
}
copy(e, t = !0) {
if (this.name = e.name, this.up.copy(e.up), this.position.copy(e.position), this.rotation.order = e.rotation.order, this.quaternion.copy(e.quaternion), this.scale.copy(e.scale), this.matrix.copy(e.matrix), this.matrixWorld.copy(e.matrixWorld), this.matrixAutoUpdate = e.matrixAutoUpdate, this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate, this.layers.mask = e.layers.mask, this.visible = e.visible, this.castShadow = e.castShadow, this.receiveShadow = e.receiveShadow, this.frustumCulled = e.frustumCulled, this.renderOrder = e.renderOrder, this.userData = JSON.parse(JSON.stringify(e.userData)), t === !0)
for (let r = 0; r < e.children.length; r++) {
const n = e.children[r];
this.add(n.clone());
}
return this;
}
}
nt.DefaultUp = new Z(0, 1, 0);
nt.DefaultMatrixAutoUpdate = !0;
nt.prototype.isObject3D = !0;
const ur = /* @__PURE__ */ new Z(), qr = /* @__PURE__ */ new Z(), mh = /* @__PURE__ */ new Z(), Xr = /* @__PURE__ */ new Z(), na = /* @__PURE__ */ new Z(), oa = /* @__PURE__ */ new Z(), wg = /* @__PURE__ */ new Z(), gh = /* @__PURE__ */ new Z(), vh = /* @__PURE__ */ new Z(), yh = /* @__PURE__ */ new Z();
class Xt {
constructor(e = new Z(), t = new Z(), r = new Z()) {
this.a = e, this.b = t, this.c = r;
}
static getNormal(e, t, r, n) {
n.subVectors(r, t), ur.subVectors(e, t), n.cross(ur);
const o = n.lengthSq();
return o > 0 ? n.multiplyScalar(1 / Math.sqrt(o)) : n.set(0, 0, 0);
}
// static/instance method to calculate barycentric coordinates
// based on: http://www.blackpawn.com/texts/pointinpoly/default.html
static getBarycoord(e, t, r, n, o) {
ur.subVectors(n, t), qr.subVectors(r, t), mh.subVectors(e, t);
const a = ur.dot(ur), s = ur.dot(qr), c = ur.dot(mh), l = qr.dot(qr), h = qr.dot(mh), u = a * l - s * s;
if (u === 0)
return o.set(-2, -1, -1);
const p = 1 / u, g = (l * c - s * h) * p, m = (a * h - s * c) * p;
return o.set(1 - g - m, m, g);
}
static containsPoint(e, t, r, n) {
return this.getBarycoord(e, t, r, n, Xr), Xr.x >= 0 && Xr.y >= 0 && Xr.x + Xr.y <= 1;
}
static getUV(e, t, r, n, o, a, s, c) {
return this.getBarycoord(e, t, r, n, Xr), c.set(0, 0), c.addScaledVector(o, Xr.x), c.addScaledVector(a, Xr.y), c.addScaledVector(s, Xr.z), c;
}
static isFrontFacing(e, t, r, n) {
return ur.subVectors(r, t), qr.subVectors(e, t), ur.cross(qr).dot(n) < 0;
}
set(e, t, r) {
return this.a.copy(e), this.b.copy(t), this.c.copy(r), this;
}
setFromPointsAndIndices(e, t, r, n) {
return this.a.copy(e[t]), this.b.copy(e[r]), this.c.copy(e[n]), this;
}
clone() {
return new this.constructor().copy(this);
}
copy(e) {
return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this;
}
getArea() {
return ur.subVectors(this.c, this.b), qr.subVectors(this.a, this.b), ur.cross(qr).length() * 0.5;
}
getMidpoint(e) {
return e.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);
}
getNormal(e) {
return Xt.getNormal(this.a, this.b, this.c, e);
}
getPlane(e) {
return e.setFromCoplanarPoints(this.a, this.b, this.c);
}
getBarycoord(e, t) {
return Xt.getBarycoord(e, this.a, this.b, this.c, t);
}
getUV(e, t, r, n, o) {
return Xt.getUV(e, this.a, this.b, this.c, t, r, n, o);
}
containsPoint(e) {
return Xt.containsPoint(e, this.a, this.b, this.c);
}
isFrontFacing(e) {
return Xt.isFrontFacing(this.a, this.b, this.c, e);
}
intersectsBox(e) {
return e.intersectsTriangle(this);
}
closestPointToPoint(e, t) {
const r = this.a, n = this.b, o = this.c;
let a, s;
na.subVectors(n, r), oa.subVectors(o, r), gh.subVectors(e, r);
const c = na.dot(gh), l = oa.dot(gh);
if (c <= 0 && l <= 0)
return t.copy(r);
vh.subVectors(e, n);
const h = na.dot(vh), u = oa.dot(vh);
if (h >= 0 && u <= h)
return t.copy(n);
const p = c * u - h * l;
if (p <= 0 && c >= 0 && h <= 0)
return a = c / (c - h), t.copy(r).addScaledVector(na, a);
yh.subVectors(e, o);
const g = na.dot(yh), m = oa.dot(yh);
if (m >= 0 && g <= m)
return t.copy(o);
const d = g * l - c * m;
if (d <= 0 && l >= 0 && m <= 0)
return s = l / (l - m), t.copy(r).addScaledVector(oa, s);
const y = h * m - g * u;
if (y <= 0 && u - h >= 0 && g - m >= 0)
return wg.subVectors(o, n), s = (u - h) / (u - h + (g - m)), t.copy(n).addScaledVector(wg, s);
const f = 1 / (y + d + p);
return a = d * f, s = p * f, t.copy(r).addScaledVector(na, a).addScaledVector(oa, s);
}
equals(e) {
return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c);
}
}
let AO = 0;
class Qt extends to {
constructor() {
super(), Object.defineProperty(this, "id", { value: AO++ }), this.uuid = qi(), this.name = "", this.type = "Material", this.fog = !0, this.blending = Sa, this.side = qn, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.blendSrc = Vp, this.blendDst = Up, this.blendEquation = bo, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.depthFunc = Kc, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = hx, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Uc, this.stencilZFail = Uc, this.stencilZPass = Uc, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaTest = 0, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0;
}
onBuild() {
}
onBeforeCompile() {
}
customProgramCacheKey() {
return this.onBeforeCompile.toString();
}
setValues(e) {
if (e !== void 0)
for (const t in e) {
const r = e[t];
if (r === void 0) {
console.warn("THREE.Material: '" + t + "' parameter is undefined.");
continue;
}
if (t === "shading") {
console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."), this.flatShading = r === Fp;
continue;
}
const n = this[t];
if (n === void 0) {
console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.");
continue;
}
n && n.isColor ? n.set(r) : n && n.isVector3 && r && r.isVector3 ? n.copy(r) : this[t] = r;
}
}
toJSON(e) {
const t = e === void 0 || typeof e == "string";
t && (e = {
textures: {},
images: {}
});
const r = {
metadata: {
version: 4.5,
type: "Material",
generator: "Material.toJSON"
}
};
r.uuid = this.uuid, r.type = this.type, this.name !== "" && (r.name = this.name), this.color && this.color.isColor && (r.color = this.color.getHex()), this.roughness !== void 0 && (r.roughness = this.roughness), this.metalness !== void 0 && (r.metalness = this.metalness), this.sheen && this.sheen.isColor && (r.sheen = this.sheen.getHex()), this.emissive && this.emissive.isColor && (r.emissive = this.emissive.getHex()), this.emissiveIntensity && this.emissiveIntensity !== 1 && (r.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (r.specular = this.specular.getHex()), this.shininess !== void 0 && (r.shininess = this.shininess), this.clearcoat !== void 0 && (r.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (r.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (r.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (r.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (r.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, r.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.map && this.map.isTexture && (r.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (r.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (r.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (r.lightMap = this.lightMap.toJSON(e).uuid, r.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (r.aoMap = this.aoMap.toJSON(e).uuid, r.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (r.bumpMap = this.bumpMap.toJSON(e).uuid, r.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (r.normalMap = this.normalMap.toJSON(e).uuid, r.normalMapType = this.normalMapType, r.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (r.displacementMap = this.displacementMap.toJSON(e).uuid, r.displacementScale = this.displacementScale, r.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (r.specularMap = this.specularMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (r.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (r.combine = this.combine)), this.envMapIntensity !== void 0 && (r.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (r.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (r.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (r.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (r.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (r.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (r.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (r.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && (r.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (r.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (r.size = this.size), this.shadowSide !== null && (r.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (r.sizeAttenuation = this.sizeAttenuation), this.blending !== Sa && (r.blending = this.blending), this.side !== qn && (r.side = this.side), this.vertexColors && (r.vertexColors = !0), this.opacity < 1 && (r.opacity = this.opacity), this.transparent === !0 && (r.transparent = this.transparent), r.depthFunc = this.depthFunc, r.depthTest = this.depthTest, r.depthWrite = this.depthWrite, r.colorWrite = this.colorWrite, r.stencilWrite = this.stencilWrite, r.stencilWriteMask = this.stencilWriteMask, r.stencilFunc = this.stencilFunc, r.stencilRef = this.stencilRef, r.stencilFuncMask = this.stencilFuncMask, r.stencilFail = this.stencilFail, r.stencilZFail = this.stencilZFail, r.stencilZPass = this.stencilZPass, this.rotation && this.rotation !== 0 && (r.rotation = this.rotation), this.polygonOffset === !0 && (r.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (r.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (r.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth && this.linewidth !== 1 && (r.linewidth = this.linewidth), this.dashSize !== void 0 && (r.dashSize = this.dashSize), this.gapSize !== void 0 && (r.gapSize = this.gapSize), this.scale !== void 0 && (r.scale = this.scale), this.dithering === !0 && (r.dithering = !0), this.alphaTest > 0 && (r.alphaTest = this.alphaTest), this.alphaToCoverage === !0 && (r.alphaToCoverage = this.alphaToCoverage), this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha), this.wireframe === !0 && (r.wireframe = this.wireframe), this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (r.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (r.wireframeLinejoin = this.wireframeLinejoin), this.morphTargets === !0 && (r.morphTargets = !0), this.morphNormals === !0 && (r.morphNormals = !0), this.flatShading === !0 && (r.flatShading = this.flatShading), this.visible === !1 && (r.visible = !1), this.toneMapped === !1 && (r.toneMapped = !1), JSON.stringify(this.userData) !== "{}" && (r.userData = this.userData);
function n(o) {
const a = [];
for (const s in o) {
const c = o[s];
delete c.metadata, a.push(c);
}
return a;
}
if (t) {
const o = n(e.textures), a = n(e.images);
o.length > 0 && (r.textures = o), a.length > 0 && (r.images = a);
}
return r;
}
clone() {
return new this.constructor().copy(this);
}
copy(e) {
this.name = e.name, this.fog = e.fog, this.blending = e.blending, this.side = e.side, this.vertexColors = e.vertexColors, this.opacity = e.opacity, this.transparent = e.transparent, this.blendSrc = e.blendSrc, this.blendDst = e.blendDst, this.blendEquation = e.blendEquation, this.blendSrcAlpha = e.blendSrcAlpha, this.blendDstAlpha = e.blendDstAlpha, this.blendEquationAlpha = e.blendEquationAlpha, this.depthFunc = e.depthFunc, this.depthTest = e.depthTest, this.depthWrite = e.depthWrite, this.stencilWriteMask = e.stencilWriteMask, this.stencilFunc = e.stencilFunc, this.stencilRef = e.stencilRef, this.stencilFuncMask = e.stencilFuncMask, this.stencilFail = e.stencilFail, this.stencilZFail = e.stencilZFail, this.stencilZPass = e.stencilZPass, this.stencilWrite = e.stencilWrite;
const t = e.clippingPlanes;
let r = null;
if (t !== null) {
const n = t.length;
r = new Array(n);
for (let o = 0; o !== n; ++o)
r[o] = t[o].clone();
}
return this.clippingPlanes = r, this.clipIntersection = e.clipIntersection, this.clipShadows = e.clipShadows, this.shadowSide = e.shadowSide, this.colorWrite = e.colorWrite, this.precision = e.precision, this.polygonOffset = e.polygonOffset, this.polygonOffsetFactor = e.polygonOffsetFactor, this.polygonOffsetUnits = e.polygonOffsetUnits, this.dithering = e.dithering, this.alphaTest = e.alphaTest, this.alphaToCoverage = e.alphaToCoverage, this.premultipliedAlpha = e.premultipliedAlpha, this.visible = e.visible, this.toneMapped = e.toneMapped, this.userData = JSON.parse(JSON.stringify(e.userData)), this;
}
dispose() {
this.dispatchEvent({ type: "dispose" });
}
set needsUpdate(e) {
e === !0 && this.version++;
}
}
Qt.prototype.isMaterial = !0;
const mx = {
aliceblue: 15792383,
antiquewhite: 16444375,
aqua: 65535,
aquamarine: 8388564,
azure: 15794175,
beige: 16119260,
bisque: 16770244,
black: 0,
blanchedalmond: 16772045,
blue: 255,
blueviolet: 9055202,
brown: 10824234,
burlywood: 14596231,
cadetblue: 6266528,
chartreuse: 8388352,
chocolate: 13789470,
coral: 16744272,
cornflowerblue: 6591981,
cornsilk: 16775388,
crimson: 14423100,
cyan: 65535,
darkblue: 139,
darkcyan: 35723,
darkgoldenrod: 12092939,
darkgray: 11119017,
darkgreen: 25600,
darkgrey: 11119017,
darkkhaki: 12433259,
darkmagenta: 9109643,
darkolivegreen: 5597999,
darkorange: 16747520,
darkorchid: 10040012,
darkred: 9109504,
darksalmon: 15308410,
darkseagreen: 9419919,
darkslateblue: 4734347,
darkslategray: 3100495,
darkslategrey: 3100495,
darkturquoise: 52945,
darkviolet: 9699539,
deeppink: 16716947,
deepskyblue: 49151,
dimgray: 6908265,
dimgrey: 6908265,
dodgerblue: 2003199,
firebrick: 11674146,
floralwhite: 16775920,
forestgreen: 2263842,
fuchsia: 16711935,
gainsboro: 14474460,
ghostwhite: 16316671,
gold: 16766720,
goldenrod: 14329120,
gray: 8421504,
green: 32768,
greenyellow: 11403055,
grey: 8421504,
honeydew: 15794160,
hotpink: 16738740,
indianred: 13458524,
indigo: 4915330,
ivory: 16777200,
khaki: 15787660,
lavender: 15132410,
lavenderblush: 16773365,
lawngreen: 8190976,
lemonchiffon: 16775885,
lightblue: 11393254,
lightcoral: 15761536,
lightcyan: 14745599,
lightgoldenrodyellow: 16448210,
lightgray: 13882323,
lightgreen: 9498256,
lightgrey: 13882323,
lightpink: 16758465,
lightsalmon: 16752762,
lightseagreen: 2142890,
lightskyblue: 8900346,
lightslategray: 7833753,
lightslategrey: 7833753,
lightsteelblue: 11584734,
lightyellow: 16777184,
lime: 65280,
limegreen: 3329330,
linen: 16445670,
magenta: 16711935,
maroon: 8388608,
mediumaquamarine: 6737322,
mediumblue: 205,
mediumorchid: 12211667,
mediumpurple: 9662683,
mediumseagreen: 3978097,
mediumslateblue: 8087790,
mediumspringgreen: 64154,
mediumturquoise: 4772300,
mediumvioletred: 13047173,
midnightblue: 1644912,
mintcream: 16121850,
mistyrose: 16770273,
moccasin: 16770229,
navajowhite: 16768685,
navy: 128,
oldlace: 16643558,
olive: 8421376,
olivedrab: 7048739,
orange: 16753920,
orangered: 16729344,
orchid: 14315734,
palegoldenrod: 15657130,
palegreen: 10025880,
paleturquoise: 11529966,
palevioletred: 14381203,
papayawhip: 16773077,
peachpuff: 16767673,
peru: 13468991,
pink: 16761035,
plum: 14524637,
powderblue: 11591910,
purple: 8388736,
rebeccapurple: 6697881,
red: 16711680,
rosybrown: 12357519,
royalblue: 4286945,
saddlebrown: 9127187,
salmon: 16416882,
sandybrown: 16032864,
seagreen: 3050327,
seashell: 16774638,
sienna: 10506797,
silver: 12632256,
skyblue: 8900331,
slateblue: 6970061,
slategray: 7372944,
slategrey: 7372944,
snow: 16775930,
springgreen: 65407,
steelblue: 4620980,
tan: 13808780,
teal: 32896,
thistle: 14204888,
tomato: 16737095,
turquoise: 4251856,
violet: 15631086,
wheat: 16113331,
white: 16777215,
whitesmoke: 16119285,
yellow: 16776960,
yellowgreen: 10145074
}, hr = { h: 0, s: 0, l: 0 }, Yl = { h: 0, s: 0, l: 0 };
function bh(i, e, t) {
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? i + (e - i) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? i + (e - i) * 6 * (2 / 3 - t) : i;
}
function xh(i) {
return i < 0.04045 ? i * 0.0773993808 : Math.pow(i * 0.9478672986 + 0.0521327014, 2.4);
}
function wh(i) {
return i < 31308e-7 ? i * 12.92 : 1.055 * Math.pow(i, 0.41666) - 0.055;
}
class Be {
constructor(e, t, r) {
return t === void 0 && r === void 0 ? this.set(e) : this.setRGB(e, t, r);
}
set(e) {
return e && e.isColor ? this.copy(e) : typeof e == "number" ? this.setHex(e) : typeof e == "string" && this.setStyle(e), this;
}
setScalar(e) {
return this.r = e, this.g = e, this.b = e, this;
}
setHex(e) {
return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (e & 255) / 255, this;
}
setRGB(e, t, r) {
return this.r = e, this.g = t, this.b = r, this;
}
setHSL(e, t, r) {
if (e = qp(e, 1), t = mi(t, 0, 1), r = mi(r, 0, 1), t === 0)
this.r = this.g = this.b = r;
else {
const n = r <= 0.5 ? r * (1 + t) : r + t - r * t, o = 2 * r - n;
this.r = bh(o, n, e + 1 / 3), this.g = bh(o, n, e), this.b = bh(o, n, e - 1 / 3);
}
return this;
}
setStyle(e) {
function t(n) {
n !== void 0 && parseFloat(n) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.");
}
let r;
if (r = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)) {
let n;
const o = r[1], a = r[2];
switch (o) {
case "rgb":
case "rgba":
if (n = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))
return this.r = Math.min(255, parseInt(n[1], 10)) / 255, this.g = Math.min(255, parseInt(n[2], 10)) / 255, this.b = Math.min(255, parseInt(n[3], 10)) / 255, t(n[4]), this;
if (n = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))
return this.r = Math.min(100, parseInt(n[1], 10)) / 100, this.g = Math.min(100, parseInt(n[2], 10)) / 100, this.b = Math.min(100, parseInt(n[3], 10)) / 100, t(n[4]), this;
break;
case "hsl":
case "hsla":
if (n = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)) {
const s = parseFloat(n[1]) / 360, c = parseInt(n[2], 10) / 100, l = parseInt(n[3], 10) / 100;
return t(n[4]), this.setHSL(s, c, l);
}
break;
}
} else if (r = /^\#([A-Fa-f\d]+)$/.exec(e)) {
const n = r[1], o = n.length;
if (o === 3)
return this.r = parseInt(n.charAt(0) + n.charAt(0), 16) / 255, this.g = parseInt(n.charAt(1) + n.charAt(1), 16) / 255, this.b = parseInt(n.charAt(2) + n.charAt(2), 16) / 255, this;
if (o === 6)
return this.r = parseInt(n.charAt(0) + n.charAt(1), 16) / 255, this.g = parseInt(n.charAt(2) + n.charAt(3), 16) / 255, this.b = parseInt(n.charAt(4) + n.charAt(5), 16) / 255, this;
}
return e && e.length > 0 ? this.setColorName(e) : this;
}
setColorName(e) {
const t = mx[e.toLowerCase()];
return t !== void 0 ? this.setHex(t) : console.warn("THREE.Color: Unknown color " + e), this;
}
clone() {
return new this.constructor(this.r, this.g, this.b);
}
copy(e) {
return this.r = e.r, this.g = e.g, this.b = e.b, this;
}
copyGammaToLinear(e, t = 2) {
return this.r = Math.pow(e.r, t), this.g = Math.pow(e.g, t), this.b = Math.pow(e.b, t), this;
}
copyLinearToGamma(e, t = 2) {
const r = t > 0 ? 1 / t : 1;
return this.r = Math.pow(e.r, r), this.g = Math.pow(e.g, r), this.b = Math.pow(e.b, r), this;
}
convertGammaToLinear(e) {
return this.copyGammaToLinear(this, e), this;
}
convertLinearToGamma(e) {
return this.copyLinearToGamma(this, e), this;
}
copySRGBToLinear(e) {
return this.r = xh(e.r), this.g = xh(e.g), this.b = xh(e.b), this;
}
copyLinearToSRGB(e) {
return this.r = wh(e.r), this.g = wh(e.g), this.b = wh(e.b), this;
}
convertSRGBToLinear() {
return this.copySRGBToLinear(this), this;
}
convertLinearToSRGB() {
return this.copyLinearToSRGB(this), this;
}
getHex() {
return this.r * 255 << 16 ^ this.g * 255 << 8 ^ this.b * 255 << 0;
}
getHexString() {
return ("000000" + this.getHex().toString(16)).slice(-6);
}
getHSL(e) {
const t = this.r, r = this.g, n = this.b, o = Math.max(t, r, n), a = Math.min(t, r, n);
let s, c;
const l = (a + o) / 2;
if (a === o)
s = 0, c = 0;
else {
const h = o - a;
switch (c = l <= 0.5 ? h / (o + a) : h / (2 - o - a), o) {
case t:
s = (r - n) / h + (r < n ? 6 : 0);
break;
case r:
s = (n - t) / h + 2;
break;
case n:
s = (t - r) / h + 4;
break;
}
s /= 6;
}
return e.h = s, e.s = c, e.l = l, e;
}
getStyle() {
return "rgb(" + (this.r * 255 | 0) + "," + (this.g * 255 | 0) + "," + (this.b * 255 | 0) + ")";
}
offsetHSL(e, t, r) {
return this.getHSL(hr), hr.h += e, hr.s += t, hr.l += r, this.setHSL(hr.h, hr.s, hr.l), this;
}
add(e) {
return this.r += e.r, this.g += e.g, this.b += e.b, this;
}
addColors(e, t) {
return this.r = e.r + t.r, this.g = e.g + t.g, this.b = e.b + t.b, this;
}
addScalar(e) {
return this.r += e, this.g += e, this.b += e, this;
}
sub(e) {
return this.r = Math.max(0, this.r - e.r), this.g = Math.max(0, this.g - e.g), this.b = Math.max(0, this.b - e.b), this;
}
multiply(e) {
return this.r *= e.r, this.g *= e.g, this.b *= e.b, this;
}
multiplyScalar(e) {
return this.r *= e, this.g *= e, this.b *= e, this;
}
lerp(e, t) {
return this.r += (e.r - this.r) * t, this.g += (e.g - this.g) * t, this.b += (e.b - this.b) * t, this;
}
lerpColors(e, t, r) {
return this.r = e.r + (t.r - e.r) * r, this.g = e.g + (t.g - e.g) * r, this.b = e.b + (t.b - e.b) * r, this;
}
lerpHSL(e, t) {
this.getHSL(hr), e.getHSL(Yl);
const r = Us(hr.h, Yl.h, t), n = Us(hr.s, Yl.s, t), o = Us(hr.l, Yl.l, t);
return this.setHSL(r, n, o), this;
}
equals(e) {
return e.r === this.r && e.g === this.g && e.b === this.b;
}
fromArray(e, t = 0) {
return this.r = e[t], this.g = e[t + 1], this.b = e[t + 2], this;
}
toArray(e = [], t = 0) {
return e[t] = this.r, e[t + 1] = this.g, e[t + 2] = this.b, e;
}
fromBufferAttribute(e, t) {
return this.r = e.getX(t), this.g = e.getY(t), this.b = e.getZ(t), e.normalized === !0 && (this.r /= 255, this.g /= 255, this.b /= 255), this;
}
toJSON() {
return this.getHex();
}
}
Be.NAMES = mx;
Be.prototype.isColor = !0;
Be.prototype.r = 1;
Be.prototype.g = 1;
Be.prototype.b = 1;
class ki extends Qt {
constructor(e) {
super(), this.type = "MeshBasicMaterial", this.color = new Be(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = vl, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = !1, this.setValues(e);
}
copy(e) {
return super.copy(e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this;
}
}
ki.prototype.isMeshBasicMaterial = !0;
const Tt = /* @__PURE__ */ new Z(), Jl = /* @__PURE__ */ new Oe();
class tt {
constructor(e, t, r) {
if (Array.isArray(e))
throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = r === !0, this.usage = za, this.updateRange = { offset: 0, count: -1 }, this.version = 0;
}
onUploadCallback() {
}
set needsUpdate(e) {
e === !0 && this.version++;
}
setUsage(e) {
return this.usage = e, this;
}
copy(e) {
return this.name = e.name, this.array = new e.array.constructor(e.array), this.itemSize = e.itemSize, this.count = e.count, this.normalized = e.normalized, this.usage = e.usage, this;
}
copyAt(e, t, r) {
e *= this.itemSize, r *= t.itemSize;
for (let n = 0, o = this.itemSize; n < o; n++)
this.array[e + n] = t.array[r + n];
return this;
}
copyArray(e) {
return this.array.set(e), this;
}
copyColorsArray(e) {
const t = this.array;
let r = 0;
for (let n = 0, o = e.length; n < o; n++) {
let a = e[n];
a === void 0 && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n), a = new Be()), t[r++] = a.r, t[r++] = a.g, t[r++] = a.b;
}
return this;
}
copyVector2sArray(e) {
const t = this.array;
let r = 0;
for (let n = 0, o = e.length; n < o; n++) {
let a = e[n];
a === void 0 && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n), a = new Oe()), t[r++] = a.x, t[r++] = a.y;
}
return this;
}
copyVector3sArray(e) {
const t = this.array;
let r = 0;
for (let n = 0, o = e.length; n < o; n++) {
let a = e[n];
a === void 0 && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n), a = new Z()), t[r++] = a.x, t[r++] = a.y, t[r++] = a.z;
}
return this;
}
copyVector4sArray(e) {
const t = this.array;
let r = 0;
for (let n = 0, o = e.length; n < o; n++) {
let a = e[n];
a === void 0 && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n), a = new Mt()), t[r++] = a.x, t[r++] = a.y, t[r++] = a.z, t[r++] = a.w;
}
return this;
}
applyMatrix3(e) {
if (this.itemSize === 2)
for (let t = 0, r = this.count; t < r; t++)
Jl.fromBufferAttribute(this, t), Jl.applyMatrix3(e), this.setXY(t, Jl.x, Jl.y);
else if (this.itemSize === 3)
for (let t = 0, r = this.count; t < r; t++)
Tt.fromBufferAttribute(this, t), Tt.applyMatrix3(e), this.setXYZ(t, Tt.x, Tt.y, Tt.z);
return this;
}
applyMatrix4(e) {
for (let t = 0, r = this.count; t < r; t++)
Tt.x = this.getX(t), Tt.y = this.getY(t), Tt.z = this.getZ(t), Tt.applyMatrix4(e), this.setXYZ(t, Tt.x, Tt.y, Tt.z);
return this;
}
applyNormalMatrix(e) {
for (let t = 0, r = this.count; t < r; t++)
Tt.x = this.getX(t), Tt.y = this.getY(t), Tt.z = this.getZ(t), Tt.applyNormalMatrix(e), this.setXYZ(t, Tt.x, Tt.y, Tt.z);
return this;
}
transformDirection(e) {
for (let t = 0, r = this.count; t < r; t++)
Tt.x = this.getX(t), Tt.y = this.getY(t), Tt.z = this.getZ(t), Tt.transformDirection(e), this.setXYZ(t, Tt.x, Tt.y, Tt.z);
return this;
}
set(e, t = 0) {
return this.array.set(e, t), this;
}
getX(e) {
return this.array[e * this.itemSize];
}
setX(e, t) {
return this.array[e * this.itemSize] = t, this;
}
getY(e) {
return this.array[e * this.itemSize + 1];
}
setY(e, t) {
return this.array[e * this.itemSize + 1] = t, this;
}
getZ(e) {
return this.array[e * this.itemSize + 2];
}
setZ(e, t) {
return this.array[e * this.itemSize + 2] = t, this;
}
getW(e) {
return this.array[e * this.itemSize + 3];
}
setW(e, t) {
return this.array[e * this.itemSize + 3] = t, this;
}
setXY(e, t, r) {
return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = r, this;
}
setXYZ(e, t, r, n) {
return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = r, this.array[e + 2] = n, this;
}
setXYZW(e, t, r, n, o) {
return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = r, this.array[e + 2] = n, this.array[e + 3] = o, this;
}
onUpload(e) {
return this.onUploadCallback = e, this;
}
clone() {
return new this.constructor(this.array, this.itemSize).copy(this);
}
toJSON() {
const e = {
itemSize: this.itemSize,
type: this.array.constructor.name,
array: Array.prototype.slice.call(this.array),
normalized: this.normalized
};
return this.name !== "" && (e.name = this.name), this.usage !== za && (e.usage = this.usage), (this.updateRange.offset !== 0 || this.updateRange.count !== -1) && (e.updateRange = this.updateRange), e;
}
}
tt.prototype.isBufferAttribute = !0;
class gx extends tt {
constructor(e, t, r) {
super(new Int8Array(e), t, r);
}
}
class vx extends tt {
constructor(e, t, r) {
super(new Uint8Array(e), t, r);
}
}
class yx extends tt {
constructor(e, t, r) {
super(new Uint8ClampedArray(e), t, r);
}
}
class bx extends tt {
constructor(e, t, r) {
super(new Int16Array(e), t, r);
}
}
class Lu extends tt {
constructor(e, t, r) {
super(new Uint16Array(e), t, r);
}
}
class xx extends tt {
constructor(e, t, r) {
super(new Int32Array(e), t, r);
}
}
class Ru extends tt {
constructor(e, t, r) {
super(new Uint32Array(e), t, r);
}
}
class wx extends tt {
constructor(e, t, r) {
super(new Uint16Array(e), t, r);
}
}
wx.prototype.isFloat16BufferAttribute = !0;
class je extends tt {
constructor(e, t, r) {
super(new Float32Array(e), t, r);
}
}
class _x extends tt {
constructor(e, t, r) {
super(new Float64Array(e), t, r);
}
}
function Mx(i) {
if (i.length === 0) return -1 / 0;
let e = i[0];
for (let t = 1, r = i.length; t < r; ++t)
i[t] > e && (e = i[t]);
return e;
}
const CO = {
Int8Array,
Uint8Array,
Uint8ClampedArray,
Int16Array,
Uint16Array,
Int32Array,
Uint32Array,
Float32Array,
Float64Array
};
function _a(i, e) {
return new CO[i](e);
}
let LO = 0;
const Ki = /* @__PURE__ */ new $e(), _h = /* @__PURE__ */ new nt(), aa = /* @__PURE__ */ new Z(), Hi = /* @__PURE__ */ new Vi(), _s = /* @__PURE__ */ new Vi(), oi = /* @__PURE__ */ new Z();
class Je extends to {
constructor() {
super(), Object.defineProperty(this, "id", { value: LO++ }), this.uuid = qi(), this.name = "", this.type = "BufferGeometry", this.index = null, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = !1, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = { start: 0, count: 1 / 0 }, this.userData = {};
}
getIndex() {
return this.index;
}
setIndex(e) {
return Array.isArray(e) ? this.index = new (Mx(e) > 65535 ? Ru : Lu)(e, 1) : this.index = e, this;
}
getAttribute(e) {
return this.attributes[e];
}
setAttribute(e, t) {
return this.attributes[e] = t, this;
}
deleteAttribute(e) {
return delete this.attributes[e], this;
}
hasAttribute(e) {
return this.attributes[e] !== void 0;
}
addGroup(e, t, r = 0) {
this.groups.push({
start: e,
count: t,
materialIndex: r
});
}
clearGroups() {
this.groups = [];
}
setDrawRange(e, t) {
this.drawRange.start = e, this.drawRange.count = t;
}
applyMatrix4(e) {
const t = this.attributes.position;
t !== void 0 && (t.applyMatrix4(e), t.needsUpdate = !0);
const r = this.attributes.normal;
if (r !== void 0) {
const o = new ii().getNormalMatrix(e);
r.applyNormalMatrix(o), r.needsUpdate = !0;
}
const n = this.attributes.tangent;
return n !== void 0 && (n.transformDirection(e), n.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this;
}
applyQuaternion(e) {
return Ki.makeRotationFromQuaternion(e), this.applyMatrix4(Ki), this;
}
rotateX(e) {
return Ki.makeRotationX(e), this.applyMatrix4(Ki), this;
}
rotateY(e) {
return Ki.makeRotationY(e), this.applyMatrix4(Ki), this;
}
rotateZ(e) {
return Ki.makeRotationZ(e), this.applyMatrix4(Ki), this;
}
translate(e, t, r) {
return Ki.makeTranslation(e, t, r), this.applyMatrix4(Ki), this;
}
scale(e, t, r) {
return Ki.makeScale(e, t, r), this.applyMatrix4(Ki), this;
}
lookAt(e) {
return _h.lookAt(e), _h.updateMatrix(), this.applyMatrix4(_h.matrix), this;
}
center() {
return this.computeBoundingBox(), this.boundingBox.getCenter(aa).negate(), this.translate(aa.x, aa.y, aa.z), this;
}
setFromPoints(e) {
const t = [];
for (let r = 0, n = e.length; r < n; r++) {
const o = e[r];
t.push(o.x, o.y, o.z || 0);
}
return this.setAttribute("position", new je(t, 3)), this;
}
computeBoundingBox() {
this.boundingBox === null && (this.boundingBox = new Vi());
const e = this.attributes.position, t = this.morphAttributes.position;
if (e && e.isGLBufferAttribute) {
console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this), this.boundingBox.set(
new Z(-1 / 0, -1 / 0, -1 / 0),
new Z(1 / 0, 1 / 0, 1 / 0)
);
return;
}
if (e !== void 0) {
if (this.boundingBox.setFromBufferAttribute(e), t)
for (let r = 0, n = t.length; r < n; r++) {
const o = t[r];
Hi.setFromBufferAttribute(o), this.morphTargetsRelative ? (oi.addVectors(this.boundingBox.min, Hi.min), this.boundingBox.expandByPoint(oi), oi.addVectors(this.boundingBox.max, Hi.max), this.boundingBox.expandByPoint(oi)) : (this.boundingBox.expandByPoint(Hi.min), this.boundingBox.expandByPoint(Hi.max));
}
} else
this.boundingBox.makeEmpty();
(isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this);
}
computeBoundingSphere() {
this.boundingSphere === null && (this.boundingSphere = new bn());
const e = this.attributes.position, t = this.morphAttributes.position;
if (e && e.isGLBufferAttribute) {
console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this), this.boundingSphere.set(new Z(), 1 / 0);
return;
}
if (e) {
const r = this.boundingSphere.center;
if (Hi.setFromBufferAttribute(e), t)
for (let o = 0, a = t.length; o < a; o++) {
const s = t[o];
_s.setFromBufferAttribute(s), this.morphTargetsRelative ? (oi.addVectors(Hi.min, _s.min), Hi.expandByPoint(oi), oi.addVectors(Hi.max, _s.max), Hi.expandByPoint(oi)) : (Hi.expandByPoint(_s.min), Hi.expandByPoint(_s.max));
}
Hi.getCenter(r);
let n = 0;
for (let o = 0, a = e.count; o < a; o++)
oi.fromBufferAttribute(e, o), n = Math.max(n, r.distanceToSquared(oi));
if (t)
for (let o = 0, a = t.length; o < a; o++) {
const s = t[o], c = this.morphTargetsRelative;
for (let l = 0, h = s.count; l < h; l++)
oi.fromBufferAttribute(s, l), c && (aa.fromBufferAttribute(e, l), oi.add(aa)), n = Math.max(n, r.distanceToSquared(oi));
}
this.boundingSphere.radius = Math.sqrt(n), isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this);
}
}
computeFaceNormals() {
}
computeTangents() {
const e = this.index, t = this.attributes;
if (e === null || t.position === void 0 || t.normal === void 0 || t.uv === void 0) {
console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");
return;
}
const r = e.array, n = t.position.array, o = t.normal.array, a = t.uv.array, s = n.length / 3;
t.tangent === void 0 && this.setAttribute("tangent", new tt(new Float32Array(4 * s), 4));
const c = t.tangent.array, l = [], h = [];
for (let E = 0; E < s; E++)
l[E] = new Z(), h[E] = new Z();
const u = new Z(), p = new Z(), g = new Z(), m = new Oe(), d = new Oe(), y = new Oe(), f = new Z(), v = new Z();
function M(E, O, L) {
u.fromArray(n, E * 3), p.fromArray(n, O * 3), g.fromArray(n, L * 3), m.fromArray(a, E * 2), d.fromArray(a, O * 2), y.fromArray(a, L * 2), p.sub(u), g.sub(u), d.sub(m), y.sub(m);
const C = 1 / (d.x * y.y - y.x * d.y);
isFinite(C) && (f.copy(p).multiplyScalar(y.y).addScaledVector(g, -d.y).multiplyScalar(C), v.copy(g).multiplyScalar(d.x).addScaledVector(p, -y.x).multiplyScalar(C), l[E].add(f), l[O].add(f), l[L].add(f), h[E].add(v), h[O].add(v), h[L].add(v));
}
let S = this.groups;
S.length === 0 && (S = [{
start: 0,
count: r.length
}]);
for (let E = 0, O = S.length; E < O; ++E) {
const L = S[E], C = L.start, I = L.count;
for (let R = C, b = C + I; R < b; R += 3)
M(
r[R + 0],
r[R + 1],
r[R + 2]
);
}
const T = new Z(), x = new Z(), w = new Z(), A = new Z();
function _(E) {
w.fromArray(o, E * 3), A.copy(w);
const O = l[E];
T.copy(O), T.sub(w.multiplyScalar(w.dot(O))).normalize(), x.crossVectors(A, O);
const L = x.dot(h[E]) < 0 ? -1 : 1;
c[E * 4] = T.x, c[E * 4 + 1] = T.y, c[E * 4 + 2] = T.z, c[E * 4 + 3] = L;
}
for (let E = 0, O = S.length; E < O; ++E) {
const L = S[E], C = L.start, I = L.count;
for (let R = C, b = C + I; R < b; R += 3)
_(r[R + 0]), _(r[R + 1]), _(r[R + 2]);
}
}
computeVertexNormals() {
const e = this.index, t = this.getAttribute("position");
if (t !== void 0) {
let r = this.getAttribute("normal");
if (r === void 0)
r = new tt(new Float32Array(t.count * 3), 3), this.setAttribute("normal", r);
else
for (let p = 0, g = r.count; p < g; p++)
r.setXYZ(p, 0, 0, 0);
const n = new Z(), o = new Z(), a = new Z(), s = new Z(), c = new Z(), l = new Z(), h = new Z(), u = new Z();
if (e)
for (let p = 0, g = e.count; p < g; p += 3) {
const m = e.getX(p + 0), d = e.getX(p + 1), y = e.getX(p + 2);
n.fromBufferAttribute(t, m), o.fromBufferAttribute(t, d), a.fromBufferAttribute(t, y), h.subVectors(a, o), u.subVectors(n, o), h.cross(u), s.fromBufferAttribute(r, m), c.fromBufferAttribute(r, d), l.fromBufferAttribute(r, y), s.add(h), c.add(h), l.add(h), r.setXYZ(m, s.x, s.y, s.z), r.setXYZ(d, c.x, c.y, c.z), r.setXYZ(y, l.x, l.y, l.z);
}
else
for (let p = 0, g = t.count; p < g; p += 3)
n.fromBufferAttribute(t, p + 0), o.fromBufferAttribute(t, p + 1), a.fromBufferAttribute(t, p + 2), h.subVectors(a, o), u.subVectors(n, o), h.cross(u), r.setXYZ(p + 0, h.x, h.y, h.z), r.setXYZ(p + 1, h.x, h.y, h.z), r.setXYZ(p + 2, h.x, h.y, h.z);
this.normalizeNormals(), r.needsUpdate = !0;
}
}
merge(e, t) {
if (!(e && e.isBufferGeometry)) {
console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
return;
}
t === void 0 && (t = 0, console.warn(
"THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."
));
const r = this.attributes;
for (const n in r) {
if (e.attributes[n] === void 0) continue;
const o = r[n].array, a = e.attributes[n], s = a.array, c = a.itemSize * t, l = Math.min(s.length, o.length - c);
for (let h = 0, u = c; h < l; h++, u++)
o[u] = s[h];
}
return this;
}
normalizeNormals() {
const e = this.attributes.normal;
for (let t = 0, r = e.count; t < r; t++)
oi.fromBufferAttribute(e, t), oi.normalize(), e.setXYZ(t, oi.x, oi.y, oi.z);
}
toNonIndexed() {
function e(s, c) {
const l = s.array, h = s.itemSize, u = s.normalized, p = new l.constructor(c.length * h);
let g = 0, m = 0;
for (let d = 0, y = c.length; d < y; d++) {
s.isInterleavedBufferAttribute ? g = c[d] * s.data.stride + s.offset : g = c[d] * h;
for (let f = 0; f < h; f++)
p[m++] = l[g++];
}
return new tt(p, h, u);
}
if (this.index === null)
return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."), this;
const t = new Je(), r = this.index.array, n = this.attributes;
for (const s in n) {
const c = n[s], l = e(c, r);
t.setAttribute(s, l);
}
const o = this.morphAttributes;
for (const s in o) {
const c = [], l = o[s];
for (let h = 0, u = l.length; h < u; h++) {
const p = l[h], g = e(p, r);
c.push(g);
}
t.morphAttributes[s] = c;
}
t.morphTargetsRelative = this.morphTargetsRelative;
const a = this.groups;
for (let s = 0, c = a.length; s < c; s++) {
const l = a[s];
t.addGroup(l.start, l.count, l.materialIndex);
}
return t;
}
toJSON() {
const e = {
metadata: {
version: 4.5,
type: "BufferGeometry",
generator: "BufferGeometry.toJSON"
}
};
if (e.uuid = this.uuid, e.type = this.type, this.name !== "" && (e.name = this.name), Object.keys(this.userData).length > 0 && (e.userData = this.userData), this.parameters !== void 0) {
const c = this.parameters;
for (const l in c)
c[l] !== void 0 && (e[l] = c[l]);
return e;
}
e.data = { attributes: {} };
const t = this.index;
t !== null && (e.data.index = {
type: t.array.constructor.name,
array: Array.prototype.slice.call(t.array)
});
const r = this.attributes;
for (const c in r) {
const l = r[c];
e.data.attributes[c] = l.toJSON(e.data);
}
const n = {};
let o = !1;
for (const c in this.morphAttributes) {
const l = this.morphAttributes[c], h = [];
for (let u = 0, p = l.length; u < p; u++) {
const g = l[u];
h.push(g.toJSON(e.data));
}
h.length > 0 && (n[c] = h, o = !0);
}
o && (e.data.morphAttributes = n, e.data.morphTargetsRelative = this.morphTargetsRelative);
const a = this.groups;
a.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(a)));
const s = this.boundingSphere;
return s !== null && (e.data.boundingSphere = {
center: s.center.toArray(),
radius: s.radius
}), e;
}
clone() {
return new Je().copy(this);
}
copy(e) {
this.index = null, this.attributes = {}, this.morphAttributes = {}, this.groups = [], this.boundingBox = null, this.boundingSphere = null;
const t = {};
this.name = e.name;
const r = e.index;
r !== null && this.setIndex(r.clone(t));
const n = e.attributes;
for (const l in n) {
const h = n[l];
this.setAttribute(l, h.clone(t));
}
const o = e.morphAttributes;
for (const l in o) {
const h = [], u = o[l];
for (let p = 0, g = u.length; p < g; p++)
h.push(u[p].clone(t));
this.morphAttributes[l] = h;
}
this.morphTargetsRelative = e.morphTargetsRelative;
const a = e.groups;
for (let l = 0, h = a.length; l < h; l++) {
const u = a[l];
this.addGroup(u.start, u.count, u.materialIndex);
}
const s = e.boundingBox;
s !== null && (this.boundingBox = s.clone());
const c = e.boundingSphere;
return c !== null && (this.boundingSphere = c.clone()), this.drawRange.start = e.drawRange.start, this.drawRange.count = e.drawRange.count, this.userData = e.userData, this;
}
dispose() {
this.dispatchEvent({ type: "dispose" });
}
}
Je.prototype.isBufferGeometry = !0;
const _g = /* @__PURE__ */ new $e(), sa = /* @__PURE__ */ new io(), Mh = /* @__PURE__ */ new bn(), En = /* @__PURE__ */ new Z(), An = /* @__PURE__ */ new Z(), Cn = /* @__PURE__ */ new Z(), Sh = /* @__PURE__ */ new Z(), Th = /* @__PURE__ */ new Z(), Eh = /* @__PURE__ */ new Z(), Kl = /* @__PURE__ */ new Z(), Ql = /* @__PURE__ */ new Z(), ec = /* @__PURE__ */ new Z(), tc = /* @__PURE__ */ new Oe(), ic = /* @__PURE__ */ new Oe(), rc = /* @__PURE__ */ new Oe(), Ah = /* @__PURE__ */ new Z(), nc = /* @__PURE__ */ new Z();
class Yt extends nt {
constructor(e = new Je(), t = new ki()) {
super(), this.type = "Mesh", this.geometry = e, this.material = t, this.updateMorphTargets();
}
copy(e) {
return super.copy(e), e.morphTargetInfluences !== void 0 && (this.morphTargetInfluences = e.morphTargetInfluences.slice()), e.morphTargetDictionary !== void 0 && (this.morphTargetDictionary = Object.assign({}, e.morphTargetDictionary)), this.material = e.material, this.geometry = e.geometry, this;
}
updateMorphTargets() {
const e = this.geometry;
if (e.isBufferGeometry) {
const t = e.morphAttributes, r = Object.keys(t);
if (r.length > 0) {
const n = t[r[0]];
if (n !== void 0) {
this.morphTargetInfluences = [], this.morphTargetDictionary = {};
for (let o = 0, a = n.length; o < a; o++) {
const s = n[o].name || String(o);
this.morphTargetInfluences.push(0), this.morphTargetDictionary[s] = o;
}
}
}
} else {
const t = e.morphTargets;
t !== void 0 && t.length > 0 && console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");
}
}
raycast(e, t) {
const r = this.geometry, n = this.material, o = this.matrixWorld;
if (n === void 0 || (r.boundingSphere === null && r.computeBoundingSphere(), Mh.copy(r.boundingSphere), Mh.applyMatrix4(o), e.ray.intersectsSphere(Mh) === !1) || (_g.copy(o).invert(), sa.copy(e.ray).applyMatrix4(_g), r.boundingBox !== null && sa.intersectsBox(r.boundingBox) === !1))
return;
let a;
if (r.isBufferGeometry) {
const s = r.index, c = r.attributes.position, l = r.morphAttributes.position, h = r.morphTargetsRelative, u = r.attributes.uv, p = r.attributes.uv2, g = r.groups, m = r.drawRange;
if (s !== null)
if (Array.isArray(n))
for (let d = 0, y = g.length; d < y; d++) {
const f = g[d], v = n[f.materialIndex], M = Math.max(f.start, m.start), S = Math.min(f.start + f.count, m.start + m.count);
for (let T = M, x = S; T < x; T += 3) {
const w = s.getX(T), A = s.getX(T + 1), _ = s.getX(T + 2);
a = oc(this, v, e, sa, c, l, h, u, p, w, A, _), a && (a.faceIndex = Math.floor(T / 3), a.face.materialIndex = f.materialIndex, t.push(a));
}
}
else {
const d = Math.max(0, m.start), y = Math.min(s.count, m.start + m.count);
for (let f = d, v = y; f < v; f += 3) {
const M = s.getX(f), S = s.getX(f + 1), T = s.getX(f + 2);
a = oc(this, n, e, sa, c, l, h, u, p, M, S, T), a && (a.faceIndex = Math.floor(f / 3), t.push(a));
}
}
else if (c !== void 0)
if (Array.isArray(n))
for (let d = 0, y = g.length; d < y; d++) {
const f = g[d], v = n[f.materialIndex], M = Math.max(f.start, m.start), S = Math.min(f.start + f.count, m.start + m.count);
for (let T = M, x = S; T < x; T += 3) {
const w = T, A = T + 1, _ = T + 2;
a = oc(this, v, e, sa, c, l, h, u, p, w, A, _), a && (a.faceIndex = Math.floor(T / 3), a.face.materialIndex = f.materialIndex, t.push(a));
}
}
else {
const d = Math.max(0, m.start), y = Math.min(c.count, m.start + m.count);
for (let f = d, v = y; f < v; f += 3) {
const M = f, S = f + 1, T = f + 2;
a = oc(this, n, e, sa, c, l, h, u, p, M, S, T), a && (a.faceIndex = Math.floor(f / 3), t.push(a));
}
}
} else r.isGeometry && console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");
}
}
Yt.prototype.isMesh = !0;
function RO(i, e, t, r, n, o, a, s) {
let c;
if (e.side === $t ? c = r.intersectTriangle(a, o, n, !0, s) : c = r.intersectTriangle(n, o, a, e.side !== Xn, s), c === null) return null;
nc.copy(s), nc.applyMatrix4(i.matrixWorld);
const l = t.ray.origin.distanceTo(nc);
return l < t.near || l > t.far ? null : {
distance: l,
point: nc.clone(),
object: i
};
}
function oc(i, e, t, r, n, o, a, s, c, l, h, u) {
En.fromBufferAttribute(n, l), An.fromBufferAttribute(n, h), Cn.fromBufferAttribute(n, u);
const p = i.morphTargetInfluences;
if (e.morphTargets && o && p) {
Kl.set(0, 0, 0), Ql.set(0, 0, 0), ec.set(0, 0, 0);
for (let m = 0, d = o.length; m < d; m++) {
const y = p[m], f = o[m];
y !== 0 && (Sh.fromBufferAttribute(f, l), Th.fromBufferAttribute(f, h), Eh.fromBufferAttribute(f, u), a ? (Kl.addScaledVector(Sh, y), Ql.addScaledVector(Th, y), ec.addScaledVector(Eh, y)) : (Kl.addScaledVector(Sh.sub(En), y), Ql.addScaledVector(Th.sub(An), y), ec.addScaledVector(Eh.sub(Cn), y)));
}
En.add(Kl), An.add(Ql), Cn.add(ec);
}
i.isSkinnedMesh && (i.boneTransform(l, En), i.boneTransform(h, An), i.boneTransform(u, Cn));
const g = RO(i, e, t, r, En, An, Cn, Ah);
if (g) {
s && (tc.fromBufferAttribute(s, l), ic.fromBufferAttribute(s, h), rc.fromBufferAttribute(s, u), g.uv = Xt.getUV(Ah, En, An, Cn, tc, ic, rc, new Oe())), c && (tc.fromBufferAttribute(c, l), ic.fromBufferAttribute(c, h), rc.fromBufferAttribute(c, u), g.uv2 = Xt.getUV(Ah, En, An, Cn, tc, ic, rc, new Oe()));
const m = {
a: l,
b: h,
c: u,
normal: new Z(),
materialIndex: 0
};
Xt.getNormal(En, An, Cn, m.normal), g.face = m;
}
return g;
}
class un extends Je {
constructor(e = 1, t = 1, r = 1, n = 1, o = 1, a = 1) {
super(), this.type = "BoxGeometry", this.parameters = {
width: e,
height: t,
depth: r,
widthSegments: n,
heightSegments: o,
depthSegments: a
};
const s = this;
n = Math.floor(n), o = Math.floor(o), a = Math.floor(a);
const c = [], l = [], h = [], u = [];
let p = 0, g = 0;
m("z", "y", "x", -1, -1, r, t, e, a, o, 0), m("z", "y", "x", 1, -1, r, t, -e, a, o, 1), m("x", "z", "y", 1, 1, e, r, t, n, a, 2), m("x", "z", "y", 1, -1, e, r, -t, n, a, 3), m("x", "y", "z", 1, -1, e, t, r, n, o, 4), m("x", "y", "z", -1, -1, e, t, -r, n, o, 5), this.setIndex(c), this.setAttribute("position", new je(l, 3)), this.setAttribute("normal", new je(h, 3)), this.setAttribute("uv", new je(u, 2));
function m(d, y, f, v, M, S, T, x, w, A, _) {
const E = S / w, O = T / A, L = S / 2, C = T / 2, I = x / 2, R = w + 1, b = A + 1;
let P = 0, N = 0;
const D = new Z();
for (let k = 0; k < b; k++) {
const V = k * O - C;
for (let q = 0; q < R; q++) {
const Y = q * E - L;
D[d] = Y * v, D[y] = V * M, D[f] = I, l.push(D.x, D.y, D.z), D[d] = 0, D[y] = 0, D[f] = x > 0 ? 1 : -1, h.push(D.x, D.y, D.z), u.push(q / w), u.push(1 - k / A), P += 1;
}
}
for (let k = 0; k < A; k++)
for (let V = 0; V < w; V++) {
const q = p + V + R * k, Y = p + V + R * (k + 1), ne = p + (V + 1) + R * (k + 1), X = p + (V + 1) + R * k;
c.push(q, Y, X), c.push(Y, ne, X), N += 6;
}
s.addGroup(g, N, _), g += N, p += P;
}
}
static fromJSON(e) {
return new un(e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments);
}
}
function Va(i) {
const e = {};
for (const t in i) {
e[t] = {};
for (const r in i[t]) {
const n = i[t][r];
n && (n.isColor || n.isMatrix3 || n.isMatrix4 || n.isVector2 || n.isVector3 || n.isVector4 || n.isTexture || n.isQuaternion) ? e[t][r] = n.clone() : Array.isArray(n) ? e[t][r] = n.slice() : e[t][r] = n;
}
}
return e;
}
function wi(i) {
const e = {};
for (let t = 0; t < i.length; t++) {
const r = Va(i[t]);
for (const n in r)
e[n] = r[n];
}
return e;
}
const Sx = { clone: Va, merge: wi };
var OO = `void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`, PO = `void main() {
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;
class hn extends Qt {
constructor(e) {
super(), this.type = "ShaderMaterial", this.defines = {}, this.uniforms = {}, this.vertexShader = OO, this.fragmentShader = PO, this.linewidth = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.lights = !1, this.clipping = !1, this.morphTargets = !1, this.morphNormals = !1, this.extensions = {
derivatives: !1,
// set to use derivatives
fragDepth: !1,
// set to use fragment depth values
drawBuffers: !1,
// set to use draw buffers
shaderTextureLOD: !1
// set to use shader texture LOD
}, this.defaultAttributeValues = {
color: [1, 1, 1],
uv: [0, 0],
uv2: [0, 0]
}, this.index0AttributeName = void 0, this.uniformsNeedUpdate = !1, this.glslVersion = null, e !== void 0 && (e.attributes !== void 0 && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."), this.setValues(e));
}
copy(e) {
return super.copy(e), this.fragmentShader = e.fragmentShader, this.vertexShader = e.vertexShader, this.uniforms = Va(e.uniforms), this.defines = Object.assign({}, e.defines), this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.lights = e.lights, this.clipping = e.clipping, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.extensions = Object.assign({}, e.extensions), this.glslVersion = e.glslVersion, this;
}
toJSON(e) {
const t = super.toJSON(e);
t.glslVersion = this.glslVersion, t.uniforms = {};
for (const n in this.uniforms) {
const o = this.uniforms[n].value;
o && o.isTexture ? t.uniforms[n] = {
type: "t",
value: o.toJSON(e).uuid
} : o && o.isColor ? t.uniforms[n] = {
type: "c",
value: o.getHex()
} : o && o.isVector2 ? t.uniforms[n] = {
type: "v2",
value: o.toArray()
} : o && o.isVector3 ? t.uniforms[n] = {
type: "v3",
value: o.toArray()
} : o && o.isVector4 ? t.uniforms[n] = {
type: "v4",
value: o.toArray()
} : o && o.isMatrix3 ? t.uniforms[n] = {
type: "m3",
value: o.toArray()
} : o && o.isMatrix4 ? t.uniforms[n] = {
type: "m4",
value: o.toArray()
} : t.uniforms[n] = {
value: o
};
}
Object.keys(this.defines).length > 0 && (t.defines = this.defines), t.vertexShader = this.vertexShader, t.fragmentShader = this.fragmentShader;
const r = {};
for (const n in this.extensions)
this.extensions[n] === !0 && (r[n] = !0);
return Object.keys(r).length > 0 && (t.extensions = r), t;
}
}
hn.prototype.isShaderMaterial = !0;
class wl extends nt {
constructor() {
super(), this.type = "Camera", this.matrixWorldInverse = new $e(), this.projectionMatrix = new $e(), this.projectionMatrixInverse = new $e();
}
copy(e, t) {
return super.copy(e, t), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this.projectionMatrixInverse.copy(e.projectionMatrixInverse), this;
}
getWorldDirection(e) {
this.updateWorldMatrix(!0, !1);
const t = this.matrixWorld.elements;
return e.set(-t[8], -t[9], -t[10]).normalize();
}
updateMatrixWorld(e) {
super.updateMatrixWorld(e), this.matrixWorldInverse.copy(this.matrixWorld).invert();
}
updateWorldMatrix(e, t) {
super.updateWorldMatrix(e, t), this.matrixWorldInverse.copy(this.matrixWorld).invert();
}
clone() {
return new this.constructor().copy(this);
}
}
wl.prototype.isCamera = !0;
class ti extends wl {
constructor(e = 50, t = 1, r = 0.1, n = 2e3) {
super(), this.type = "PerspectiveCamera", this.fov = e, this.zoom = 1, this.near = r, this.far = n, this.focus = 10, this.aspect = t, this.view = null, this.filmGauge = 35, this.filmOffset = 0, this.updateProjectionMatrix();
}
copy(e, t) {
return super.copy(e, t), this.fov = e.fov, this.zoom = e.zoom, this.near = e.near, this.far = e.far, this.focus = e.focus, this.aspect = e.aspect, this.view = e.view === null ? null : Object.assign({}, e.view), this.filmGauge = e.filmGauge, this.filmOffset = e.filmOffset, this;
}
/**
* Sets the FOV by focal length in respect to the current .filmGauge.
*
* The default film gauge is 35, so that the focal length can be specified for
* a 35mm (full frame) camera.
*
* Values for focal length and film gauge must have the same unit.
*/
setFocalLength(e) {
const t = 0.5 * this.getFilmHeight() / e;
this.fov = il * 2 * Math.atan(t), this.updateProjectionMatrix();
}
/**
* Calculates the focal length from the current .fov and .filmGauge.
*/
getFocalLength() {
const e = Math.tan(Co * 0.5 * this.fov);
return 0.5 * this.getFilmHeight() / e;
}
getEffectiveFOV() {
return il * 2 * Math.atan(
Math.tan(Co * 0.5 * this.fov) / this.zoom
);
}
getFilmWidth() {
return this.filmGauge * Math.min(this.aspect, 1);
}
getFilmHeight() {
return this.filmGauge / Math.max(this.aspect, 1);
}
/**
* Sets an offset in a larger frustum. This is useful for multi-window or
* multi-monitor/multi-machine setups.
*
* For example, if you have 3x2 monitors and each monitor is 1920x1080 and
* the monitors are in grid like this
*
* +---+---+---+
* | A | B | C |
* +---+---+---+
* | D | E | F |
* +---+---+---+
*
* then for each monitor you would call it like this
*
* const w = 1920;
* const h = 1080;
* const fullWidth = w * 3;
* const fullHeight = h * 2;
*
* --A--
* camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );
* --B--
* camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );
* --C--
* camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );
* --D--
* camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );
* --E--
* camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );
* --F--
* camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
*
* Note there is no reason monitors have to be the same size or in a grid.
*/
setViewOffset(e, t, r, n, o, a) {
this.aspect = e / t, this.view === null && (this.view = {
enabled: !0,
fullWidth: 1,
fullHeight: 1,
offsetX: 0,
offsetY: 0,
width: 1,
height: 1
}), this.view.enabled = !0, this.view.fullWidth = e, this.view.fullHeight = t, this.view.offsetX = r, this.view.offsetY = n, this.view.width = o, this.view.height = a, this.updateProjectionMatrix();
}
clearViewOffset() {
this.view !== null && (this.view.enabled = !1), this.updateProjectionMatrix();
}
updateProjectionMatrix() {
const e = this.near;
let t = e * Math.tan(Co * 0.5 * this.fov) / this.zoom, r = 2 * t, n = this.aspect * r, o = -0.5 * n;
const a = this.view;
if (this.view !== null && this.view.enabled) {
const c = a.fullWidth, l = a.fullHeight;
o += a.offsetX * n / c, t -= a.offsetY * r / l, n *= a.width / c, r *= a.height / l;
}
const s = this.filmOffset;
s !== 0 && (o += e * s / this.getFilmWidth()), this.projectionMatrix.makePerspective(o, o + n, t, t - r, e, this.far), this.projectionMatrixInverse.copy(this.projectionMatrix).invert();
}
toJSON(e) {
const t = super.toJSON(e);
return t.object.fov = this.fov, t.object.zoom = this.zoom, t.object.near = this.near, t.object.far = this.far, t.object.focus = this.focus, t.object.aspect = this.aspect, this.view !== null && (t.object.view = Object.assign({}, this.view)), t.object.filmGauge = this.filmGauge, t.object.filmOffset = this.filmOffset, t;
}
}
ti.prototype.isPerspectiveCamera = !0;
const la = 90, ca = 1;
class Ou extends nt {
constructor(e, t, r) {
if (super(), this.type = "CubeCamera", r.isWebGLCubeRenderTarget !== !0) {
console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");
return;
}
this.renderTarget = r;
const n = new ti(la, ca, e, t);
n.layers = this.layers, n.up.set(0, -1, 0), n.lookAt(new Z(1, 0, 0)), this.add(n);
const o = new ti(la, ca, e, t);
o.layers = this.layers, o.up.set(0, -1, 0), o.lookAt(new Z(-1, 0, 0)), this.add(o);
const a = new ti(la, ca, e, t);
a.layers = this.layers, a.up.set(0, 0, 1), a.lookAt(new Z(0, 1, 0)), this.add(a);
const s = new ti(la, ca, e, t);
s.layers = this.layers, s.up.set(0, 0, -1), s.lookAt(new Z(0, -1, 0)), this.add(s);
const c = new ti(la, ca, e, t);
c.layers = this.layers, c.up.set(0, -1, 0), c.lookAt(new Z(0, 0, 1)), this.add(c);
const l = new ti(la, ca, e, t);
l.layers = this.layers, l.up.set(0, -1, 0), l.lookAt(new Z(0, 0, -1)), this.add(l);
}
update(e, t) {
this.parent === null && this.updateMatrixWorld();
const r = this.renderTarget, [n, o, a, s, c, l] = this.children, h = e.xr.enabled, u = e.getRenderTarget();
e.xr.enabled = !1;
const p = r.texture.generateMipmaps;
r.texture.generateMipmaps = !1, e.setRenderTarget(r, 0), e.render(t, n), e.setRenderTarget(r, 1), e.render(t, o), e.setRenderTarget(r, 2), e.render(t, a), e.setRenderTarget(r, 3), e.render(t, s), e.setRenderTarget(r, 4), e.render(t, c), r.texture.generateMipmaps = p, e.setRenderTarget(r, 5), e.render(t, l), e.setRenderTarget(u), e.xr.enabled = h;
}
}
class cs extends Jt {
constructor(e, t, r, n, o, a, s, c, l, h) {
e = e !== void 0 ? e : [], t = t !== void 0 ? t : yl, s = s !== void 0 ? s : an, super(e, t, r, n, o, a, s, c, l, h), this._needsFlipEnvMap = !0, this.flipY = !1;
}
get images() {
return this.image;
}
set images(e) {
this.image = e;
}
}
cs.prototype.isCubeTexture = !0;
class Pu extends vr {
constructor(e, t, r) {
Number.isInteger(t) && (console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"), t = r), super(e, e, t), t = t || {}, this.texture = new cs(void 0, t.mapping, t.wrapS, t.wrapT, t.magFilter, t.minFilter, t.format, t.type, t.anisotropy, t.encoding), this.texture.generateMipmaps = t.generateMipmaps !== void 0 ? t.generateMipmaps : !1, this.texture.minFilter = t.minFilter !== void 0 ? t.minFilter : Ut, this.texture._needsFlipEnvMap = !1;
}
fromEquirectangularTexture(e, t) {
this.texture.type = t.type, this.texture.format = $i, this.texture.encoding = t.encoding, this.texture.generateMipmaps = t.generateMipmaps, this.texture.minFilter = t.minFilter, this.texture.magFilter = t.magFilter;
const r = {
uniforms: {
tEquirect: { value: null }
},
vertexShader: (
/* glsl */
`
varying vec3 vWorldDirection;
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include
#include
}
`
),
fragmentShader: (
/* glsl */
`
uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include
void main() {
vec3 direction = normalize( vWorldDirection );
vec2 sampleUV = equirectUv( direction );
gl_FragColor = texture2D( tEquirect, sampleUV );
}
`
)
}, n = new un(5, 5, 5), o = new hn({
name: "CubemapFromEquirect",
uniforms: Va(r.uniforms),
vertexShader: r.vertexShader,
fragmentShader: r.fragmentShader,
side: $t,
blending: on
});
o.uniforms.tEquirect.value = t;
const a = new Yt(n, o), s = t.minFilter;
return t.minFilter === yn && (t.minFilter = Ut), new Ou(1, 10, this).update(e, a), t.minFilter = s, a.geometry.dispose(), a.material.dispose(), this;
}
clear(e, t, r, n) {
const o = e.getRenderTarget();
for (let a = 0; a < 6; a++)
e.setRenderTarget(this, a), e.clear(t, r, n);
e.setRenderTarget(o);
}
}
Pu.prototype.isWebGLCubeRenderTarget = !0;
const Ch = /* @__PURE__ */ new Z(), IO = /* @__PURE__ */ new Z(), DO = /* @__PURE__ */ new ii();
class Ar {
constructor(e = new Z(1, 0, 0), t = 0) {
this.normal = e, this.constant = t;
}
set(e, t) {
return this.normal.copy(e), this.constant = t, this;
}
setComponents(e, t, r, n) {
return this.normal.set(e, t, r), this.constant = n, this;
}
setFromNormalAndCoplanarPoint(e, t) {
return this.normal.copy(e), this.constant = -t.dot(this.normal), this;
}
setFromCoplanarPoints(e, t, r) {
const n = Ch.subVectors(r, t).cross(IO.subVectors(e, t)).normalize();
return this.setFromNormalAndCoplanarPoint(n, e), this;
}
copy(e) {
return this.normal.copy(e.normal), this.constant = e.constant, this;
}
normalize() {
const e = 1 / this.normal.length();
return this.normal.multiplyScalar(e), this.constant *= e, this;
}
negate() {
return this.constant *= -1, this.normal.negate(), this;
}
distanceToPoint(e) {
return this.normal.dot(e) + this.constant;
}
distanceToSphere(e) {
return this.distanceToPoint(e.center) - e.radius;
}
projectPoint(e, t) {
return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e);
}
intersectLine(e, t) {
const r = e.delta(Ch), n = this.normal.dot(r);
if (n === 0)
return this.distanceToPoint(e.start) === 0 ? t.copy(e.start) : null;
const o = -(e.start.dot(this.normal) + this.constant) / n;
return o < 0 || o > 1 ? null : t.copy(r).multiplyScalar(o).add(e.start);
}
intersectsLine(e) {
const t = this.distanceToPoint(e.start), r = this.distanceToPoint(e.end);
return t < 0 && r > 0 || r < 0 && t > 0;
}
intersectsBox(e) {
return e.intersectsPlane(this);
}
intersectsSphere(e) {
return e.intersectsPlane(this);
}
coplanarPoint(e) {
return e.copy(this.normal).multiplyScalar(-this.constant);
}
applyMatrix4(e, t) {
const r = t || DO.getNormalMatrix(e), n = this.coplanarPoint(Ch).applyMatrix4(e), o = this.normal.applyMatrix3(r).normalize();
return this.constant = -n.dot(o), this;
}
translate(e) {
return this.constant -= e.dot(this.normal), this;
}
equals(e) {
return e.normal.equals(this.normal) && e.constant === this.constant;
}
clone() {
return new this.constructor().copy(this);
}
}
Ar.prototype.isPlane = !0;
const ua = /* @__PURE__ */ new bn(), ac = /* @__PURE__ */ new Z();
class _l {
constructor(e = new Ar(), t = new Ar(), r = new Ar(), n = new Ar(), o = new Ar(), a = new Ar()) {
this.planes = [e, t, r, n, o, a];
}
set(e, t, r, n, o, a) {
const s = this.planes;
return s[0].copy(e), s[1].copy(t), s[2].copy(r), s[3].copy(n), s[4].copy(o), s[5].copy(a), this;
}
copy(e) {
const t = this.planes;
for (let r = 0; r < 6; r++)
t[r].copy(e.planes[r]);
return this;
}
setFromProjectionMatrix(e) {
const t = this.planes, r = e.elements, n = r[0], o = r[1], a = r[2], s = r[3], c = r[4], l = r[5], h = r[6], u = r[7], p = r[8], g = r[9], m = r[10], d = r[11], y = r[12], f = r[13], v = r[14], M = r[15];
return t[0].setComponents(s - n, u - c, d - p, M - y).normalize(), t[1].setComponents(s + n, u + c, d + p, M + y).normalize(), t[2].setComponents(s + o, u + l, d + g, M + f).normalize(), t[3].setComponents(s - o, u - l, d - g, M - f).normalize(), t[4].setComponents(s - a, u - h, d - m, M - v).normalize(), t[5].setComponents(s + a, u + h, d + m, M + v).normalize(), this;
}
intersectsObject(e) {
const t = e.geometry;
return t.boundingSphere === null && t.computeBoundingSphere(), ua.copy(t.boundingSphere).applyMatrix4(e.matrixWorld), this.intersectsSphere(ua);
}
intersectsSprite(e) {
return ua.center.set(0, 0, 0), ua.radius = 0.7071067811865476, ua.applyMatrix4(e.matrixWorld), this.intersectsSphere(ua);
}
intersectsSphere(e) {
const t = this.planes, r = e.center, n = -e.radius;
for (let o = 0; o < 6; o++)
if (t[o].distanceToPoint(r) < n)
return !1;
return !0;
}
intersectsBox(e) {
const t = this.planes;
for (let r = 0; r < 6; r++) {
const n = t[r];
if (ac.x = n.normal.x > 0 ? e.max.x : e.min.x, ac.y = n.normal.y > 0 ? e.max.y : e.min.y, ac.z = n.normal.z > 0 ? e.max.z : e.min.z, n.distanceToPoint(ac) < 0)
return !1;
}
return !0;
}
containsPoint(e) {
const t = this.planes;
for (let r = 0; r < 6; r++)
if (t[r].distanceToPoint(e) < 0)
return !1;
return !0;
}
clone() {
return new this.constructor().copy(this);
}
}
function Tx() {
let i = null, e = !1, t = null, r = null;
function n(o, a) {
t(o, a), r = i.requestAnimationFrame(n);
}
return {
start: function() {
e !== !0 && t !== null && (r = i.requestAnimationFrame(n), e = !0);
},
stop: function() {
i.cancelAnimationFrame(r), e = !1;
},
setAnimationLoop: function(o) {
t = o;
},
setContext: function(o) {
i = o;
}
};
}
function NO(i, e) {
const t = e.isWebGL2, r = /* @__PURE__ */ new WeakMap();
function n(l, h) {
const u = l.array, p = l.usage, g = i.createBuffer();
i.bindBuffer(h, g), i.bufferData(h, u, p), l.onUploadCallback();
let m = 5126;
return u instanceof Float32Array ? m = 5126 : u instanceof Float64Array ? console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.") : u instanceof Uint16Array ? l.isFloat16BufferAttribute ? t ? m = 5131 : console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.") : m = 5123 : u instanceof Int16Array ? m = 5122 : u instanceof Uint32Array ? m = 5125 : u instanceof Int32Array ? m = 5124 : u instanceof Int8Array ? m = 5120 : (u instanceof Uint8Array || u instanceof Uint8ClampedArray) && (m = 5121), {
buffer: g,
type: m,
bytesPerElement: u.BYTES_PER_ELEMENT,
version: l.version
};
}
function o(l, h, u) {
const p = h.array, g = h.updateRange;
i.bindBuffer(u, l), g.count === -1 ? i.bufferSubData(u, 0, p) : (t ? i.bufferSubData(
u,
g.offset * p.BYTES_PER_ELEMENT,
p,
g.offset,
g.count
) : i.bufferSubData(
u,
g.offset * p.BYTES_PER_ELEMENT,
p.subarray(g.offset, g.offset + g.count)
), g.count = -1);
}
function a(l) {
return l.isInterleavedBufferAttribute && (l = l.data), r.get(l);
}
function s(l) {
l.isInterleavedBufferAttribute && (l = l.data);
const h = r.get(l);
h && (i.deleteBuffer(h.buffer), r.delete(l));
}
function c(l, h) {
if (l.isGLBufferAttribute) {
const p = r.get(l);
(!p || p.version < l.version) && r.set(l, {
buffer: l.buffer,
type: l.type,
bytesPerElement: l.elementSize,
version: l.version
});
return;
}
l.isInterleavedBufferAttribute && (l = l.data);
const u = r.get(l);
u === void 0 ? r.set(l, n(l, h)) : u.version < l.version && (o(u.buffer, l, h), u.version = l.version);
}
return {
get: a,
remove: s,
update: c
};
}
class No extends Je {
constructor(e = 1, t = 1, r = 1, n = 1) {
super(), this.type = "PlaneGeometry", this.parameters = {
width: e,
height: t,
widthSegments: r,
heightSegments: n
};
const o = e / 2, a = t / 2, s = Math.floor(r), c = Math.floor(n), l = s + 1, h = c + 1, u = e / s, p = t / c, g = [], m = [], d = [], y = [];
for (let f = 0; f < h; f++) {
const v = f * p - a;
for (let M = 0; M < l; M++) {
const S = M * u - o;
m.push(S, -v, 0), d.push(0, 0, 1), y.push(M / s), y.push(1 - f / c);
}
}
for (let f = 0; f < c; f++)
for (let v = 0; v < s; v++) {
const M = v + l * f, S = v + l * (f + 1), T = v + 1 + l * (f + 1), x = v + 1 + l * f;
g.push(M, S, x), g.push(S, T, x);
}
this.setIndex(g), this.setAttribute("position", new je(m, 3)), this.setAttribute("normal", new je(d, 3)), this.setAttribute("uv", new je(y, 2));
}
static fromJSON(e) {
return new No(e.width, e.height, e.widthSegments, e.heightSegments);
}
}
var BO = `#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, vUv ).g;
#endif`, kO = `#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`, zO = `#ifdef ALPHATEST
if ( diffuseColor.a < ALPHATEST ) discard;
#endif`, FO = `#ifdef USE_AOMAP
float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;
reflectedLight.indirectDiffuse *= ambientOcclusion;
#if defined( USE_ENVMAP ) && defined( STANDARD )
float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );
#endif
#endif`, VO = `#ifdef USE_AOMAP
uniform sampler2D aoMap;
uniform float aoMapIntensity;
#endif`, UO = "vec3 transformed = vec3( position );", GO = `vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
vec3 objectTangent = vec3( tangent.xyz );
#endif`, HO = `vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {
const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
vec4 r = roughness * c0 + c1;
float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
return vec2( -1.04, 1.04 ) * a004 + r.zw;
}
float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
#if defined ( PHYSICALLY_CORRECT_LIGHTS )
float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
if( cutoffDistance > 0.0 ) {
distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
}
return distanceFalloff;
#else
if( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );
}
return 1.0;
#endif
}
vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {
return RECIPROCAL_PI * diffuseColor;
}
vec3 F_Schlick( const in vec3 specularColor, const in float dotVH ) {
float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH );
return ( 1.0 - specularColor ) * fresnel + specularColor;
}
vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {
float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );
vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;
return Fr * fresnel + F0;
}
float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {
float a2 = pow2( alpha );
float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
return 1.0 / ( gl * gv );
}
float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
float a2 = pow2( alpha );
float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
return 0.5 / max( gv + gl, EPSILON );
}
float D_GGX( const in float alpha, const in float dotNH ) {
float a2 = pow2( alpha );
float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
return RECIPROCAL_PI * a2 / pow2( denom );
}
vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {
float alpha = pow2( roughness );
vec3 halfDir = normalize( incidentLight.direction + viewDir );
float dotNL = saturate( dot( normal, incidentLight.direction ) );
float dotNV = saturate( dot( normal, viewDir ) );
float dotNH = saturate( dot( normal, halfDir ) );
float dotLH = saturate( dot( incidentLight.direction, halfDir ) );
vec3 F = F_Schlick( specularColor, dotLH );
float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );
float D = D_GGX( alpha, dotNH );
return F * ( G * D );
}
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
const float LUT_SIZE = 64.0;
const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
const float LUT_BIAS = 0.5 / LUT_SIZE;
float dotNV = saturate( dot( N, V ) );
vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
uv = uv * LUT_SCALE + LUT_BIAS;
return uv;
}
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
float l = length( f );
return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
}
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
float x = dot( v1, v2 );
float y = abs( x );
float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
float b = 3.4175940 + ( 4.1616724 + y ) * y;
float v = a / b;
float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
return cross( v1, v2 ) * theta_sintheta;
}
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
vec3 lightNormal = cross( v1, v2 );
if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
vec3 T1, T2;
T1 = normalize( V - N * dot( V, N ) );
T2 = - cross( N, T1 );
mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
vec3 coords[ 4 ];
coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
coords[ 0 ] = normalize( coords[ 0 ] );
coords[ 1 ] = normalize( coords[ 1 ] );
coords[ 2 ] = normalize( coords[ 2 ] );
coords[ 3 ] = normalize( coords[ 3 ] );
vec3 vectorFormFactor = vec3( 0.0 );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
return vec3( result );
}
vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {
float dotNV = saturate( dot( normal, viewDir ) );
vec2 brdf = integrateSpecularBRDF( dotNV, roughness );
return specularColor * brdf.x + brdf.y;
}
void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );
vec2 brdf = integrateSpecularBRDF( dotNV, roughness );
vec3 FssEss = F * brdf.x + brdf.y;
float Ess = brdf.x + brdf.y;
float Ems = 1.0 - Ess;
vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
singleScatter += FssEss;
multiScatter += Fms * Ems;
}
float G_BlinnPhong_Implicit( ) {
return 0.25;
}
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
}
vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {
vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );
float dotNH = saturate( dot( geometry.normal, halfDir ) );
float dotLH = saturate( dot( incidentLight.direction, halfDir ) );
vec3 F = F_Schlick( specularColor, dotLH );
float G = G_BlinnPhong_Implicit( );
float D = D_BlinnPhong( shininess, dotNH );
return F * ( G * D );
}
float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {
return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );
}
float BlinnExponentToGGXRoughness( const in float blinnExponent ) {
return sqrt( 2.0 / ( blinnExponent + 2.0 ) );
}
#if defined( USE_SHEEN )
float D_Charlie(float roughness, float NoH) {
float invAlpha = 1.0 / roughness;
float cos2h = NoH * NoH;
float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);
}
float V_Neubelt(float NoV, float NoL) {
return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));
}
vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {
vec3 N = geometry.normal;
vec3 V = geometry.viewDir;
vec3 H = normalize( V + L );
float dotNH = saturate( dot( N, H ) );
return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );
}
#endif`, jO = `#ifdef USE_BUMPMAP
uniform sampler2D bumpMap;
uniform float bumpScale;
vec2 dHdxy_fwd() {
vec2 dSTdx = dFdx( vUv );
vec2 dSTdy = dFdy( vUv );
float Hll = bumpScale * texture2D( bumpMap, vUv ).x;
float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;
float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;
return vec2( dBx, dBy );
}
vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );
vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );
vec3 vN = surf_norm;
vec3 R1 = cross( vSigmaY, vN );
vec3 R2 = cross( vN, vSigmaX );
float fDet = dot( vSigmaX, R1 ) * faceDirection;
vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
return normalize( abs( fDet ) * surf_norm - vGrad );
}
#endif`, WO = `#if NUM_CLIPPING_PLANES > 0
vec4 plane;
#pragma unroll_loop_start
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
plane = clippingPlanes[ i ];
if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
}
#pragma unroll_loop_end
#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
bool clipped = true;
#pragma unroll_loop_start
for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
plane = clippingPlanes[ i ];
clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
}
#pragma unroll_loop_end
if ( clipped ) discard;
#endif
#endif`, $O = `#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`, qO = `#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
#endif`, XO = `#if NUM_CLIPPING_PLANES > 0
vClipPosition = - mvPosition.xyz;
#endif`, ZO = `#if defined( USE_COLOR_ALPHA )
diffuseColor *= vColor;
#elif defined( USE_COLOR )
diffuseColor.rgb *= vColor;
#endif`, YO = `#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR )
varying vec3 vColor;
#endif`, JO = `#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
varying vec3 vColor;
#endif`, KO = `#if defined( USE_COLOR_ALPHA )
vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
vColor.xyz *= instanceColor.xyz;
#endif`, QO = `#define PI 3.141592653589793
#define PI2 6.283185307179586
#define PI_HALF 1.5707963267948966
#define RECIPROCAL_PI 0.3183098861837907
#define RECIPROCAL_PI2 0.15915494309189535
#define EPSILON 1e-6
#ifndef saturate
#define saturate(a) clamp( a, 0.0, 1.0 )
#endif
#define whiteComplement(a) ( 1.0 - saturate( a ) )
float pow2( const in float x ) { return x*x; }
float pow3( const in float x ) { return x*x*x; }
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }
highp float rand( const in vec2 uv ) {
const highp float a = 12.9898, b = 78.233, c = 43758.5453;
highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
return fract(sin(sn) * c);
}
#ifdef HIGH_PRECISION
float precisionSafeLength( vec3 v ) { return length( v ); }
#else
float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }
float precisionSafeLength( vec3 v ) {
float maxComponent = max3( abs( v ) );
return length( v / maxComponent ) * maxComponent;
}
#endif
struct IncidentLight {
vec3 color;
vec3 direction;
bool visible;
};
struct ReflectedLight {
vec3 directDiffuse;
vec3 directSpecular;
vec3 indirectDiffuse;
vec3 indirectSpecular;
};
struct GeometricContext {
vec3 position;
vec3 normal;
vec3 viewDir;
#ifdef CLEARCOAT
vec3 clearcoatNormal;
#endif
};
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
}
vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {
float distance = dot( planeNormal, point - pointOnPlane );
return - distance * planeNormal + point;
}
float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {
return sign( dot( point - pointOnPlane, planeNormal ) );
}
vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {
return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;
}
mat3 transposeMat3( const in mat3 m ) {
mat3 tmp;
tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
return tmp;
}
float linearToRelativeLuminance( const in vec3 color ) {
vec3 weights = vec3( 0.2126, 0.7152, 0.0722 );
return dot( weights, color.rgb );
}
bool isPerspectiveMatrix( mat4 m ) {
return m[ 2 ][ 3 ] == - 1.0;
}
vec2 equirectUv( in vec3 dir ) {
float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
return vec2( u, v );
}`, eP = `#ifdef ENVMAP_TYPE_CUBE_UV
#define cubeUV_maxMipLevel 8.0
#define cubeUV_minMipLevel 4.0
#define cubeUV_maxTileSize 256.0
#define cubeUV_minTileSize 16.0
float getFace( vec3 direction ) {
vec3 absDirection = abs( direction );
float face = - 1.0;
if ( absDirection.x > absDirection.z ) {
if ( absDirection.x > absDirection.y )
face = direction.x > 0.0 ? 0.0 : 3.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
} else {
if ( absDirection.z > absDirection.y )
face = direction.z > 0.0 ? 2.0 : 5.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
}
return face;
}
vec2 getUV( vec3 direction, float face ) {
vec2 uv;
if ( face == 0.0 ) {
uv = vec2( direction.z, direction.y ) / abs( direction.x );
} else if ( face == 1.0 ) {
uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
} else if ( face == 2.0 ) {
uv = vec2( - direction.x, direction.y ) / abs( direction.z );
} else if ( face == 3.0 ) {
uv = vec2( - direction.z, direction.y ) / abs( direction.x );
} else if ( face == 4.0 ) {
uv = vec2( - direction.x, direction.z ) / abs( direction.y );
} else {
uv = vec2( direction.x, direction.y ) / abs( direction.z );
}
return 0.5 * ( uv + 1.0 );
}
vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
float face = getFace( direction );
float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
mipInt = max( mipInt, cubeUV_minMipLevel );
float faceSize = exp2( mipInt );
float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );
vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );
vec2 f = fract( uv );
uv += 0.5 - f;
if ( face > 2.0 ) {
uv.y += faceSize;
face -= 3.0;
}
uv.x += face * faceSize;
if ( mipInt < cubeUV_maxMipLevel ) {
uv.y += 2.0 * cubeUV_maxTileSize;
}
uv.y += filterInt * 2.0 * cubeUV_minTileSize;
uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );
uv *= texelSize;
vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;
uv.x += texelSize;
vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;
uv.y += texelSize;
vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;
uv.x -= texelSize;
vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;
vec3 tm = mix( tl, tr, f.x );
vec3 bm = mix( bl, br, f.x );
return mix( tm, bm, f.y );
}
#define r0 1.0
#define v0 0.339
#define m0 - 2.0
#define r1 0.8
#define v1 0.276
#define m1 - 1.0
#define r4 0.4
#define v4 0.046
#define m4 2.0
#define r5 0.305
#define v5 0.016
#define m5 3.0
#define r6 0.21
#define v6 0.0038
#define m6 4.0
float roughnessToMip( float roughness ) {
float mip = 0.0;
if ( roughness >= r1 ) {
mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;
} else if ( roughness >= r4 ) {
mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;
} else if ( roughness >= r5 ) {
mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;
} else if ( roughness >= r6 ) {
mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;
} else {
mip = - 2.0 * log2( 1.16 * roughness ); }
return mip;
}
vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );
float mipF = fract( mip );
float mipInt = floor( mip );
vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
if ( mipF == 0.0 ) {
return vec4( color0, 1.0 );
} else {
vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
return vec4( mix( color0, color1, mipF ), 1.0 );
}
}
#endif`, tP = `vec3 transformedNormal = objectNormal;
#ifdef USE_INSTANCING
mat3 m = mat3( instanceMatrix );
transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );
transformedNormal = m * transformedNormal;
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;
#ifdef FLIP_SIDED
transformedTangent = - transformedTangent;
#endif
#endif`, iP = `#ifdef USE_DISPLACEMENTMAP
uniform sampler2D displacementMap;
uniform float displacementScale;
uniform float displacementBias;
#endif`, rP = `#ifdef USE_DISPLACEMENTMAP
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );
#endif`, nP = `#ifdef USE_EMISSIVEMAP
vec4 emissiveColor = texture2D( emissiveMap, vUv );
emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;
totalEmissiveRadiance *= emissiveColor.rgb;
#endif`, oP = `#ifdef USE_EMISSIVEMAP
uniform sampler2D emissiveMap;
#endif`, aP = "gl_FragColor = linearToOutputTexel( gl_FragColor );", sP = `
vec4 LinearToLinear( in vec4 value ) {
return value;
}
vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {
return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );
}
vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {
return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );
}
vec4 sRGBToLinear( in vec4 value ) {
return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
}
vec4 LinearTosRGB( in vec4 value ) {
return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
}
vec4 RGBEToLinear( in vec4 value ) {
return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );
}
vec4 LinearToRGBE( in vec4 value ) {
float maxComponent = max( max( value.r, value.g ), value.b );
float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );
return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );
}
vec4 RGBMToLinear( in vec4 value, in float maxRange ) {
return vec4( value.rgb * value.a * maxRange, 1.0 );
}
vec4 LinearToRGBM( in vec4 value, in float maxRange ) {
float maxRGB = max( value.r, max( value.g, value.b ) );
float M = clamp( maxRGB / maxRange, 0.0, 1.0 );
M = ceil( M * 255.0 ) / 255.0;
return vec4( value.rgb / ( M * maxRange ), M );
}
vec4 RGBDToLinear( in vec4 value, in float maxRange ) {
return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );
}
vec4 LinearToRGBD( in vec4 value, in float maxRange ) {
float maxRGB = max( value.r, max( value.g, value.b ) );
float D = max( maxRange / maxRGB, 1.0 );
D = clamp( floor( D ) / 255.0, 0.0, 1.0 );
return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );
}
const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );
vec4 LinearToLogLuv( in vec4 value ) {
vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;
Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );
vec4 vResult;
vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;
float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;
vResult.w = fract( Le );
vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;
return vResult;
}
const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );
vec4 LogLuvToLinear( in vec4 value ) {
float Le = value.z * 255.0 + value.w;
vec3 Xp_Y_XYZp;
Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );
Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;
Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;
vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;
return vec4( max( vRGB, 0.0 ), 1.0 );
}`, lP = `#ifdef USE_ENVMAP
#ifdef ENV_WORLDPOS
vec3 cameraToFrag;
if ( isOrthographic ) {
cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
} else {
cameraToFrag = normalize( vWorldPosition - cameraPosition );
}
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
#ifdef ENVMAP_MODE_REFLECTION
vec3 reflectVec = reflect( cameraToFrag, worldNormal );
#else
vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
#endif
#else
vec3 reflectVec = vReflect;
#endif
#ifdef ENVMAP_TYPE_CUBE
vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
#elif defined( ENVMAP_TYPE_CUBE_UV )
vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );
#else
vec4 envColor = vec4( 0.0 );
#endif
#ifndef ENVMAP_TYPE_CUBE_UV
envColor = envMapTexelToLinear( envColor );
#endif
#ifdef ENVMAP_BLENDING_MULTIPLY
outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
#elif defined( ENVMAP_BLENDING_MIX )
outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
#elif defined( ENVMAP_BLENDING_ADD )
outgoingLight += envColor.xyz * specularStrength * reflectivity;
#endif
#endif`, cP = `#ifdef USE_ENVMAP
uniform float envMapIntensity;
uniform float flipEnvMap;
uniform int maxMipLevel;
#ifdef ENVMAP_TYPE_CUBE
uniform samplerCube envMap;
#else
uniform sampler2D envMap;
#endif
#endif`, uP = `#ifdef USE_ENVMAP
uniform float reflectivity;
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
#define ENV_WORLDPOS
#endif
#ifdef ENV_WORLDPOS
varying vec3 vWorldPosition;
uniform float refractionRatio;
#else
varying vec3 vReflect;
#endif
#endif`, hP = `#ifdef USE_ENVMAP
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )
#define ENV_WORLDPOS
#endif
#ifdef ENV_WORLDPOS
varying vec3 vWorldPosition;
#else
varying vec3 vReflect;
uniform float refractionRatio;
#endif
#endif`, dP = `#ifdef USE_ENVMAP
#ifdef ENV_WORLDPOS
vWorldPosition = worldPosition.xyz;
#else
vec3 cameraToVertex;
if ( isOrthographic ) {
cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
} else {
cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
}
vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
#ifdef ENVMAP_MODE_REFLECTION
vReflect = reflect( cameraToVertex, worldNormal );
#else
vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
#endif
#endif
#endif`, pP = `#ifdef USE_FOG
fogDepth = - mvPosition.z;
#endif`, fP = `#ifdef USE_FOG
varying float fogDepth;
#endif`, mP = `#ifdef USE_FOG
#ifdef FOG_EXP2
float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );
#else
float fogFactor = smoothstep( fogNear, fogFar, fogDepth );
#endif
gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
#endif`, gP = `#ifdef USE_FOG
uniform vec3 fogColor;
varying float fogDepth;
#ifdef FOG_EXP2
uniform float fogDensity;
#else
uniform float fogNear;
uniform float fogFar;
#endif
#endif`, vP = `#ifdef USE_GRADIENTMAP
uniform sampler2D gradientMap;
#endif
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
float dotNL = dot( normal, lightDirection );
vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
#ifdef USE_GRADIENTMAP
return texture2D( gradientMap, coord ).rgb;
#else
return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );
#endif
}`, yP = `#ifdef USE_LIGHTMAP
vec4 lightMapTexel= texture2D( lightMap, vUv2 );
reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
#endif`, bP = `#ifdef USE_LIGHTMAP
uniform sampler2D lightMap;
uniform float lightMapIntensity;
#endif`, xP = `vec3 diffuse = vec3( 1.0 );
GeometricContext geometry;
geometry.position = mvPosition.xyz;
geometry.normal = normalize( transformedNormal );
geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );
GeometricContext backGeometry;
backGeometry.position = geometry.position;
backGeometry.normal = -geometry.normal;
backGeometry.viewDir = geometry.viewDir;
vLightFront = vec3( 0.0 );
vIndirectFront = vec3( 0.0 );
#ifdef DOUBLE_SIDED
vLightBack = vec3( 0.0 );
vIndirectBack = vec3( 0.0 );
#endif
IncidentLight directLight;
float dotNL;
vec3 directLightColor_Diffuse;
vIndirectFront += getAmbientLightIrradiance( ambientLightColor );
vIndirectFront += getLightProbeIrradiance( lightProbe, geometry );
#ifdef DOUBLE_SIDED
vIndirectBack += getAmbientLightIrradiance( ambientLightColor );
vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );
#endif
#if NUM_POINT_LIGHTS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );
dotNL = dot( geometry.normal, directLight.direction );
directLightColor_Diffuse = PI * directLight.color;
vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
#ifdef DOUBLE_SIDED
vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;
#endif
}
#pragma unroll_loop_end
#endif
#if NUM_SPOT_LIGHTS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );
dotNL = dot( geometry.normal, directLight.direction );
directLightColor_Diffuse = PI * directLight.color;
vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
#ifdef DOUBLE_SIDED
vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;
#endif
}
#pragma unroll_loop_end
#endif
#if NUM_DIR_LIGHTS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );
dotNL = dot( geometry.normal, directLight.direction );
directLightColor_Diffuse = PI * directLight.color;
vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
#ifdef DOUBLE_SIDED
vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;
#endif
}
#pragma unroll_loop_end
#endif
#if NUM_HEMI_LIGHTS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );
#ifdef DOUBLE_SIDED
vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );
#endif
}
#pragma unroll_loop_end
#endif`, wP = `uniform bool receiveShadow;
uniform vec3 ambientLightColor;
uniform vec3 lightProbe[ 9 ];
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
float x = normal.x, y = normal.y, z = normal.z;
vec3 result = shCoefficients[ 0 ] * 0.886227;
result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
return result;
}
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {
vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );
vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
return irradiance;
}
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
vec3 irradiance = ambientLightColor;
#ifndef PHYSICALLY_CORRECT_LIGHTS
irradiance *= PI;
#endif
return irradiance;
}
#if NUM_DIR_LIGHTS > 0
struct DirectionalLight {
vec3 direction;
vec3 color;
};
uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {
directLight.color = directionalLight.color;
directLight.direction = directionalLight.direction;
directLight.visible = true;
}
#endif
#if NUM_POINT_LIGHTS > 0
struct PointLight {
vec3 position;
vec3 color;
float distance;
float decay;
};
uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {
vec3 lVector = pointLight.position - geometry.position;
directLight.direction = normalize( lVector );
float lightDistance = length( lVector );
directLight.color = pointLight.color;
directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );
directLight.visible = ( directLight.color != vec3( 0.0 ) );
}
#endif
#if NUM_SPOT_LIGHTS > 0
struct SpotLight {
vec3 position;
vec3 direction;
vec3 color;
float distance;
float decay;
float coneCos;
float penumbraCos;
};
uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {
vec3 lVector = spotLight.position - geometry.position;
directLight.direction = normalize( lVector );
float lightDistance = length( lVector );
float angleCos = dot( directLight.direction, spotLight.direction );
if ( angleCos > spotLight.coneCos ) {
float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );
directLight.color = spotLight.color;
directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );
directLight.visible = true;
} else {
directLight.color = vec3( 0.0 );
directLight.visible = false;
}
}
#endif
#if NUM_RECT_AREA_LIGHTS > 0
struct RectAreaLight {
vec3 color;
vec3 position;
vec3 halfWidth;
vec3 halfHeight;
};
uniform sampler2D ltc_1; uniform sampler2D ltc_2;
uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
#endif
#if NUM_HEMI_LIGHTS > 0
struct HemisphereLight {
vec3 direction;
vec3 skyColor;
vec3 groundColor;
};
uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {
float dotNL = dot( geometry.normal, hemiLight.direction );
float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
#ifndef PHYSICALLY_CORRECT_LIGHTS
irradiance *= PI;
#endif
return irradiance;
}
#endif`, _P = `#if defined( USE_ENVMAP )
#ifdef ENVMAP_MODE_REFRACTION
uniform float refractionRatio;
#endif
vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {
vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );
#ifdef ENVMAP_TYPE_CUBE
vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );
#ifdef TEXTURE_LOD_EXT
vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );
#else
vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );
#endif
envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;
#elif defined( ENVMAP_TYPE_CUBE_UV )
vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );
#else
vec4 envMapColor = vec4( 0.0 );
#endif
return PI * envMapColor.rgb * envMapIntensity;
}
float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {
float maxMIPLevelScalar = float( maxMIPLevel );
float sigma = PI * roughness * roughness / ( 1.0 + roughness );
float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );
return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );
}
vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {
#ifdef ENVMAP_MODE_REFLECTION
vec3 reflectVec = reflect( -viewDir, normal );
reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
#else
vec3 reflectVec = refract( -viewDir, normal, refractionRatio );
#endif
reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );
#ifdef ENVMAP_TYPE_CUBE
vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );
#ifdef TEXTURE_LOD_EXT
vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );
#else
vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );
#endif
envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;
#elif defined( ENVMAP_TYPE_CUBE_UV )
vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );
#endif
return envMapColor.rgb * envMapIntensity;
}
#endif`, MP = `ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`, SP = `varying vec3 vViewPosition;
#ifndef FLAT_SHADED
varying vec3 vNormal;
#endif
struct ToonMaterial {
vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;
#ifndef PHYSICALLY_CORRECT_LIGHTS
irradiance *= PI;
#endif
reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_Toon
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon
#define Material_LightProbeLOD( material ) (0)`, TP = `BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`, EP = `varying vec3 vViewPosition;
#ifndef FLAT_SHADED
varying vec3 vNormal;
#endif
struct BlinnPhongMaterial {
vec3 diffuseColor;
vec3 specularColor;
float specularShininess;
float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
#ifndef PHYSICALLY_CORRECT_LIGHTS
irradiance *= PI;
#endif
reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_BlinnPhong
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong
#define Material_LightProbeLOD( material ) (0)`, AP = `PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;
material.specularRoughness = min( material.specularRoughness, 1.0 );
#ifdef REFLECTIVITY
material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );
#else
material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );
#endif
#ifdef CLEARCOAT
material.clearcoat = clearcoat;
material.clearcoatRoughness = clearcoatRoughness;
#ifdef USE_CLEARCOATMAP
material.clearcoat *= texture2D( clearcoatMap, vUv ).x;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;
#endif
material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
material.clearcoatRoughness += geometryRoughness;
material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
#endif
#ifdef USE_SHEEN
material.sheenColor = sheen;
#endif`, CP = `struct PhysicalMaterial {
vec3 diffuseColor;
float specularRoughness;
vec3 specularColor;
#ifdef CLEARCOAT
float clearcoat;
float clearcoatRoughness;
#endif
#ifdef USE_SHEEN
vec3 sheenColor;
#endif
};
#define MAXIMUM_SPECULAR_COEFFICIENT 0.16
#define DEFAULT_SPECULAR_COEFFICIENT 0.04
float clearcoatDHRApprox( const in float roughness, const in float dotNL ) {
return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );
}
#if NUM_RECT_AREA_LIGHTS > 0
void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
vec3 normal = geometry.normal;
vec3 viewDir = geometry.viewDir;
vec3 position = geometry.position;
vec3 lightPos = rectAreaLight.position;
vec3 halfWidth = rectAreaLight.halfWidth;
vec3 halfHeight = rectAreaLight.halfHeight;
vec3 lightColor = rectAreaLight.color;
float roughness = material.specularRoughness;
vec3 rectCoords[ 4 ];
rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
vec2 uv = LTC_Uv( normal, viewDir, roughness );
vec4 t1 = texture2D( ltc_1, uv );
vec4 t2 = texture2D( ltc_2, uv );
mat3 mInv = mat3(
vec3( t1.x, 0, t1.y ),
vec3( 0, 1, 0 ),
vec3( t1.z, 0, t1.w )
);
vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
#ifndef PHYSICALLY_CORRECT_LIGHTS
irradiance *= PI;
#endif
#ifdef CLEARCOAT
float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );
vec3 ccIrradiance = ccDotNL * directLight.color;
#ifndef PHYSICALLY_CORRECT_LIGHTS
ccIrradiance *= PI;
#endif
float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );
reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );
#else
float clearcoatDHR = 0.0;
#endif
#ifdef USE_SHEEN
reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(
material.specularRoughness,
directLight.direction,
geometry,
material.sheenColor
);
#else
reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);
#endif
reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
#ifdef CLEARCOAT
float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );
reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );
float ccDotNL = ccDotNV;
float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );
#else
float clearcoatDHR = 0.0;
#endif
float clearcoatInv = 1.0 - clearcoatDHR;
vec3 singleScattering = vec3( 0.0 );
vec3 multiScattering = vec3( 0.0 );
vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );
vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );
reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;
reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
#define RE_Direct RE_Direct_Physical
#define RE_Direct_RectArea RE_Direct_RectArea_Physical
#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical
#define RE_IndirectSpecular RE_IndirectSpecular_Physical
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
}`, LP = `
GeometricContext geometry;
geometry.position = - vViewPosition;
geometry.normal = normal;
geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
#ifdef CLEARCOAT
geometry.clearcoatNormal = clearcoatNormal;
#endif
IncidentLight directLight;
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
PointLight pointLight;
#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
PointLightShadow pointLightShadow;
#endif
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
pointLight = pointLights[ i ];
getPointDirectLightIrradiance( pointLight, geometry, directLight );
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
pointLightShadow = pointLightShadows[ i ];
directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
#endif
RE_Direct( directLight, geometry, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
SpotLight spotLight;
#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
SpotLightShadow spotLightShadow;
#endif
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
spotLight = spotLights[ i ];
getSpotDirectLightIrradiance( spotLight, geometry, directLight );
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
spotLightShadow = spotLightShadows[ i ];
directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;
#endif
RE_Direct( directLight, geometry, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
DirectionalLight directionalLight;
#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
DirectionalLightShadow directionalLightShadow;
#endif
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
directionalLight = directionalLights[ i ];
getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
directionalLightShadow = directionalLightShadows[ i ];
directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
#endif
RE_Direct( directLight, geometry, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
RectAreaLight rectAreaLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
rectAreaLight = rectAreaLights[ i ];
RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
vec3 iblIrradiance = vec3( 0.0 );
vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
irradiance += getLightProbeIrradiance( lightProbe, geometry );
#if ( NUM_HEMI_LIGHTS > 0 )
#pragma unroll_loop_start
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );
}
#pragma unroll_loop_end
#endif
#endif
#if defined( RE_IndirectSpecular )
vec3 radiance = vec3( 0.0 );
vec3 clearcoatRadiance = vec3( 0.0 );
#endif`, RP = `#if defined( RE_IndirectDiffuse )
#ifdef USE_LIGHTMAP
vec4 lightMapTexel= texture2D( lightMap, vUv2 );
vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
#ifndef PHYSICALLY_CORRECT_LIGHTS
lightMapIrradiance *= PI;
#endif
irradiance += lightMapIrradiance;
#endif
#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );
#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );
#ifdef CLEARCOAT
clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );
#endif
#endif`, OP = `#if defined( RE_IndirectDiffuse )
RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );
#endif`, PP = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`, IP = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
uniform float logDepthBufFC;
varying float vFragDepth;
varying float vIsPerspective;
#endif`, DP = `#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGDEPTHBUF_EXT
varying float vFragDepth;
varying float vIsPerspective;
#else
uniform float logDepthBufFC;
#endif
#endif`, NP = `#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGDEPTHBUF_EXT
vFragDepth = 1.0 + gl_Position.w;
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
#else
if ( isPerspectiveMatrix( projectionMatrix ) ) {
gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
gl_Position.z *= gl_Position.w;
}
#endif
#endif`, BP = `#ifdef USE_MAP
vec4 texelColor = texture2D( map, vUv );
texelColor = mapTexelToLinear( texelColor );
diffuseColor *= texelColor;
#endif`, kP = `#ifdef USE_MAP
uniform sampler2D map;
#endif`, zP = `#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
#endif
#ifdef USE_MAP
vec4 mapTexel = texture2D( map, uv );
diffuseColor *= mapTexelToLinear( mapTexel );
#endif
#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, uv ).g;
#endif`, FP = `#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
uniform mat3 uvTransform;
#endif
#ifdef USE_MAP
uniform sampler2D map;
#endif
#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`, VP = `float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
vec4 texelMetalness = texture2D( metalnessMap, vUv );
metalnessFactor *= texelMetalness.b;
#endif`, UP = `#ifdef USE_METALNESSMAP
uniform sampler2D metalnessMap;
#endif`, GP = `#ifdef USE_MORPHNORMALS
objectNormal *= morphTargetBaseInfluence;
objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
#endif`, HP = `#ifdef USE_MORPHTARGETS
uniform float morphTargetBaseInfluence;
#ifndef USE_MORPHNORMALS
uniform float morphTargetInfluences[ 8 ];
#else
uniform float morphTargetInfluences[ 4 ];
#endif
#endif`, jP = `#ifdef USE_MORPHTARGETS
transformed *= morphTargetBaseInfluence;
transformed += morphTarget0 * morphTargetInfluences[ 0 ];
transformed += morphTarget1 * morphTargetInfluences[ 1 ];
transformed += morphTarget2 * morphTargetInfluences[ 2 ];
transformed += morphTarget3 * morphTargetInfluences[ 3 ];
#ifndef USE_MORPHNORMALS
transformed += morphTarget4 * morphTargetInfluences[ 4 ];
transformed += morphTarget5 * morphTargetInfluences[ 5 ];
transformed += morphTarget6 * morphTargetInfluences[ 6 ];
transformed += morphTarget7 * morphTargetInfluences[ 7 ];
#endif
#endif`, WP = `float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
#ifdef FLAT_SHADED
vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );
vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );
vec3 normal = normalize( cross( fdx, fdy ) );
#else
vec3 normal = normalize( vNormal );
#ifdef DOUBLE_SIDED
normal = normal * faceDirection;
#endif
#ifdef USE_TANGENT
vec3 tangent = normalize( vTangent );
vec3 bitangent = normalize( vBitangent );
#ifdef DOUBLE_SIDED
tangent = tangent * faceDirection;
bitangent = bitangent * faceDirection;
#endif
#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )
mat3 vTBN = mat3( tangent, bitangent, normal );
#endif
#endif
#endif
vec3 geometryNormal = normal;`, $P = `#ifdef OBJECTSPACE_NORMALMAP
normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
#ifdef FLIP_SIDED
normal = - normal;
#endif
#ifdef DOUBLE_SIDED
normal = normal * faceDirection;
#endif
normal = normalize( normalMatrix * normal );
#elif defined( TANGENTSPACE_NORMALMAP )
vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
mapN.xy *= normalScale;
#ifdef USE_TANGENT
normal = normalize( vTBN * mapN );
#else
normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection );
#endif
#elif defined( USE_BUMPMAP )
normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection );
#endif`, qP = `#ifdef USE_NORMALMAP
uniform sampler2D normalMap;
uniform vec2 normalScale;
#endif
#ifdef OBJECTSPACE_NORMALMAP
uniform mat3 normalMatrix;
#endif
#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )
vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {
vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );
vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );
vec2 st0 = dFdx( vUv.st );
vec2 st1 = dFdy( vUv.st );
vec3 N = surf_norm;
vec3 q1perp = cross( q1, N );
vec3 q0perp = cross( N, q0 );
vec3 T = q1perp * st0.x + q0perp * st1.x;
vec3 B = q1perp * st0.y + q0perp * st1.y;
float det = max( dot( T, T ), dot( B, B ) );
float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );
return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );
}
#endif`, XP = `#ifdef CLEARCOAT
vec3 clearcoatNormal = geometryNormal;
#endif`, ZP = `#ifdef USE_CLEARCOAT_NORMALMAP
vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;
clearcoatMapN.xy *= clearcoatNormalScale;
#ifdef USE_TANGENT
clearcoatNormal = normalize( vTBN * clearcoatMapN );
#else
clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );
#endif
#endif`, YP = `#ifdef USE_CLEARCOATMAP
uniform sampler2D clearcoatMap;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
uniform sampler2D clearcoatRoughnessMap;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
uniform sampler2D clearcoatNormalMap;
uniform vec2 clearcoatNormalScale;
#endif`, JP = `vec3 packNormalToRGB( const in vec3 normal ) {
return normalize( normal ) * 0.5 + 0.5;
}
vec3 unpackRGBToNormal( const in vec3 rgb ) {
return 2.0 * rgb.xyz - 1.0;
}
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
const float ShiftRight8 = 1. / 256.;
vec4 packDepthToRGBA( const in float v ) {
vec4 r = vec4( fract( v * PackFactors ), v );
r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;
}
float unpackRGBAToDepth( const in vec4 v ) {
return dot( v, UnpackFactors );
}
vec4 pack2HalfToRGBA( vec2 v ) {
vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));
return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);
}
vec2 unpackRGBATo2Half( vec4 v ) {
return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
}
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
return ( viewZ + near ) / ( near - far );
}
float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {
return linearClipZ * ( near - far ) - near;
}
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
return (( near + viewZ ) * far ) / (( far - near ) * viewZ );
}
float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {
return ( near * far ) / ( ( far - near ) * invClipZ - far );
}`, KP = `#ifdef PREMULTIPLIED_ALPHA
gl_FragColor.rgb *= gl_FragColor.a;
#endif`, QP = `vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_INSTANCING
mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`, eI = `#ifdef DITHERING
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`, tI = `#ifdef DITHERING
vec3 dithering( vec3 color ) {
float grid_position = rand( gl_FragCoord.xy );
vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
return color + dither_shift_RGB;
}
#endif`, iI = `float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
vec4 texelRoughness = texture2D( roughnessMap, vUv );
roughnessFactor *= texelRoughness.g;
#endif`, rI = `#ifdef USE_ROUGHNESSMAP
uniform sampler2D roughnessMap;
#endif`, nI = `#ifdef USE_SHADOWMAP
#if NUM_DIR_LIGHT_SHADOWS > 0
uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
struct DirectionalLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];
struct SpotLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
struct PointLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
float shadowCameraNear;
float shadowCameraFar;
};
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
#endif
float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
}
vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
return unpackRGBATo2Half( texture2D( shadow, uv ) );
}
float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
float occlusion = 1.0;
vec2 distribution = texture2DDistribution( shadow, uv );
float hard_shadow = step( compare , distribution.x );
if (hard_shadow != 1.0 ) {
float distance = compare - distribution.x ;
float variance = max( 0.00000, distribution.y * distribution.y );
float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
}
return occlusion;
}
float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
float shadow = 1.0;
shadowCoord.xyz /= shadowCoord.w;
shadowCoord.z += shadowBias;
bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );
bool inFrustum = all( inFrustumVec );
bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );
bool frustumTest = all( frustumTestVec );
if ( frustumTest ) {
#if defined( SHADOWMAP_TYPE_PCF )
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
float dx0 = - texelSize.x * shadowRadius;
float dy0 = - texelSize.y * shadowRadius;
float dx1 = + texelSize.x * shadowRadius;
float dy1 = + texelSize.y * shadowRadius;
float dx2 = dx0 / 2.0;
float dy2 = dy0 / 2.0;
float dx3 = dx1 / 2.0;
float dy3 = dy1 / 2.0;
shadow = (
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
) * ( 1.0 / 17.0 );
#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
float dx = texelSize.x;
float dy = texelSize.y;
vec2 uv = shadowCoord.xy;
vec2 f = fract( uv * shadowMapSize + 0.5 );
uv -= f * texelSize;
shadow = (
texture2DCompare( shadowMap, uv, shadowCoord.z ) +
texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
f.x ) +
mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
f.x ) +
mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
f.y ) +
mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
f.y ) +
mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
f.x ),
mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
f.x ),
f.y )
) * ( 1.0 / 9.0 );
#elif defined( SHADOWMAP_TYPE_VSM )
shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
#else
shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
#endif
}
return shadow;
}
vec2 cubeToUV( vec3 v, float texelSizeY ) {
vec3 absV = abs( v );
float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
absV *= scaleToCube;
v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
vec2 planar = v.xy;
float almostATexel = 1.5 * texelSizeY;
float almostOne = 1.0 - almostATexel;
if ( absV.z >= almostOne ) {
if ( v.z > 0.0 )
planar.x = 4.0 - v.x;
} else if ( absV.x >= almostOne ) {
float signX = sign( v.x );
planar.x = v.z * signX + 2.0 * signX;
} else if ( absV.y >= almostOne ) {
float signY = sign( v.y );
planar.x = v.x + 2.0 * signY + 2.0;
planar.y = v.z * signY - 2.0;
}
return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
}
float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
vec3 lightToPosition = shadowCoord.xyz;
float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;
vec3 bd3D = normalize( lightToPosition );
#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
return (
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
) * ( 1.0 / 9.0 );
#else
return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
#endif
}
#endif`, oI = `#ifdef USE_SHADOWMAP
#if NUM_DIR_LIGHT_SHADOWS > 0
uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
struct DirectionalLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];
varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];
struct SpotLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
struct PointLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
float shadowCameraNear;
float shadowCameraFar;
};
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
#endif
#endif`, aI = `#ifdef USE_SHADOWMAP
#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0
vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
vec4 shadowWorldPosition;
#endif
#if NUM_DIR_LIGHT_SHADOWS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );
vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
#endif
#endif`, sI = `float getShadowMask() {
float shadow = 1.0;
#ifdef USE_SHADOWMAP
#if NUM_DIR_LIGHT_SHADOWS > 0
DirectionalLightShadow directionalLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
directionalLight = directionalLightShadows[ i ];
shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
}
#pragma unroll_loop_end
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
SpotLightShadow spotLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
spotLight = spotLightShadows[ i ];
shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;
}
#pragma unroll_loop_end
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
PointLightShadow pointLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
pointLight = pointLightShadows[ i ];
shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
}
#pragma unroll_loop_end
#endif
#endif
return shadow;
}`, lI = `#ifdef USE_SKINNING
mat4 boneMatX = getBoneMatrix( skinIndex.x );
mat4 boneMatY = getBoneMatrix( skinIndex.y );
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`, cI = `#ifdef USE_SKINNING
uniform mat4 bindMatrix;
uniform mat4 bindMatrixInverse;
#ifdef BONE_TEXTURE
uniform highp sampler2D boneTexture;
uniform int boneTextureSize;
mat4 getBoneMatrix( const in float i ) {
float j = i * 4.0;
float x = mod( j, float( boneTextureSize ) );
float y = floor( j / float( boneTextureSize ) );
float dx = 1.0 / float( boneTextureSize );
float dy = 1.0 / float( boneTextureSize );
y = dy * ( y + 0.5 );
vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );
vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );
vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );
vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );
mat4 bone = mat4( v1, v2, v3, v4 );
return bone;
}
#else
uniform mat4 boneMatrices[ MAX_BONES ];
mat4 getBoneMatrix( const in float i ) {
mat4 bone = boneMatrices[ int(i) ];
return bone;
}
#endif
#endif`, uI = `#ifdef USE_SKINNING
vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
vec4 skinned = vec4( 0.0 );
skinned += boneMatX * skinVertex * skinWeight.x;
skinned += boneMatY * skinVertex * skinWeight.y;
skinned += boneMatZ * skinVertex * skinWeight.z;
skinned += boneMatW * skinVertex * skinWeight.w;
transformed = ( bindMatrixInverse * skinned ).xyz;
#endif`, hI = `#ifdef USE_SKINNING
mat4 skinMatrix = mat4( 0.0 );
skinMatrix += skinWeight.x * boneMatX;
skinMatrix += skinWeight.y * boneMatY;
skinMatrix += skinWeight.z * boneMatZ;
skinMatrix += skinWeight.w * boneMatW;
skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
#ifdef USE_TANGENT
objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
#endif
#endif`, dI = `float specularStrength;
#ifdef USE_SPECULARMAP
vec4 texelSpecular = texture2D( specularMap, vUv );
specularStrength = texelSpecular.r;
#else
specularStrength = 1.0;
#endif`, pI = `#ifdef USE_SPECULARMAP
uniform sampler2D specularMap;
#endif`, fI = `#if defined( TONE_MAPPING )
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`, mI = `#ifndef saturate
#define saturate(a) clamp( a, 0.0, 1.0 )
#endif
uniform float toneMappingExposure;
vec3 LinearToneMapping( vec3 color ) {
return toneMappingExposure * color;
}
vec3 ReinhardToneMapping( vec3 color ) {
color *= toneMappingExposure;
return saturate( color / ( vec3( 1.0 ) + color ) );
}
vec3 OptimizedCineonToneMapping( vec3 color ) {
color *= toneMappingExposure;
color = max( vec3( 0.0 ), color - 0.004 );
return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
}
vec3 RRTAndODTFit( vec3 v ) {
vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
return a / b;
}
vec3 ACESFilmicToneMapping( vec3 color ) {
const mat3 ACESInputMat = mat3(
vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),
vec3( 0.04823, 0.01566, 0.83777 )
);
const mat3 ACESOutputMat = mat3(
vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),
vec3( -0.07367, -0.00605, 1.07602 )
);
color *= toneMappingExposure / 0.6;
color = ACESInputMat * color;
color = RRTAndODTFit( color );
color = ACESOutputMat * color;
return saturate( color );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`, gI = `#ifdef USE_TRANSMISSION
float transmissionFactor = transmission;
float thicknessFactor = thickness;
#ifdef USE_TRANSMISSIONMAP
transmissionFactor *= texture2D( transmissionMap, vUv ).r;
#endif
#ifdef USE_THICKNESSNMAP
thicknessFactor *= texture2D( thicknessMap, vUv ).g;
#endif
vec3 pos = vWorldPosition.xyz / vWorldPosition.w;
vec3 v = normalize( cameraPosition - pos );
float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity );
vec3 transmission = transmissionFactor * getIBLVolumeRefraction(
normal, v, roughnessFactor, material.diffuseColor, totalSpecular,
pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,
attenuationColor, attenuationDistance );
totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor );
#endif`, vI = `#ifdef USE_TRANSMISSION
#ifdef USE_TRANSMISSIONMAP
uniform sampler2D transmissionMap;
#endif
#ifdef USE_THICKNESSMAP
uniform sampler2D thicknessMap;
#endif
uniform vec2 transmissionSamplerSize;
uniform sampler2D transmissionSamplerMap;
uniform mat4 modelMatrix;
uniform mat4 projectionMatrix;
varying vec4 vWorldPosition;
vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) {
vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior);
vec3 modelScale;
modelScale.x = length(vec3(modelMatrix[0].xyz));
modelScale.y = length(vec3(modelMatrix[1].xyz));
modelScale.z = length(vec3(modelMatrix[2].xyz));
return normalize(refractionVector) * thickness * modelScale;
}
float applyIorToRoughness(float roughness, float ior) {
return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0);
}
vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) {
float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior);
return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb;
}
vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) {
if (attenuationDistance == 0.0) {
return radiance;
} else {
vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance;
vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance;
}
}
vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor,
vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,
vec3 attenuationColor, float attenuationDistance) {
vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix);
vec3 refractedRayExit = position + transmissionRay;
vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0);
vec2 refractionCoords = ndcPos.xy / ndcPos.w;
refractionCoords += 1.0;
refractionCoords /= 2.0;
vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior);
vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance);
return (1.0 - specularColor) * attenuatedColor * baseColor;
}
#endif`, yI = `#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )
varying vec2 vUv;
#endif`, bI = `#ifdef USE_UV
#ifdef UVS_VERTEX_ONLY
vec2 vUv;
#else
varying vec2 vUv;
#endif
uniform mat3 uvTransform;
#endif`, xI = `#ifdef USE_UV
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
#endif`, wI = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
varying vec2 vUv2;
#endif`, _I = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
attribute vec2 uv2;
varying vec2 vUv2;
uniform mat3 uv2Transform;
#endif`, MI = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;
#endif`, SI = `#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )
vec4 worldPosition = vec4( transformed, 1.0 );
#ifdef USE_INSTANCING
worldPosition = instanceMatrix * worldPosition;
#endif
worldPosition = modelMatrix * worldPosition;
#endif`, TI = `uniform sampler2D t2D;
varying vec2 vUv;
void main() {
vec4 texColor = texture2D( t2D, vUv );
gl_FragColor = mapTexelToLinear( texColor );
#include
#include
}`, EI = `varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
gl_Position = vec4( position.xy, 1.0, 1.0 );
}`, AI = `#include
uniform float opacity;
varying vec3 vWorldDirection;
#include
void main() {
vec3 vReflect = vWorldDirection;
#include
gl_FragColor = envColor;
gl_FragColor.a *= opacity;
#include
#include
}`, CI = `varying vec3 vWorldDirection;
#include
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include
#include
gl_Position.z = gl_Position.w;
}`, LI = `#if DEPTH_PACKING == 3200
uniform float opacity;
#endif
#include
#include
#include
#include
#include
#include
#include
varying vec2 vHighPrecisionZW;
void main() {
#include
vec4 diffuseColor = vec4( 1.0 );
#if DEPTH_PACKING == 3200
diffuseColor.a = opacity;
#endif
#include
#include
#include
#include
float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
#if DEPTH_PACKING == 3200
gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
#elif DEPTH_PACKING == 3201
gl_FragColor = packDepthToRGBA( fragCoordZ );
#endif
}`, RI = `#include
#include
#include
#include
#include
#include
#include
varying vec2 vHighPrecisionZW;
void main() {
#include
#include
#ifdef USE_DISPLACEMENTMAP
#include
#include
#include
#endif
#include
#include
#include
#include
#include
#include
#include
vHighPrecisionZW = gl_Position.zw;
}`, OI = `#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include
#include
#include
#include
#include
#include
void main () {
#include
vec4 diffuseColor = vec4( 1.0 );
#include
#include
#include
float dist = length( vWorldPosition - referencePosition );
dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
dist = saturate( dist );
gl_FragColor = packDepthToRGBA( dist );
}`, PI = `#define DISTANCE
varying vec3 vWorldPosition;
#include
#include
#include
#include
#include
#include
void main() {
#include
#include
#ifdef USE_DISPLACEMENTMAP
#include
#include
#include
#endif
#include
#include
#include
#include
#include
#include
#include
vWorldPosition = worldPosition.xyz;
}`, II = `uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include
void main() {
vec3 direction = normalize( vWorldDirection );
vec2 sampleUV = equirectUv( direction );
vec4 texColor = texture2D( tEquirect, sampleUV );
gl_FragColor = mapTexelToLinear( texColor );
#include
#include
}`, DI = `varying vec3 vWorldDirection;
#include
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include
#include
}`, NI = `uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include
#include
#include
#include
#include
void main() {
#include
if ( mod( vLineDistance, totalSize ) > dashSize ) {
discard;
}
vec3 outgoingLight = vec3( 0.0 );
vec4 diffuseColor = vec4( diffuse, opacity );
#include
#include
outgoingLight = diffuseColor.rgb;
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
#include
#include
#include
#include
}`, BI = `uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include
#include
#include
#include
#include
#include
void main() {
vLineDistance = scale * lineDistance;
#include
#include
#include
#include
#include
#include
#include
}`, kI = `uniform vec3 diffuse;
uniform float opacity;
#ifndef FLAT_SHADED
varying vec3 vNormal;
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
void main() {
#include
vec4 diffuseColor = vec4( diffuse, opacity );
#include
#include
#include
#include
#include
#include
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
#ifdef USE_LIGHTMAP
vec4 lightMapTexel= texture2D( lightMap, vUv2 );
reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
#else
reflectedLight.indirectDiffuse += vec3( 1.0 );
#endif
#include
reflectedLight.indirectDiffuse *= diffuseColor.rgb;
vec3 outgoingLight = reflectedLight.indirectDiffuse;
#include
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
#include
#include
#include
#include
#include
}`, zI = `#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
void main() {
#include
#include
#include
#include
#ifdef USE_ENVMAP
#include
#include
#include
#include
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
}`, FI = `uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
varying vec3 vLightFront;
varying vec3 vIndirectFront;
#ifdef DOUBLE_SIDED
varying vec3 vLightBack;
varying vec3 vIndirectBack;
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
void main() {
#include
vec4 diffuseColor = vec4( diffuse, opacity );
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include
#include
#include
#include
#include
#include
#include
#ifdef DOUBLE_SIDED
reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;
#else
reflectedLight.indirectDiffuse += vIndirectFront;
#endif
#include
reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );
#ifdef DOUBLE_SIDED
reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;
#else
reflectedLight.directDiffuse = vLightFront;
#endif
reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();
#include
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
#include
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
#include
#include
#include
#include
#include
}`, VI = `#define LAMBERT
varying vec3 vLightFront;
varying vec3 vIndirectFront;
#ifdef DOUBLE_SIDED
varying vec3 vLightBack;
varying vec3 vIndirectBack;
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
void main() {
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
}`, UI = `#define MATCAP
uniform vec3 diffuse;
uniform float opacity;
uniform sampler2D matcap;
varying vec3 vViewPosition;
#ifndef FLAT_SHADED
varying vec3 vNormal;
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
void main() {
#include
vec4 diffuseColor = vec4( diffuse, opacity );
#include
#include
#include
#include
#include
#include
#include
vec3 viewDir = normalize( vViewPosition );
vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
vec3 y = cross( viewDir, x );
vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
#ifdef USE_MATCAP
vec4 matcapColor = texture2D( matcap, uv );
matcapColor = matcapTexelToLinear( matcapColor );
#else
vec4 matcapColor = vec4( 1.0 );
#endif
vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
#include
#include
#include
#include
#include
}`, GI = `#define MATCAP
varying vec3 vViewPosition;
#ifndef FLAT_SHADED
varying vec3 vNormal;
#endif
#include