import { shallowRef as In, watchEffect as s0, readonly as o0, unref as H, getCurrentScope as a0, onScopeDispose as l0, getCurrentInstance as cn, onMounted as on, nextTick as Mt, watch as Ke, ref as Ae, defineComponent as De, openBlock as pe, createElementBlock as Re, createElementVNode as Be, warn as Kw, isVNode as ed, computed as ce, inject as ht, isRef as Ls, onBeforeUnmount as li, onBeforeMount as Qw, provide as gn, mergeProps as Oi, renderSlot as Xe, toRef as Bn, onUnmounted as c0, useAttrs as e1, useSlots as ou, createCommentVNode as Ge, Fragment as Wt, normalizeClass as Le, createBlock as He, withCtx as fe, resolveDynamicComponent as zn, withModifiers as fn, createVNode as ae, toDisplayString as wt, normalizeStyle as Ot, Transition as hl, withDirectives as Ft, vShow as xn, reactive as qn, onActivated as t1, onUpdated as sf, cloneVNode as n1, Text as u0, Comment as i1, Teleport as r1, onDeactivated as s1, toHandlers as o1, withKeys as vi, createTextVNode as yt, createSlots as a1, toRaw as of, toRefs as cr, resolveComponent as Xn, resolveDirective as l1, toHandlerKey as c1, renderList as ri, vModelText as u1, h as bo, createApp as h1, markRaw as Cn, hasInjectionContext as d1, effectScope as f1, isReactive as af, pushScopeId as p1, popScopeId as m1 } from "vue";
import { TreeControls as g1, CreateTooltipContent as v1, Tooltip as y1, DrawToolbar as b1 } from "@abi-software/map-utilities";
import { MapSvgIcon as x1, MapSvgSpriteColor as w1 } from "@abi-software/svg-sprite";
const Qi = (n, e, { checkForDefaultPrevented: t = !0 } = {}) => (r) => {
const s = n == null ? void 0 : n(r);
if (t === !1 || !s)
return e == null ? void 0 : e(r);
};
var M1 = Object.defineProperty, S1 = Object.defineProperties, _1 = Object.getOwnPropertyDescriptors, Gp = Object.getOwnPropertySymbols, T1 = Object.prototype.hasOwnProperty, E1 = Object.prototype.propertyIsEnumerable, Hp = (n, e, t) => e in n ? M1(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, A1 = (n, e) => {
for (var t in e || (e = {}))
T1.call(e, t) && Hp(n, t, e[t]);
if (Gp)
for (var t of Gp(e))
E1.call(e, t) && Hp(n, t, e[t]);
return n;
}, C1 = (n, e) => S1(n, _1(e));
function Wp(n, e) {
var t;
const i = In();
return s0(() => {
i.value = n();
}, C1(A1({}, e), {
flush: (t = void 0) != null ? t : "sync"
})), o0(i);
}
var jp;
const rn = typeof window < "u", L1 = (n) => typeof n == "string", h0 = () => {
}, td = rn && ((jp = window == null ? void 0 : window.navigator) == null ? void 0 : jp.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function d0(n) {
return typeof n == "function" ? n() : H(n);
}
function R1(n) {
return n;
}
function au(n) {
return a0() ? (l0(n), !0) : !1;
}
function P1(n, e = !0) {
cn() ? on(n) : e ? n() : Mt(n);
}
function ir(n) {
var e;
const t = d0(n);
return (e = t == null ? void 0 : t.$el) != null ? e : t;
}
const dl = rn ? window : void 0, I1 = rn ? window.document : void 0;
function pn(...n) {
let e, t, i, r;
if (L1(n[0]) || Array.isArray(n[0]) ? ([t, i, r] = n, e = dl) : [e, t, i, r] = n, !e)
return h0;
Array.isArray(t) || (t = [t]), Array.isArray(i) || (i = [i]);
const s = [], o = () => {
s.forEach((d) => d()), s.length = 0;
}, a = (d, h, p, g) => (d.addEventListener(h, p, g), () => d.removeEventListener(h, p, g)), c = Ke(() => [ir(e), d0(r)], ([d, h]) => {
o(), d && s.push(...t.flatMap((p) => i.map((g) => a(d, p, g, h))));
}, { immediate: !0, flush: "post" }), l = () => {
c(), o();
};
return au(l), l;
}
let $p = !1;
function O1(n, e, t = {}) {
const { window: i = dl, ignore: r = [], capture: s = !0, detectIframe: o = !1 } = t;
if (!i)
return;
td && !$p && ($p = !0, Array.from(i.document.body.children).forEach((p) => p.addEventListener("click", h0)));
let a = !0;
const c = (p) => r.some((g) => {
if (typeof g == "string")
return Array.from(i.document.querySelectorAll(g)).some((f) => f === p.target || p.composedPath().includes(f));
{
const f = ir(g);
return f && (p.target === f || p.composedPath().includes(f));
}
}), d = [
pn(i, "click", (p) => {
const g = ir(n);
if (!(!g || g === p.target || p.composedPath().includes(g))) {
if (p.detail === 0 && (a = !c(p)), !a) {
a = !0;
return;
}
e(p);
}
}, { passive: !0, capture: s }),
pn(i, "pointerdown", (p) => {
const g = ir(n);
g && (a = !p.composedPath().includes(g) && !c(p));
}, { passive: !0 }),
o && pn(i, "blur", (p) => {
var g;
const f = ir(n);
((g = i.document.activeElement) == null ? void 0 : g.tagName) === "IFRAME" && !(f != null && f.contains(i.document.activeElement)) && e(p);
})
].filter(Boolean);
return () => d.forEach((p) => p());
}
function f0(n, e = !1) {
const t = Ae(), i = () => t.value = !!n();
return i(), P1(i, e), t;
}
const Zp = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Xp = "__vueuse_ssr_handlers__";
Zp[Xp] = Zp[Xp] || {};
function D1({ document: n = I1 } = {}) {
if (!n)
return Ae("visible");
const e = Ae(n.visibilityState);
return pn(n, "visibilitychange", () => {
e.value = n.visibilityState;
}), e;
}
var Yp = Object.getOwnPropertySymbols, N1 = Object.prototype.hasOwnProperty, F1 = Object.prototype.propertyIsEnumerable, B1 = (n, e) => {
var t = {};
for (var i in n)
N1.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
if (n != null && Yp)
for (var i of Yp(n))
e.indexOf(i) < 0 && F1.call(n, i) && (t[i] = n[i]);
return t;
};
function ii(n, e, t = {}) {
const i = t, { window: r = dl } = i, s = B1(i, ["window"]);
let o;
const a = f0(() => r && "ResizeObserver" in r), c = () => {
o && (o.disconnect(), o = void 0);
}, l = Ke(() => ir(n), (h) => {
c(), a.value && r && h && (o = new ResizeObserver(e), o.observe(h, s));
}, { immediate: !0, flush: "post" }), d = () => {
c(), l();
};
return au(d), {
isSupported: a,
stop: d
};
}
var Jp = Object.getOwnPropertySymbols, z1 = Object.prototype.hasOwnProperty, U1 = Object.prototype.propertyIsEnumerable, V1 = (n, e) => {
var t = {};
for (var i in n)
z1.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
if (n != null && Jp)
for (var i of Jp(n))
e.indexOf(i) < 0 && U1.call(n, i) && (t[i] = n[i]);
return t;
};
function k1(n, e, t = {}) {
const i = t, { window: r = dl } = i, s = V1(i, ["window"]);
let o;
const a = f0(() => r && "MutationObserver" in r), c = () => {
o && (o.disconnect(), o = void 0);
}, l = Ke(() => ir(n), (h) => {
c(), a.value && r && h && (o = new MutationObserver(e), o.observe(h, s));
}, { immediate: !0 }), d = () => {
c(), l();
};
return au(d), {
isSupported: a,
stop: d
};
}
var qp;
(function(n) {
n.UP = "UP", n.RIGHT = "RIGHT", n.DOWN = "DOWN", n.LEFT = "LEFT", n.NONE = "NONE";
})(qp || (qp = {}));
var G1 = Object.defineProperty, Kp = Object.getOwnPropertySymbols, H1 = Object.prototype.hasOwnProperty, W1 = Object.prototype.propertyIsEnumerable, Qp = (n, e, t) => e in n ? G1(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, j1 = (n, e) => {
for (var t in e || (e = {}))
H1.call(e, t) && Qp(n, t, e[t]);
if (Kp)
for (var t of Kp(e))
W1.call(e, t) && Qp(n, t, e[t]);
return n;
};
const $1 = {
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]
};
j1({
linear: R1
}, $1);
function Z1({ window: n = dl } = {}) {
if (!n)
return Ae(!1);
const e = Ae(n.document.hasFocus());
return pn(n, "blur", () => {
e.value = !1;
}), pn(n, "focus", () => {
e.value = !0;
}), e;
}
const X1 = () => rn && /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 $a = () => {
}, Y1 = Object.prototype.hasOwnProperty, em = (n, e) => Y1.call(n, e), Un = Array.isArray, Ln = (n) => typeof n == "function", On = (n) => typeof n == "string", Pn = (n) => n !== null && typeof n == "object", J1 = Object.prototype.toString, q1 = (n) => J1.call(n), ju = (n) => q1(n).slice(8, -1), lf = (n) => {
const e = /* @__PURE__ */ Object.create(null);
return (t) => e[t] || (e[t] = n(t));
}, K1 = /-(\w)/g, Q1 = lf(
(n) => n.replace(K1, (e, t) => t ? t.toUpperCase() : "")
), eM = /\B([A-Z])/g, tM = lf(
(n) => n.replace(eM, "-$1").toLowerCase()
), nM = lf((n) => n.charAt(0).toUpperCase() + n.slice(1));
var p0 = typeof global == "object" && global && global.Object === Object && global, iM = typeof self == "object" && self && self.Object === Object && self, Gi = p0 || iM || Function("return this")(), Bi = Gi.Symbol, m0 = Object.prototype, rM = m0.hasOwnProperty, sM = m0.toString, ga = Bi ? Bi.toStringTag : void 0;
function oM(n) {
var e = rM.call(n, ga), t = n[ga];
try {
n[ga] = void 0;
var i = !0;
} catch {
}
var r = sM.call(n);
return i && (e ? n[ga] = t : delete n[ga]), r;
}
var aM = Object.prototype, lM = aM.toString;
function cM(n) {
return lM.call(n);
}
var uM = "[object Null]", hM = "[object Undefined]", tm = Bi ? Bi.toStringTag : void 0;
function ta(n) {
return n == null ? n === void 0 ? hM : uM : tm && tm in Object(n) ? oM(n) : cM(n);
}
function Co(n) {
return n != null && typeof n == "object";
}
var dM = "[object Symbol]";
function lu(n) {
return typeof n == "symbol" || Co(n) && ta(n) == dM;
}
function fM(n, e) {
for (var t = -1, i = n == null ? 0 : n.length, r = Array(i); ++t < i; )
r[t] = e(n[t], t, n);
return r;
}
var xi = Array.isArray, pM = 1 / 0, nm = Bi ? Bi.prototype : void 0, im = nm ? nm.toString : void 0;
function g0(n) {
if (typeof n == "string")
return n;
if (xi(n))
return fM(n, g0) + "";
if (lu(n))
return im ? im.call(n) : "";
var e = n + "";
return e == "0" && 1 / n == -pM ? "-0" : e;
}
var mM = /\s/;
function gM(n) {
for (var e = n.length; e-- && mM.test(n.charAt(e)); )
;
return e;
}
var vM = /^\s+/;
function yM(n) {
return n && n.slice(0, gM(n) + 1).replace(vM, "");
}
function Wr(n) {
var e = typeof n;
return n != null && (e == "object" || e == "function");
}
var rm = NaN, bM = /^[-+]0x[0-9a-f]+$/i, xM = /^0b[01]+$/i, wM = /^0o[0-7]+$/i, MM = parseInt;
function sm(n) {
if (typeof n == "number")
return n;
if (lu(n))
return rm;
if (Wr(n)) {
var e = typeof n.valueOf == "function" ? n.valueOf() : n;
n = Wr(e) ? e + "" : e;
}
if (typeof n != "string")
return n === 0 ? n : +n;
n = yM(n);
var t = xM.test(n);
return t || wM.test(n) ? MM(n.slice(2), t ? 2 : 8) : bM.test(n) ? rm : +n;
}
function v0(n) {
return n;
}
var SM = "[object AsyncFunction]", _M = "[object Function]", TM = "[object GeneratorFunction]", EM = "[object Proxy]";
function y0(n) {
if (!Wr(n))
return !1;
var e = ta(n);
return e == _M || e == TM || e == SM || e == EM;
}
var $u = Gi["__core-js_shared__"], om = function() {
var n = /[^.]+$/.exec($u && $u.keys && $u.keys.IE_PROTO || "");
return n ? "Symbol(src)_1." + n : "";
}();
function AM(n) {
return !!om && om in n;
}
var CM = Function.prototype, LM = CM.toString;
function Vs(n) {
if (n != null) {
try {
return LM.call(n);
} catch {
}
try {
return n + "";
} catch {
}
}
return "";
}
var RM = /[\\^$.*+?()[\]{}|]/g, PM = /^\[object .+?Constructor\]$/, IM = Function.prototype, OM = Object.prototype, DM = IM.toString, NM = OM.hasOwnProperty, FM = RegExp(
"^" + DM.call(NM).replace(RM, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function BM(n) {
if (!Wr(n) || AM(n))
return !1;
var e = y0(n) ? FM : PM;
return e.test(Vs(n));
}
function zM(n, e) {
return n == null ? void 0 : n[e];
}
function ks(n, e) {
var t = zM(n, e);
return BM(t) ? t : void 0;
}
var nd = ks(Gi, "WeakMap");
function UM(n, e, t) {
switch (t.length) {
case 0:
return n.call(e);
case 1:
return n.call(e, t[0]);
case 2:
return n.call(e, t[0], t[1]);
case 3:
return n.call(e, t[0], t[1], t[2]);
}
return n.apply(e, t);
}
var VM = 800, kM = 16, GM = Date.now;
function HM(n) {
var e = 0, t = 0;
return function() {
var i = GM(), r = kM - (i - t);
if (t = i, r > 0) {
if (++e >= VM)
return arguments[0];
} else
e = 0;
return n.apply(void 0, arguments);
};
}
function WM(n) {
return function() {
return n;
};
}
var Hc = function() {
try {
var n = ks(Object, "defineProperty");
return n({}, "", {}), n;
} catch {
}
}(), jM = Hc ? function(n, e) {
return Hc(n, "toString", {
configurable: !0,
enumerable: !1,
value: WM(e),
writable: !0
});
} : v0, $M = HM(jM);
function ZM(n, e, t, i) {
n.length;
for (var r = t + 1; r--; )
if (e(n[r], r, n))
return r;
return -1;
}
var XM = 9007199254740991, YM = /^(?:0|[1-9]\d*)$/;
function cf(n, e) {
var t = typeof n;
return e = e ?? XM, !!e && (t == "number" || t != "symbol" && YM.test(n)) && n > -1 && n % 1 == 0 && n < e;
}
function JM(n, e, t) {
e == "__proto__" && Hc ? Hc(n, e, {
configurable: !0,
enumerable: !0,
value: t,
writable: !0
}) : n[e] = t;
}
function uf(n, e) {
return n === e || n !== n && e !== e;
}
var qM = Object.prototype, KM = qM.hasOwnProperty;
function QM(n, e, t) {
var i = n[e];
(!(KM.call(n, e) && uf(i, t)) || t === void 0 && !(e in n)) && JM(n, e, t);
}
var am = Math.max;
function eS(n, e, t) {
return e = am(e === void 0 ? n.length - 1 : e, 0), function() {
for (var i = arguments, r = -1, s = am(i.length - e, 0), o = Array(s); ++r < s; )
o[r] = i[e + r];
r = -1;
for (var a = Array(e + 1); ++r < e; )
a[r] = i[r];
return a[e] = t(o), UM(n, this, a);
};
}
var tS = 9007199254740991;
function hf(n) {
return typeof n == "number" && n > -1 && n % 1 == 0 && n <= tS;
}
function nS(n) {
return n != null && hf(n.length) && !y0(n);
}
var iS = Object.prototype;
function rS(n) {
var e = n && n.constructor, t = typeof e == "function" && e.prototype || iS;
return n === t;
}
function sS(n, e) {
for (var t = -1, i = Array(n); ++t < n; )
i[t] = e(t);
return i;
}
var oS = "[object Arguments]";
function lm(n) {
return Co(n) && ta(n) == oS;
}
var b0 = Object.prototype, aS = b0.hasOwnProperty, lS = b0.propertyIsEnumerable, df = lm(/* @__PURE__ */ function() {
return arguments;
}()) ? lm : function(n) {
return Co(n) && aS.call(n, "callee") && !lS.call(n, "callee");
};
function cS() {
return !1;
}
var x0 = typeof exports == "object" && exports && !exports.nodeType && exports, cm = x0 && typeof module == "object" && module && !module.nodeType && module, uS = cm && cm.exports === x0, um = uS ? Gi.Buffer : void 0, hS = um ? um.isBuffer : void 0, id = hS || cS, dS = "[object Arguments]", fS = "[object Array]", pS = "[object Boolean]", mS = "[object Date]", gS = "[object Error]", vS = "[object Function]", yS = "[object Map]", bS = "[object Number]", xS = "[object Object]", wS = "[object RegExp]", MS = "[object Set]", SS = "[object String]", _S = "[object WeakMap]", TS = "[object ArrayBuffer]", ES = "[object DataView]", AS = "[object Float32Array]", CS = "[object Float64Array]", LS = "[object Int8Array]", RS = "[object Int16Array]", PS = "[object Int32Array]", IS = "[object Uint8Array]", OS = "[object Uint8ClampedArray]", DS = "[object Uint16Array]", NS = "[object Uint32Array]", Pt = {};
Pt[AS] = Pt[CS] = Pt[LS] = Pt[RS] = Pt[PS] = Pt[IS] = Pt[OS] = Pt[DS] = Pt[NS] = !0;
Pt[dS] = Pt[fS] = Pt[TS] = Pt[pS] = Pt[ES] = Pt[mS] = Pt[gS] = Pt[vS] = Pt[yS] = Pt[bS] = Pt[xS] = Pt[wS] = Pt[MS] = Pt[SS] = Pt[_S] = !1;
function FS(n) {
return Co(n) && hf(n.length) && !!Pt[ta(n)];
}
function BS(n) {
return function(e) {
return n(e);
};
}
var w0 = typeof exports == "object" && exports && !exports.nodeType && exports, Ba = w0 && typeof module == "object" && module && !module.nodeType && module, zS = Ba && Ba.exports === w0, Zu = zS && p0.process, hm = function() {
try {
var n = Ba && Ba.require && Ba.require("util").types;
return n || Zu && Zu.binding && Zu.binding("util");
} catch {
}
}(), dm = hm && hm.isTypedArray, M0 = dm ? BS(dm) : FS, US = Object.prototype, VS = US.hasOwnProperty;
function kS(n, e) {
var t = xi(n), i = !t && df(n), r = !t && !i && id(n), s = !t && !i && !r && M0(n), o = t || i || r || s, a = o ? sS(n.length, String) : [], c = a.length;
for (var l in n)
VS.call(n, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
(l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
r && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
s && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties.
cf(l, c))) && a.push(l);
return a;
}
function GS(n, e) {
return function(t) {
return n(e(t));
};
}
var HS = GS(Object.keys, Object), WS = Object.prototype, jS = WS.hasOwnProperty;
function $S(n) {
if (!rS(n))
return HS(n);
var e = [];
for (var t in Object(n))
jS.call(n, t) && t != "constructor" && e.push(t);
return e;
}
function S0(n) {
return nS(n) ? kS(n) : $S(n);
}
var ZS = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, XS = /^\w*$/;
function ff(n, e) {
if (xi(n))
return !1;
var t = typeof n;
return t == "number" || t == "symbol" || t == "boolean" || n == null || lu(n) ? !0 : XS.test(n) || !ZS.test(n) || e != null && n in Object(e);
}
var Za = ks(Object, "create");
function YS() {
this.__data__ = Za ? Za(null) : {}, this.size = 0;
}
function JS(n) {
var e = this.has(n) && delete this.__data__[n];
return this.size -= e ? 1 : 0, e;
}
var qS = "__lodash_hash_undefined__", KS = Object.prototype, QS = KS.hasOwnProperty;
function e_(n) {
var e = this.__data__;
if (Za) {
var t = e[n];
return t === qS ? void 0 : t;
}
return QS.call(e, n) ? e[n] : void 0;
}
var t_ = Object.prototype, n_ = t_.hasOwnProperty;
function i_(n) {
var e = this.__data__;
return Za ? e[n] !== void 0 : n_.call(e, n);
}
var r_ = "__lodash_hash_undefined__";
function s_(n, e) {
var t = this.__data__;
return this.size += this.has(n) ? 0 : 1, t[n] = Za && e === void 0 ? r_ : e, this;
}
function Rs(n) {
var e = -1, t = n == null ? 0 : n.length;
for (this.clear(); ++e < t; ) {
var i = n[e];
this.set(i[0], i[1]);
}
}
Rs.prototype.clear = YS;
Rs.prototype.delete = JS;
Rs.prototype.get = e_;
Rs.prototype.has = i_;
Rs.prototype.set = s_;
function o_() {
this.__data__ = [], this.size = 0;
}
function cu(n, e) {
for (var t = n.length; t--; )
if (uf(n[t][0], e))
return t;
return -1;
}
var a_ = Array.prototype, l_ = a_.splice;
function c_(n) {
var e = this.__data__, t = cu(e, n);
if (t < 0)
return !1;
var i = e.length - 1;
return t == i ? e.pop() : l_.call(e, t, 1), --this.size, !0;
}
function u_(n) {
var e = this.__data__, t = cu(e, n);
return t < 0 ? void 0 : e[t][1];
}
function h_(n) {
return cu(this.__data__, n) > -1;
}
function d_(n, e) {
var t = this.__data__, i = cu(t, n);
return i < 0 ? (++this.size, t.push([n, e])) : t[i][1] = e, this;
}
function pr(n) {
var e = -1, t = n == null ? 0 : n.length;
for (this.clear(); ++e < t; ) {
var i = n[e];
this.set(i[0], i[1]);
}
}
pr.prototype.clear = o_;
pr.prototype.delete = c_;
pr.prototype.get = u_;
pr.prototype.has = h_;
pr.prototype.set = d_;
var Xa = ks(Gi, "Map");
function f_() {
this.size = 0, this.__data__ = {
hash: new Rs(),
map: new (Xa || pr)(),
string: new Rs()
};
}
function p_(n) {
var e = typeof n;
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? n !== "__proto__" : n === null;
}
function uu(n, e) {
var t = n.__data__;
return p_(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map;
}
function m_(n) {
var e = uu(this, n).delete(n);
return this.size -= e ? 1 : 0, e;
}
function g_(n) {
return uu(this, n).get(n);
}
function v_(n) {
return uu(this, n).has(n);
}
function y_(n, e) {
var t = uu(this, n), i = t.size;
return t.set(n, e), this.size += t.size == i ? 0 : 1, this;
}
function mr(n) {
var e = -1, t = n == null ? 0 : n.length;
for (this.clear(); ++e < t; ) {
var i = n[e];
this.set(i[0], i[1]);
}
}
mr.prototype.clear = f_;
mr.prototype.delete = m_;
mr.prototype.get = g_;
mr.prototype.has = v_;
mr.prototype.set = y_;
var b_ = "Expected a function";
function pf(n, e) {
if (typeof n != "function" || e != null && typeof e != "function")
throw new TypeError(b_);
var t = function() {
var i = arguments, r = e ? e.apply(this, i) : i[0], s = t.cache;
if (s.has(r))
return s.get(r);
var o = n.apply(this, i);
return t.cache = s.set(r, o) || s, o;
};
return t.cache = new (pf.Cache || mr)(), t;
}
pf.Cache = mr;
var x_ = 500;
function w_(n) {
var e = pf(n, function(i) {
return t.size === x_ && t.clear(), i;
}), t = e.cache;
return e;
}
var M_ = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, S_ = /\\(\\)?/g, __ = w_(function(n) {
var e = [];
return n.charCodeAt(0) === 46 && e.push(""), n.replace(M_, function(t, i, r, s) {
e.push(r ? s.replace(S_, "$1") : i || t);
}), e;
});
function T_(n) {
return n == null ? "" : g0(n);
}
function hu(n, e) {
return xi(n) ? n : ff(n, e) ? [n] : __(T_(n));
}
var E_ = 1 / 0;
function fl(n) {
if (typeof n == "string" || lu(n))
return n;
var e = n + "";
return e == "0" && 1 / n == -E_ ? "-0" : e;
}
function mf(n, e) {
e = hu(e, n);
for (var t = 0, i = e.length; n != null && t < i; )
n = n[fl(e[t++])];
return t && t == i ? n : void 0;
}
function er(n, e, t) {
var i = n == null ? void 0 : mf(n, e);
return i === void 0 ? t : i;
}
function _0(n, e) {
for (var t = -1, i = e.length, r = n.length; ++t < i; )
n[r + t] = e[t];
return n;
}
var fm = Bi ? Bi.isConcatSpreadable : void 0;
function A_(n) {
return xi(n) || df(n) || !!(fm && n && n[fm]);
}
function C_(n, e, t, i, r) {
var s = -1, o = n.length;
for (t || (t = A_), r || (r = []); ++s < o; ) {
var a = n[s];
t(a) ? _0(r, a) : r[r.length] = a;
}
return r;
}
function L_(n) {
var e = n == null ? 0 : n.length;
return e ? C_(n) : [];
}
function R_(n) {
return $M(eS(n, void 0, L_), n + "");
}
function Ri() {
if (!arguments.length)
return [];
var n = arguments[0];
return xi(n) ? n : [n];
}
function P_() {
this.__data__ = new pr(), this.size = 0;
}
function I_(n) {
var e = this.__data__, t = e.delete(n);
return this.size = e.size, t;
}
function O_(n) {
return this.__data__.get(n);
}
function D_(n) {
return this.__data__.has(n);
}
var N_ = 200;
function F_(n, e) {
var t = this.__data__;
if (t instanceof pr) {
var i = t.__data__;
if (!Xa || i.length < N_ - 1)
return i.push([n, e]), this.size = ++t.size, this;
t = this.__data__ = new mr(i);
}
return t.set(n, e), this.size = t.size, this;
}
function rr(n) {
var e = this.__data__ = new pr(n);
this.size = e.size;
}
rr.prototype.clear = P_;
rr.prototype.delete = I_;
rr.prototype.get = O_;
rr.prototype.has = D_;
rr.prototype.set = F_;
function B_(n, e) {
for (var t = -1, i = n == null ? 0 : n.length, r = 0, s = []; ++t < i; ) {
var o = n[t];
e(o, t, n) && (s[r++] = o);
}
return s;
}
function z_() {
return [];
}
var U_ = Object.prototype, V_ = U_.propertyIsEnumerable, pm = Object.getOwnPropertySymbols, k_ = pm ? function(n) {
return n == null ? [] : (n = Object(n), B_(pm(n), function(e) {
return V_.call(n, e);
}));
} : z_;
function G_(n, e, t) {
var i = e(n);
return xi(n) ? i : _0(i, t(n));
}
function mm(n) {
return G_(n, S0, k_);
}
var rd = ks(Gi, "DataView"), sd = ks(Gi, "Promise"), od = ks(Gi, "Set"), gm = "[object Map]", H_ = "[object Object]", vm = "[object Promise]", ym = "[object Set]", bm = "[object WeakMap]", xm = "[object DataView]", W_ = Vs(rd), j_ = Vs(Xa), $_ = Vs(sd), Z_ = Vs(od), X_ = Vs(nd), Nr = ta;
(rd && Nr(new rd(new ArrayBuffer(1))) != xm || Xa && Nr(new Xa()) != gm || sd && Nr(sd.resolve()) != vm || od && Nr(new od()) != ym || nd && Nr(new nd()) != bm) && (Nr = function(n) {
var e = ta(n), t = e == H_ ? n.constructor : void 0, i = t ? Vs(t) : "";
if (i)
switch (i) {
case W_:
return xm;
case j_:
return gm;
case $_:
return vm;
case Z_:
return ym;
case X_:
return bm;
}
return e;
});
var wm = Gi.Uint8Array, Y_ = "__lodash_hash_undefined__";
function J_(n) {
return this.__data__.set(n, Y_), this;
}
function q_(n) {
return this.__data__.has(n);
}
function Wc(n) {
var e = -1, t = n == null ? 0 : n.length;
for (this.__data__ = new mr(); ++e < t; )
this.add(n[e]);
}
Wc.prototype.add = Wc.prototype.push = J_;
Wc.prototype.has = q_;
function K_(n, e) {
for (var t = -1, i = n == null ? 0 : n.length; ++t < i; )
if (e(n[t], t, n))
return !0;
return !1;
}
function Q_(n, e) {
return n.has(e);
}
var eT = 1, tT = 2;
function T0(n, e, t, i, r, s) {
var o = t & eT, a = n.length, c = e.length;
if (a != c && !(o && c > a))
return !1;
var l = s.get(n), d = s.get(e);
if (l && d)
return l == e && d == n;
var h = -1, p = !0, g = t & tT ? new Wc() : void 0;
for (s.set(n, e), s.set(e, n); ++h < a; ) {
var f = n[h], u = e[h];
if (i)
var y = o ? i(u, f, h, e, n, s) : i(f, u, h, n, e, s);
if (y !== void 0) {
if (y)
continue;
p = !1;
break;
}
if (g) {
if (!K_(e, function(v, m) {
if (!Q_(g, m) && (f === v || r(f, v, t, i, s)))
return g.push(m);
})) {
p = !1;
break;
}
} else if (!(f === u || r(f, u, t, i, s))) {
p = !1;
break;
}
}
return s.delete(n), s.delete(e), p;
}
function nT(n) {
var e = -1, t = Array(n.size);
return n.forEach(function(i, r) {
t[++e] = [r, i];
}), t;
}
function iT(n) {
var e = -1, t = Array(n.size);
return n.forEach(function(i) {
t[++e] = i;
}), t;
}
var rT = 1, sT = 2, oT = "[object Boolean]", aT = "[object Date]", lT = "[object Error]", cT = "[object Map]", uT = "[object Number]", hT = "[object RegExp]", dT = "[object Set]", fT = "[object String]", pT = "[object Symbol]", mT = "[object ArrayBuffer]", gT = "[object DataView]", Mm = Bi ? Bi.prototype : void 0, Xu = Mm ? Mm.valueOf : void 0;
function vT(n, e, t, i, r, s, o) {
switch (t) {
case gT:
if (n.byteLength != e.byteLength || n.byteOffset != e.byteOffset)
return !1;
n = n.buffer, e = e.buffer;
case mT:
return !(n.byteLength != e.byteLength || !s(new wm(n), new wm(e)));
case oT:
case aT:
case uT:
return uf(+n, +e);
case lT:
return n.name == e.name && n.message == e.message;
case hT:
case fT:
return n == e + "";
case cT:
var a = nT;
case dT:
var c = i & rT;
if (a || (a = iT), n.size != e.size && !c)
return !1;
var l = o.get(n);
if (l)
return l == e;
i |= sT, o.set(n, e);
var d = T0(a(n), a(e), i, r, s, o);
return o.delete(n), d;
case pT:
if (Xu)
return Xu.call(n) == Xu.call(e);
}
return !1;
}
var yT = 1, bT = Object.prototype, xT = bT.hasOwnProperty;
function wT(n, e, t, i, r, s) {
var o = t & yT, a = mm(n), c = a.length, l = mm(e), d = l.length;
if (c != d && !o)
return !1;
for (var h = c; h--; ) {
var p = a[h];
if (!(o ? p in e : xT.call(e, p)))
return !1;
}
var g = s.get(n), f = s.get(e);
if (g && f)
return g == e && f == n;
var u = !0;
s.set(n, e), s.set(e, n);
for (var y = o; ++h < c; ) {
p = a[h];
var v = n[p], m = e[p];
if (i)
var w = o ? i(m, v, p, e, n, s) : i(v, m, p, n, e, s);
if (!(w === void 0 ? v === m || r(v, m, t, i, s) : w)) {
u = !1;
break;
}
y || (y = p == "constructor");
}
if (u && !y) {
var S = n.constructor, T = e.constructor;
S != T && "constructor" in n && "constructor" in e && !(typeof S == "function" && S instanceof S && typeof T == "function" && T instanceof T) && (u = !1);
}
return s.delete(n), s.delete(e), u;
}
var MT = 1, Sm = "[object Arguments]", _m = "[object Array]", Nl = "[object Object]", ST = Object.prototype, Tm = ST.hasOwnProperty;
function _T(n, e, t, i, r, s) {
var o = xi(n), a = xi(e), c = o ? _m : Nr(n), l = a ? _m : Nr(e);
c = c == Sm ? Nl : c, l = l == Sm ? Nl : l;
var d = c == Nl, h = l == Nl, p = c == l;
if (p && id(n)) {
if (!id(e))
return !1;
o = !0, d = !1;
}
if (p && !d)
return s || (s = new rr()), o || M0(n) ? T0(n, e, t, i, r, s) : vT(n, e, c, t, i, r, s);
if (!(t & MT)) {
var g = d && Tm.call(n, "__wrapped__"), f = h && Tm.call(e, "__wrapped__");
if (g || f) {
var u = g ? n.value() : n, y = f ? e.value() : e;
return s || (s = new rr()), r(u, y, t, i, s);
}
}
return p ? (s || (s = new rr()), wT(n, e, t, i, r, s)) : !1;
}
function du(n, e, t, i, r) {
return n === e ? !0 : n == null || e == null || !Co(n) && !Co(e) ? n !== n && e !== e : _T(n, e, t, i, du, r);
}
var TT = 1, ET = 2;
function AT(n, e, t, i) {
var r = t.length, s = r;
if (n == null)
return !s;
for (n = Object(n); r--; ) {
var o = t[r];
if (o[2] ? o[1] !== n[o[0]] : !(o[0] in n))
return !1;
}
for (; ++r < s; ) {
o = t[r];
var a = o[0], c = n[a], l = o[1];
if (o[2]) {
if (c === void 0 && !(a in n))
return !1;
} else {
var d = new rr(), h;
if (!(h === void 0 ? du(l, c, TT | ET, i, d) : h))
return !1;
}
}
return !0;
}
function E0(n) {
return n === n && !Wr(n);
}
function CT(n) {
for (var e = S0(n), t = e.length; t--; ) {
var i = e[t], r = n[i];
e[t] = [i, r, E0(r)];
}
return e;
}
function A0(n, e) {
return function(t) {
return t == null ? !1 : t[n] === e && (e !== void 0 || n in Object(t));
};
}
function LT(n) {
var e = CT(n);
return e.length == 1 && e[0][2] ? A0(e[0][0], e[0][1]) : function(t) {
return t === n || AT(t, n, e);
};
}
function RT(n, e) {
return n != null && e in Object(n);
}
function PT(n, e, t) {
e = hu(e, n);
for (var i = -1, r = e.length, s = !1; ++i < r; ) {
var o = fl(e[i]);
if (!(s = n != null && t(n, o)))
break;
n = n[o];
}
return s || ++i != r ? s : (r = n == null ? 0 : n.length, !!r && hf(r) && cf(o, r) && (xi(n) || df(n)));
}
function C0(n, e) {
return n != null && PT(n, e, RT);
}
var IT = 1, OT = 2;
function DT(n, e) {
return ff(n) && E0(e) ? A0(fl(n), e) : function(t) {
var i = er(t, n);
return i === void 0 && i === e ? C0(t, n) : du(e, i, IT | OT);
};
}
function NT(n) {
return function(e) {
return e == null ? void 0 : e[n];
};
}
function FT(n) {
return function(e) {
return mf(e, n);
};
}
function BT(n) {
return ff(n) ? NT(fl(n)) : FT(n);
}
function zT(n) {
return typeof n == "function" ? n : n == null ? v0 : typeof n == "object" ? xi(n) ? DT(n[0], n[1]) : LT(n) : BT(n);
}
var Yu = function() {
return Gi.Date.now();
}, UT = "Expected a function", VT = Math.max, kT = Math.min;
function ad(n, e, t) {
var i, r, s, o, a, c, l = 0, d = !1, h = !1, p = !0;
if (typeof n != "function")
throw new TypeError(UT);
e = sm(e) || 0, Wr(t) && (d = !!t.leading, h = "maxWait" in t, s = h ? VT(sm(t.maxWait) || 0, e) : s, p = "trailing" in t ? !!t.trailing : p);
function g(M) {
var x = i, _ = r;
return i = r = void 0, l = M, o = n.apply(_, x), o;
}
function f(M) {
return l = M, a = setTimeout(v, e), d ? g(M) : o;
}
function u(M) {
var x = M - c, _ = M - l, E = e - x;
return h ? kT(E, s - _) : E;
}
function y(M) {
var x = M - c, _ = M - l;
return c === void 0 || x >= e || x < 0 || h && _ >= s;
}
function v() {
var M = Yu();
if (y(M))
return m(M);
a = setTimeout(v, u(M));
}
function m(M) {
return a = void 0, p && i ? g(M) : (i = r = void 0, o);
}
function w() {
a !== void 0 && clearTimeout(a), l = 0, i = c = r = a = void 0;
}
function S() {
return a === void 0 ? o : m(Yu());
}
function T() {
var M = Yu(), x = y(M);
if (i = arguments, r = this, c = M, x) {
if (a === void 0)
return f(c);
if (h)
return clearTimeout(a), a = setTimeout(v, e), g(c);
}
return a === void 0 && (a = setTimeout(v, e)), o;
}
return T.cancel = w, T.flush = S, T;
}
function GT(n, e, t) {
var i = n == null ? 0 : n.length;
if (!i)
return -1;
var r = i - 1;
return ZM(n, zT(e), r);
}
function jc(n) {
for (var e = -1, t = n == null ? 0 : n.length, i = {}; ++e < t; ) {
var r = n[e];
i[r[0]] = r[1];
}
return i;
}
function ld(n, e) {
return du(n, e);
}
function sr(n) {
return n == null;
}
function HT(n) {
return n === void 0;
}
function WT(n, e, t, i) {
if (!Wr(n))
return n;
e = hu(e, n);
for (var r = -1, s = e.length, o = s - 1, a = n; a != null && ++r < s; ) {
var c = fl(e[r]), l = t;
if (c === "__proto__" || c === "constructor" || c === "prototype")
return n;
if (r != o) {
var d = a[c];
l = void 0, l === void 0 && (l = Wr(d) ? d : cf(e[r + 1]) ? [] : {});
}
QM(a, c, l), a = a[c];
}
return n;
}
function jT(n, e, t) {
for (var i = -1, r = e.length, s = {}; ++i < r; ) {
var o = e[i], a = mf(n, o);
t(a, o) && WT(s, hu(o, n), a);
}
return s;
}
function $T(n, e) {
return jT(n, e, function(t, i) {
return C0(n, i);
});
}
var ZT = R_(function(n, e) {
return n == null ? {} : $T(n, e);
});
const yi = (n) => n === void 0, gf = (n) => typeof n == "boolean", St = (n) => typeof n == "number", Ms = (n) => typeof Element > "u" ? !1 : n instanceof Element, XT = (n) => On(n) ? !Number.isNaN(Number(n)) : !1, YT = (n = "") => n.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"), Br = (n) => nM(n), Em = (n) => Object.keys(n);
class L0 extends Error {
constructor(e) {
super(e), this.name = "ElementPlusError";
}
}
function na(n, e) {
throw new L0(`[${n}] ${e}`);
}
function en(n, e) {
if (process.env.NODE_ENV !== "production") {
const t = On(n) ? new L0(`[${n}] ${e}`) : n;
console.warn(t);
}
}
const JT = "utils/dom/style", R0 = (n = "") => n.split(" ").filter((e) => !!e.trim()), Am = (n, e) => {
!n || !e.trim() || n.classList.add(...R0(e));
}, $c = (n, e) => {
!n || !e.trim() || n.classList.remove(...R0(e));
}, va = (n, e) => {
var t;
if (!rn || !n || !e)
return "";
let i = Q1(e);
i === "float" && (i = "cssFloat");
try {
const r = n.style[i];
if (r)
return r;
const s = (t = document.defaultView) == null ? void 0 : t.getComputedStyle(n, "");
return s ? s[i] : "";
} catch {
return n.style[i];
}
};
function Zc(n, e = "px") {
if (!n)
return "";
if (St(n) || XT(n))
return `${n}${e}`;
if (On(n))
return n;
en(JT, "binding value must be a string or number");
}
function qT(n, e) {
if (!rn)
return;
if (!e) {
n.scrollTop = 0;
return;
}
const t = [];
let i = e.offsetParent;
for (; i !== null && n !== i && n.contains(i); )
t.push(i), i = i.offsetParent;
const r = e.offsetTop + t.reduce((c, l) => c + l.offsetTop, 0), s = r + e.offsetHeight, o = n.scrollTop, a = o + n.clientHeight;
r < o ? n.scrollTop = r : s > a && (n.scrollTop = s - n.clientHeight);
}
/*! Element Plus Icons Vue v2.3.1 */
var KT = /* @__PURE__ */ De({
name: "ArrowDown",
__name: "arrow-down",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("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"
})
]));
}
}), vf = KT, QT = /* @__PURE__ */ De({
name: "ArrowLeft",
__name: "arrow-left",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("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"
})
]));
}
}), jr = QT, eE = /* @__PURE__ */ De({
name: "ArrowRight",
__name: "arrow-right",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("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"
})
]));
}
}), $r = eE, tE = /* @__PURE__ */ De({
name: "ArrowUp",
__name: "arrow-up",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("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"
})
]));
}
}), nE = tE, iE = /* @__PURE__ */ De({
name: "CircleCheck",
__name: "circle-check",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("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"
}),
Be("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"
})
]));
}
}), rE = iE, sE = /* @__PURE__ */ De({
name: "CircleClose",
__name: "circle-close",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("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"
}),
Be("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"
})
]));
}
}), yf = sE, oE = /* @__PURE__ */ De({
name: "Close",
__name: "close",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("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"
})
]));
}
}), cd = oE, aE = /* @__PURE__ */ De({
name: "Delete",
__name: "delete",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("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 = aE, lE = /* @__PURE__ */ De({
name: "Hide",
__name: "hide",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("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"
}),
Be("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"
})
]));
}
}), cE = lE, uE = /* @__PURE__ */ De({
name: "Loading",
__name: "loading",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("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"
})
]));
}
}), P0 = uE, hE = /* @__PURE__ */ De({
name: "Minus",
__name: "minus",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("path", {
fill: "currentColor",
d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"
})
]));
}
}), dE = hE, fE = /* @__PURE__ */ De({
name: "Plus",
__name: "plus",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("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"
})
]));
}
}), fu = fE, pE = /* @__PURE__ */ De({
name: "View",
__name: "view",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("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"
})
]));
}
}), mE = pE, gE = /* @__PURE__ */ De({
name: "WarningFilled",
__name: "warning-filled",
setup(n) {
return (e, t) => (pe(), Re("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Be("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"
})
]));
}
}), I0 = gE;
const O0 = "__epPropKey", Ye = (n) => n, vE = (n) => Pn(n) && !!n[O0], pu = (n, e) => {
if (!Pn(n) || vE(n))
return n;
const { values: t, required: i, default: r, type: s, validator: o } = n, c = {
type: s,
required: !!i,
validator: t || o ? (l) => {
let d = !1, h = [];
if (t && (h = Array.from(t), em(n, "default") && h.push(r), d || (d = h.includes(l))), o && (d || (d = o(l))), !d && h.length > 0) {
const p = [...new Set(h)].map((g) => JSON.stringify(g)).join(", ");
Kw(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${p}], got value ${JSON.stringify(l)}.`);
}
return d;
} : void 0,
[O0]: !0
};
return em(n, "default") && (c.default = r), c;
}, dt = (n) => jc(Object.entries(n).map(([e, t]) => [
e,
pu(t, e)
])), Zr = Ye([
String,
Object,
Function
]), D0 = {
validating: P0,
success: rE,
error: yf
}, vn = (n, e) => {
if (n.install = (t) => {
for (const i of [n, ...Object.values(e ?? {})])
t.component(i.name, i);
}, e)
for (const [t, i] of Object.entries(e))
n[t] = i;
return n;
}, yE = (n, e) => (n.install = (t) => {
t.directive(e, n);
}, n), gr = (n) => (n.install = $a, n), Di = {
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"
}, Dt = "update:modelValue", Qr = "change", Ss = "input", N0 = ["", "default", "small", "large"], Fc = (n) => {
const e = Un(n) ? n : [n], t = [];
return e.forEach((i) => {
var r;
Un(i) ? t.push(...Fc(i)) : ed(i) && Un(i.children) ? t.push(...Fc(i.children)) : (t.push(i), ed(i) && ((r = i.component) != null && r.subTree) && t.push(...Fc(i.component.subTree)));
}), t;
}, bE = (n) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n), tr = (n) => n, xE = ["class", "style"], wE = /^on[A-Z]/, ME = (n = {}) => {
const { excludeListeners: e = !1, excludeKeys: t } = n, i = ce(() => ((t == null ? void 0 : t.value) || []).concat(xE)), r = cn();
return r ? ce(() => {
var s;
return jc(Object.entries((s = r.proxy) == null ? void 0 : s.$attrs).filter(([o]) => !i.value.includes(o) && !(e && wE.test(o))));
}) : (en("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), ce(() => ({})));
}, SE = ({ from: n, replacement: e, scope: t, version: i, ref: r, type: s = "API" }, o) => {
Ke(() => H(o), (a) => {
a && en(t, `[${s}] ${n} is about to be deprecated in version ${i}, please use ${e} instead.
For more detail, please visit: ${r}
`);
}, {
immediate: !0
});
};
var _E = {
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 TE = (n) => (e, t) => EE(e, t, H(n)), EE = (n, e, t) => er(t, n, n).replace(/\{(\w+)\}/g, (i, r) => {
var s;
return `${(s = e == null ? void 0 : e[r]) != null ? s : `{${r}}`}`;
}), AE = (n) => {
const e = ce(() => H(n).name), t = Ls(n) ? n : Ae(n);
return {
lang: e,
locale: t,
t: TE(n)
};
}, F0 = Symbol("localeContextKey"), mu = (n) => {
const e = n || ht(F0, Ae());
return AE(ce(() => e.value || _E));
}, Bc = "el", CE = "is-", ls = (n, e, t, i, r) => {
let s = `${n}-${e}`;
return t && (s += `-${t}`), i && (s += `__${i}`), r && (s += `--${r}`), s;
}, B0 = Symbol("namespaceContextKey"), bf = (n) => {
const e = n || (cn() ? ht(B0, Ae(Bc)) : Ae(Bc));
return ce(() => H(e) || Bc);
}, it = (n, e) => {
const t = bf(e);
return {
namespace: t,
b: (u = "") => ls(t.value, n, u, "", ""),
e: (u) => u ? ls(t.value, n, "", u, "") : "",
m: (u) => u ? ls(t.value, n, "", "", u) : "",
be: (u, y) => u && y ? ls(t.value, n, u, y, "") : "",
em: (u, y) => u && y ? ls(t.value, n, "", u, y) : "",
bm: (u, y) => u && y ? ls(t.value, n, u, "", y) : "",
bem: (u, y, v) => u && y && v ? ls(t.value, n, u, y, v) : "",
is: (u, ...y) => {
const v = y.length >= 1 ? y[0] : !0;
return u && v ? `${CE}${u}` : "";
},
cssVar: (u) => {
const y = {};
for (const v in u)
u[v] && (y[`--${t.value}-${v}`] = u[v]);
return y;
},
cssVarName: (u) => `--${t.value}-${u}`,
cssVarBlock: (u) => {
const y = {};
for (const v in u)
u[v] && (y[`--${t.value}-${n}-${v}`] = u[v]);
return y;
},
cssVarBlockName: (u) => `--${t.value}-${n}-${u}`
};
}, LE = pu({
type: Ye(Boolean),
default: null
}), RE = pu({
type: Ye(Function)
}), PE = (n) => {
const e = `update:${n}`, t = `onUpdate:${n}`, i = [e], r = {
[n]: LE,
[t]: RE
};
return {
useModelToggle: ({
indicator: o,
toggleReason: a,
shouldHideWhenRouteChanges: c,
shouldProceed: l,
onShow: d,
onHide: h
}) => {
const p = cn(), { emit: g } = p, f = p.props, u = ce(() => Ln(f[t])), y = ce(() => f[n] === null), v = (x) => {
o.value !== !0 && (o.value = !0, a && (a.value = x), Ln(d) && d(x));
}, m = (x) => {
o.value !== !1 && (o.value = !1, a && (a.value = x), Ln(h) && h(x));
}, w = (x) => {
if (f.disabled === !0 || Ln(l) && !l())
return;
const _ = u.value && rn;
_ && g(e, !0), (y.value || !_) && v(x);
}, S = (x) => {
if (f.disabled === !0 || !rn)
return;
const _ = u.value && rn;
_ && g(e, !1), (y.value || !_) && m(x);
}, T = (x) => {
gf(x) && (f.disabled && x ? u.value && g(e, !1) : o.value !== x && (x ? v() : m()));
}, M = () => {
o.value ? S() : w();
};
return Ke(() => f[n], T), c && p.appContext.config.globalProperties.$route !== void 0 && Ke(() => ({
...p.proxy.$route
}), () => {
c.value && o.value && S();
}), on(() => {
T(f[n]);
}), {
hide: S,
show: w,
toggle: M,
hasUpdateHandler: u
};
},
useModelToggleProps: r,
useModelToggleEmits: i
};
}, z0 = (n) => {
const e = cn();
return ce(() => {
var t, i;
return (i = (t = e == null ? void 0 : e.proxy) == null ? void 0 : t.$props) == null ? void 0 : i[n];
});
};
var kn = "top", oi = "bottom", ai = "right", Gn = "left", xf = "auto", pl = [kn, oi, ai, Gn], Lo = "start", Ya = "end", IE = "clippingParents", U0 = "viewport", ya = "popper", OE = "reference", Cm = pl.reduce(function(n, e) {
return n.concat([e + "-" + Lo, e + "-" + Ya]);
}, []), ia = [].concat(pl, [xf]).reduce(function(n, e) {
return n.concat([e, e + "-" + Lo, e + "-" + Ya]);
}, []), DE = "beforeRead", NE = "read", FE = "afterRead", BE = "beforeMain", zE = "main", UE = "afterMain", VE = "beforeWrite", kE = "write", GE = "afterWrite", HE = [DE, NE, FE, BE, zE, UE, VE, kE, GE];
function zi(n) {
return n ? (n.nodeName || "").toLowerCase() : null;
}
function Si(n) {
if (n == null) return window;
if (n.toString() !== "[object Window]") {
var e = n.ownerDocument;
return e && e.defaultView || window;
}
return n;
}
function Ro(n) {
var e = Si(n).Element;
return n instanceof e || n instanceof Element;
}
function si(n) {
var e = Si(n).HTMLElement;
return n instanceof e || n instanceof HTMLElement;
}
function wf(n) {
if (typeof ShadowRoot > "u") return !1;
var e = Si(n).ShadowRoot;
return n instanceof e || n instanceof ShadowRoot;
}
function WE(n) {
var e = n.state;
Object.keys(e.elements).forEach(function(t) {
var i = e.styles[t] || {}, r = e.attributes[t] || {}, s = e.elements[t];
!si(s) || !zi(s) || (Object.assign(s.style, i), Object.keys(r).forEach(function(o) {
var a = r[o];
a === !1 ? s.removeAttribute(o) : s.setAttribute(o, a === !0 ? "" : a);
}));
});
}
function jE(n) {
var e = n.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(i) {
var r = e.elements[i], s = e.attributes[i] || {}, o = Object.keys(e.styles.hasOwnProperty(i) ? e.styles[i] : t[i]), a = o.reduce(function(c, l) {
return c[l] = "", c;
}, {});
!si(r) || !zi(r) || (Object.assign(r.style, a), Object.keys(s).forEach(function(c) {
r.removeAttribute(c);
}));
});
};
}
var V0 = { name: "applyStyles", enabled: !0, phase: "write", fn: WE, effect: jE, requires: ["computeStyles"] };
function Ni(n) {
return n.split("-")[0];
}
var _s = Math.max, Yc = Math.min, Po = Math.round;
function Io(n, e) {
e === void 0 && (e = !1);
var t = n.getBoundingClientRect(), i = 1, r = 1;
if (si(n) && e) {
var s = n.offsetHeight, o = n.offsetWidth;
o > 0 && (i = Po(t.width) / o || 1), s > 0 && (r = Po(t.height) / s || 1);
}
return { width: t.width / i, height: t.height / r, top: t.top / r, right: t.right / i, bottom: t.bottom / r, left: t.left / i, x: t.left / i, y: t.top / r };
}
function Mf(n) {
var e = Io(n), t = n.offsetWidth, i = n.offsetHeight;
return Math.abs(e.width - t) <= 1 && (t = e.width), Math.abs(e.height - i) <= 1 && (i = e.height), { x: n.offsetLeft, y: n.offsetTop, width: t, height: i };
}
function k0(n, e) {
var t = e.getRootNode && e.getRootNode();
if (n.contains(e)) return !0;
if (t && wf(t)) {
var i = e;
do {
if (i && n.isSameNode(i)) return !0;
i = i.parentNode || i.host;
} while (i);
}
return !1;
}
function ur(n) {
return Si(n).getComputedStyle(n);
}
function $E(n) {
return ["table", "td", "th"].indexOf(zi(n)) >= 0;
}
function es(n) {
return ((Ro(n) ? n.ownerDocument : n.document) || window.document).documentElement;
}
function gu(n) {
return zi(n) === "html" ? n : n.assignedSlot || n.parentNode || (wf(n) ? n.host : null) || es(n);
}
function Lm(n) {
return !si(n) || ur(n).position === "fixed" ? null : n.offsetParent;
}
function ZE(n) {
var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, t = navigator.userAgent.indexOf("Trident") !== -1;
if (t && si(n)) {
var i = ur(n);
if (i.position === "fixed") return null;
}
var r = gu(n);
for (wf(r) && (r = r.host); si(r) && ["html", "body"].indexOf(zi(r)) < 0; ) {
var s = ur(r);
if (s.transform !== "none" || s.perspective !== "none" || s.contain === "paint" || ["transform", "perspective"].indexOf(s.willChange) !== -1 || e && s.willChange === "filter" || e && s.filter && s.filter !== "none") return r;
r = r.parentNode;
}
return null;
}
function ml(n) {
for (var e = Si(n), t = Lm(n); t && $E(t) && ur(t).position === "static"; ) t = Lm(t);
return t && (zi(t) === "html" || zi(t) === "body" && ur(t).position === "static") ? e : t || ZE(n) || e;
}
function Sf(n) {
return ["top", "bottom"].indexOf(n) >= 0 ? "x" : "y";
}
function za(n, e, t) {
return _s(n, Yc(e, t));
}
function XE(n, e, t) {
var i = za(n, e, t);
return i > t ? t : i;
}
function G0() {
return { top: 0, right: 0, bottom: 0, left: 0 };
}
function H0(n) {
return Object.assign({}, G0(), n);
}
function W0(n, e) {
return e.reduce(function(t, i) {
return t[i] = n, t;
}, {});
}
var YE = function(n, e) {
return n = typeof n == "function" ? n(Object.assign({}, e.rects, { placement: e.placement })) : n, H0(typeof n != "number" ? n : W0(n, pl));
};
function JE(n) {
var e, t = n.state, i = n.name, r = n.options, s = t.elements.arrow, o = t.modifiersData.popperOffsets, a = Ni(t.placement), c = Sf(a), l = [Gn, ai].indexOf(a) >= 0, d = l ? "height" : "width";
if (!(!s || !o)) {
var h = YE(r.padding, t), p = Mf(s), g = c === "y" ? kn : Gn, f = c === "y" ? oi : ai, u = t.rects.reference[d] + t.rects.reference[c] - o[c] - t.rects.popper[d], y = o[c] - t.rects.reference[c], v = ml(s), m = v ? c === "y" ? v.clientHeight || 0 : v.clientWidth || 0 : 0, w = u / 2 - y / 2, S = h[g], T = m - p[d] - h[f], M = m / 2 - p[d] / 2 + w, x = za(S, M, T), _ = c;
t.modifiersData[i] = (e = {}, e[_] = x, e.centerOffset = x - M, e);
}
}
function qE(n) {
var e = n.state, t = n.options, i = t.element, r = i === void 0 ? "[data-popper-arrow]" : i;
r != null && (typeof r == "string" && (r = e.elements.popper.querySelector(r), !r) || !k0(e.elements.popper, r) || (e.elements.arrow = r));
}
var KE = { name: "arrow", enabled: !0, phase: "main", fn: JE, effect: qE, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] };
function Oo(n) {
return n.split("-")[1];
}
var QE = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
function eA(n) {
var e = n.x, t = n.y, i = window, r = i.devicePixelRatio || 1;
return { x: Po(e * r) / r || 0, y: Po(t * r) / r || 0 };
}
function Rm(n) {
var e, t = n.popper, i = n.popperRect, r = n.placement, s = n.variation, o = n.offsets, a = n.position, c = n.gpuAcceleration, l = n.adaptive, d = n.roundOffsets, h = n.isFixed, p = o.x, g = p === void 0 ? 0 : p, f = o.y, u = f === void 0 ? 0 : f, y = typeof d == "function" ? d({ x: g, y: u }) : { x: g, y: u };
g = y.x, u = y.y;
var v = o.hasOwnProperty("x"), m = o.hasOwnProperty("y"), w = Gn, S = kn, T = window;
if (l) {
var M = ml(t), x = "clientHeight", _ = "clientWidth";
if (M === Si(t) && (M = es(t), ur(M).position !== "static" && a === "absolute" && (x = "scrollHeight", _ = "scrollWidth")), M = M, r === kn || (r === Gn || r === ai) && s === Ya) {
S = oi;
var E = h && M === T && T.visualViewport ? T.visualViewport.height : M[x];
u -= E - i.height, u *= c ? 1 : -1;
}
if (r === Gn || (r === kn || r === oi) && s === Ya) {
w = ai;
var L = h && M === T && T.visualViewport ? T.visualViewport.width : M[_];
g -= L - i.width, g *= c ? 1 : -1;
}
}
var R = Object.assign({ position: a }, l && QE), C = d === !0 ? eA({ x: g, y: u }) : { x: g, y: u };
if (g = C.x, u = C.y, c) {
var A;
return Object.assign({}, R, (A = {}, A[S] = m ? "0" : "", A[w] = v ? "0" : "", A.transform = (T.devicePixelRatio || 1) <= 1 ? "translate(" + g + "px, " + u + "px)" : "translate3d(" + g + "px, " + u + "px, 0)", A));
}
return Object.assign({}, R, (e = {}, e[S] = m ? u + "px" : "", e[w] = v ? g + "px" : "", e.transform = "", e));
}
function tA(n) {
var e = n.state, t = n.options, i = t.gpuAcceleration, r = i === void 0 ? !0 : i, s = t.adaptive, o = s === void 0 ? !0 : s, a = t.roundOffsets, c = a === void 0 ? !0 : a, l = { placement: Ni(e.placement), variation: Oo(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: r, isFixed: e.options.strategy === "fixed" };
e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, Rm(Object.assign({}, l, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: o, roundOffsets: c })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, Rm(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 j0 = { name: "computeStyles", enabled: !0, phase: "beforeWrite", fn: tA, data: {} }, Fl = { passive: !0 };
function nA(n) {
var e = n.state, t = n.instance, i = n.options, r = i.scroll, s = r === void 0 ? !0 : r, o = i.resize, a = o === void 0 ? !0 : o, c = Si(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper);
return s && l.forEach(function(d) {
d.addEventListener("scroll", t.update, Fl);
}), a && c.addEventListener("resize", t.update, Fl), function() {
s && l.forEach(function(d) {
d.removeEventListener("scroll", t.update, Fl);
}), a && c.removeEventListener("resize", t.update, Fl);
};
}
var $0 = { name: "eventListeners", enabled: !0, phase: "write", fn: function() {
}, effect: nA, data: {} }, iA = { left: "right", right: "left", bottom: "top", top: "bottom" };
function zc(n) {
return n.replace(/left|right|bottom|top/g, function(e) {
return iA[e];
});
}
var rA = { start: "end", end: "start" };
function Pm(n) {
return n.replace(/start|end/g, function(e) {
return rA[e];
});
}
function _f(n) {
var e = Si(n), t = e.pageXOffset, i = e.pageYOffset;
return { scrollLeft: t, scrollTop: i };
}
function Tf(n) {
return Io(es(n)).left + _f(n).scrollLeft;
}
function sA(n) {
var e = Si(n), t = es(n), i = e.visualViewport, r = t.clientWidth, s = t.clientHeight, o = 0, a = 0;
return i && (r = i.width, s = i.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (o = i.offsetLeft, a = i.offsetTop)), { width: r, height: s, x: o + Tf(n), y: a };
}
function oA(n) {
var e, t = es(n), i = _f(n), r = (e = n.ownerDocument) == null ? void 0 : e.body, s = _s(t.scrollWidth, t.clientWidth, r ? r.scrollWidth : 0, r ? r.clientWidth : 0), o = _s(t.scrollHeight, t.clientHeight, r ? r.scrollHeight : 0, r ? r.clientHeight : 0), a = -i.scrollLeft + Tf(n), c = -i.scrollTop;
return ur(r || t).direction === "rtl" && (a += _s(t.clientWidth, r ? r.clientWidth : 0) - s), { width: s, height: o, x: a, y: c };
}
function Ef(n) {
var e = ur(n), t = e.overflow, i = e.overflowX, r = e.overflowY;
return /auto|scroll|overlay|hidden/.test(t + r + i);
}
function Z0(n) {
return ["html", "body", "#document"].indexOf(zi(n)) >= 0 ? n.ownerDocument.body : si(n) && Ef(n) ? n : Z0(gu(n));
}
function Ua(n, e) {
var t;
e === void 0 && (e = []);
var i = Z0(n), r = i === ((t = n.ownerDocument) == null ? void 0 : t.body), s = Si(i), o = r ? [s].concat(s.visualViewport || [], Ef(i) ? i : []) : i, a = e.concat(o);
return r ? a : a.concat(Ua(gu(o)));
}
function ud(n) {
return Object.assign({}, n, { left: n.x, top: n.y, right: n.x + n.width, bottom: n.y + n.height });
}
function aA(n) {
var e = Io(n);
return e.top = e.top + n.clientTop, e.left = e.left + n.clientLeft, e.bottom = e.top + n.clientHeight, e.right = e.left + n.clientWidth, e.width = n.clientWidth, e.height = n.clientHeight, e.x = e.left, e.y = e.top, e;
}
function Im(n, e) {
return e === U0 ? ud(sA(n)) : Ro(e) ? aA(e) : ud(oA(es(n)));
}
function lA(n) {
var e = Ua(gu(n)), t = ["absolute", "fixed"].indexOf(ur(n).position) >= 0, i = t && si(n) ? ml(n) : n;
return Ro(i) ? e.filter(function(r) {
return Ro(r) && k0(r, i) && zi(r) !== "body";
}) : [];
}
function cA(n, e, t) {
var i = e === "clippingParents" ? lA(n) : [].concat(e), r = [].concat(i, [t]), s = r[0], o = r.reduce(function(a, c) {
var l = Im(n, c);
return a.top = _s(l.top, a.top), a.right = Yc(l.right, a.right), a.bottom = Yc(l.bottom, a.bottom), a.left = _s(l.left, a.left), a;
}, Im(n, s));
return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o;
}
function X0(n) {
var e = n.reference, t = n.element, i = n.placement, r = i ? Ni(i) : null, s = i ? Oo(i) : null, o = e.x + e.width / 2 - t.width / 2, a = e.y + e.height / 2 - t.height / 2, c;
switch (r) {
case kn:
c = { x: o, y: e.y - t.height };
break;
case oi:
c = { x: o, y: e.y + e.height };
break;
case ai:
c = { x: e.x + e.width, y: a };
break;
case Gn:
c = { x: e.x - t.width, y: a };
break;
default:
c = { x: e.x, y: e.y };
}
var l = r ? Sf(r) : null;
if (l != null) {
var d = l === "y" ? "height" : "width";
switch (s) {
case Lo:
c[l] = c[l] - (e[d] / 2 - t[d] / 2);
break;
case Ya:
c[l] = c[l] + (e[d] / 2 - t[d] / 2);
break;
}
}
return c;
}
function Ja(n, e) {
e === void 0 && (e = {});
var t = e, i = t.placement, r = i === void 0 ? n.placement : i, s = t.boundary, o = s === void 0 ? IE : s, a = t.rootBoundary, c = a === void 0 ? U0 : a, l = t.elementContext, d = l === void 0 ? ya : l, h = t.altBoundary, p = h === void 0 ? !1 : h, g = t.padding, f = g === void 0 ? 0 : g, u = H0(typeof f != "number" ? f : W0(f, pl)), y = d === ya ? OE : ya, v = n.rects.popper, m = n.elements[p ? y : d], w = cA(Ro(m) ? m : m.contextElement || es(n.elements.popper), o, c), S = Io(n.elements.reference), T = X0({ reference: S, element: v, strategy: "absolute", placement: r }), M = ud(Object.assign({}, v, T)), x = d === ya ? M : S, _ = { top: w.top - x.top + u.top, bottom: x.bottom - w.bottom + u.bottom, left: w.left - x.left + u.left, right: x.right - w.right + u.right }, E = n.modifiersData.offset;
if (d === ya && E) {
var L = E[r];
Object.keys(_).forEach(function(R) {
var C = [ai, oi].indexOf(R) >= 0 ? 1 : -1, A = [kn, oi].indexOf(R) >= 0 ? "y" : "x";
_[R] += L[A] * C;
});
}
return _;
}
function uA(n, e) {
e === void 0 && (e = {});
var t = e, i = t.placement, r = t.boundary, s = t.rootBoundary, o = t.padding, a = t.flipVariations, c = t.allowedAutoPlacements, l = c === void 0 ? ia : c, d = Oo(i), h = d ? a ? Cm : Cm.filter(function(f) {
return Oo(f) === d;
}) : pl, p = h.filter(function(f) {
return l.indexOf(f) >= 0;
});
p.length === 0 && (p = h);
var g = p.reduce(function(f, u) {
return f[u] = Ja(n, { placement: u, boundary: r, rootBoundary: s, padding: o })[Ni(u)], f;
}, {});
return Object.keys(g).sort(function(f, u) {
return g[f] - g[u];
});
}
function hA(n) {
if (Ni(n) === xf) return [];
var e = zc(n);
return [Pm(n), e, Pm(e)];
}
function dA(n) {
var e = n.state, t = n.options, i = n.name;
if (!e.modifiersData[i]._skip) {
for (var r = t.mainAxis, s = r === void 0 ? !0 : r, o = t.altAxis, a = o === void 0 ? !0 : o, c = t.fallbackPlacements, l = t.padding, d = t.boundary, h = t.rootBoundary, p = t.altBoundary, g = t.flipVariations, f = g === void 0 ? !0 : g, u = t.allowedAutoPlacements, y = e.options.placement, v = Ni(y), m = v === y, w = c || (m || !f ? [zc(y)] : hA(y)), S = [y].concat(w).reduce(function(ie, j) {
return ie.concat(Ni(j) === xf ? uA(e, { placement: j, boundary: d, rootBoundary: h, padding: l, flipVariations: f, allowedAutoPlacements: u }) : j);
}, []), T = e.rects.reference, M = e.rects.popper, x = /* @__PURE__ */ new Map(), _ = !0, E = S[0], L = 0; L < S.length; L++) {
var R = S[L], C = Ni(R), A = Oo(R) === Lo, P = [kn, oi].indexOf(C) >= 0, I = P ? "width" : "height", b = Ja(e, { placement: R, boundary: d, rootBoundary: h, altBoundary: p, padding: l }), O = P ? A ? ai : Gn : A ? oi : kn;
T[I] > M[I] && (O = zc(O));
var N = zc(O), D = [];
if (s && D.push(b[C] <= 0), a && D.push(b[O] <= 0, b[N] <= 0), D.every(function(ie) {
return ie;
})) {
E = R, _ = !1;
break;
}
x.set(R, D);
}
if (_) for (var B = f ? 3 : 1, U = function(ie) {
var j = S.find(function(G) {
var W = x.get(G);
if (W) return W.slice(0, ie).every(function(q) {
return q;
});
});
if (j) return E = j, "break";
}, k = B; k > 0; k--) {
var K = U(k);
if (K === "break") break;
}
e.placement !== E && (e.modifiersData[i]._skip = !0, e.placement = E, e.reset = !0);
}
}
var fA = { name: "flip", enabled: !0, phase: "main", fn: dA, requiresIfExists: ["offset"], data: { _skip: !1 } };
function Om(n, e, t) {
return t === void 0 && (t = { x: 0, y: 0 }), { top: n.top - e.height - t.y, right: n.right - e.width + t.x, bottom: n.bottom - e.height + t.y, left: n.left - e.width - t.x };
}
function Dm(n) {
return [kn, ai, oi, Gn].some(function(e) {
return n[e] >= 0;
});
}
function pA(n) {
var e = n.state, t = n.name, i = e.rects.reference, r = e.rects.popper, s = e.modifiersData.preventOverflow, o = Ja(e, { elementContext: "reference" }), a = Ja(e, { altBoundary: !0 }), c = Om(o, i), l = Om(a, r, s), d = Dm(c), h = Dm(l);
e.modifiersData[t] = { referenceClippingOffsets: c, popperEscapeOffsets: l, isReferenceHidden: d, hasPopperEscaped: h }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": d, "data-popper-escaped": h });
}
var mA = { name: "hide", enabled: !0, phase: "main", requiresIfExists: ["preventOverflow"], fn: pA };
function gA(n, e, t) {
var i = Ni(n), r = [Gn, kn].indexOf(i) >= 0 ? -1 : 1, s = typeof t == "function" ? t(Object.assign({}, e, { placement: n })) : t, o = s[0], a = s[1];
return o = o || 0, a = (a || 0) * r, [Gn, ai].indexOf(i) >= 0 ? { x: a, y: o } : { x: o, y: a };
}
function vA(n) {
var e = n.state, t = n.options, i = n.name, r = t.offset, s = r === void 0 ? [0, 0] : r, o = ia.reduce(function(d, h) {
return d[h] = gA(h, e.rects, s), d;
}, {}), a = o[e.placement], c = a.x, l = a.y;
e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += c, e.modifiersData.popperOffsets.y += l), e.modifiersData[i] = o;
}
var yA = { name: "offset", enabled: !0, phase: "main", requires: ["popperOffsets"], fn: vA };
function bA(n) {
var e = n.state, t = n.name;
e.modifiersData[t] = X0({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement });
}
var Y0 = { name: "popperOffsets", enabled: !0, phase: "read", fn: bA, data: {} };
function xA(n) {
return n === "x" ? "y" : "x";
}
function wA(n) {
var e = n.state, t = n.options, i = n.name, r = t.mainAxis, s = r === void 0 ? !0 : r, o = t.altAxis, a = o === void 0 ? !1 : o, c = t.boundary, l = t.rootBoundary, d = t.altBoundary, h = t.padding, p = t.tether, g = p === void 0 ? !0 : p, f = t.tetherOffset, u = f === void 0 ? 0 : f, y = Ja(e, { boundary: c, rootBoundary: l, padding: h, altBoundary: d }), v = Ni(e.placement), m = Oo(e.placement), w = !m, S = Sf(v), T = xA(S), M = e.modifiersData.popperOffsets, x = e.rects.reference, _ = e.rects.popper, E = typeof u == "function" ? u(Object.assign({}, e.rects, { placement: e.placement })) : u, L = typeof E == "number" ? { mainAxis: E, altAxis: E } : Object.assign({ mainAxis: 0, altAxis: 0 }, E), R = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, C = { x: 0, y: 0 };
if (M) {
if (s) {
var A, P = S === "y" ? kn : Gn, I = S === "y" ? oi : ai, b = S === "y" ? "height" : "width", O = M[S], N = O + y[P], D = O - y[I], B = g ? -_[b] / 2 : 0, U = m === Lo ? x[b] : _[b], k = m === Lo ? -_[b] : -x[b], K = e.elements.arrow, ie = g && K ? Mf(K) : { width: 0, height: 0 }, j = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : G0(), G = j[P], W = j[I], q = za(0, x[b], ie[b]), Q = w ? x[b] / 2 - B - q - G - L.mainAxis : U - q - G - L.mainAxis, ee = w ? -x[b] / 2 + B + q + W + L.mainAxis : k + q + W + L.mainAxis, ne = e.elements.arrow && ml(e.elements.arrow), Y = ne ? S === "y" ? ne.clientTop || 0 : ne.clientLeft || 0 : 0, te = (A = R == null ? void 0 : R[S]) != null ? A : 0, F = O + Q - te - Y, $ = O + ee - te, J = za(g ? Yc(N, F) : N, O, g ? _s(D, $) : D);
M[S] = J, C[S] = J - O;
}
if (a) {
var z, V = S === "x" ? kn : Gn, oe = S === "x" ? oi : ai, ue = M[T], le = T === "y" ? "height" : "width", ve = ue + y[V], xe = ue - y[oe], Te = [kn, Gn].indexOf(v) !== -1, de = (z = R == null ? void 0 : R[T]) != null ? z : 0, we = Te ? ve : ue - x[le] - _[le] - de + L.altAxis, se = Te ? ue + x[le] + _[le] - de - L.altAxis : xe, Se = g && Te ? XE(we, ue, se) : za(g ? we : ve, ue, g ? se : xe);
M[T] = Se, C[T] = Se - ue;
}
e.modifiersData[i] = C;
}
}
var MA = { name: "preventOverflow", enabled: !0, phase: "main", fn: wA, requiresIfExists: ["offset"] };
function SA(n) {
return { scrollLeft: n.scrollLeft, scrollTop: n.scrollTop };
}
function _A(n) {
return n === Si(n) || !si(n) ? _f(n) : SA(n);
}
function TA(n) {
var e = n.getBoundingClientRect(), t = Po(e.width) / n.offsetWidth || 1, i = Po(e.height) / n.offsetHeight || 1;
return t !== 1 || i !== 1;
}
function EA(n, e, t) {
t === void 0 && (t = !1);
var i = si(e), r = si(e) && TA(e), s = es(e), o = Io(n, r), a = { scrollLeft: 0, scrollTop: 0 }, c = { x: 0, y: 0 };
return (i || !i && !t) && ((zi(e) !== "body" || Ef(s)) && (a = _A(e)), si(e) ? (c = Io(e, !0), c.x += e.clientLeft, c.y += e.clientTop) : s && (c.x = Tf(s))), { x: o.left + a.scrollLeft - c.x, y: o.top + a.scrollTop - c.y, width: o.width, height: o.height };
}
function AA(n) {
var e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), i = [];
n.forEach(function(s) {
e.set(s.name, s);
});
function r(s) {
t.add(s.name);
var o = [].concat(s.requires || [], s.requiresIfExists || []);
o.forEach(function(a) {
if (!t.has(a)) {
var c = e.get(a);
c && r(c);
}
}), i.push(s);
}
return n.forEach(function(s) {
t.has(s.name) || r(s);
}), i;
}
function CA(n) {
var e = AA(n);
return HE.reduce(function(t, i) {
return t.concat(e.filter(function(r) {
return r.phase === i;
}));
}, []);
}
function LA(n) {
var e;
return function() {
return e || (e = new Promise(function(t) {
Promise.resolve().then(function() {
e = void 0, t(n());
});
})), e;
};
}
function RA(n) {
var e = n.reduce(function(t, i) {
var r = t[i.name];
return t[i.name] = r ? Object.assign({}, r, i, { options: Object.assign({}, r.options, i.options), data: Object.assign({}, r.data, i.data) }) : i, t;
}, {});
return Object.keys(e).map(function(t) {
return e[t];
});
}
var Nm = { placement: "bottom", modifiers: [], strategy: "absolute" };
function Fm() {
for (var n = arguments.length, e = new Array(n), t = 0; t < n; t++) e[t] = arguments[t];
return !e.some(function(i) {
return !(i && typeof i.getBoundingClientRect == "function");
});
}
function Af(n) {
n === void 0 && (n = {});
var e = n, t = e.defaultModifiers, i = t === void 0 ? [] : t, r = e.defaultOptions, s = r === void 0 ? Nm : r;
return function(o, a, c) {
c === void 0 && (c = s);
var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Nm, s), modifiersData: {}, elements: { reference: o, popper: a }, attributes: {}, styles: {} }, d = [], h = !1, p = { state: l, setOptions: function(u) {
var y = typeof u == "function" ? u(l.options) : u;
f(), l.options = Object.assign({}, s, l.options, y), l.scrollParents = { reference: Ro(o) ? Ua(o) : o.contextElement ? Ua(o.contextElement) : [], popper: Ua(a) };
var v = CA(RA([].concat(i, l.options.modifiers)));
return l.orderedModifiers = v.filter(function(m) {
return m.enabled;
}), g(), p.update();
}, forceUpdate: function() {
if (!h) {
var u = l.elements, y = u.reference, v = u.popper;
if (Fm(y, v)) {
l.rects = { reference: EA(y, ml(v), l.options.strategy === "fixed"), popper: Mf(v) }, l.reset = !1, l.placement = l.options.placement, l.orderedModifiers.forEach(function(_) {
return l.modifiersData[_.name] = Object.assign({}, _.data);
});
for (var m = 0; m < l.orderedModifiers.length; m++) {
if (l.reset === !0) {
l.reset = !1, m = -1;
continue;
}
var w = l.orderedModifiers[m], S = w.fn, T = w.options, M = T === void 0 ? {} : T, x = w.name;
typeof S == "function" && (l = S({ state: l, options: M, name: x, instance: p }) || l);
}
}
}
}, update: LA(function() {
return new Promise(function(u) {
p.forceUpdate(), u(l);
});
}), destroy: function() {
f(), h = !0;
} };
if (!Fm(o, a)) return p;
p.setOptions(c).then(function(u) {
!h && c.onFirstUpdate && c.onFirstUpdate(u);
});
function g() {
l.orderedModifiers.forEach(function(u) {
var y = u.name, v = u.options, m = v === void 0 ? {} : v, w = u.effect;
if (typeof w == "function") {
var S = w({ state: l, name: y, instance: p, options: m }), T = function() {
};
d.push(S || T);
}
});
}
function f() {
d.forEach(function(u) {
return u();
}), d = [];
}
return p;
};
}
Af();
var PA = [$0, Y0, j0, V0];
Af({ defaultModifiers: PA });
var IA = [$0, Y0, j0, V0, yA, fA, MA, KE, mA], OA = Af({ defaultModifiers: IA });
const DA = (n, e, t = {}) => {
const i = {
name: "updateState",
enabled: !0,
phase: "write",
fn: ({ state: c }) => {
const l = NA(c);
Object.assign(o.value, l);
},
requires: ["computeStyles"]
}, r = ce(() => {
const { onFirstUpdate: c, placement: l, strategy: d, modifiers: h } = H(t);
return {
onFirstUpdate: c,
placement: l || "bottom",
strategy: d || "absolute",
modifiers: [
...h || [],
i,
{ name: "applyStyles", enabled: !1 }
]
};
}), s = In(), o = Ae({
styles: {
popper: {
position: H(r).strategy,
left: "0",
top: "0"
},
arrow: {
position: "absolute"
}
},
attributes: {}
}), a = () => {
s.value && (s.value.destroy(), s.value = void 0);
};
return Ke(r, (c) => {
const l = H(s);
l && l.setOptions(c);
}, {
deep: !0
}), Ke([n, e], ([c, l]) => {
a(), !(!c || !l) && (s.value = OA(c, l, H(r)));
}), li(() => {
a();
}), {
state: ce(() => {
var c;
return { ...((c = H(s)) == null ? void 0 : c.state) || {} };
}),
styles: ce(() => H(o).styles),
attributes: ce(() => H(o).attributes),
update: () => {
var c;
return (c = H(s)) == null ? void 0 : c.update();
},
forceUpdate: () => {
var c;
return (c = H(s)) == null ? void 0 : c.forceUpdate();
},
instanceRef: ce(() => H(s))
};
};
function NA(n) {
const e = Object.keys(n.elements), t = jc(e.map((r) => [r, n.styles[r] || {}])), i = jc(e.map((r) => [r, n.attributes[r]]));
return {
styles: t,
attributes: i
};
}
function Bm() {
let n;
const e = (i, r) => {
t(), n = window.setTimeout(i, r);
}, t = () => window.clearTimeout(n);
return au(() => t()), {
registerTimeout: e,
cancelTimeout: t
};
}
const hd = {
prefix: Math.floor(Math.random() * 1e4),
current: 0
}, FA = Symbol("elIdInjection"), Cf = () => cn() ? ht(FA, hd) : hd, vu = (n) => {
const e = Cf();
!rn && e === hd && en("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 = bf();
return ce(() => H(n) || `${t.value}-id-${e.prefix}-${e.current++}`);
};
let xo = [];
const zm = (n) => {
const e = n;
e.key === Di.esc && xo.forEach((t) => t(e));
}, BA = (n) => {
on(() => {
xo.length === 0 && document.addEventListener("keydown", zm), rn && xo.push(n);
}), li(() => {
xo = xo.filter((e) => e !== n), xo.length === 0 && rn && document.removeEventListener("keydown", zm);
});
};
let Um;
const J0 = () => {
const n = bf(), e = Cf(), t = ce(() => `${n.value}-popper-container-${e.prefix}`), i = ce(() => `#${t.value}`);
return {
id: t,
selector: i
};
}, zA = (n) => {
const e = document.createElement("div");
return e.id = n, document.body.appendChild(e), e;
}, UA = () => {
const { id: n, selector: e } = J0();
return Qw(() => {
rn && (process.env.NODE_ENV === "test" || !Um || !document.body.querySelector(e.value)) && (Um = zA(n.value));
}), {
id: n,
selector: e
};
}, VA = dt({
showAfter: {
type: Number,
default: 0
},
hideAfter: {
type: Number,
default: 200
},
autoClose: {
type: Number,
default: 0
}
}), kA = ({
showAfter: n,
hideAfter: e,
autoClose: t,
open: i,
close: r
}) => {
const { registerTimeout: s } = Bm(), {
registerTimeout: o,
cancelTimeout: a
} = Bm();
return {
onOpen: (d) => {
s(() => {
i(d);
const h = H(t);
St(h) && h > 0 && o(() => {
r(d);
}, h);
}, H(n));
},
onClose: (d) => {
a(), s(() => {
r(d);
}, H(e));
}
};
}, q0 = Symbol("elForwardRef"), GA = (n) => {
gn(q0, {
setForwardRef: (t) => {
n.value = t;
}
});
}, HA = (n) => ({
mounted(e) {
n(e);
},
updated(e) {
n(e);
},
unmounted() {
n(null);
}
}), Vm = {
current: 0
}, km = Ae(0), K0 = 2e3, Gm = Symbol("elZIndexContextKey"), Q0 = Symbol("zIndexContextKey"), ey = (n) => {
const e = cn() ? ht(Gm, Vm) : Vm, t = n || (cn() ? ht(Q0, void 0) : void 0), i = ce(() => {
const o = H(t);
return St(o) ? o : K0;
}), r = ce(() => i.value + km.value), s = () => (e.current++, km.value = e.current, r.value);
return !rn && !ht(Gm) && en("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: i,
currentZIndex: r,
nextZIndex: s
};
};
function WA(n) {
let e;
function t() {
if (n.value == null)
return;
const { selectionStart: r, selectionEnd: s, value: o } = n.value;
if (r == null || s == null)
return;
const a = o.slice(0, Math.max(0, r)), c = o.slice(Math.max(0, s));
e = {
selectionStart: r,
selectionEnd: s,
value: o,
beforeTxt: a,
afterTxt: c
};
}
function i() {
if (n.value == null || e == null)
return;
const { value: r } = n.value, { beforeTxt: s, afterTxt: o, selectionStart: a } = e;
if (s == null || o == null || a == null)
return;
let c = r.length;
if (r.endsWith(o))
c = r.length - o.length;
else if (r.startsWith(s))
c = s.length;
else {
const l = s[a - 1], d = r.indexOf(l, a - 1);
d !== -1 && (c = d + 1);
}
n.value.setSelectionRange(c, c);
}
return [t, i];
}
const jA = (n, e, t) => Fc(n.subTree).filter((s) => {
var o;
return ed(s) && ((o = s.type) == null ? void 0 : o.name) === e && !!s.component;
}).map((s) => s.component.uid).map((s) => t[s]).filter((s) => !!s), $A = (n, e) => {
const t = {}, i = In([]);
return {
children: i,
addChild: (o) => {
t[o.uid] = o, i.value = jA(n, e, t);
},
removeChild: (o) => {
delete t[o], i.value = i.value.filter((a) => a.uid !== o);
}
};
}, Do = pu({
type: String,
values: N0,
required: !1
}), ty = Symbol("size"), ZA = () => {
const n = ht(ty, {});
return ce(() => H(n.size) || "");
};
function ny(n, {
beforeFocus: e,
afterFocus: t,
beforeBlur: i,
afterBlur: r
} = {}) {
const s = cn(), { emit: o } = s, a = In(), c = Ae(!1), l = (p) => {
Ln(e) && e(p) || c.value || (c.value = !0, o("focus", p), t == null || t());
}, d = (p) => {
var g;
Ln(i) && i(p) || p.relatedTarget && ((g = a.value) != null && g.contains(p.relatedTarget)) || (c.value = !1, o("blur", p), r == null || r());
}, h = () => {
var p, g;
(p = a.value) != null && p.contains(document.activeElement) && a.value !== document.activeElement || (g = n.value) == null || g.focus();
};
return Ke(a, (p) => {
p && p.setAttribute("tabindex", "-1");
}), pn(a, "focus", l, !0), pn(a, "blur", d, !0), pn(a, "click", h, !0), process.env.NODE_ENV === "test" && on(() => {
const p = Ms(n.value) ? n.value : document.querySelector("input,textarea");
p && (pn(p, "focus", l, !0), pn(p, "blur", d, !0));
}), {
isFocused: c,
wrapperRef: a,
handleFocus: l,
handleBlur: d
};
}
function iy({
afterComposition: n,
emit: e
}) {
const t = Ae(!1), i = (a) => {
e == null || e("compositionstart", a), t.value = !0;
}, r = (a) => {
var c;
e == null || e("compositionupdate", a);
const l = (c = a.target) == null ? void 0 : c.value, d = l[l.length - 1] || "";
t.value = !bE(d);
}, s = (a) => {
e == null || e("compositionend", a), t.value && (t.value = !1, Mt(() => n(a)));
};
return {
isComposing: t,
handleComposition: (a) => {
a.type === "compositionend" ? s(a) : r(a);
},
handleCompositionStart: i,
handleCompositionUpdate: r,
handleCompositionEnd: s
};
}
const ry = Symbol("emptyValuesContextKey"), XA = "use-empty-values", YA = ["", void 0, null], JA = void 0, qA = dt({
emptyValues: Array,
valueOnClear: {
type: [String, Number, Boolean, Function],
default: void 0,
validator: (n) => Ln(n) ? !n() : !n
}
}), KA = (n, e) => {
const t = cn() ? ht(ry, Ae({})) : Ae({}), i = ce(() => n.emptyValues || t.value.emptyValues || YA), r = ce(() => Ln(n.valueOnClear) ? n.valueOnClear() : n.valueOnClear !== void 0 ? n.valueOnClear : Ln(t.value.valueOnClear) ? t.value.valueOnClear() : t.value.valueOnClear !== void 0 ? t.value.valueOnClear : JA), s = (o) => i.value.includes(o);
return i.value.includes(r.value) || en(XA, "value-on-clear should be a value of empty-values"), {
emptyValues: i,
valueOnClear: r,
isEmptyValue: s
};
}, QA = dt({
ariaLabel: String,
ariaOrientation: {
type: String,
values: ["horizontal", "vertical", "undefined"]
},
ariaControls: String
}), Gs = (n) => ZT(QA, n), sy = Symbol(), Jc = Ae();
function Lf(n, e = void 0) {
const t = cn() ? ht(sy, Jc) : Jc;
return n ? ce(() => {
var i, r;
return (r = (i = t.value) == null ? void 0 : i[n]) != null ? r : e;
}) : t;
}
function eC(n, e) {
const t = Lf(), i = it(n, ce(() => {
var a;
return ((a = t.value) == null ? void 0 : a.namespace) || Bc;
})), r = mu(ce(() => {
var a;
return (a = t.value) == null ? void 0 : a.locale;
})), s = ey(ce(() => {
var a;
return ((a = t.value) == null ? void 0 : a.zIndex) || K0;
})), o = ce(() => {
var a;
return H(e) || ((a = t.value) == null ? void 0 : a.size) || "";
});
return tC(ce(() => H(t) || {})), {
ns: i,
locale: r,
zIndex: s,
size: o
};
}
const tC = (n, e, t = !1) => {
var i;
const r = !!cn(), s = r ? Lf() : void 0, o = (i = void 0) != null ? i : r ? gn : void 0;
if (!o) {
en("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
return;
}
const a = ce(() => {
const c = H(n);
return s != null && s.value ? nC(s.value, c) : c;
});
return o(sy, a), o(F0, ce(() => a.value.locale)), o(B0, ce(() => a.value.namespace)), o(Q0, ce(() => a.value.zIndex)), o(ty, {
size: ce(() => a.value.size || "")
}), o(ry, ce(() => ({
emptyValues: a.value.emptyValues,
valueOnClear: a.value.valueOnClear
}))), (t || !Jc.value) && (Jc.value = a.value), a;
}, nC = (n, e) => {
const t = [.../* @__PURE__ */ new Set([...Em(n), ...Em(e)])], i = {};
for (const r of t)
i[r] = e[r] !== void 0 ? e[r] : n[r];
return i;
};
var at = (n, e) => {
const t = n.__vccOpts || n;
for (const [i, r] of e)
t[i] = r;
return t;
};
const iC = dt({
size: {
type: Ye([Number, String])
},
color: {
type: String
}
}), rC = De({
name: "ElIcon",
inheritAttrs: !1
}), sC = /* @__PURE__ */ De({
...rC,
props: iC,
setup(n) {
const e = n, t = it("icon"), i = ce(() => {
const { size: r, color: s } = e;
return !r && !s ? {} : {
fontSize: yi(r) ? void 0 : Zc(r),
"--color": s
};
});
return (r, s) => (pe(), Re("i", Oi({
class: H(t).b(),
style: H(i)
}, r.$attrs), [
Xe(r.$slots, "default")
], 16));
}
});
var oC = /* @__PURE__ */ at(sC, [["__file", "icon.vue"]]);
const Bt = vn(oC), Rf = Symbol("formContextKey"), qc = Symbol("formItemContextKey"), ra = (n, e = {}) => {
const t = Ae(void 0), i = e.prop ? t : z0("size"), r = e.global ? t : ZA(), s = e.form ? { size: void 0 } : ht(Rf, void 0), o = e.formItem ? { size: void 0 } : ht(qc, void 0);
return ce(() => i.value || H(n) || (o == null ? void 0 : o.size) || (s == null ? void 0 : s.size) || r.value || "");
}, yu = (n) => {
const e = z0("disabled"), t = ht(Rf, void 0);
return ce(() => e.value || H(n) || (t == null ? void 0 : t.disabled) || !1);
}, gl = () => {
const n = ht(Rf, void 0), e = ht(qc, void 0);
return {
form: n,
formItem: e
};
}, Pf = (n, {
formItemContext: e,
disableIdGeneration: t,
disableIdManagement: i
}) => {
t || (t = Ae(!1)), i || (i = Ae(!1));
const r = Ae();
let s;
const o = ce(() => {
var a;
return !!(!(n.label || n.ariaLabel) && e && e.inputIds && ((a = e.inputIds) == null ? void 0 : a.length) <= 1);
});
return on(() => {
s = Ke([Bn(n, "id"), t], ([a, c]) => {
const l = a ?? (c ? void 0 : vu().value);
l !== r.value && (e != null && e.removeInputId && (r.value && e.removeInputId(r.value), !(i != null && i.value) && !c && l && e.addInputId(l)), r.value = l);
}, { immediate: !0 });
}), c0(() => {
s && s(), e != null && e.removeInputId && r.value && e.removeInputId(r.value);
}), {
isLabeledByFormItem: o,
inputId: r
};
};
let ui;
const aC = `
height:0 !important;
visibility:hidden !important;
${X1() ? "" : "overflow:hidden !important;"}
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
`, lC = [
"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 cC(n) {
const e = window.getComputedStyle(n), t = e.getPropertyValue("box-sizing"), i = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), r = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width"));
return { contextStyle: lC.map((o) => `${o}:${e.getPropertyValue(o)}`).join(";"), paddingSize: i, borderSize: r, boxSizing: t };
}
function Hm(n, e = 1, t) {
var i;
ui || (ui = document.createElement("textarea"), document.body.appendChild(ui));
const { paddingSize: r, borderSize: s, boxSizing: o, contextStyle: a } = cC(n);
ui.setAttribute("style", `${a};${aC}`), ui.value = n.value || n.placeholder || "";
let c = ui.scrollHeight;
const l = {};
o === "border-box" ? c = c + s : o === "content-box" && (c = c - r), ui.value = "";
const d = ui.scrollHeight - r;
if (St(e)) {
let h = d * e;
o === "border-box" && (h = h + r + s), c = Math.max(h, c), l.minHeight = `${h}px`;
}
if (St(t)) {
let h = d * t;
o === "border-box" && (h = h + r + s), c = Math.min(h, c);
}
return l.height = `${c}px`, (i = ui.parentNode) == null || i.removeChild(ui), ui = void 0, l;
}
const uC = dt({
id: {
type: String,
default: void 0
},
size: Do,
disabled: Boolean,
modelValue: {
type: Ye([
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: Ye([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: Zr
},
prefixIcon: {
type: Zr
},
containerRole: {
type: String,
default: void 0
},
tabindex: {
type: [String, Number],
default: 0
},
validateEvent: {
type: Boolean,
default: !0
},
inputStyle: {
type: Ye([Object, Array, String]),
default: () => tr({})
},
autofocus: Boolean,
rows: {
type: Number,
default: 2
},
...Gs(["ariaLabel"])
}), hC = {
[Dt]: (n) => On(n),
input: (n) => On(n),
change: (n) => On(n),
focus: (n) => n instanceof FocusEvent,
blur: (n) => n instanceof FocusEvent,
clear: () => !0,
mouseleave: (n) => n instanceof MouseEvent,
mouseenter: (n) => n instanceof MouseEvent,
keydown: (n) => n instanceof Event,
compositionstart: (n) => n instanceof CompositionEvent,
compositionupdate: (n) => n instanceof CompositionEvent,
compositionend: (n) => n instanceof CompositionEvent
}, dC = De({
name: "ElInput",
inheritAttrs: !1
}), fC = /* @__PURE__ */ De({
...dC,
props: uC,
emits: hC,
setup(n, { expose: e, emit: t }) {
const i = n, r = e1(), s = ou(), o = ce(() => {
const de = {};
return i.containerRole === "combobox" && (de["aria-haspopup"] = r["aria-haspopup"], de["aria-owns"] = r["aria-owns"], de["aria-expanded"] = r["aria-expanded"]), de;
}), a = ce(() => [
i.type === "textarea" ? y.b() : u.b(),
u.m(g.value),
u.is("disabled", f.value),
u.is("exceed", K.value),
{
[u.b("group")]: s.prepend || s.append,
[u.m("prefix")]: s.prefix || i.prefixIcon,
[u.m("suffix")]: s.suffix || i.suffixIcon || i.clearable || i.showPassword,
[u.bm("suffix", "password-clear")]: D.value && B.value,
[u.b("hidden")]: i.type === "hidden"
},
r.class
]), c = ce(() => [
u.e("wrapper"),
u.is("focus", E.value)
]), l = ME({
excludeKeys: ce(() => Object.keys(o.value))
}), { form: d, formItem: h } = gl(), { inputId: p } = Pf(i, {
formItemContext: h
}), g = ra(), f = yu(), u = it("input"), y = it("textarea"), v = In(), m = In(), w = Ae(!1), S = Ae(!1), T = Ae(), M = In(i.inputStyle), x = ce(() => v.value || m.value), { wrapperRef: _, isFocused: E, handleFocus: L, handleBlur: R } = ny(x, {
beforeFocus() {
return f.value;
},
afterBlur() {
var de;
i.validateEvent && ((de = h == null ? void 0 : h.validate) == null || de.call(h, "blur").catch((we) => en(we)));
}
}), C = ce(() => {
var de;
return (de = d == null ? void 0 : d.statusIcon) != null ? de : !1;
}), A = ce(() => (h == null ? void 0 : h.validateState) || ""), P = ce(() => A.value && D0[A.value]), I = ce(() => S.value ? mE : cE), b = ce(() => [
r.style
]), O = ce(() => [
i.inputStyle,
M.value,
{ resize: i.resize }
]), N = ce(() => sr(i.modelValue) ? "" : String(i.modelValue)), D = ce(() => i.clearable && !f.value && !i.readonly && !!N.value && (E.value || w.value)), B = ce(() => i.showPassword && !f.value && !i.readonly && !!N.value && (!!N.value || E.value)), U = ce(() => i.showWordLimit && !!i.maxlength && (i.type === "text" || i.type === "textarea") && !f.value && !i.readonly && !i.showPassword), k = ce(() => N.value.length), K = ce(() => !!U.value && k.value > Number(i.maxlength)), ie = ce(() => !!s.suffix || !!i.suffixIcon || D.value || i.showPassword || U.value || !!A.value && C.value), [j, G] = WA(v);
ii(m, (de) => {
if (Q(), !U.value || i.resize !== "both")
return;
const we = de[0], { width: se } = we.contentRect;
T.value = {
right: `calc(100% - ${se + 15 + 6}px)`
};
});
const W = () => {
const { type: de, autosize: we } = i;
if (!(!rn || de !== "textarea" || !m.value))
if (we) {
const se = Pn(we) ? we.minRows : void 0, Se = Pn(we) ? we.maxRows : void 0, ge = Hm(m.value, se, Se);
M.value = {
overflowY: "hidden",
...ge
}, Mt(() => {
m.value.offsetHeight, M.value = ge;
});
} else
M.value = {
minHeight: Hm(m.value).minHeight
};
}, Q = ((de) => {
let we = !1;
return () => {
var se;
if (we || !i.autosize)
return;
((se = m.value) == null ? void 0 : se.offsetParent) === null || (de(), we = !0);
};
})(W), ee = () => {
const de = x.value, we = i.formatter ? i.formatter(N.value) : N.value;
!de || de.value === we || (de.value = we);
}, ne = async (de) => {
j();
let { value: we } = de.target;
if (i.formatter && (we = i.parser ? i.parser(we) : we), !te.value) {
if (we === N.value) {
ee();
return;
}
t(Dt, we), t("input", we), await Mt(), ee(), G();
}
}, Y = (de) => {
t("change", de.target.value);
}, {
isComposing: te,
handleCompositionStart: F,
handleCompositionUpdate: $,
handleCompositionEnd: J
} = iy({ emit: t, afterComposition: ne }), z = () => {
S.value = !S.value, V();
}, V = async () => {
var de;
await Mt(), (de = x.value) == null || de.focus();
}, oe = () => {
var de;
return (de = x.value) == null ? void 0 : de.blur();
}, ue = (de) => {
w.value = !1, t("mouseleave", de);
}, le = (de) => {
w.value = !0, t("mouseenter", de);
}, ve = (de) => {
t("keydown", de);
}, xe = () => {
var de;
(de = x.value) == null || de.select();
}, Te = () => {
t(Dt, ""), t("change", ""), t("clear"), t("input", "");
};
return Ke(() => i.modelValue, () => {
var de;
Mt(() => W()), i.validateEvent && ((de = h == null ? void 0 : h.validate) == null || de.call(h, "change").catch((we) => en(we)));
}), Ke(N, () => ee()), Ke(() => i.type, async () => {
await Mt(), ee(), W();
}), on(() => {
!i.formatter && i.parser && en("ElInput", "If you set the parser, you also need to set the formatter."), ee(), Mt(W);
}), e({
input: v,
textarea: m,
ref: x,
textareaStyle: O,
autosize: Bn(i, "autosize"),
isComposing: te,
focus: V,
blur: oe,
select: xe,
clear: Te,
resizeTextarea: W
}), (de, we) => (pe(), Re("div", Oi(H(o), {
class: [
H(a),
{
[H(u).bm("group", "append")]: de.$slots.append,
[H(u).bm("group", "prepend")]: de.$slots.prepend
}
],
style: H(b),
role: de.containerRole,
onMouseenter: le,
onMouseleave: ue
}), [
Ge(" input "),
de.type !== "textarea" ? (pe(), Re(Wt, { key: 0 }, [
Ge(" prepend slot "),
de.$slots.prepend ? (pe(), Re("div", {
key: 0,
class: Le(H(u).be("group", "prepend"))
}, [
Xe(de.$slots, "prepend")
], 2)) : Ge("v-if", !0),
Be("div", {
ref_key: "wrapperRef",
ref: _,
class: Le(H(c))
}, [
Ge(" prefix slot "),
de.$slots.prefix || de.prefixIcon ? (pe(), Re("span", {
key: 0,
class: Le(H(u).e("prefix"))
}, [
Be("span", {
class: Le(H(u).e("prefix-inner"))
}, [
Xe(de.$slots, "prefix"),
de.prefixIcon ? (pe(), He(H(Bt), {
key: 0,
class: Le(H(u).e("icon"))
}, {
default: fe(() => [
(pe(), He(zn(de.prefixIcon)))
]),
_: 1
}, 8, ["class"])) : Ge("v-if", !0)
], 2)
], 2)) : Ge("v-if", !0),
Be("input", Oi({
id: H(p),
ref_key: "input",
ref: v,
class: H(u).e("inner")
}, H(l), {
minlength: de.minlength,
maxlength: de.maxlength,
type: de.showPassword ? S.value ? "text" : "password" : de.type,
disabled: H(f),
readonly: de.readonly,
autocomplete: de.autocomplete,
tabindex: de.tabindex,
"aria-label": de.ariaLabel,
placeholder: de.placeholder,
style: de.inputStyle,
form: de.form,
autofocus: de.autofocus,
onCompositionstart: H(F),
onCompositionupdate: H($),
onCompositionend: H(J),
onInput: ne,
onChange: Y,
onKeydown: ve
}), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
Ge(" suffix slot "),
H(ie) ? (pe(), Re("span", {
key: 1,
class: Le(H(u).e("suffix"))
}, [
Be("span", {
class: Le(H(u).e("suffix-inner"))
}, [
!H(D) || !H(B) || !H(U) ? (pe(), Re(Wt, { key: 0 }, [
Xe(de.$slots, "suffix"),
de.suffixIcon ? (pe(), He(H(Bt), {
key: 0,
class: Le(H(u).e("icon"))
}, {
default: fe(() => [
(pe(), He(zn(de.suffixIcon)))
]),
_: 1
}, 8, ["class"])) : Ge("v-if", !0)
], 64)) : Ge("v-if", !0),
H(D) ? (pe(), He(H(Bt), {
key: 1,
class: Le([H(u).e("icon"), H(u).e("clear")]),
onMousedown: fn(H($a), ["prevent"]),
onClick: Te
}, {
default: fe(() => [
ae(H(yf))
]),
_: 1
}, 8, ["class", "onMousedown"])) : Ge("v-if", !0),
H(B) ? (pe(), He(H(Bt), {
key: 2,
class: Le([H(u).e("icon"), H(u).e("password")]),
onClick: z
}, {
default: fe(() => [
(pe(), He(zn(H(I))))
]),
_: 1
}, 8, ["class"])) : Ge("v-if", !0),
H(U) ? (pe(), Re("span", {
key: 3,
class: Le(H(u).e("count"))
}, [
Be("span", {
class: Le(H(u).e("count-inner"))
}, wt(H(k)) + " / " + wt(de.maxlength), 3)
], 2)) : Ge("v-if", !0),
H(A) && H(P) && H(C) ? (pe(), He(H(Bt), {
key: 4,
class: Le([
H(u).e("icon"),
H(u).e("validateIcon"),
H(u).is("loading", H(A) === "validating")
])
}, {
default: fe(() => [
(pe(), He(zn(H(P))))
]),
_: 1
}, 8, ["class"])) : Ge("v-if", !0)
], 2)
], 2)) : Ge("v-if", !0)
], 2),
Ge(" append slot "),
de.$slots.append ? (pe(), Re("div", {
key: 1,
class: Le(H(u).be("group", "append"))
}, [
Xe(de.$slots, "append")
], 2)) : Ge("v-if", !0)
], 64)) : (pe(), Re(Wt, { key: 1 }, [
Ge(" textarea "),
Be("textarea", Oi({
id: H(p),
ref_key: "textarea",
ref: m,
class: [H(y).e("inner"), H(u).is("focus", H(E))]
}, H(l), {
minlength: de.minlength,
maxlength: de.maxlength,
tabindex: de.tabindex,
disabled: H(f),
readonly: de.readonly,
autocomplete: de.autocomplete,
style: H(O),
"aria-label": de.ariaLabel,
placeholder: de.placeholder,
form: de.form,
autofocus: de.autofocus,
rows: de.rows,
onCompositionstart: H(F),
onCompositionupdate: H($),
onCompositionend: H(J),
onInput: ne,
onFocus: H(L),
onBlur: H(R),
onChange: Y,
onKeydown: ve
}), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]),
H(U) ? (pe(), Re("span", {
key: 0,
style: Ot(T.value),
class: Le(H(u).e("count"))
}, wt(H(k)) + " / " + wt(de.maxlength), 7)) : Ge("v-if", !0)
], 64))
], 16, ["role"]));
}
});
var pC = /* @__PURE__ */ at(fC, [["__file", "input.vue"]]);
const mC = vn(pC), Ys = 4, gC = {
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"
}
}, vC = ({
move: n,
size: e,
bar: t
}) => ({
[t.size]: e,
transform: `translate${t.axis}(${n}%)`
}), If = Symbol("scrollbarContextKey"), yC = dt({
vertical: Boolean,
size: String,
move: Number,
ratio: {
type: Number,
required: !0
},
always: Boolean
}), bC = "Thumb", xC = /* @__PURE__ */ De({
__name: "thumb",
props: yC,
setup(n) {
const e = n, t = ht(If), i = it("scrollbar");
t || na(bC, "can not inject scrollbar context");
const r = Ae(), s = Ae(), o = Ae({}), a = Ae(!1);
let c = !1, l = !1, d = rn ? document.onselectstart : null;
const h = ce(() => gC[e.vertical ? "vertical" : "horizontal"]), p = ce(() => vC({
size: e.size,
move: e.move,
bar: h.value
})), g = ce(() => r.value[h.value.offset] ** 2 / t.wrapElement[h.value.scrollSize] / e.ratio / s.value[h.value.offset]), f = (M) => {
var x;
if (M.stopPropagation(), M.ctrlKey || [1, 2].includes(M.button))
return;
(x = window.getSelection()) == null || x.removeAllRanges(), y(M);
const _ = M.currentTarget;
_ && (o.value[h.value.axis] = _[h.value.offset] - (M[h.value.client] - _.getBoundingClientRect()[h.value.direction]));
}, u = (M) => {
if (!s.value || !r.value || !t.wrapElement)
return;
const x = Math.abs(M.target.getBoundingClientRect()[h.value.direction] - M[h.value.client]), _ = s.value[h.value.offset] / 2, E = (x - _) * 100 * g.value / r.value[h.value.offset];
t.wrapElement[h.value.scroll] = E * t.wrapElement[h.value.scrollSize] / 100;
}, y = (M) => {
M.stopImmediatePropagation(), c = !0, document.addEventListener("mousemove", v), document.addEventListener("mouseup", m), d = document.onselectstart, document.onselectstart = () => !1;
}, v = (M) => {
if (!r.value || !s.value || c === !1)
return;
const x = o.value[h.value.axis];
if (!x)
return;
const _ = (r.value.getBoundingClientRect()[h.value.direction] - M[h.value.client]) * -1, E = s.value[h.value.offset] - x, L = (_ - E) * 100 * g.value / r.value[h.value.offset];
t.wrapElement[h.value.scroll] = L * t.wrapElement[h.value.scrollSize] / 100;
}, m = () => {
c = !1, o.value[h.value.axis] = 0, document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", m), T(), l && (a.value = !1);
}, w = () => {
l = !1, a.value = !!e.size;
}, S = () => {
l = !0, a.value = c;
};
li(() => {
T(), document.removeEventListener("mouseup", m);
});
const T = () => {
document.onselectstart !== d && (document.onselectstart = d);
};
return pn(Bn(t, "scrollbarElement"), "mousemove", w), pn(Bn(t, "scrollbarElement"), "mouseleave", S), (M, x) => (pe(), He(hl, {
name: H(i).b("fade"),
persisted: ""
}, {
default: fe(() => [
Ft(Be("div", {
ref_key: "instance",
ref: r,
class: Le([H(i).e("bar"), H(i).is(H(h).key)]),
onMousedown: u
}, [
Be("div", {
ref_key: "thumb",
ref: s,
class: Le(H(i).e("thumb")),
style: Ot(H(p)),
onMousedown: f
}, null, 38)
], 34), [
[xn, M.always || a.value]
])
]),
_: 1
}, 8, ["name"]));
}
});
var Wm = /* @__PURE__ */ at(xC, [["__file", "thumb.vue"]]);
const wC = dt({
always: {
type: Boolean,
default: !0
},
minSize: {
type: Number,
required: !0
}
}), MC = /* @__PURE__ */ De({
__name: "bar",
props: wC,
setup(n, { expose: e }) {
const t = n, i = ht(If), r = Ae(0), s = Ae(0), o = Ae(""), a = Ae(""), c = Ae(1), l = Ae(1);
return e({
handleScroll: (p) => {
if (p) {
const g = p.offsetHeight - Ys, f = p.offsetWidth - Ys;
s.value = p.scrollTop * 100 / g * c.value, r.value = p.scrollLeft * 100 / f * l.value;
}
},
update: () => {
const p = i == null ? void 0 : i.wrapElement;
if (!p)
return;
const g = p.offsetHeight - Ys, f = p.offsetWidth - Ys, u = g ** 2 / p.scrollHeight, y = f ** 2 / p.scrollWidth, v = Math.max(u, t.minSize), m = Math.max(y, t.minSize);
c.value = u / (g - u) / (v / (g - v)), l.value = y / (f - y) / (m / (f - m)), a.value = v + Ys < g ? `${v}px` : "", o.value = m + Ys < f ? `${m}px` : "";
}
}), (p, g) => (pe(), Re(Wt, null, [
ae(Wm, {
move: r.value,
ratio: l.value,
size: o.value,
always: p.always
}, null, 8, ["move", "ratio", "size", "always"]),
ae(Wm, {
move: s.value,
ratio: c.value,
size: a.value,
vertical: "",
always: p.always
}, null, 8, ["move", "ratio", "size", "always"])
], 64));
}
});
var SC = /* @__PURE__ */ at(MC, [["__file", "bar.vue"]]);
const _C = dt({
height: {
type: [String, Number],
default: ""
},
maxHeight: {
type: [String, Number],
default: ""
},
native: {
type: Boolean,
default: !1
},
wrapStyle: {
type: Ye([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,
...Gs(["ariaLabel", "ariaOrientation"])
}), TC = {
scroll: ({
scrollTop: n,
scrollLeft: e
}) => [n, e].every(St)
}, dd = "ElScrollbar", EC = De({
name: dd
}), AC = /* @__PURE__ */ De({
...EC,
props: _C,
emits: TC,
setup(n, { expose: e, emit: t }) {
const i = n, r = it("scrollbar");
let s, o, a = 0, c = 0;
const l = Ae(), d = Ae(), h = Ae(), p = Ae(), g = ce(() => {
const T = {};
return i.height && (T.height = Zc(i.height)), i.maxHeight && (T.maxHeight = Zc(i.maxHeight)), [i.wrapStyle, T];
}), f = ce(() => [
i.wrapClass,
r.e("wrap"),
{ [r.em("wrap", "hidden-default")]: !i.native }
]), u = ce(() => [r.e("view"), i.viewClass]), y = () => {
var T;
d.value && ((T = p.value) == null || T.handleScroll(d.value), a = d.value.scrollTop, c = d.value.scrollLeft, t("scroll", {
scrollTop: d.value.scrollTop,
scrollLeft: d.value.scrollLeft
}));
};
function v(T, M) {
Pn(T) ? d.value.scrollTo(T) : St(T) && St(M) && d.value.scrollTo(T, M);
}
const m = (T) => {
if (!St(T)) {
en(dd, "value must be a number");
return;
}
d.value.scrollTop = T;
}, w = (T) => {
if (!St(T)) {
en(dd, "value must be a number");
return;
}
d.value.scrollLeft = T;
}, S = () => {
var T;
(T = p.value) == null || T.update();
};
return Ke(() => i.noresize, (T) => {
T ? (s == null || s(), o == null || o()) : ({ stop: s } = ii(h, S), o = pn("resize", S));
}, { immediate: !0 }), Ke(() => [i.maxHeight, i.height], () => {
i.native || Mt(() => {
var T;
S(), d.value && ((T = p.value) == null || T.handleScroll(d.value));
});
}), gn(If, qn({
scrollbarElement: l,
wrapElement: d
})), t1(() => {
d.value && (d.value.scrollTop = a, d.value.scrollLeft = c);
}), on(() => {
i.native || Mt(() => {
S();
});
}), sf(() => S()), e({
wrapRef: d,
update: S,
scrollTo: v,
setScrollTop: m,
setScrollLeft: w,
handleScroll: y
}), (T, M) => (pe(), Re("div", {
ref_key: "scrollbarRef",
ref: l,
class: Le(H(r).b())
}, [
Be("div", {
ref_key: "wrapRef",
ref: d,
class: Le(H(f)),
style: Ot(H(g)),
tabindex: T.tabindex,
onScroll: y
}, [
(pe(), He(zn(T.tag), {
id: T.id,
ref_key: "resizeRef",
ref: h,
class: Le(H(u)),
style: Ot(T.viewStyle),
role: T.role,
"aria-label": T.ariaLabel,
"aria-orientation": T.ariaOrientation
}, {
default: fe(() => [
Xe(T.$slots, "default")
]),
_: 3
}, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
], 46, ["tabindex"]),
T.native ? Ge("v-if", !0) : (pe(), He(SC, {
key: 0,
ref_key: "barRef",
ref: p,
always: T.always,
"min-size": T.minSize
}, null, 8, ["always", "min-size"]))
], 2));
}
});
var CC = /* @__PURE__ */ at(AC, [["__file", "scrollbar.vue"]]);
const LC = vn(CC), Of = Symbol("popper"), oy = Symbol("popperContent"), RC = [
"dialog",
"grid",
"group",
"listbox",
"menu",
"navigation",
"tooltip",
"tree"
], ay = dt({
role: {
type: String,
values: RC,
default: "tooltip"
}
}), PC = De({
name: "ElPopper",
inheritAttrs: !1
}), IC = /* @__PURE__ */ De({
...PC,
props: ay,
setup(n, { expose: e }) {
const t = n, i = Ae(), r = Ae(), s = Ae(), o = Ae(), a = ce(() => t.role), c = {
triggerRef: i,
popperInstanceRef: r,
contentRef: s,
referenceRef: o,
role: a
};
return e(c), gn(Of, c), (l, d) => Xe(l.$slots, "default");
}
});
var OC = /* @__PURE__ */ at(IC, [["__file", "popper.vue"]]);
const ly = dt({
arrowOffset: {
type: Number,
default: 5
}
}), DC = De({
name: "ElPopperArrow",
inheritAttrs: !1
}), NC = /* @__PURE__ */ De({
...DC,
props: ly,
setup(n, { expose: e }) {
const t = n, i = it("popper"), { arrowOffset: r, arrowRef: s, arrowStyle: o } = ht(oy, void 0);
return Ke(() => t.arrowOffset, (a) => {
r.value = a;
}), li(() => {
s.value = void 0;
}), e({
arrowRef: s
}), (a, c) => (pe(), Re("span", {
ref_key: "arrowRef",
ref: s,
class: Le(H(i).e("arrow")),
style: Ot(H(o)),
"data-popper-arrow": ""
}, null, 6));
}
});
var FC = /* @__PURE__ */ at(NC, [["__file", "arrow.vue"]]);
const Ju = "ElOnlyChild", BC = De({
name: Ju,
setup(n, {
slots: e,
attrs: t
}) {
var i;
const r = ht(q0), s = HA((i = r == null ? void 0 : r.setForwardRef) != null ? i : $a);
return () => {
var o;
const a = (o = e.default) == null ? void 0 : o.call(e, t);
if (!a)
return null;
if (a.length > 1)
return en(Ju, "requires exact only one valid child."), null;
const c = cy(a);
return c ? Ft(n1(c, t), [[s]]) : (en(Ju, "no valid child node found"), null);
};
}
});
function cy(n) {
if (!n)
return null;
const e = n;
for (const t of e) {
if (Pn(t))
switch (t.type) {
case i1:
continue;
case u0:
case "svg":
return jm(t);
case Wt:
return cy(t.children);
default:
return t;
}
return jm(t);
}
return null;
}
function jm(n) {
const e = it("only-child");
return ae("span", {
class: e.e("content")
}, [n]);
}
const uy = dt({
virtualRef: {
type: Ye(Object)
},
virtualTriggering: Boolean,
onMouseenter: {
type: Ye(Function)
},
onMouseleave: {
type: Ye(Function)
},
onClick: {
type: Ye(Function)
},
onKeydown: {
type: Ye(Function)
},
onFocus: {
type: Ye(Function)
},
onBlur: {
type: Ye(Function)
},
onContextmenu: {
type: Ye(Function)
},
id: String,
open: Boolean
}), zC = De({
name: "ElPopperTrigger",
inheritAttrs: !1
}), UC = /* @__PURE__ */ De({
...zC,
props: uy,
setup(n, { expose: e }) {
const t = n, { role: i, triggerRef: r } = ht(Of, void 0);
GA(r);
const s = ce(() => a.value ? t.id : void 0), o = ce(() => {
if (i && i.value === "tooltip")
return t.open && t.id ? t.id : void 0;
}), a = ce(() => {
if (i && i.value !== "tooltip")
return i.value;
}), c = ce(() => a.value ? `${t.open}` : void 0);
let l;
const d = [
"onMouseenter",
"onMouseleave",
"onClick",
"onKeydown",
"onFocus",
"onBlur",
"onContextmenu"
];
return on(() => {
Ke(() => t.virtualRef, (h) => {
h && (r.value = ir(h));
}, {
immediate: !0
}), Ke(r, (h, p) => {
l == null || l(), l = void 0, Ms(h) && (d.forEach((g) => {
var f;
const u = t[g];
u && (h.addEventListener(g.slice(2).toLowerCase(), u), (f = p == null ? void 0 : p.removeEventListener) == null || f.call(p, g.slice(2).toLowerCase(), u));
}), l = Ke([s, o, a, c], (g) => {
[
"aria-controls",
"aria-describedby",
"aria-haspopup",
"aria-expanded"
].forEach((f, u) => {
sr(g[u]) ? h.removeAttribute(f) : h.setAttribute(f, g[u]);
});
}, { immediate: !0 })), Ms(p) && [
"aria-controls",
"aria-describedby",
"aria-haspopup",
"aria-expanded"
].forEach((g) => p.removeAttribute(g));
}, {
immediate: !0
});
}), li(() => {
if (l == null || l(), l = void 0, r.value && Ms(r.value)) {
const h = r.value;
d.forEach((p) => {
const g = t[p];
g && h.removeEventListener(p.slice(2).toLowerCase(), g);
}), r.value = void 0;
}
}), e({
triggerRef: r
}), (h, p) => h.virtualTriggering ? Ge("v-if", !0) : (pe(), He(H(BC), Oi({ key: 0 }, h.$attrs, {
"aria-controls": H(s),
"aria-describedby": H(o),
"aria-expanded": H(c),
"aria-haspopup": H(a)
}), {
default: fe(() => [
Xe(h.$slots, "default")
]),
_: 3
}, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"]));
}
});
var VC = /* @__PURE__ */ at(UC, [["__file", "trigger.vue"]]);
const qu = "focus-trap.focus-after-trapped", Ku = "focus-trap.focus-after-released", kC = "focus-trap.focusout-prevented", $m = {
cancelable: !0,
bubbles: !1
}, GC = {
cancelable: !0,
bubbles: !1
}, Zm = "focusAfterTrapped", Xm = "focusAfterReleased", HC = Symbol("elFocusTrap"), Df = Ae(), bu = Ae(0), Nf = Ae(0);
let Bl = 0;
const hy = (n) => {
const e = [], t = document.createTreeWalker(n, NodeFilter.SHOW_ELEMENT, {
acceptNode: (i) => {
const r = i.tagName === "INPUT" && i.type === "hidden";
return i.disabled || i.hidden || r ? NodeFilter.FILTER_SKIP : i.tabIndex >= 0 || i === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
}
});
for (; t.nextNode(); )
e.push(t.currentNode);
return e;
}, Ym = (n, e) => {
for (const t of n)
if (!WC(t, e))
return t;
}, WC = (n, e) => {
if (process.env.NODE_ENV === "test")
return !1;
if (getComputedStyle(n).visibility === "hidden")
return !0;
for (; n; ) {
if (e && n === e)
return !1;
if (getComputedStyle(n).display === "none")
return !0;
n = n.parentElement;
}
return !1;
}, jC = (n) => {
const e = hy(n), t = Ym(e, n), i = Ym(e.reverse(), n);
return [t, i];
}, $C = (n) => n instanceof HTMLInputElement && "select" in n, Ir = (n, e) => {
if (n && n.focus) {
const t = document.activeElement;
n.focus({ preventScroll: !0 }), Nf.value = window.performance.now(), n !== t && $C(n) && e && n.select();
}
};
function Jm(n, e) {
const t = [...n], i = n.indexOf(e);
return i !== -1 && t.splice(i, 1), t;
}
const ZC = () => {
let n = [];
return {
push: (i) => {
const r = n[0];
r && i !== r && r.pause(), n = Jm(n, i), n.unshift(i);
},
remove: (i) => {
var r, s;
n = Jm(n, i), (s = (r = n[0]) == null ? void 0 : r.resume) == null || s.call(r);
}
};
}, XC = (n, e = !1) => {
const t = document.activeElement;
for (const i of n)
if (Ir(i, e), document.activeElement !== t)
return;
}, qm = ZC(), YC = () => bu.value > Nf.value, zl = () => {
Df.value = "pointer", bu.value = window.performance.now();
}, Km = () => {
Df.value = "keyboard", bu.value = window.performance.now();
}, JC = () => (on(() => {
Bl === 0 && (document.addEventListener("mousedown", zl), document.addEventListener("touchstart", zl), document.addEventListener("keydown", Km)), Bl++;
}), li(() => {
Bl--, Bl <= 0 && (document.removeEventListener("mousedown", zl), document.removeEventListener("touchstart", zl), document.removeEventListener("keydown", Km));
}), {
focusReason: Df,
lastUserFocusTimestamp: bu,
lastAutomatedFocusTimestamp: Nf
}), Ul = (n) => new CustomEvent(kC, {
...GC,
detail: n
}), qC = De({
name: "ElFocusTrap",
inheritAttrs: !1,
props: {
loop: Boolean,
trapped: Boolean,
focusTrapEl: Object,
focusStartEl: {
type: [Object, String],
default: "first"
}
},
emits: [
Zm,
Xm,
"focusin",
"focusout",
"focusout-prevented",
"release-requested"
],
setup(n, { emit: e }) {
const t = Ae();
let i, r;
const { focusReason: s } = JC();
BA((f) => {
n.trapped && !o.paused && e("release-requested", f);
});
const o = {
paused: !1,
pause() {
this.paused = !0;
},
resume() {
this.paused = !1;
}
}, a = (f) => {
if (!n.loop && !n.trapped || o.paused)
return;
const { key: u, altKey: y, ctrlKey: v, metaKey: m, currentTarget: w, shiftKey: S } = f, { loop: T } = n, M = u === Di.tab && !y && !v && !m, x = document.activeElement;
if (M && x) {
const _ = w, [E, L] = jC(_);
if (E && L) {
if (!S && x === L) {
const C = Ul({
focusReason: s.value
});
e("focusout-prevented", C), C.defaultPrevented || (f.preventDefault(), T && Ir(E, !0));
} else if (S && [E, _].includes(x)) {
const C = Ul({
focusReason: s.value
});
e("focusout-prevented", C), C.defaultPrevented || (f.preventDefault(), T && Ir(L, !0));
}
} else if (x === _) {
const C = Ul({
focusReason: s.value
});
e("focusout-prevented", C), C.defaultPrevented || f.preventDefault();
}
}
};
gn(HC, {
focusTrapRef: t,
onKeydown: a
}), Ke(() => n.focusTrapEl, (f) => {
f && (t.value = f);
}, { immediate: !0 }), Ke([t], ([f], [u]) => {
f && (f.addEventListener("keydown", a), f.addEventListener("focusin", d), f.addEventListener("focusout", h)), u && (u.removeEventListener("keydown", a), u.removeEventListener("focusin", d), u.removeEventListener("focusout", h));
});
const c = (f) => {
e(Zm, f);
}, l = (f) => e(Xm, f), d = (f) => {
const u = H(t);
if (!u)
return;
const y = f.target, v = f.relatedTarget, m = y && u.contains(y);
n.trapped || v && u.contains(v) || (i = v), m && e("focusin", f), !o.paused && n.trapped && (m ? r = y : Ir(r, !0));
}, h = (f) => {
const u = H(t);
if (!(o.paused || !u))
if (n.trapped) {
const y = f.relatedTarget;
!sr(y) && !u.contains(y) && setTimeout(() => {
if (!o.paused && n.trapped) {
const v = Ul({
focusReason: s.value
});
e("focusout-prevented", v), v.defaultPrevented || Ir(r, !0);
}
}, 0);
} else {
const y = f.target;
y && u.contains(y) || e("focusout", f);
}
};
async function p() {
await Mt();
const f = H(t);
if (f) {
qm.push(o);
const u = f.contains(document.activeElement) ? i : document.activeElement;
if (i = u, !f.contains(u)) {
const v = new Event(qu, $m);
f.addEventListener(qu, c), f.dispatchEvent(v), v.defaultPrevented || Mt(() => {
let m = n.focusStartEl;
On(m) || (Ir(m), document.activeElement !== m && (m = "first")), m === "first" && XC(hy(f), !0), (document.activeElement === u || m === "container") && Ir(f);
});
}
}
}
function g() {
const f = H(t);
if (f) {
f.removeEventListener(qu, c);
const u = new CustomEvent(Ku, {
...$m,
detail: {
focusReason: s.value
}
});
f.addEventListener(Ku, l), f.dispatchEvent(u), !u.defaultPrevented && (s.value == "keyboard" || !YC() || f.contains(document.activeElement)) && Ir(i ?? document.body), f.removeEventListener(Ku, l), qm.remove(o);
}
}
return on(() => {
n.trapped && p(), Ke(() => n.trapped, (f) => {
f ? p() : g();
});
}), li(() => {
n.trapped && g(), t.value && (t.value.removeEventListener("keydown", a), t.value.removeEventListener("focusin", d), t.value.removeEventListener("focusout", h), t.value = void 0);
}), {
onKeydown: a
};
}
});
function KC(n, e, t, i, r, s) {
return Xe(n.$slots, "default", { handleKeydown: n.onKeydown });
}
var QC = /* @__PURE__ */ at(qC, [["render", KC], ["__file", "focus-trap.vue"]]);
const e2 = ["fixed", "absolute"], t2 = dt({
boundariesPadding: {
type: Number,
default: 0
},
fallbackPlacements: {
type: Ye(Array),
default: void 0
},
gpuAcceleration: {
type: Boolean,
default: !0
},
offset: {
type: Number,
default: 12
},
placement: {
type: String,
values: ia,
default: "bottom"
},
popperOptions: {
type: Ye(Object),
default: () => ({})
},
strategy: {
type: String,
values: e2,
default: "absolute"
}
}), dy = dt({
...t2,
id: String,
style: {
type: Ye([String, Array, Object])
},
className: {
type: Ye([String, Array, Object])
},
effect: {
type: Ye(String),
default: "dark"
},
visible: Boolean,
enterable: {
type: Boolean,
default: !0
},
pure: Boolean,
focusOnShow: {
type: Boolean,
default: !1
},
trapping: {
type: Boolean,
default: !1
},
popperClass: {
type: Ye([String, Array, Object])
},
popperStyle: {
type: Ye([String, Array, Object])
},
referenceEl: {
type: Ye(Object)
},
triggerTargetEl: {
type: Ye(Object)
},
stopPopperMouseEvent: {
type: Boolean,
default: !0
},
virtualTriggering: Boolean,
zIndex: Number,
...Gs(["ariaLabel"])
}), n2 = {
mouseenter: (n) => n instanceof MouseEvent,
mouseleave: (n) => n instanceof MouseEvent,
focus: () => !0,
blur: () => !0,
close: () => !0
}, i2 = (n, e = []) => {
const { placement: t, strategy: i, popperOptions: r } = n, s = {
placement: t,
strategy: i,
...r,
modifiers: [...s2(n), ...e]
};
return o2(s, r == null ? void 0 : r.modifiers), s;
}, r2 = (n) => {
if (rn)
return ir(n);
};
function s2(n) {
const { offset: e, gpuAcceleration: t, fallbackPlacements: i } = n;
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: i
}
},
{
name: "computeStyles",
options: {
gpuAcceleration: t
}
}
];
}
function o2(n, e) {
e && (n.modifiers = [...n.modifiers, ...e ?? []]);
}
const a2 = 0, l2 = (n) => {
const { popperInstanceRef: e, contentRef: t, triggerRef: i, role: r } = ht(Of, void 0), s = Ae(), o = Ae(), a = ce(() => ({
name: "eventListeners",
enabled: !!n.visible
})), c = ce(() => {
var v;
const m = H(s), w = (v = H(o)) != null ? v : a2;
return {
name: "arrow",
enabled: !HT(m),
options: {
element: m,
padding: w
}
};
}), l = ce(() => ({
onFirstUpdate: () => {
f();
},
...i2(n, [
H(c),
H(a)
])
})), d = ce(() => r2(n.referenceEl) || H(i)), { attributes: h, state: p, styles: g, update: f, forceUpdate: u, instanceRef: y } = DA(d, t, l);
return Ke(y, (v) => e.value = v), on(() => {
Ke(() => {
var v;
return (v = H(d)) == null ? void 0 : v.getBoundingClientRect();
}, () => {
f();
});
}), {
attributes: h,
arrowRef: s,
contentRef: t,
instanceRef: y,
state: p,
styles: g,
role: r,
forceUpdate: u,
update: f
};
}, c2 = (n, {
attributes: e,
styles: t,
role: i
}) => {
const { nextZIndex: r } = ey(), s = it("popper"), o = ce(() => H(e).popper), a = Ae(St(n.zIndex) ? n.zIndex : r()), c = ce(() => [
s.b(),
s.is("pure", n.pure),
s.is(n.effect),
n.popperClass
]), l = ce(() => [
{ zIndex: H(a) },
H(t).popper,
n.popperStyle || {}
]), d = ce(() => i.value === "dialog" ? "false" : void 0), h = ce(() => H(t).arrow || {});
return {
ariaModal: d,
arrowStyle: h,
contentAttrs: o,
contentClass: c,
contentStyle: l,
contentZIndex: a,
updateZIndex: () => {
a.value = St(n.zIndex) ? n.zIndex : r();
}
};
}, u2 = (n, e) => {
const t = Ae(!1), i = Ae();
return {
focusStartRef: i,
trapped: t,
onFocusAfterReleased: (l) => {
var d;
((d = l.detail) == null ? void 0 : d.focusReason) !== "pointer" && (i.value = "first", e("blur"));
},
onFocusAfterTrapped: () => {
e("focus");
},
onFocusInTrap: (l) => {
n.visible && !t.value && (l.target && (i.value = l.target), t.value = !0);
},
onFocusoutPrevented: (l) => {
n.trapping || (l.detail.focusReason === "pointer" && l.preventDefault(), t.value = !1);
},
onReleaseRequested: () => {
t.value = !1, e("close");
}
};
}, h2 = De({
name: "ElPopperContent"
}), d2 = /* @__PURE__ */ De({
...h2,
props: dy,
emits: n2,
setup(n, { expose: e, emit: t }) {
const i = n, {
focusStartRef: r,
trapped: s,
onFocusAfterReleased: o,
onFocusAfterTrapped: a,
onFocusInTrap: c,
onFocusoutPrevented: l,
onReleaseRequested: d
} = u2(i, t), { attributes: h, arrowRef: p, contentRef: g, styles: f, instanceRef: u, role: y, update: v } = l2(i), {
ariaModal: m,
arrowStyle: w,
contentAttrs: S,
contentClass: T,
contentStyle: M,
updateZIndex: x
} = c2(i, {
styles: f,
attributes: h,
role: y
}), _ = ht(qc, void 0), E = Ae();
gn(oy, {
arrowStyle: w,
arrowRef: p,
arrowOffset: E
}), _ && gn(qc, {
..._,
addInputId: $a,
removeInputId: $a
});
let L;
const R = (A = !0) => {
v(), A && x();
}, C = () => {
R(!1), i.visible && i.focusOnShow ? s.value = !0 : i.visible === !1 && (s.value = !1);
};
return on(() => {
Ke(() => i.triggerTargetEl, (A, P) => {
L == null || L(), L = void 0;
const I = H(A || g.value), b = H(P || g.value);
Ms(I) && (L = Ke([y, () => i.ariaLabel, m, () => i.id], (O) => {
["role", "aria-label", "aria-modal", "id"].forEach((N, D) => {
sr(O[D]) ? I.removeAttribute(N) : I.setAttribute(N, O[D]);
});
}, { immediate: !0 })), b !== I && Ms(b) && ["role", "aria-label", "aria-modal", "id"].forEach((O) => {
b.removeAttribute(O);
});
}, { immediate: !0 }), Ke(() => i.visible, C, { immediate: !0 });
}), li(() => {
L == null || L(), L = void 0;
}), e({
popperContentRef: g,
popperInstanceRef: u,
updatePopper: R,
contentStyle: M
}), (A, P) => (pe(), Re("div", Oi({
ref_key: "contentRef",
ref: g
}, H(S), {
style: H(M),
class: H(T),
tabindex: "-1",
onMouseenter: (I) => A.$emit("mouseenter", I),
onMouseleave: (I) => A.$emit("mouseleave", I)
}), [
ae(H(QC), {
trapped: H(s),
"trap-on-focus-in": !0,
"focus-trap-el": H(g),
"focus-start-el": H(r),
onFocusAfterTrapped: H(a),
onFocusAfterReleased: H(o),
onFocusin: H(c),
onFocusoutPrevented: H(l),
onReleaseRequested: H(d)
}, {
default: fe(() => [
Xe(A.$slots, "default")
]),
_: 3
}, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
], 16, ["onMouseenter", "onMouseleave"]));
}
});
var f2 = /* @__PURE__ */ at(d2, [["__file", "content.vue"]]);
const p2 = vn(OC), Ff = Symbol("elTooltip"), Zn = dt({
...VA,
...dy,
appendTo: {
type: Ye([String, Object])
},
content: {
type: String,
default: ""
},
rawContent: Boolean,
persistent: Boolean,
visible: {
type: Ye(Boolean),
default: null
},
transition: String,
teleported: {
type: Boolean,
default: !0
},
disabled: Boolean,
...Gs(["ariaLabel"])
}), qa = dt({
...uy,
disabled: Boolean,
trigger: {
type: Ye([String, Array]),
default: "hover"
},
triggerKeys: {
type: Ye(Array),
default: () => [Di.enter, Di.space]
}
}), {
useModelToggleProps: m2,
useModelToggleEmits: g2,
useModelToggle: v2
} = PE("visible"), y2 = dt({
...ay,
...m2,
...Zn,
...qa,
...ly,
showArrow: {
type: Boolean,
default: !0
}
}), b2 = [
...g2,
"before-show",
"before-hide",
"show",
"hide",
"open",
"close"
], x2 = (n, e) => Un(n) ? n.includes(e) : n === e, Js = (n, e, t) => (i) => {
x2(H(n), e) && t(i);
}, w2 = De({
name: "ElTooltipTrigger"
}), M2 = /* @__PURE__ */ De({
...w2,
props: qa,
setup(n, { expose: e }) {
const t = n, i = it("tooltip"), { controlled: r, id: s, open: o, onOpen: a, onClose: c, onToggle: l } = ht(Ff, void 0), d = Ae(null), h = () => {
if (H(r) || t.disabled)
return !0;
}, p = Bn(t, "trigger"), g = Qi(h, Js(p, "hover", a)), f = Qi(h, Js(p, "hover", c)), u = Qi(h, Js(p, "click", (S) => {
S.button === 0 && l(S);
})), y = Qi(h, Js(p, "focus", a)), v = Qi(h, Js(p, "focus", c)), m = Qi(h, Js(p, "contextmenu", (S) => {
S.preventDefault(), l(S);
})), w = Qi(h, (S) => {
const { code: T } = S;
t.triggerKeys.includes(T) && (S.preventDefault(), l(S));
});
return e({
triggerRef: d
}), (S, T) => (pe(), He(H(VC), {
id: H(s),
"virtual-ref": S.virtualRef,
open: H(o),
"virtual-triggering": S.virtualTriggering,
class: Le(H(i).e("trigger")),
onBlur: H(v),
onClick: H(u),
onContextmenu: H(m),
onFocus: H(y),
onMouseenter: H(g),
onMouseleave: H(f),
onKeydown: H(w)
}, {
default: fe(() => [
Xe(S.$slots, "default")
]),
_: 3
}, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]));
}
});
var S2 = /* @__PURE__ */ at(M2, [["__file", "trigger.vue"]]);
const _2 = dt({
to: {
type: Ye([String, Object]),
required: !0
},
disabled: Boolean
}), T2 = /* @__PURE__ */ De({
__name: "teleport",
props: _2,
setup(n) {
return (e, t) => e.disabled ? Xe(e.$slots, "default", { key: 0 }) : (pe(), He(r1, {
key: 1,
to: e.to
}, [
Xe(e.$slots, "default")
], 8, ["to"]));
}
});
var E2 = /* @__PURE__ */ at(T2, [["__file", "teleport.vue"]]);
const A2 = vn(E2), C2 = De({
name: "ElTooltipContent",
inheritAttrs: !1
}), L2 = /* @__PURE__ */ De({
...C2,
props: Zn,
setup(n, { expose: e }) {
const t = n, { selector: i } = J0(), r = it("tooltip"), s = Ae(null);
let o;
const {
controlled: a,
id: c,
open: l,
trigger: d,
onClose: h,
onOpen: p,
onShow: g,
onHide: f,
onBeforeShow: u,
onBeforeHide: y
} = ht(Ff, void 0), v = ce(() => t.transition || `${r.namespace.value}-fade-in-linear`), m = ce(() => process.env.NODE_ENV === "test" ? !0 : t.persistent);
li(() => {
o == null || o();
});
const w = ce(() => H(m) ? !0 : H(l)), S = ce(() => t.disabled ? !1 : H(l)), T = ce(() => t.appendTo || i.value), M = ce(() => {
var b;
return (b = t.style) != null ? b : {};
}), x = Ae(!0), _ = () => {
f(), x.value = !0;
}, E = () => {
if (H(a))
return !0;
}, L = Qi(E, () => {
t.enterable && H(d) === "hover" && p();
}), R = Qi(E, () => {
H(d) === "hover" && h();
}), C = () => {
var b, O;
(O = (b = s.value) == null ? void 0 : b.updatePopper) == null || O.call(b), u == null || u();
}, A = () => {
y == null || y();
}, P = () => {
g(), o = O1(ce(() => {
var b;
return (b = s.value) == null ? void 0 : b.popperContentRef;
}), () => {
if (H(a))
return;
H(d) !== "hover" && h();
});
}, I = () => {
t.virtualTriggering || h();
};
return Ke(() => H(l), (b) => {
b ? x.value = !1 : o == null || o();
}, {
flush: "post"
}), Ke(() => t.content, () => {
var b, O;
(O = (b = s.value) == null ? void 0 : b.updatePopper) == null || O.call(b);
}), e({
contentRef: s
}), (b, O) => (pe(), He(H(A2), {
disabled: !b.teleported,
to: H(T)
}, {
default: fe(() => [
ae(hl, {
name: H(v),
onAfterLeave: _,
onBeforeEnter: C,
onAfterEnter: P,
onBeforeLeave: A
}, {
default: fe(() => [
H(w) ? Ft((pe(), He(H(f2), Oi({
key: 0,
id: H(c),
ref_key: "contentRef",
ref: s
}, b.$attrs, {
"aria-label": b.ariaLabel,
"aria-hidden": x.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, H(M)],
"reference-el": b.referenceEl,
"trigger-target-el": b.triggerTargetEl,
visible: H(S),
"z-index": b.zIndex,
onMouseenter: H(L),
onMouseleave: H(R),
onBlur: I,
onClose: H(h)
}), {
default: fe(() => [
Xe(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"])), [
[xn, H(S)]
]) : Ge("v-if", !0)
]),
_: 3
}, 8, ["name"])
]),
_: 3
}, 8, ["disabled", "to"]));
}
});
var R2 = /* @__PURE__ */ at(L2, [["__file", "content.vue"]]);
const P2 = De({
name: "ElTooltip"
}), I2 = /* @__PURE__ */ De({
...P2,
props: y2,
emits: b2,
setup(n, { expose: e, emit: t }) {
const i = n;
UA();
const r = vu(), s = Ae(), o = Ae(), a = () => {
var v;
const m = H(s);
m && ((v = m.popperInstanceRef) == null || v.update());
}, c = Ae(!1), l = Ae(), { show: d, hide: h, hasUpdateHandler: p } = v2({
indicator: c,
toggleReason: l
}), { onOpen: g, onClose: f } = kA({
showAfter: Bn(i, "showAfter"),
hideAfter: Bn(i, "hideAfter"),
autoClose: Bn(i, "autoClose"),
open: d,
close: h
}), u = ce(() => gf(i.visible) && !p.value);
gn(Ff, {
controlled: u,
id: r,
open: o0(c),
trigger: Bn(i, "trigger"),
onOpen: (v) => {
g(v);
},
onClose: (v) => {
f(v);
},
onToggle: (v) => {
H(c) ? f(v) : g(v);
},
onShow: () => {
t("show", l.value);
},
onHide: () => {
t("hide", l.value);
},
onBeforeShow: () => {
t("before-show", l.value);
},
onBeforeHide: () => {
t("before-hide", l.value);
},
updatePopper: a
}), Ke(() => i.disabled, (v) => {
v && c.value && (c.value = !1);
});
const y = (v) => {
var m, w;
const S = (w = (m = o.value) == null ? void 0 : m.contentRef) == null ? void 0 : w.popperContentRef, T = (v == null ? void 0 : v.relatedTarget) || document.activeElement;
return S && S.contains(T);
};
return s1(() => c.value && h()), e({
popperRef: s,
contentRef: o,
isFocusInsideContent: y,
updatePopper: a,
onOpen: g,
onClose: f,
hide: h
}), (v, m) => (pe(), He(H(p2), {
ref_key: "popperRef",
ref: s,
role: v.role
}, {
default: fe(() => [
ae(S2, {
disabled: v.disabled,
trigger: v.trigger,
"trigger-keys": v.triggerKeys,
"virtual-ref": v.virtualRef,
"virtual-triggering": v.virtualTriggering
}, {
default: fe(() => [
v.$slots.default ? Xe(v.$slots, "default", { key: 0 }) : Ge("v-if", !0)
]),
_: 3
}, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]),
ae(R2, {
ref_key: "contentRef",
ref: o,
"aria-label": v.ariaLabel,
"boundaries-padding": v.boundariesPadding,
content: v.content,
disabled: v.disabled,
effect: v.effect,
enterable: v.enterable,
"fallback-placements": v.fallbackPlacements,
"hide-after": v.hideAfter,
"gpu-acceleration": v.gpuAcceleration,
offset: v.offset,
persistent: v.persistent,
"popper-class": v.popperClass,
"popper-style": v.popperStyle,
placement: v.placement,
"popper-options": v.popperOptions,
pure: v.pure,
"raw-content": v.rawContent,
"reference-el": v.referenceEl,
"trigger-target-el": v.triggerTargetEl,
"show-after": v.showAfter,
strategy: v.strategy,
teleported: v.teleported,
transition: v.transition,
"virtual-triggering": v.virtualTriggering,
"z-index": v.zIndex,
"append-to": v.appendTo
}, {
default: fe(() => [
Xe(v.$slots, "content", {}, () => [
v.rawContent ? (pe(), Re("span", {
key: 0,
innerHTML: v.content
}, null, 8, ["innerHTML"])) : (pe(), Re("span", { key: 1 }, wt(v.content), 1))
]),
v.showArrow ? (pe(), He(H(FC), {
key: 0,
"arrow-offset": v.arrowOffset
}, null, 8, ["arrow-offset"])) : Ge("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 O2 = /* @__PURE__ */ at(I2, [["__file", "tooltip.vue"]]);
const Bf = vn(O2), fy = Symbol("buttonGroupContextKey"), D2 = (n, e) => {
SE({
from: "type.text",
replacement: "link",
version: "3.0.0",
scope: "props",
ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
}, ce(() => n.type === "text"));
const t = ht(fy, void 0), i = Lf("button"), { form: r } = gl(), s = ra(ce(() => t == null ? void 0 : t.size)), o = yu(), a = Ae(), c = ou(), l = ce(() => n.type || (t == null ? void 0 : t.type) || ""), d = ce(() => {
var f, u, y;
return (y = (u = n.autoInsertSpace) != null ? u : (f = i.value) == null ? void 0 : f.autoInsertSpace) != null ? y : !1;
}), h = ce(() => n.tag === "button" ? {
ariaDisabled: o.value || n.loading,
disabled: o.value || n.loading,
autofocus: n.autofocus,
type: n.nativeType
} : {}), p = ce(() => {
var f;
const u = (f = c.default) == null ? void 0 : f.call(c);
if (d.value && (u == null ? void 0 : u.length) === 1) {
const y = u[0];
if ((y == null ? void 0 : y.type) === u0) {
const v = y.children;
return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(v.trim());
}
}
return !1;
});
return {
_disabled: o,
_size: s,
_type: l,
_ref: a,
_props: h,
shouldAddSpace: p,
handleClick: (f) => {
if (o.value || n.loading) {
f.stopPropagation();
return;
}
n.nativeType === "reset" && (r == null || r.resetFields()), e("click", f);
}
};
}, N2 = [
"default",
"primary",
"success",
"warning",
"info",
"danger",
"text",
""
], F2 = ["button", "submit", "reset"], fd = dt({
size: Do,
disabled: Boolean,
type: {
type: String,
values: N2,
default: ""
},
icon: {
type: Zr
},
nativeType: {
type: String,
values: F2,
default: "button"
},
loading: Boolean,
loadingIcon: {
type: Zr,
default: () => P0
},
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: Ye([String, Object]),
default: "button"
}
}), B2 = {
click: (n) => n instanceof MouseEvent
};
function Mn(n, e) {
z2(n) && (n = "100%");
var t = U2(n);
return n = e === 360 ? n : Math.min(e, Math.max(0, parseFloat(n))), t && (n = parseInt(String(n * e), 10) / 100), Math.abs(n - e) < 1e-6 ? 1 : (e === 360 ? n = (n < 0 ? n % e + e : n % e) / parseFloat(String(e)) : n = n % e / parseFloat(String(e)), n);
}
function Vl(n) {
return Math.min(1, Math.max(0, n));
}
function z2(n) {
return typeof n == "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
}
function U2(n) {
return typeof n == "string" && n.indexOf("%") !== -1;
}
function py(n) {
return n = parseFloat(n), (isNaN(n) || n < 0 || n > 1) && (n = 1), n;
}
function kl(n) {
return n <= 1 ? "".concat(Number(n) * 100, "%") : n;
}
function bs(n) {
return n.length === 1 ? "0" + n : String(n);
}
function V2(n, e, t) {
return {
r: Mn(n, 255) * 255,
g: Mn(e, 255) * 255,
b: Mn(t, 255) * 255
};
}
function Qm(n, e, t) {
n = Mn(n, 255), e = Mn(e, 255), t = Mn(t, 255);
var i = Math.max(n, e, t), r = Math.min(n, e, t), s = 0, o = 0, a = (i + r) / 2;
if (i === r)
o = 0, s = 0;
else {
var c = i - r;
switch (o = a > 0.5 ? c / (2 - i - r) : c / (i + r), i) {
case n:
s = (e - t) / c + (e < t ? 6 : 0);
break;
case e:
s = (t - n) / c + 2;
break;
case t:
s = (n - e) / c + 4;
break;
}
s /= 6;
}
return { h: s, s: o, l: a };
}
function Qu(n, e, t) {
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? n + (e - n) * (6 * t) : t < 1 / 2 ? e : t < 2 / 3 ? n + (e - n) * (2 / 3 - t) * 6 : n;
}
function k2(n, e, t) {
var i, r, s;
if (n = Mn(n, 360), e = Mn(e, 100), t = Mn(t, 100), e === 0)
r = t, s = t, i = t;
else {
var o = t < 0.5 ? t * (1 + e) : t + e - t * e, a = 2 * t - o;
i = Qu(a, o, n + 1 / 3), r = Qu(a, o, n), s = Qu(a, o, n - 1 / 3);
}
return { r: i * 255, g: r * 255, b: s * 255 };
}
function eg(n, e, t) {
n = Mn(n, 255), e = Mn(e, 255), t = Mn(t, 255);
var i = Math.max(n, e, t), r = Math.min(n, e, t), s = 0, o = i, a = i - r, c = i === 0 ? 0 : a / i;
if (i === r)
s = 0;
else {
switch (i) {
case n:
s = (e - t) / a + (e < t ? 6 : 0);
break;
case e:
s = (t - n) / a + 2;
break;
case t:
s = (n - e) / a + 4;
break;
}
s /= 6;
}
return { h: s, s: c, v: o };
}
function G2(n, e, t) {
n = Mn(n, 360) * 6, e = Mn(e, 100), t = Mn(t, 100);
var i = Math.floor(n), r = n - i, s = t * (1 - e), o = t * (1 - r * e), a = t * (1 - (1 - r) * e), c = i % 6, l = [t, o, s, s, a, t][c], d = [a, t, t, o, s, s][c], h = [s, s, a, t, t, o][c];
return { r: l * 255, g: d * 255, b: h * 255 };
}
function tg(n, e, t, i) {
var r = [
bs(Math.round(n).toString(16)),
bs(Math.round(e).toString(16)),
bs(Math.round(t).toString(16))
];
return i && r[0].startsWith(r[0].charAt(1)) && r[1].startsWith(r[1].charAt(1)) && r[2].startsWith(r[2].charAt(1)) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) : r.join("");
}
function H2(n, e, t, i, r) {
var s = [
bs(Math.round(n).toString(16)),
bs(Math.round(e).toString(16)),
bs(Math.round(t).toString(16)),
bs(W2(i))
];
return r && s[0].startsWith(s[0].charAt(1)) && s[1].startsWith(s[1].charAt(1)) && s[2].startsWith(s[2].charAt(1)) && s[3].startsWith(s[3].charAt(1)) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) + s[3].charAt(0) : s.join("");
}
function W2(n) {
return Math.round(parseFloat(n) * 255).toString(16);
}
function ng(n) {
return $n(n) / 255;
}
function $n(n) {
return parseInt(n, 16);
}
function j2(n) {
return {
r: n >> 16,
g: (n & 65280) >> 8,
b: n & 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 $2(n) {
var e = { r: 0, g: 0, b: 0 }, t = 1, i = null, r = null, s = null, o = !1, a = !1;
return typeof n == "string" && (n = Y2(n)), typeof n == "object" && (ji(n.r) && ji(n.g) && ji(n.b) ? (e = V2(n.r, n.g, n.b), o = !0, a = String(n.r).substr(-1) === "%" ? "prgb" : "rgb") : ji(n.h) && ji(n.s) && ji(n.v) ? (i = kl(n.s), r = kl(n.v), e = G2(n.h, i, r), o = !0, a = "hsv") : ji(n.h) && ji(n.s) && ji(n.l) && (i = kl(n.s), s = kl(n.l), e = k2(n.h, i, s), o = !0, a = "hsl"), Object.prototype.hasOwnProperty.call(n, "a") && (t = n.a)), t = py(t), {
ok: o,
format: n.format || a,
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 Z2 = "[-\\+]?\\d+%?", X2 = "[-\\+]?\\d*\\.\\d+%?", zr = "(?:".concat(X2, ")|(?:").concat(Z2, ")"), eh = "[\\s|\\(]+(".concat(zr, ")[,|\\s]+(").concat(zr, ")[,|\\s]+(").concat(zr, ")\\s*\\)?"), th = "[\\s|\\(]+(".concat(zr, ")[,|\\s]+(").concat(zr, ")[,|\\s]+(").concat(zr, ")[,|\\s]+(").concat(zr, ")\\s*\\)?"), mi = {
CSS_UNIT: new RegExp(zr),
rgb: new RegExp("rgb" + eh),
rgba: new RegExp("rgba" + th),
hsl: new RegExp("hsl" + eh),
hsla: new RegExp("hsla" + th),
hsv: new RegExp("hsv" + eh),
hsva: new RegExp("hsva" + th),
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 Y2(n) {
if (n = n.trim().toLowerCase(), n.length === 0)
return !1;
var e = !1;
if (pd[n])
n = pd[n], e = !0;
else if (n === "transparent")
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
var t = mi.rgb.exec(n);
return t ? { r: t[1], g: t[2], b: t[3] } : (t = mi.rgba.exec(n), t ? { r: t[1], g: t[2], b: t[3], a: t[4] } : (t = mi.hsl.exec(n), t ? { h: t[1], s: t[2], l: t[3] } : (t = mi.hsla.exec(n), t ? { h: t[1], s: t[2], l: t[3], a: t[4] } : (t = mi.hsv.exec(n), t ? { h: t[1], s: t[2], v: t[3] } : (t = mi.hsva.exec(n), t ? { h: t[1], s: t[2], v: t[3], a: t[4] } : (t = mi.hex8.exec(n), t ? {
r: $n(t[1]),
g: $n(t[2]),
b: $n(t[3]),
a: ng(t[4]),
format: e ? "name" : "hex8"
} : (t = mi.hex6.exec(n), t ? {
r: $n(t[1]),
g: $n(t[2]),
b: $n(t[3]),
format: e ? "name" : "hex"
} : (t = mi.hex4.exec(n), t ? {
r: $n(t[1] + t[1]),
g: $n(t[2] + t[2]),
b: $n(t[3] + t[3]),
a: ng(t[4] + t[4]),
format: e ? "name" : "hex8"
} : (t = mi.hex3.exec(n), t ? {
r: $n(t[1] + t[1]),
g: $n(t[2] + t[2]),
b: $n(t[3] + t[3]),
format: e ? "name" : "hex"
} : !1)))))))));
}
function ji(n) {
return !!mi.CSS_UNIT.exec(String(n));
}
var J2 = (
/** @class */
function() {
function n(e, t) {
e === void 0 && (e = ""), t === void 0 && (t = {});
var i;
if (e instanceof n)
return e;
typeof e == "number" && (e = j2(e)), this.originalInput = e;
var r = $2(e);
this.originalInput = e, this.r = r.r, this.g = r.g, this.b = r.b, this.a = r.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (i = t.format) !== null && i !== void 0 ? i : r.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 = r.ok;
}
return n.prototype.isDark = function() {
return this.getBrightness() < 128;
}, n.prototype.isLight = function() {
return !this.isDark();
}, n.prototype.getBrightness = function() {
var e = this.toRgb();
return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3;
}, n.prototype.getLuminance = function() {
var e = this.toRgb(), t, i, r, s = e.r / 255, o = e.g / 255, a = e.b / 255;
return s <= 0.03928 ? t = s / 12.92 : t = Math.pow((s + 0.055) / 1.055, 2.4), o <= 0.03928 ? i = o / 12.92 : i = 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), 0.2126 * t + 0.7152 * i + 0.0722 * r;
}, n.prototype.getAlpha = function() {
return this.a;
}, n.prototype.setAlpha = function(e) {
return this.a = py(e), this.roundA = Math.round(100 * this.a) / 100, this;
}, n.prototype.isMonochrome = function() {
var e = this.toHsl().s;
return e === 0;
}, n.prototype.toHsv = function() {
var e = eg(this.r, this.g, this.b);
return { h: e.h * 360, s: e.s, v: e.v, a: this.a };
}, n.prototype.toHsvString = function() {
var e = eg(this.r, this.g, this.b), t = Math.round(e.h * 360), i = Math.round(e.s * 100), r = Math.round(e.v * 100);
return this.a === 1 ? "hsv(".concat(t, ", ").concat(i, "%, ").concat(r, "%)") : "hsva(".concat(t, ", ").concat(i, "%, ").concat(r, "%, ").concat(this.roundA, ")");
}, n.prototype.toHsl = function() {
var e = Qm(this.r, this.g, this.b);
return { h: e.h * 360, s: e.s, l: e.l, a: this.a };
}, n.prototype.toHslString = function() {
var e = Qm(this.r, this.g, this.b), t = Math.round(e.h * 360), i = Math.round(e.s * 100), r = Math.round(e.l * 100);
return this.a === 1 ? "hsl(".concat(t, ", ").concat(i, "%, ").concat(r, "%)") : "hsla(".concat(t, ", ").concat(i, "%, ").concat(r, "%, ").concat(this.roundA, ")");
}, n.prototype.toHex = function(e) {
return e === void 0 && (e = !1), tg(this.r, this.g, this.b, e);
}, n.prototype.toHexString = function(e) {
return e === void 0 && (e = !1), "#" + this.toHex(e);
}, n.prototype.toHex8 = function(e) {
return e === void 0 && (e = !1), H2(this.r, this.g, this.b, this.a, e);
}, n.prototype.toHex8String = function(e) {
return e === void 0 && (e = !1), "#" + this.toHex8(e);
}, n.prototype.toHexShortString = function(e) {
return e === void 0 && (e = !1), this.a === 1 ? this.toHexString(e) : this.toHex8String(e);
}, n.prototype.toRgb = function() {
return {
r: Math.round(this.r),
g: Math.round(this.g),
b: Math.round(this.b),
a: this.a
};
}, n.prototype.toRgbString = function() {
var e = Math.round(this.r), t = Math.round(this.g), i = Math.round(this.b);
return this.a === 1 ? "rgb(".concat(e, ", ").concat(t, ", ").concat(i, ")") : "rgba(".concat(e, ", ").concat(t, ", ").concat(i, ", ").concat(this.roundA, ")");
}, n.prototype.toPercentageRgb = function() {
var e = function(t) {
return "".concat(Math.round(Mn(t, 255) * 100), "%");
};
return {
r: e(this.r),
g: e(this.g),
b: e(this.b),
a: this.a
};
}, n.prototype.toPercentageRgbString = function() {
var e = function(t) {
return Math.round(Mn(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, ")");
}, n.prototype.toName = function() {
if (this.a === 0)
return "transparent";
if (this.a < 1)
return !1;
for (var e = "#" + tg(this.r, this.g, this.b, !1), t = 0, i = Object.entries(pd); t < i.length; t++) {
var r = i[t], s = r[0], o = r[1];
if (e === o)
return s;
}
return !1;
}, n.prototype.toString = function(e) {
var t = !!e;
e = e ?? this.format;
var i = !1, r = this.a < 1 && this.a >= 0, s = !t && r && (e.startsWith("hex") || e === "name");
return s ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (i = this.toRgbString()), e === "prgb" && (i = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (i = this.toHexString()), e === "hex3" && (i = this.toHexString(!0)), e === "hex4" && (i = this.toHex8String(!0)), e === "hex8" && (i = this.toHex8String()), e === "name" && (i = this.toName()), e === "hsl" && (i = this.toHslString()), e === "hsv" && (i = this.toHsvString()), i || this.toHexString());
}, n.prototype.toNumber = function() {
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
}, n.prototype.clone = function() {
return new n(this.toString());
}, n.prototype.lighten = function(e) {
e === void 0 && (e = 10);
var t = this.toHsl();
return t.l += e / 100, t.l = Vl(t.l), new n(t);
}, n.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 n(t);
}, n.prototype.darken = function(e) {
e === void 0 && (e = 10);
var t = this.toHsl();
return t.l -= e / 100, t.l = Vl(t.l), new n(t);
}, n.prototype.tint = function(e) {
return e === void 0 && (e = 10), this.mix("white", e);
}, n.prototype.shade = function(e) {
return e === void 0 && (e = 10), this.mix("black", e);
}, n.prototype.desaturate = function(e) {
e === void 0 && (e = 10);
var t = this.toHsl();
return t.s -= e / 100, t.s = Vl(t.s), new n(t);
}, n.prototype.saturate = function(e) {
e === void 0 && (e = 10);
var t = this.toHsl();
return t.s += e / 100, t.s = Vl(t.s), new n(t);
}, n.prototype.greyscale = function() {
return this.desaturate(100);
}, n.prototype.spin = function(e) {
var t = this.toHsl(), i = (t.h + e) % 360;
return t.h = i < 0 ? 360 + i : i, new n(t);
}, n.prototype.mix = function(e, t) {
t === void 0 && (t = 50);
var i = this.toRgb(), r = new n(e).toRgb(), s = t / 100, o = {
r: (r.r - i.r) * s + i.r,
g: (r.g - i.g) * s + i.g,
b: (r.b - i.b) * s + i.b,
a: (r.a - i.a) * s + i.a
};
return new n(o);
}, n.prototype.analogous = function(e, t) {
e === void 0 && (e = 6), t === void 0 && (t = 30);
var i = this.toHsl(), r = 360 / t, s = [this];
for (i.h = (i.h - (r * e >> 1) + 720) % 360; --e; )
i.h = (i.h + r) % 360, s.push(new n(i));
return s;
}, n.prototype.complement = function() {
var e = this.toHsl();
return e.h = (e.h + 180) % 360, new n(e);
}, n.prototype.monochromatic = function(e) {
e === void 0 && (e = 6);
for (var t = this.toHsv(), i = t.h, r = t.s, s = t.v, o = [], a = 1 / e; e--; )
o.push(new n({ h: i, s: r, v: s })), s = (s + a) % 1;
return o;
}, n.prototype.splitcomplement = function() {
var e = this.toHsl(), t = e.h;
return [
this,
new n({ h: (t + 72) % 360, s: e.s, l: e.l }),
new n({ h: (t + 216) % 360, s: e.s, l: e.l })
];
}, n.prototype.onBackground = function(e) {
var t = this.toRgb(), i = new n(e).toRgb(), r = t.a + i.a * (1 - t.a);
return new n({
r: (t.r * t.a + i.r * i.a * (1 - t.a)) / r,
g: (t.g * t.a + i.g * i.a * (1 - t.a)) / r,
b: (t.b * t.a + i.b * i.a * (1 - t.a)) / r,
a: r
});
}, n.prototype.triad = function() {
return this.polyad(3);
}, n.prototype.tetrad = function() {
return this.polyad(4);
}, n.prototype.polyad = function(e) {
for (var t = this.toHsl(), i = t.h, r = [this], s = 360 / e, o = 1; o < e; o++)
r.push(new n({ h: (i + o * s) % 360, s: t.s, l: t.l }));
return r;
}, n.prototype.equals = function(e) {
return this.toRgbString() === new n(e).toRgbString();
}, n;
}()
);
function Mr(n, e = 20) {
return n.mix("#141414", e).toString();
}
function q2(n) {
const e = yu(), t = it("button");
return ce(() => {
let i = {}, r = n.color;
if (r) {
const s = r.match(/var\((.*?)\)/);
s && (r = window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));
const o = new J2(r), a = n.dark ? o.tint(20).toString() : Mr(o, 20);
if (n.plain)
i = t.cssVarBlock({
"bg-color": n.dark ? Mr(o, 90) : o.tint(90).toString(),
"text-color": r,
"border-color": n.dark ? Mr(o, 50) : o.tint(50).toString(),
"hover-text-color": `var(${t.cssVarName("color-white")})`,
"hover-bg-color": r,
"hover-border-color": r,
"active-bg-color": a,
"active-text-color": `var(${t.cssVarName("color-white")})`,
"active-border-color": a
}), e.value && (i[t.cssVarBlockName("disabled-bg-color")] = n.dark ? Mr(o, 90) : o.tint(90).toString(), i[t.cssVarBlockName("disabled-text-color")] = n.dark ? Mr(o, 50) : o.tint(50).toString(), i[t.cssVarBlockName("disabled-border-color")] = n.dark ? Mr(o, 80) : o.tint(80).toString());
else {
const c = n.dark ? Mr(o, 30) : o.tint(30).toString(), l = o.isDark() ? `var(${t.cssVarName("color-white")})` : `var(${t.cssVarName("color-black")})`;
if (i = t.cssVarBlock({
"bg-color": r,
"text-color": l,
"border-color": r,
"hover-bg-color": c,
"hover-text-color": l,
"hover-border-color": c,
"active-bg-color": a,
"active-border-color": a
}), e.value) {
const d = n.dark ? Mr(o, 50) : o.tint(50).toString();
i[t.cssVarBlockName("disabled-bg-color")] = d, i[t.cssVarBlockName("disabled-text-color")] = n.dark ? "rgba(255, 255, 255, 0.5)" : `var(${t.cssVarName("color-white")})`, i[t.cssVarBlockName("disabled-border-color")] = d;
}
}
}
return i;
});
}
const K2 = De({
name: "ElButton"
}), Q2 = /* @__PURE__ */ De({
...K2,
props: fd,
emits: B2,
setup(n, { expose: e, emit: t }) {
const i = n, r = q2(i), s = it("button"), { _ref: o, _size: a, _type: c, _disabled: l, _props: d, shouldAddSpace: h, handleClick: p } = D2(i, t), g = ce(() => [
s.b(),
s.m(c.value),
s.m(a.value),
s.is("disabled", l.value),
s.is("loading", i.loading),
s.is("plain", i.plain),
s.is("round", i.round),
s.is("circle", i.circle),
s.is("text", i.text),
s.is("link", i.link),
s.is("has-bg", i.bg)
]);
return e({
ref: o,
size: a,
type: c,
disabled: l,
shouldAddSpace: h
}), (f, u) => (pe(), He(zn(f.tag), Oi({
ref_key: "_ref",
ref: o
}, H(d), {
class: H(g),
style: H(r),
onClick: H(p)
}), {
default: fe(() => [
f.loading ? (pe(), Re(Wt, { key: 0 }, [
f.$slots.loading ? Xe(f.$slots, "loading", { key: 0 }) : (pe(), He(H(Bt), {
key: 1,
class: Le(H(s).is("loading"))
}, {
default: fe(() => [
(pe(), He(zn(f.loadingIcon)))
]),
_: 1
}, 8, ["class"]))
], 64)) : f.icon || f.$slots.icon ? (pe(), He(H(Bt), { key: 1 }, {
default: fe(() => [
f.icon ? (pe(), He(zn(f.icon), { key: 0 })) : Xe(f.$slots, "icon", { key: 1 })
]),
_: 3
})) : Ge("v-if", !0),
f.$slots.default ? (pe(), Re("span", {
key: 2,
class: Le({ [H(s).em("text", "expand")]: H(h) })
}, [
Xe(f.$slots, "default")
], 2)) : Ge("v-if", !0)
]),
_: 3
}, 16, ["class", "style", "onClick"]));
}
});
var eL = /* @__PURE__ */ at(Q2, [["__file", "button.vue"]]);
const tL = {
size: fd.size,
type: fd.type
}, nL = De({
name: "ElButtonGroup"
}), iL = /* @__PURE__ */ De({
...nL,
props: tL,
setup(n) {
const e = n;
gn(fy, qn({
size: Bn(e, "size"),
type: Bn(e, "type")
}));
const t = it("button");
return (i, r) => (pe(), Re("div", {
class: Le(H(t).b("group"))
}, [
Xe(i.$slots, "default")
], 2));
}
});
var my = /* @__PURE__ */ at(iL, [["__file", "button-group.vue"]]);
const sa = vn(eL, {
ButtonGroup: my
});
gr(my);
var Fr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function rL(n) {
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
}
function xu(n) {
if (n.__esModule) return n;
var e = n.default;
if (typeof e == "function") {
var t = function i() {
return this instanceof i ? 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(n).forEach(function(i) {
var r = Object.getOwnPropertyDescriptor(n, i);
Object.defineProperty(t, i, r.get ? r : {
enumerable: !0,
get: function() {
return n[i];
}
});
}), t;
}
const Or = /* @__PURE__ */ new Map();
if (rn) {
let n;
document.addEventListener("mousedown", (e) => n = e), document.addEventListener("mouseup", (e) => {
if (n) {
for (const t of Or.values())
for (const { documentHandler: i } of t)
i(e, n);
n = void 0;
}
});
}
function ig(n, e) {
let t = [];
return Array.isArray(e.arg) ? t = e.arg : Ms(e.arg) && t.push(e.arg), function(i, r) {
const s = e.instance.popperRef, o = i.target, a = r == null ? void 0 : r.target, c = !e || !e.instance, l = !o || !a, d = n.contains(o) || n.contains(a), h = n === o, p = t.length && t.some((f) => f == null ? void 0 : f.contains(o)) || t.length && t.includes(a), g = s && (s.contains(o) || s.contains(a));
c || l || d || h || p || g || e.value(i, r);
};
}
const sL = {
beforeMount(n, e) {
Or.has(n) || Or.set(n, []), Or.get(n).push({
documentHandler: ig(n, e),
bindingFn: e.value
});
},
updated(n, e) {
Or.has(n) || Or.set(n, []);
const t = Or.get(n), i = t.findIndex((s) => s.bindingFn === e.oldValue), r = {
documentHandler: ig(n, e),
bindingFn: e.value
};
i >= 0 ? t.splice(i, 1, r) : t.push(r);
},
unmounted(n) {
Or.delete(n);
}
}, oL = 100, aL = 600, rg = {
beforeMount(n, e) {
const t = e.value, { interval: i = oL, delay: r = aL } = Ln(t) ? {} : t;
let s, o;
const a = () => Ln(t) ? t() : t.handler(), c = () => {
o && (clearTimeout(o), o = void 0), s && (clearInterval(s), s = void 0);
};
n.addEventListener("mousedown", (l) => {
l.button === 0 && (c(), a(), document.addEventListener("mouseup", () => c(), {
once: !0
}), o = setTimeout(() => {
s = setInterval(() => {
a();
}, i);
}, r));
});
}
}, md = dt({
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
}), lL = {
close: (n) => n instanceof MouseEvent,
click: (n) => n instanceof MouseEvent
}, cL = De({
name: "ElTag"
}), uL = /* @__PURE__ */ De({
...cL,
props: md,
emits: lL,
setup(n, { emit: e }) {
const t = n, i = ra(), r = it("tag"), s = ce(() => {
const { type: l, hit: d, effect: h, closable: p, round: g } = t;
return [
r.b(),
r.is("closable", p),
r.m(l || "primary"),
r.m(i.value),
r.m(h),
r.is("hit", d),
r.is("round", g)
];
}), o = (l) => {
e("close", l);
}, a = (l) => {
e("click", l);
}, c = (l) => {
l.component.subTree.component.bum = null;
};
return (l, d) => l.disableTransitions ? (pe(), Re("span", {
key: 0,
class: Le(H(s)),
style: Ot({ backgroundColor: l.color }),
onClick: a
}, [
Be("span", {
class: Le(H(r).e("content"))
}, [
Xe(l.$slots, "default")
], 2),
l.closable ? (pe(), He(H(Bt), {
key: 0,
class: Le(H(r).e("close")),
onClick: fn(o, ["stop"])
}, {
default: fe(() => [
ae(H(cd))
]),
_: 1
}, 8, ["class", "onClick"])) : Ge("v-if", !0)
], 6)) : (pe(), He(hl, {
key: 1,
name: `${H(r).namespace.value}-zoom-in-center`,
appear: "",
onVnodeMounted: c
}, {
default: fe(() => [
Be("span", {
class: Le(H(s)),
style: Ot({ backgroundColor: l.color }),
onClick: a
}, [
Be("span", {
class: Le(H(r).e("content"))
}, [
Xe(l.$slots, "default")
], 2),
l.closable ? (pe(), He(H(Bt), {
key: 0,
class: Le(H(r).e("close")),
onClick: fn(o, ["stop"])
}, {
default: fe(() => [
ae(H(cd))
]),
_: 1
}, 8, ["class", "onClick"])) : Ge("v-if", !0)
], 6)
]),
_: 3
}, 8, ["name"]));
}
});
var hL = /* @__PURE__ */ at(uL, [["__file", "tag.vue"]]);
const dL = vn(hL), gy = Symbol("rowContextKey"), fL = [
"start",
"center",
"end",
"space-around",
"space-between",
"space-evenly"
], pL = ["top", "middle", "bottom"], mL = dt({
tag: {
type: String,
default: "div"
},
gutter: {
type: Number,
default: 0
},
justify: {
type: String,
values: fL,
default: "start"
},
align: {
type: String,
values: pL
}
}), gL = De({
name: "ElRow"
}), vL = /* @__PURE__ */ De({
...gL,
props: mL,
setup(n) {
const e = n, t = it("row"), i = ce(() => e.gutter);
gn(gy, {
gutter: i
});
const r = ce(() => {
const o = {};
return e.gutter && (o.marginRight = o.marginLeft = `-${e.gutter / 2}px`), o;
}), s = ce(() => [
t.b(),
t.is(`justify-${e.justify}`, e.justify !== "start"),
t.is(`align-${e.align}`, !!e.align)
]);
return (o, a) => (pe(), He(zn(o.tag), {
class: Le(H(s)),
style: Ot(H(r))
}, {
default: fe(() => [
Xe(o.$slots, "default")
]),
_: 3
}, 8, ["class", "style"]));
}
});
var yL = /* @__PURE__ */ at(vL, [["__file", "row.vue"]]);
const Hi = vn(yL), bL = dt({
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: Ye([Number, Object]),
default: () => tr({})
},
sm: {
type: Ye([Number, Object]),
default: () => tr({})
},
md: {
type: Ye([Number, Object]),
default: () => tr({})
},
lg: {
type: Ye([Number, Object]),
default: () => tr({})
},
xl: {
type: Ye([Number, Object]),
default: () => tr({})
}
}), xL = De({
name: "ElCol"
}), wL = /* @__PURE__ */ De({
...xL,
props: bL,
setup(n) {
const e = n, { gutter: t } = ht(gy, { gutter: ce(() => 0) }), i = it("col"), r = ce(() => {
const o = {};
return t.value && (o.paddingLeft = o.paddingRight = `${t.value / 2}px`), o;
}), s = ce(() => {
const o = [];
return ["span", "offset", "pull", "push"].forEach((l) => {
const d = e[l];
St(d) && (l === "span" ? o.push(i.b(`${e[l]}`)) : d > 0 && o.push(i.b(`${l}-${e[l]}`)));
}), ["xs", "sm", "md", "lg", "xl"].forEach((l) => {
St(e[l]) ? o.push(i.b(`${l}-${e[l]}`)) : Pn(e[l]) && Object.entries(e[l]).forEach(([d, h]) => {
o.push(d !== "span" ? i.b(`${l}-${d}-${h}`) : i.b(`${l}-${h}`));
});
}), t.value && o.push(i.is("guttered")), [i.b(), o];
});
return (o, a) => (pe(), He(zn(o.tag), {
class: Le(H(s)),
style: Ot(H(r))
}, {
default: fe(() => [
Xe(o.$slots, "default")
]),
_: 3
}, 8, ["class", "style"]));
}
});
var ML = /* @__PURE__ */ at(wL, [["__file", "col.vue"]]);
const _i = vn(ML), sg = (n) => St(n) || On(n) || Un(n), SL = dt({
accordion: Boolean,
modelValue: {
type: Ye([Array, String, Number]),
default: () => tr([])
}
}), _L = {
[Dt]: sg,
[Qr]: sg
}, vy = Symbol("collapseContextKey"), TL = (n, e) => {
const t = Ae(Ri(n.modelValue)), i = (s) => {
t.value = s;
const o = n.accordion ? t.value[0] : t.value;
e(Dt, o), e(Qr, o);
}, r = (s) => {
if (n.accordion)
i([t.value[0] === s ? "" : s]);
else {
const o = [...t.value], a = o.indexOf(s);
a > -1 ? o.splice(a, 1) : o.push(s), i(o);
}
};
return Ke(() => n.modelValue, () => t.value = Ri(n.modelValue), { deep: !0 }), gn(vy, {
activeNames: t,
handleItemClick: r
}), {
activeNames: t,
setActiveNames: i
};
}, EL = () => {
const n = it("collapse");
return {
rootKls: ce(() => n.b())
};
}, AL = De({
name: "ElCollapse"
}), CL = /* @__PURE__ */ De({
...AL,
props: SL,
emits: _L,
setup(n, { expose: e, emit: t }) {
const i = n, { activeNames: r, setActiveNames: s } = TL(i, t), { rootKls: o } = EL();
return e({
activeNames: r,
setActiveNames: s
}), (a, c) => (pe(), Re("div", {
class: Le(H(o))
}, [
Xe(a.$slots, "default")
], 2));
}
});
var LL = /* @__PURE__ */ at(CL, [["__file", "collapse.vue"]]);
const RL = De({
name: "ElCollapseTransition"
}), PL = /* @__PURE__ */ De({
...RL,
setup(n) {
const e = it("collapse-transition"), t = (r) => {
r.style.maxHeight = "", r.style.overflow = r.dataset.oldOverflow, r.style.paddingTop = r.dataset.oldPaddingTop, r.style.paddingBottom = r.dataset.oldPaddingBottom;
}, i = {
beforeEnter(r) {
r.dataset || (r.dataset = {}), r.dataset.oldPaddingTop = r.style.paddingTop, r.dataset.oldPaddingBottom = r.style.paddingBottom, r.style.height && (r.dataset.elExistsHeight = r.style.height), r.style.maxHeight = 0, r.style.paddingTop = 0, r.style.paddingBottom = 0;
},
enter(r) {
requestAnimationFrame(() => {
r.dataset.oldOverflow = r.style.overflow, r.dataset.elExistsHeight ? r.style.maxHeight = r.dataset.elExistsHeight : r.scrollHeight !== 0 ? r.style.maxHeight = `${r.scrollHeight}px` : r.style.maxHeight = 0, r.style.paddingTop = r.dataset.oldPaddingTop, r.style.paddingBottom = r.dataset.oldPaddingBottom, r.style.overflow = "hidden";
});
},
afterEnter(r) {
r.style.maxHeight = "", r.style.overflow = r.dataset.oldOverflow;
},
enterCancelled(r) {
t(r);
},
beforeLeave(r) {
r.dataset || (r.dataset = {}), r.dataset.oldPaddingTop = r.style.paddingTop, r.dataset.oldPaddingBottom = r.style.paddingBottom, r.dataset.oldOverflow = r.style.overflow, r.style.maxHeight = `${r.scrollHeight}px`, r.style.overflow = "hidden";
},
leave(r) {
r.scrollHeight !== 0 && (r.style.maxHeight = 0, r.style.paddingTop = 0, r.style.paddingBottom = 0);
},
afterLeave(r) {
t(r);
},
leaveCancelled(r) {
t(r);
}
};
return (r, s) => (pe(), He(hl, Oi({
name: H(e).b()
}, o1(i)), {
default: fe(() => [
Xe(r.$slots, "default")
]),
_: 3
}, 16, ["name"]));
}
});
var IL = /* @__PURE__ */ at(PL, [["__file", "collapse-transition.vue"]]);
const OL = vn(IL), DL = dt({
title: {
type: String,
default: ""
},
name: {
type: Ye([String, Number]),
default: void 0
},
icon: {
type: Zr,
default: $r
},
disabled: Boolean
}), NL = (n) => {
const e = ht(vy), { namespace: t } = it("collapse"), i = Ae(!1), r = Ae(!1), s = Cf(), o = ce(() => s.current++), a = ce(() => {
var p;
return (p = n.name) != null ? p : `${t.value}-id-${s.prefix}-${H(o)}`;
}), c = ce(() => e == null ? void 0 : e.activeNames.value.includes(H(a)));
return {
focusing: i,
id: o,
isActive: c,
handleFocus: () => {
setTimeout(() => {
r.value ? r.value = !1 : i.value = !0;
}, 50);
},
handleHeaderClick: () => {
n.disabled || (e == null || e.handleItemClick(H(a)), i.value = !1, r.value = !0);
},
handleEnterClick: () => {
e == null || e.handleItemClick(H(a));
}
};
}, FL = (n, { focusing: e, isActive: t, id: i }) => {
const r = it("collapse"), s = ce(() => [
r.b("item"),
r.is("active", H(t)),
r.is("disabled", n.disabled)
]), o = ce(() => [
r.be("item", "header"),
r.is("active", H(t)),
{ focusing: H(e) && !n.disabled }
]), a = ce(() => [
r.be("item", "arrow"),
r.is("active", H(t))
]), c = ce(() => r.be("item", "wrap")), l = ce(() => r.be("item", "content")), d = ce(() => r.b(`content-${H(i)}`)), h = ce(() => r.b(`head-${H(i)}`));
return {
arrowKls: a,
headKls: o,
rootKls: s,
itemWrapperKls: c,
itemContentKls: l,
scopedContentId: d,
scopedHeadId: h
};
}, BL = De({
name: "ElCollapseItem"
}), zL = /* @__PURE__ */ De({
...BL,
props: DL,
setup(n, { expose: e }) {
const t = n, {
focusing: i,
id: r,
isActive: s,
handleFocus: o,
handleHeaderClick: a,
handleEnterClick: c
} = NL(t), {
arrowKls: l,
headKls: d,
rootKls: h,
itemWrapperKls: p,
itemContentKls: g,
scopedContentId: f,
scopedHeadId: u
} = FL(t, { focusing: i, isActive: s, id: r });
return e({
isActive: s
}), (y, v) => (pe(), Re("div", {
class: Le(H(h))
}, [
Be("button", {
id: H(u),
class: Le(H(d)),
"aria-expanded": H(s),
"aria-controls": H(f),
"aria-describedby": H(f),
tabindex: y.disabled ? -1 : 0,
type: "button",
onClick: H(a),
onKeydown: vi(fn(H(c), ["stop", "prevent"]), ["space", "enter"]),
onFocus: H(o),
onBlur: (m) => i.value = !1
}, [
Xe(y.$slots, "title", {}, () => [
yt(wt(y.title), 1)
]),
Xe(y.$slots, "icon", { isActive: H(s) }, () => [
ae(H(Bt), {
class: Le(H(l))
}, {
default: fe(() => [
(pe(), He(zn(y.icon)))
]),
_: 1
}, 8, ["class"])
])
], 42, ["id", "aria-expanded", "aria-controls", "aria-describedby", "tabindex", "onClick", "onKeydown", "onFocus", "onBlur"]),
ae(H(OL), null, {
default: fe(() => [
Ft(Be("div", {
id: H(f),
role: "region",
class: Le(H(p)),
"aria-hidden": !H(s),
"aria-labelledby": H(u)
}, [
Be("div", {
class: Le(H(g))
}, [
Xe(y.$slots, "default")
], 2)
], 10, ["id", "aria-hidden", "aria-labelledby"]), [
[xn, H(s)]
])
]),
_: 3
})
], 2));
}
});
var yy = /* @__PURE__ */ at(zL, [["__file", "collapse-item.vue"]]);
const by = vn(LL, {
CollapseItem: yy
}), xy = gr(yy), UL = De({
name: "ElContainer"
}), VL = /* @__PURE__ */ De({
...UL,
props: {
direction: {
type: String
}
},
setup(n) {
const e = n, t = ou(), i = it("container"), r = 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 (s, o) => (pe(), Re("section", {
class: Le([H(i).b(), H(i).is("vertical", H(r))])
}, [
Xe(s.$slots, "default")
], 2));
}
});
var kL = /* @__PURE__ */ at(VL, [["__file", "container.vue"]]);
const GL = De({
name: "ElAside"
}), HL = /* @__PURE__ */ De({
...GL,
props: {
width: {
type: String,
default: null
}
},
setup(n) {
const e = n, t = it("aside"), i = ce(() => e.width ? t.cssVarBlock({ width: e.width }) : {});
return (r, s) => (pe(), Re("aside", {
class: Le(H(t).b()),
style: Ot(H(i))
}, [
Xe(r.$slots, "default")
], 6));
}
});
var wy = /* @__PURE__ */ at(HL, [["__file", "aside.vue"]]);
const WL = De({
name: "ElFooter"
}), jL = /* @__PURE__ */ De({
...WL,
props: {
height: {
type: String,
default: null
}
},
setup(n) {
const e = n, t = it("footer"), i = ce(() => e.height ? t.cssVarBlock({ height: e.height }) : {});
return (r, s) => (pe(), Re("footer", {
class: Le(H(t).b()),
style: Ot(H(i))
}, [
Xe(r.$slots, "default")
], 6));
}
});
var My = /* @__PURE__ */ at(jL, [["__file", "footer.vue"]]);
const $L = De({
name: "ElHeader"
}), ZL = /* @__PURE__ */ De({
...$L,
props: {
height: {
type: String,
default: null
}
},
setup(n) {
const e = n, t = it("header"), i = ce(() => e.height ? t.cssVarBlock({
height: e.height
}) : {});
return (r, s) => (pe(), Re("header", {
class: Le(H(t).b()),
style: Ot(H(i))
}, [
Xe(r.$slots, "default")
], 6));
}
});
var Sy = /* @__PURE__ */ at(ZL, [["__file", "header.vue"]]);
const XL = De({
name: "ElMain"
}), YL = /* @__PURE__ */ De({
...XL,
setup(n) {
const e = it("main");
return (t, i) => (pe(), Re("main", {
class: Le(H(e).b())
}, [
Xe(t.$slots, "default")
], 2));
}
});
var _y = /* @__PURE__ */ at(YL, [["__file", "main.vue"]]);
const Wi = vn(kL, {
Aside: wy,
Footer: My,
Header: Sy,
Main: _y
});
gr(wy);
const Ty = gr(My), JL = gr(Sy), vr = gr(_y), qL = /* @__PURE__ */ De({
inheritAttrs: !1
});
function KL(n, e, t, i, r, s) {
return Xe(n.$slots, "default");
}
var QL = /* @__PURE__ */ at(qL, [["render", KL], ["__file", "collection.vue"]]);
const eR = /* @__PURE__ */ De({
name: "ElCollectionItem",
inheritAttrs: !1
});
function tR(n, e, t, i, r, s) {
return Xe(n.$slots, "default");
}
var nR = /* @__PURE__ */ at(eR, [["render", tR], ["__file", "collection-item.vue"]]);
const iR = "data-el-collection-item", rR = (n) => {
const e = `El${n}Collection`, t = `${e}Item`, i = Symbol(e), r = Symbol(t), s = {
...QL,
name: e,
setup() {
const a = Ae(null), c = /* @__PURE__ */ new Map();
gn(i, {
itemMap: c,
getItems: () => {
const d = H(a);
if (!d)
return [];
const h = Array.from(d.querySelectorAll(`[${iR}]`));
return [...c.values()].sort((g, f) => h.indexOf(g.ref) - h.indexOf(f.ref));
},
collectionRef: a
});
}
}, o = {
...nR,
name: t,
setup(a, { attrs: c }) {
const l = Ae(null), d = ht(i, void 0);
gn(r, {
collectionItemRef: l
}), on(() => {
const h = H(l);
h && d.itemMap.set(h, {
ref: h,
...c
});
}), li(() => {
const h = H(l);
d.itemMap.delete(h);
});
}
};
return {
COLLECTION_INJECTION_KEY: i,
COLLECTION_ITEM_INJECTION_KEY: r,
ElCollection: s,
ElCollectionItem: o
};
}, nh = dt({
trigger: qa.trigger,
effect: {
...Zn.effect,
default: "light"
},
type: {
type: Ye(String)
},
placement: {
type: Ye(String),
default: "bottom"
},
popperOptions: {
type: Ye(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: Ye([Number, String]),
default: 0
},
maxHeight: {
type: Ye([Number, String]),
default: ""
},
popperClass: {
type: String,
default: ""
},
disabled: Boolean,
role: {
type: String,
default: "menu"
},
buttonProps: {
type: Ye(Object)
},
teleported: Zn.teleported
});
dt({
command: {
type: [Object, String, Number],
default: () => ({})
},
disabled: Boolean,
divided: Boolean,
textValue: String,
icon: {
type: Zr
}
});
dt({
onKeydown: { type: Ye(Function) }
});
rR("Dropdown");
const sR = dt({
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: Do,
controls: {
type: Boolean,
default: !0
},
controlsPosition: {
type: String,
default: "",
values: ["", "right"]
},
valueOnClear: {
type: [String, Number, null],
validator: (n) => n === null || St(n) || ["min", "max"].includes(n),
default: null
},
name: String,
placeholder: String,
precision: {
type: Number,
validator: (n) => n >= 0 && n === Number.parseInt(`${n}`, 10)
},
validateEvent: {
type: Boolean,
default: !0
},
...Gs(["ariaLabel"])
}), oR = {
[Qr]: (n, e) => e !== n,
blur: (n) => n instanceof FocusEvent,
focus: (n) => n instanceof FocusEvent,
[Ss]: (n) => St(n) || sr(n),
[Dt]: (n) => St(n) || sr(n)
}, aR = De({
name: "ElInputNumber"
}), lR = /* @__PURE__ */ De({
...aR,
props: sR,
emits: oR,
setup(n, { expose: e, emit: t }) {
const i = n, { t: r } = mu(), s = it("input-number"), o = Ae(), a = qn({
currentValue: i.modelValue,
userInput: null
}), { formItem: c } = gl(), l = ce(() => St(i.modelValue) && i.modelValue <= i.min), d = ce(() => St(i.modelValue) && i.modelValue >= i.max), h = ce(() => {
const I = v(i.step);
return yi(i.precision) ? Math.max(v(i.modelValue), I) : (I > i.precision && en("InputNumber", "precision should not be less than the decimal places of step"), i.precision);
}), p = ce(() => i.controls && i.controlsPosition === "right"), g = ra(), f = yu(), u = ce(() => {
if (a.userInput !== null)
return a.userInput;
let I = a.currentValue;
if (sr(I))
return "";
if (St(I)) {
if (Number.isNaN(I))
return "";
yi(i.precision) || (I = I.toFixed(i.precision));
}
return I;
}), y = (I, b) => {
if (yi(b) && (b = h.value), b === 0)
return Math.round(I);
let O = String(I);
const N = O.indexOf(".");
if (N === -1 || !O.replace(".", "").split("")[N + b])
return I;
const U = O.length;
return O.charAt(U - 1) === "5" && (O = `${O.slice(0, Math.max(0, U - 1))}6`), Number.parseFloat(Number(O).toFixed(b));
}, v = (I) => {
if (sr(I))
return 0;
const b = I.toString(), O = b.indexOf(".");
let N = 0;
return O !== -1 && (N = b.length - O - 1), N;
}, m = (I, b = 1) => St(I) ? y(I + i.step * b) : a.currentValue, w = () => {
if (i.readonly || f.value || d.value)
return;
const I = Number(u.value) || 0, b = m(I);
M(b), t(Ss, a.currentValue), A();
}, S = () => {
if (i.readonly || f.value || l.value)
return;
const I = Number(u.value) || 0, b = m(I, -1);
M(b), t(Ss, a.currentValue), A();
}, T = (I, b) => {
const { max: O, min: N, step: D, precision: B, stepStrictly: U, valueOnClear: k } = i;
O < N && na("InputNumber", "min should not be greater than max.");
let K = Number(I);
if (sr(I) || Number.isNaN(K))
return null;
if (I === "") {
if (k === null)
return null;
K = On(k) ? { min: N, max: O }[k] : k;
}
return U && (K = y(Math.round(K / D) * D, B), K !== I && b && t(Dt, K)), yi(B) || (K = y(K, B)), (K > O || K < N) && (K = K > O ? O : N, b && t(Dt, K)), K;
}, M = (I, b = !0) => {
var O;
const N = a.currentValue, D = T(I);
if (!b) {
t(Dt, D);
return;
}
N === D && I || (a.userInput = null, t(Dt, D), N !== D && t(Qr, D, N), i.validateEvent && ((O = c == null ? void 0 : c.validate) == null || O.call(c, "change").catch((B) => en(B))), a.currentValue = D);
}, x = (I) => {
a.userInput = I;
const b = I === "" ? null : Number(I);
t(Ss, b), M(b, !1);
}, _ = (I) => {
const b = I !== "" ? Number(I) : "";
(St(b) && !Number.isNaN(b) || I === "") && M(b), A(), a.userInput = null;
}, E = () => {
var I, b;
(b = (I = o.value) == null ? void 0 : I.focus) == null || b.call(I);
}, L = () => {
var I, b;
(b = (I = o.value) == null ? void 0 : I.blur) == null || b.call(I);
}, R = (I) => {
t("focus", I);
}, C = (I) => {
var b;
a.userInput = null, t("blur", I), i.validateEvent && ((b = c == null ? void 0 : c.validate) == null || b.call(c, "blur").catch((O) => en(O)));
}, A = () => {
a.currentValue !== i.modelValue && (a.currentValue = i.modelValue);
}, P = (I) => {
document.activeElement === I.target && I.preventDefault();
};
return Ke(() => i.modelValue, (I, b) => {
const O = T(I, !0);
a.userInput === null && O !== b && (a.currentValue = O);
}, { immediate: !0 }), on(() => {
var I;
const { min: b, max: O, modelValue: N } = i, D = (I = o.value) == null ? void 0 : I.input;
if (D.setAttribute("role", "spinbutton"), Number.isFinite(O) ? D.setAttribute("aria-valuemax", String(O)) : D.removeAttribute("aria-valuemax"), Number.isFinite(b) ? D.setAttribute("aria-valuemin", String(b)) : D.removeAttribute("aria-valuemin"), D.setAttribute("aria-valuenow", a.currentValue || a.currentValue === 0 ? String(a.currentValue) : ""), D.setAttribute("aria-disabled", String(f.value)), !St(N) && N != null) {
let B = Number(N);
Number.isNaN(B) && (B = null), t(Dt, B);
}
D.addEventListener("wheel", P, { passive: !1 });
}), sf(() => {
var I, b;
const O = (I = o.value) == null ? void 0 : I.input;
O == null || O.setAttribute("aria-valuenow", `${(b = a.currentValue) != null ? b : ""}`);
}), e({
focus: E,
blur: L
}), (I, b) => (pe(), Re("div", {
class: Le([
H(s).b(),
H(s).m(H(g)),
H(s).is("disabled", H(f)),
H(s).is("without-controls", !I.controls),
H(s).is("controls-right", H(p))
]),
onDragstart: fn(() => {
}, ["prevent"])
}, [
I.controls ? Ft((pe(), Re("span", {
key: 0,
role: "button",
"aria-label": H(r)("el.inputNumber.decrease"),
class: Le([H(s).e("decrease"), H(s).is("disabled", H(l))]),
onKeydown: vi(S, ["enter"])
}, [
Xe(I.$slots, "decrease-icon", {}, () => [
ae(H(Bt), null, {
default: fe(() => [
H(p) ? (pe(), He(H(vf), { key: 0 })) : (pe(), He(H(dE), { key: 1 }))
]),
_: 1
})
])
], 42, ["aria-label", "onKeydown"])), [
[H(rg), S]
]) : Ge("v-if", !0),
I.controls ? Ft((pe(), Re("span", {
key: 1,
role: "button",
"aria-label": H(r)("el.inputNumber.increase"),
class: Le([H(s).e("increase"), H(s).is("disabled", H(d))]),
onKeydown: vi(w, ["enter"])
}, [
Xe(I.$slots, "increase-icon", {}, () => [
ae(H(Bt), null, {
default: fe(() => [
H(p) ? (pe(), He(H(nE), { key: 0 })) : (pe(), He(H(fu), { key: 1 }))
]),
_: 1
})
])
], 42, ["aria-label", "onKeydown"])), [
[H(rg), w]
]) : Ge("v-if", !0),
ae(H(mC), {
id: I.id,
ref_key: "input",
ref: o,
type: "number",
step: I.step,
"model-value": H(u),
placeholder: I.placeholder,
readonly: I.readonly,
disabled: H(f),
size: H(g),
max: I.max,
min: I.min,
name: I.name,
"aria-label": I.ariaLabel,
"validate-event": !1,
onKeydown: [
vi(fn(w, ["prevent"]), ["up"]),
vi(fn(S, ["prevent"]), ["down"])
],
onBlur: C,
onFocus: R,
onInput: x,
onChange: _
}, a1({ _: 2 }, [
I.$slots.prefix ? {
name: "prefix",
fn: fe(() => [
Xe(I.$slots, "prefix")
])
} : void 0,
I.$slots.suffix ? {
name: "suffix",
fn: fe(() => [
Xe(I.$slots, "suffix")
])
} : void 0
]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"])
], 42, ["onDragstart"]));
}
});
var cR = /* @__PURE__ */ at(lR, [["__file", "input-number.vue"]]);
const yr = vn(cR), Ey = Symbol("ElSelectGroup"), wu = Symbol("ElSelect");
function uR(n, e) {
const t = ht(wu), i = ht(Ey, { disabled: !1 }), r = ce(() => d(Ri(t.props.modelValue), n.value)), s = ce(() => {
var g;
if (t.props.multiple) {
const f = Ri((g = t.props.modelValue) != null ? g : []);
return !r.value && f.length >= t.props.multipleLimit && t.props.multipleLimit > 0;
} else
return !1;
}), o = ce(() => n.label || (Pn(n.value) ? "" : n.value)), a = ce(() => n.value || n.label || ""), c = ce(() => n.disabled || e.groupDisabled || s.value), l = cn(), d = (g = [], f) => {
if (Pn(n.value)) {
const u = t.props.valueKey;
return g && g.some((y) => of(er(y, u)) === er(f, u));
} else
return g && g.includes(f);
}, h = () => {
!n.disabled && !i.disabled && (t.states.hoveringIndex = t.optionsArray.indexOf(l.proxy));
}, p = (g) => {
const f = new RegExp(YT(g), "i");
e.visible = f.test(o.value) || n.created;
};
return Ke(() => o.value, () => {
!n.created && !t.props.remote && t.setSelected();
}), Ke(() => n.value, (g, f) => {
const { remote: u, valueKey: y } = t.props;
if (g !== f && (t.onOptionDestroy(f, l.proxy), t.onOptionCreate(l.proxy)), !n.created && !u) {
if (y && Pn(g) && Pn(f) && g[y] === f[y])
return;
t.setSelected();
}
}), Ke(() => i.disabled, () => {
e.groupDisabled = i.disabled;
}, { immediate: !0 }), {
select: t,
currentLabel: o,
currentValue: a,
itemSelected: r,
isDisabled: c,
hoverItem: h,
updateOption: p
};
}
const hR = De({
name: "ElOption",
componentName: "ElOption",
props: {
value: {
required: !0,
type: [String, Number, Boolean, Object]
},
label: [String, Number],
created: Boolean,
disabled: Boolean
},
setup(n) {
const e = it("select"), t = vu(), i = ce(() => [
e.be("dropdown", "item"),
e.is("disabled", H(a)),
e.is("selected", H(o)),
e.is("hovering", H(p))
]), r = qn({
index: -1,
groupDisabled: !1,
visible: !0,
hover: !1
}), {
currentLabel: s,
itemSelected: o,
isDisabled: a,
select: c,
hoverItem: l,
updateOption: d
} = uR(n, r), { visible: h, hover: p } = cr(r), g = cn().proxy;
c.onOptionCreate(g), li(() => {
const u = g.value, { selected: y } = c.states, m = (c.props.multiple ? y : [y]).some((w) => w.value === g.value);
Mt(() => {
c.states.cachedOptions.get(u) === g && !m && c.states.cachedOptions.delete(u);
}), c.onOptionDestroy(u, g);
});
function f() {
a.value || c.handleOptionSelect(g);
}
return {
ns: e,
id: t,
containerKls: i,
currentLabel: s,
itemSelected: o,
isDisabled: a,
select: c,
hoverItem: l,
updateOption: d,
visible: h,
hover: p,
selectOptionClick: f,
states: r
};
}
});
function dR(n, e, t, i, r, s) {
return Ft((pe(), Re("li", {
id: n.id,
class: Le(n.containerKls),
role: "option",
"aria-disabled": n.isDisabled || void 0,
"aria-selected": n.itemSelected,
onMouseenter: n.hoverItem,
onClick: fn(n.selectOptionClick, ["stop"])
}, [
Xe(n.$slots, "default", {}, () => [
Be("span", null, wt(n.currentLabel), 1)
])
], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [
[xn, n.visible]
]);
}
var zf = /* @__PURE__ */ at(hR, [["render", dR], ["__file", "option.vue"]]);
const fR = De({
name: "ElSelectDropdown",
componentName: "ElSelectDropdown",
setup() {
const n = ht(wu), e = it("select"), t = ce(() => n.props.popperClass), i = ce(() => n.props.multiple), r = ce(() => n.props.fitInputWidth), s = Ae("");
function o() {
var a;
s.value = `${(a = n.selectRef) == null ? void 0 : a.offsetWidth}px`;
}
return on(() => {
o(), ii(n.selectRef, o);
}), {
ns: e,
minWidth: s,
popperClass: t,
isMultiple: i,
isFitInputWidth: r
};
}
});
function pR(n, e, t, i, r, s) {
return pe(), Re("div", {
class: Le([n.ns.b("dropdown"), n.ns.is("multiple", n.isMultiple), n.popperClass]),
style: Ot({ [n.isFitInputWidth ? "width" : "minWidth"]: n.minWidth })
}, [
n.$slots.header ? (pe(), Re("div", {
key: 0,
class: Le(n.ns.be("dropdown", "header"))
}, [
Xe(n.$slots, "header")
], 2)) : Ge("v-if", !0),
Xe(n.$slots, "default"),
n.$slots.footer ? (pe(), Re("div", {
key: 1,
class: Le(n.ns.be("dropdown", "footer"))
}, [
Xe(n.$slots, "footer")
], 2)) : Ge("v-if", !0)
], 6);
}
var mR = /* @__PURE__ */ at(fR, [["render", pR], ["__file", "select-dropdown.vue"]]);
const gR = 11, vR = (n, e) => {
const { t } = mu(), i = vu(), r = it("select"), s = it("input"), o = qn({
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
}), a = Ae(null), c = Ae(null), l = Ae(null), d = Ae(null), h = Ae(null), p = Ae(null), g = Ae(null), f = Ae(null), u = Ae(null), y = Ae(null), v = Ae(null), m = Ae(null), {
isComposing: w,
handleCompositionStart: S,
handleCompositionUpdate: T,
handleCompositionEnd: M
} = iy({
afterComposition: (he) => se(he)
}), { wrapperRef: x, isFocused: _ } = ny(h, {
beforeFocus() {
return b.value;
},
afterFocus() {
n.automaticDropdown && !E.value && (E.value = !0, o.menuVisibleOnFocus = !0);
},
beforeBlur(he) {
var _e, Ce;
return ((_e = l.value) == null ? void 0 : _e.isFocusInsideContent(he)) || ((Ce = d.value) == null ? void 0 : Ce.isFocusInsideContent(he));
},
afterBlur() {
E.value = !1, o.menuVisibleOnFocus = !1;
}
}), E = Ae(!1), L = Ae(), { form: R, formItem: C } = gl(), { inputId: A } = Pf(n, {
formItemContext: C
}), { valueOnClear: P, isEmptyValue: I } = KA(n), b = ce(() => n.disabled || (R == null ? void 0 : R.disabled)), O = ce(() => Un(n.modelValue) ? n.modelValue.length > 0 : !I(n.modelValue)), N = ce(() => n.clearable && !b.value && o.inputHovering && O.value), D = ce(() => n.remote && n.filterable && !n.remoteShowSuffix ? "" : n.suffixIcon), B = ce(() => r.is("reverse", D.value && E.value)), U = ce(() => (C == null ? void 0 : C.validateState) || ""), k = ce(() => D0[U.value]), K = ce(() => n.remote ? 300 : 0), ie = ce(() => n.loading ? n.loadingText || t("el.select.loading") : n.remote && !o.inputValue && o.options.size === 0 ? !1 : n.filterable && o.inputValue && o.options.size > 0 && j.value === 0 ? n.noMatchText || t("el.select.noMatch") : o.options.size === 0 ? n.noDataText || t("el.select.noData") : null), j = ce(() => G.value.filter((he) => he.visible).length), G = ce(() => {
const he = Array.from(o.options.values()), _e = [];
return o.optionValues.forEach((Ce) => {
const ke = he.findIndex((Ze) => Ze.value === Ce);
ke > -1 && _e.push(he[ke]);
}), _e.length >= he.length ? _e : he;
}), W = ce(() => Array.from(o.cachedOptions.values())), q = ce(() => {
const he = G.value.filter((_e) => !_e.created).some((_e) => _e.currentLabel === o.inputValue);
return n.filterable && n.allowCreate && o.inputValue !== "" && !he;
}), Q = () => {
n.filterable && Ln(n.filterMethod) || n.filterable && n.remote && Ln(n.remoteMethod) || G.value.forEach((he) => {
var _e;
(_e = he.updateOption) == null || _e.call(he, o.inputValue);
});
}, ee = ra(), ne = ce(() => ["small"].includes(ee.value) ? "small" : "default"), Y = ce({
get() {
return E.value && ie.value !== !1;
},
set(he) {
E.value = he;
}
}), te = ce(() => {
if (n.multiple && !yi(n.modelValue))
return Ri(n.modelValue).length === 0 && !o.inputValue;
const he = Un(n.modelValue) ? n.modelValue[0] : n.modelValue;
return n.filterable || yi(he) ? !o.inputValue : !0;
}), F = ce(() => {
var he;
const _e = (he = n.placeholder) != null ? he : t("el.select.placeholder");
return n.multiple || !O.value ? _e : o.selectedLabel;
}), $ = ce(() => td ? null : "mouseenter");
Ke(() => n.modelValue, (he, _e) => {
n.multiple && n.filterable && !n.reserveKeyword && (o.inputValue = "", J("")), V(), !ld(he, _e) && n.validateEvent && (C == null || C.validate("change").catch((Ce) => en(Ce)));
}, {
flush: "post",
deep: !0
}), Ke(() => E.value, (he) => {
he ? J(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = !0), e("visible-change", he);
}), Ke(() => o.options.entries(), () => {
var he;
if (!rn)
return;
const _e = ((he = a.value) == null ? void 0 : he.querySelectorAll("input")) || [];
(!n.filterable && !n.defaultFirstOption && !yi(n.modelValue) || !Array.from(_e).includes(document.activeElement)) && V(), n.defaultFirstOption && (n.filterable || n.remote) && j.value && z();
}, {
flush: "post"
}), Ke(() => o.hoveringIndex, (he) => {
St(he) && he > -1 ? L.value = G.value[he] || {} : L.value = {}, G.value.forEach((_e) => {
_e.hover = L.value === _e;
});
}), s0(() => {
o.isBeforeHide || Q();
});
const J = (he) => {
o.previousQuery === he || w.value || (o.previousQuery = he, n.filterable && Ln(n.filterMethod) ? n.filterMethod(he) : n.filterable && n.remote && Ln(n.remoteMethod) && n.remoteMethod(he), n.defaultFirstOption && (n.filterable || n.remote) && j.value ? Mt(z) : Mt(ue));
}, z = () => {
const he = G.value.filter((ke) => ke.visible && !ke.disabled && !ke.states.groupDisabled), _e = he.find((ke) => ke.created), Ce = he[0];
o.hoveringIndex = bt(G.value, _e || Ce);
}, V = () => {
if (n.multiple)
o.selectedLabel = "";
else {
const _e = Un(n.modelValue) ? n.modelValue[0] : n.modelValue, Ce = oe(_e);
o.selectedLabel = Ce.currentLabel, o.selected = [Ce];
return;
}
const he = [];
yi(n.modelValue) || Ri(n.modelValue).forEach((_e) => {
he.push(oe(_e));
}), o.selected = he;
}, oe = (he) => {
let _e;
const Ce = ju(he).toLowerCase() === "object", ke = ju(he).toLowerCase() === "null", Ze = ju(he).toLowerCase() === "undefined";
for (let ut = o.cachedOptions.size - 1; ut >= 0; ut--) {
const Zt = W.value[ut];
if (Ce ? er(Zt.value, n.valueKey) === er(he, n.valueKey) : Zt.value === he) {
_e = {
value: he,
currentLabel: Zt.currentLabel,
get isDisabled() {
return Zt.isDisabled;
}
};
break;
}
}
if (_e)
return _e;
const Qe = Ce ? he.label : !ke && !Ze ? he : "";
return {
value: he,
currentLabel: Qe
};
}, ue = () => {
o.hoveringIndex = G.value.findIndex((he) => o.selected.some((_e) => gt(_e) === gt(he)));
}, le = () => {
o.selectionWidth = c.value.getBoundingClientRect().width;
}, ve = () => {
o.calculatorWidth = p.value.getBoundingClientRect().width;
}, xe = () => {
o.collapseItemWidth = v.value.getBoundingClientRect().width;
}, Te = () => {
var he, _e;
(_e = (he = l.value) == null ? void 0 : he.updatePopper) == null || _e.call(he);
}, de = () => {
var he, _e;
(_e = (he = d.value) == null ? void 0 : he.updatePopper) == null || _e.call(he);
}, we = () => {
o.inputValue.length > 0 && !E.value && (E.value = !0), J(o.inputValue);
}, se = (he) => {
if (o.inputValue = he.target.value, n.remote)
Se();
else
return we();
}, Se = ad(() => {
we();
}, K.value), ge = (he) => {
ld(n.modelValue, he) || e(Qr, he);
}, be = (he) => GT(he, (_e) => !o.disabledOptions.has(_e)), Ie = (he) => {
if (n.multiple && he.code !== Di.delete && he.target.value.length <= 0) {
const _e = Ri(n.modelValue).slice(), Ce = be(_e);
if (Ce < 0)
return;
const ke = _e[Ce];
_e.splice(Ce, 1), e(Dt, _e), ge(_e), e("remove-tag", ke);
}
}, et = (he, _e) => {
const Ce = o.selected.indexOf(_e);
if (Ce > -1 && !b.value) {
const ke = Ri(n.modelValue).slice();
ke.splice(Ce, 1), e(Dt, ke), ge(ke), e("remove-tag", _e.value);
}
he.stopPropagation(), Vt();
}, mt = (he) => {
he.stopPropagation();
const _e = n.multiple ? [] : P.value;
if (n.multiple)
for (const Ce of o.selected)
Ce.isDisabled && _e.push(Ce.value);
e(Dt, _e), ge(_e), o.hoveringIndex = -1, E.value = !1, e("clear"), Vt();
}, Ue = (he) => {
var _e;
if (n.multiple) {
const Ce = Ri((_e = n.modelValue) != null ? _e : []).slice(), ke = bt(Ce, he.value);
ke > -1 ? Ce.splice(ke, 1) : (n.multipleLimit <= 0 || Ce.length < n.multipleLimit) && Ce.push(he.value), e(Dt, Ce), ge(Ce), he.created && J(""), n.filterable && !n.reserveKeyword && (o.inputValue = "");
} else
e(Dt, he.value), ge(he.value), E.value = !1;
Vt(), !E.value && Mt(() => {
Ve(he);
});
}, bt = (he = [], _e) => {
if (!Pn(_e))
return he.indexOf(_e);
const Ce = n.valueKey;
let ke = -1;
return he.some((Ze, Qe) => of(er(Ze, Ce)) === er(_e, Ce) ? (ke = Qe, !0) : !1), ke;
}, Ve = (he) => {
var _e, Ce, ke, Ze, Qe;
const qe = Un(he) ? he[0] : he;
let ut = null;
if (qe != null && qe.value) {
const Zt = G.value.filter((hn) => hn.value === qe.value);
Zt.length > 0 && (ut = Zt[0].$el);
}
if (l.value && ut) {
const Zt = (Ze = (ke = (Ce = (_e = l.value) == null ? void 0 : _e.popperRef) == null ? void 0 : Ce.contentRef) == null ? void 0 : ke.querySelector) == null ? void 0 : Ze.call(ke, `.${r.be("dropdown", "wrap")}`);
Zt && qT(Zt, ut);
}
(Qe = m.value) == null || Qe.handleScroll();
}, lt = (he) => {
o.options.set(he.value, he), o.cachedOptions.set(he.value, he), he.disabled && o.disabledOptions.set(he.value, he);
}, tt = (he, _e) => {
o.options.get(he) === _e && o.options.delete(he);
}, xt = ce(() => {
var he, _e;
return (_e = (he = l.value) == null ? void 0 : he.popperRef) == null ? void 0 : _e.contentRef;
}), pt = () => {
o.isBeforeHide = !1, Mt(() => Ve(o.selected));
}, Vt = () => {
var he;
(he = h.value) == null || he.focus();
}, Nt = () => {
var he;
(he = h.value) == null || he.blur();
}, re = (he) => {
mt(he);
}, Ee = () => {
E.value = !1, _.value && Nt();
}, Ne = () => {
o.inputValue.length > 0 ? o.inputValue = "" : E.value = !1;
}, je = () => {
b.value || (td && (o.inputHovering = !0), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = !1 : E.value = !E.value);
}, rt = () => {
E.value ? G.value[o.hoveringIndex] && Ue(G.value[o.hoveringIndex]) : je();
}, gt = (he) => Pn(he.value) ? er(he.value, n.valueKey) : he.value, Tt = ce(() => G.value.filter((he) => he.visible).every((he) => he.disabled)), Lt = ce(() => n.multiple ? n.collapseTags ? o.selected.slice(0, n.maxCollapseTags) : o.selected : []), kt = ce(() => n.multiple ? n.collapseTags ? o.selected.slice(n.maxCollapseTags) : [] : []), Z = (he) => {
if (!E.value) {
E.value = !0;
return;
}
if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || w.value) && !Tt.value) {
he === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : he === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1));
const _e = G.value[o.hoveringIndex];
(_e.disabled === !0 || _e.states.groupDisabled === !0 || !_e.visible) && Z(he), Mt(() => Ve(L.value));
}
}, ye = () => {
if (!c.value)
return 0;
const he = window.getComputedStyle(c.value);
return Number.parseFloat(he.gap || "6px");
}, me = ce(() => {
const he = ye();
return { maxWidth: `${v.value && n.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - he : o.selectionWidth}px` };
}), Me = ce(() => ({ maxWidth: `${o.selectionWidth}px` })), Oe = ce(() => ({
width: `${Math.max(o.calculatorWidth, gR)}px`
}));
return ii(c, le), ii(p, ve), ii(u, Te), ii(x, Te), ii(y, de), ii(v, xe), on(() => {
V();
}), {
inputId: A,
contentId: i,
nsSelect: r,
nsInput: s,
states: o,
isFocused: _,
expanded: E,
optionsArray: G,
hoverOption: L,
selectSize: ee,
filteredOptionsCount: j,
resetCalculatorWidth: ve,
updateTooltip: Te,
updateTagTooltip: de,
debouncedOnInputChange: Se,
onInput: se,
deletePrevTag: Ie,
deleteTag: et,
deleteSelected: mt,
handleOptionSelect: Ue,
scrollToOption: Ve,
hasModelValue: O,
shouldShowPlaceholder: te,
currentPlaceholder: F,
mouseEnterEventName: $,
showClose: N,
iconComponent: D,
iconReverse: B,
validateState: U,
validateIcon: k,
showNewOption: q,
updateOptions: Q,
collapseTagSize: ne,
setSelected: V,
selectDisabled: b,
emptyText: ie,
handleCompositionStart: S,
handleCompositionUpdate: T,
handleCompositionEnd: M,
onOptionCreate: lt,
onOptionDestroy: tt,
handleMenuEnter: pt,
focus: Vt,
blur: Nt,
handleClearClick: re,
handleClickOutside: Ee,
handleEsc: Ne,
toggleMenu: je,
selectOption: rt,
getValueKey: gt,
navigateOptions: Z,
dropdownMenuVisible: Y,
showTagList: Lt,
collapseTagList: kt,
tagStyle: me,
collapseTagStyle: Me,
inputStyle: Oe,
popperRef: xt,
inputRef: h,
tooltipRef: l,
tagTooltipRef: d,
calculatorRef: p,
prefixRef: g,
suffixRef: f,
selectRef: a,
wrapperRef: x,
selectionRef: c,
scrollbarRef: m,
menuRef: u,
tagMenuRef: y,
collapseItemRef: v
};
};
var yR = De({
name: "ElOptions",
setup(n, { slots: e }) {
const t = ht(wu);
let i = [];
return () => {
var r, s;
const o = (r = e.default) == null ? void 0 : r.call(e), a = [];
function c(l) {
Un(l) && l.forEach((d) => {
var h, p, g, f;
const u = (h = (d == null ? void 0 : d.type) || {}) == null ? void 0 : h.name;
u === "ElOptionGroup" ? c(!On(d.children) && !Un(d.children) && Ln((p = d.children) == null ? void 0 : p.default) ? (g = d.children) == null ? void 0 : g.default() : d.children) : u === "ElOption" ? a.push((f = d.props) == null ? void 0 : f.value) : Un(d.children) && c(d.children);
});
}
return o.length && c((s = o[0]) == null ? void 0 : s.children), ld(a, i) || (i = a, t && (t.states.optionValues = a)), o;
};
}
});
const bR = dt({
name: String,
id: String,
modelValue: {
type: [Array, String, Number, Boolean, Object],
default: void 0
},
autocomplete: {
type: String,
default: "off"
},
automaticDropdown: Boolean,
size: Do,
effect: {
type: Ye(String),
default: "light"
},
disabled: Boolean,
clearable: Boolean,
filterable: Boolean,
allowCreate: Boolean,
loading: Boolean,
popperClass: {
type: String,
default: ""
},
popperOptions: {
type: Ye(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: Zn.teleported,
persistent: {
type: Boolean,
default: !0
},
clearIcon: {
type: Zr,
default: yf
},
fitInputWidth: Boolean,
suffixIcon: {
type: Zr,
default: vf
},
tagType: { ...md.type, default: "info" },
tagEffect: { ...md.effect, default: "light" },
validateEvent: {
type: Boolean,
default: !0
},
remoteShowSuffix: Boolean,
placement: {
type: Ye(String),
values: ia,
default: "bottom-start"
},
fallbackPlacements: {
type: Ye(Array),
default: ["bottom-start", "top-start", "right", "left"]
},
appendTo: String,
...qA,
...Gs(["ariaLabel"])
}), og = "ElSelect", xR = De({
name: og,
componentName: og,
components: {
ElSelectMenu: mR,
ElOption: zf,
ElOptions: yR,
ElTag: dL,
ElScrollbar: LC,
ElTooltip: Bf,
ElIcon: Bt
},
directives: { ClickOutside: sL },
props: bR,
emits: [
Dt,
Qr,
"remove-tag",
"clear",
"visible-change",
"focus",
"blur"
],
setup(n, { emit: e }) {
const t = ce(() => {
const { modelValue: s, multiple: o } = n, a = o ? [] : void 0;
return Un(s) ? o ? s : a : o ? a : s;
}), i = qn({
...cr(n),
modelValue: t
}), r = vR(i, e);
return gn(wu, qn({
props: i,
states: r.states,
optionsArray: r.optionsArray,
handleOptionSelect: r.handleOptionSelect,
onOptionCreate: r.onOptionCreate,
onOptionDestroy: r.onOptionDestroy,
selectRef: r.selectRef,
setSelected: r.setSelected
})), {
...r,
modelValue: t
};
}
});
function wR(n, e, t, i, r, s) {
const o = Xn("el-tag"), a = Xn("el-tooltip"), c = Xn("el-icon"), l = Xn("el-option"), d = Xn("el-options"), h = Xn("el-scrollbar"), p = Xn("el-select-menu"), g = l1("click-outside");
return Ft((pe(), Re("div", {
ref: "selectRef",
class: Le([n.nsSelect.b(), n.nsSelect.m(n.selectSize)]),
[c1(n.mouseEnterEventName)]: (f) => n.states.inputHovering = !0,
onMouseleave: (f) => n.states.inputHovering = !1
}, [
ae(a, {
ref: "tooltipRef",
visible: n.dropdownMenuVisible,
placement: n.placement,
teleported: n.teleported,
"popper-class": [n.nsSelect.e("popper"), n.popperClass],
"popper-options": n.popperOptions,
"fallback-placements": n.fallbackPlacements,
effect: n.effect,
pure: "",
trigger: "click",
transition: `${n.nsSelect.namespace.value}-zoom-in-top`,
"stop-popper-mouse-event": !1,
"gpu-acceleration": !1,
persistent: n.persistent,
"append-to": n.appendTo,
onBeforeShow: n.handleMenuEnter,
onHide: (f) => n.states.isBeforeHide = !1
}, {
default: fe(() => {
var f;
return [
Be("div", {
ref: "wrapperRef",
class: Le([
n.nsSelect.e("wrapper"),
n.nsSelect.is("focused", n.isFocused),
n.nsSelect.is("hovering", n.states.inputHovering),
n.nsSelect.is("filterable", n.filterable),
n.nsSelect.is("disabled", n.selectDisabled)
]),
onClick: fn(n.toggleMenu, ["prevent"])
}, [
n.$slots.prefix ? (pe(), Re("div", {
key: 0,
ref: "prefixRef",
class: Le(n.nsSelect.e("prefix"))
}, [
Xe(n.$slots, "prefix")
], 2)) : Ge("v-if", !0),
Be("div", {
ref: "selectionRef",
class: Le([
n.nsSelect.e("selection"),
n.nsSelect.is("near", n.multiple && !n.$slots.prefix && !!n.states.selected.length)
])
}, [
n.multiple ? Xe(n.$slots, "tag", { key: 0 }, () => [
(pe(!0), Re(Wt, null, ri(n.showTagList, (u) => (pe(), Re("div", {
key: n.getValueKey(u),
class: Le(n.nsSelect.e("selected-item"))
}, [
ae(o, {
closable: !n.selectDisabled && !u.isDisabled,
size: n.collapseTagSize,
type: n.tagType,
effect: n.tagEffect,
"disable-transitions": "",
style: Ot(n.tagStyle),
onClose: (y) => n.deleteTag(y, u)
}, {
default: fe(() => [
Be("span", {
class: Le(n.nsSelect.e("tags-text"))
}, [
Xe(n.$slots, "label", {
label: u.currentLabel,
value: u.value
}, () => [
yt(wt(u.currentLabel), 1)
])
], 2)
]),
_: 2
}, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
], 2))), 128)),
n.collapseTags && n.states.selected.length > n.maxCollapseTags ? (pe(), He(a, {
key: 0,
ref: "tagTooltipRef",
disabled: n.dropdownMenuVisible || !n.collapseTagsTooltip,
"fallback-placements": ["bottom", "top", "right", "left"],
effect: n.effect,
placement: "bottom",
teleported: n.teleported
}, {
default: fe(() => [
Be("div", {
ref: "collapseItemRef",
class: Le(n.nsSelect.e("selected-item"))
}, [
ae(o, {
closable: !1,
size: n.collapseTagSize,
type: n.tagType,
effect: n.tagEffect,
"disable-transitions": "",
style: Ot(n.collapseTagStyle)
}, {
default: fe(() => [
Be("span", {
class: Le(n.nsSelect.e("tags-text"))
}, " + " + wt(n.states.selected.length - n.maxCollapseTags), 3)
]),
_: 1
}, 8, ["size", "type", "effect", "style"])
], 2)
]),
content: fe(() => [
Be("div", {
ref: "tagMenuRef",
class: Le(n.nsSelect.e("selection"))
}, [
(pe(!0), Re(Wt, null, ri(n.collapseTagList, (u) => (pe(), Re("div", {
key: n.getValueKey(u),
class: Le(n.nsSelect.e("selected-item"))
}, [
ae(o, {
class: "in-tooltip",
closable: !n.selectDisabled && !u.isDisabled,
size: n.collapseTagSize,
type: n.tagType,
effect: n.tagEffect,
"disable-transitions": "",
onClose: (y) => n.deleteTag(y, u)
}, {
default: fe(() => [
Be("span", {
class: Le(n.nsSelect.e("tags-text"))
}, [
Xe(n.$slots, "label", {
label: u.currentLabel,
value: u.value
}, () => [
yt(wt(u.currentLabel), 1)
])
], 2)
]),
_: 2
}, 1032, ["closable", "size", "type", "effect", "onClose"])
], 2))), 128))
], 2)
]),
_: 3
}, 8, ["disabled", "effect", "teleported"])) : Ge("v-if", !0)
]) : Ge("v-if", !0),
n.selectDisabled ? Ge("v-if", !0) : (pe(), Re("div", {
key: 1,
class: Le([
n.nsSelect.e("selected-item"),
n.nsSelect.e("input-wrapper"),
n.nsSelect.is("hidden", !n.filterable)
])
}, [
Ft(Be("input", {
id: n.inputId,
ref: "inputRef",
"onUpdate:modelValue": (u) => n.states.inputValue = u,
type: "text",
name: n.name,
class: Le([n.nsSelect.e("input"), n.nsSelect.is(n.selectSize)]),
disabled: n.selectDisabled,
autocomplete: n.autocomplete,
style: Ot(n.inputStyle),
role: "combobox",
readonly: !n.filterable,
spellcheck: "false",
"aria-activedescendant": ((f = n.hoverOption) == null ? void 0 : f.id) || "",
"aria-controls": n.contentId,
"aria-expanded": n.dropdownMenuVisible,
"aria-label": n.ariaLabel,
"aria-autocomplete": "none",
"aria-haspopup": "listbox",
onKeydown: [
vi(fn((u) => n.navigateOptions("next"), ["stop", "prevent"]), ["down"]),
vi(fn((u) => n.navigateOptions("prev"), ["stop", "prevent"]), ["up"]),
vi(fn(n.handleEsc, ["stop", "prevent"]), ["esc"]),
vi(fn(n.selectOption, ["stop", "prevent"]), ["enter"]),
vi(fn(n.deletePrevTag, ["stop"]), ["delete"])
],
onCompositionstart: n.handleCompositionStart,
onCompositionupdate: n.handleCompositionUpdate,
onCompositionend: n.handleCompositionEnd,
onInput: n.onInput,
onClick: fn(n.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"]), [
[u1, n.states.inputValue]
]),
n.filterable ? (pe(), Re("span", {
key: 0,
ref: "calculatorRef",
"aria-hidden": "true",
class: Le(n.nsSelect.e("input-calculator")),
textContent: wt(n.states.inputValue)
}, null, 10, ["textContent"])) : Ge("v-if", !0)
], 2)),
n.shouldShowPlaceholder ? (pe(), Re("div", {
key: 2,
class: Le([
n.nsSelect.e("selected-item"),
n.nsSelect.e("placeholder"),
n.nsSelect.is("transparent", !n.hasModelValue || n.expanded && !n.states.inputValue)
])
}, [
n.hasModelValue ? Xe(n.$slots, "label", {
key: 0,
label: n.currentPlaceholder,
value: n.modelValue
}, () => [
Be("span", null, wt(n.currentPlaceholder), 1)
]) : (pe(), Re("span", { key: 1 }, wt(n.currentPlaceholder), 1))
], 2)) : Ge("v-if", !0)
], 2),
Be("div", {
ref: "suffixRef",
class: Le(n.nsSelect.e("suffix"))
}, [
n.iconComponent && !n.showClose ? (pe(), He(c, {
key: 0,
class: Le([n.nsSelect.e("caret"), n.nsSelect.e("icon"), n.iconReverse])
}, {
default: fe(() => [
(pe(), He(zn(n.iconComponent)))
]),
_: 1
}, 8, ["class"])) : Ge("v-if", !0),
n.showClose && n.clearIcon ? (pe(), He(c, {
key: 1,
class: Le([
n.nsSelect.e("caret"),
n.nsSelect.e("icon"),
n.nsSelect.e("clear")
]),
onClick: n.handleClearClick
}, {
default: fe(() => [
(pe(), He(zn(n.clearIcon)))
]),
_: 1
}, 8, ["class", "onClick"])) : Ge("v-if", !0),
n.validateState && n.validateIcon ? (pe(), He(c, {
key: 2,
class: Le([n.nsInput.e("icon"), n.nsInput.e("validateIcon")])
}, {
default: fe(() => [
(pe(), He(zn(n.validateIcon)))
]),
_: 1
}, 8, ["class"])) : Ge("v-if", !0)
], 2)
], 10, ["onClick"])
];
}),
content: fe(() => [
ae(p, { ref: "menuRef" }, {
default: fe(() => [
n.$slots.header ? (pe(), Re("div", {
key: 0,
class: Le(n.nsSelect.be("dropdown", "header")),
onClick: fn(() => {
}, ["stop"])
}, [
Xe(n.$slots, "header")
], 10, ["onClick"])) : Ge("v-if", !0),
Ft(ae(h, {
id: n.contentId,
ref: "scrollbarRef",
tag: "ul",
"wrap-class": n.nsSelect.be("dropdown", "wrap"),
"view-class": n.nsSelect.be("dropdown", "list"),
class: Le([n.nsSelect.is("empty", n.filteredOptionsCount === 0)]),
role: "listbox",
"aria-label": n.ariaLabel,
"aria-orientation": "vertical"
}, {
default: fe(() => [
n.showNewOption ? (pe(), He(l, {
key: 0,
value: n.states.inputValue,
created: !0
}, null, 8, ["value"])) : Ge("v-if", !0),
ae(d, null, {
default: fe(() => [
Xe(n.$slots, "default")
]),
_: 3
})
]),
_: 3
}, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [
[xn, n.states.options.size > 0 && !n.loading]
]),
n.$slots.loading && n.loading ? (pe(), Re("div", {
key: 1,
class: Le(n.nsSelect.be("dropdown", "loading"))
}, [
Xe(n.$slots, "loading")
], 2)) : n.loading || n.filteredOptionsCount === 0 ? (pe(), Re("div", {
key: 2,
class: Le(n.nsSelect.be("dropdown", "empty"))
}, [
Xe(n.$slots, "empty", {}, () => [
Be("span", null, wt(n.emptyText), 1)
])
], 2)) : Ge("v-if", !0),
n.$slots.footer ? (pe(), Re("div", {
key: 3,
class: Le(n.nsSelect.be("dropdown", "footer")),
onClick: fn(() => {
}, ["stop"])
}, [
Xe(n.$slots, "footer")
], 10, ["onClick"])) : Ge("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, n.handleClickOutside, n.popperRef]
]);
}
var MR = /* @__PURE__ */ at(xR, [["render", wR], ["__file", "select.vue"]]);
const SR = De({
name: "ElOptionGroup",
componentName: "ElOptionGroup",
props: {
label: String,
disabled: Boolean
},
setup(n) {
const e = it("select"), t = Ae(null), i = cn(), r = Ae([]);
gn(Ey, qn({
...cr(n)
}));
const s = ce(() => r.value.some((l) => l.visible === !0)), o = (l) => {
var d, h;
return ((d = l.type) == null ? void 0 : d.name) === "ElOption" && !!((h = l.component) != null && h.proxy);
}, a = (l) => {
const d = Ri(l), h = [];
return d.forEach((p) => {
var g, f;
o(p) ? h.push(p.component.proxy) : (g = p.children) != null && g.length ? h.push(...a(p.children)) : (f = p.component) != null && f.subTree && h.push(...a(p.component.subTree));
}), h;
}, c = () => {
r.value = a(i.subTree);
};
return on(() => {
c();
}), k1(t, c, {
attributes: !0,
subtree: !0,
childList: !0
}), {
groupRef: t,
visible: s,
ns: e
};
}
});
function _R(n, e, t, i, r, s) {
return Ft((pe(), Re("ul", {
ref: "groupRef",
class: Le(n.ns.be("group", "wrap"))
}, [
Be("li", {
class: Le(n.ns.be("group", "title"))
}, wt(n.label), 3),
Be("li", null, [
Be("ul", {
class: Le(n.ns.b("group"))
}, [
Xe(n.$slots, "default")
], 2)
])
], 2)), [
[xn, n.visible]
]);
}
var Ay = /* @__PURE__ */ at(SR, [["render", _R], ["__file", "option-group.vue"]]);
const oa = vn(MR, {
Option: zf,
OptionGroup: Ay
}), aa = gr(zf);
gr(Ay);
const TR = dt({
trigger: qa.trigger,
placement: nh.placement,
disabled: qa.disabled,
visible: Zn.visible,
transition: Zn.transition,
popperOptions: nh.popperOptions,
tabindex: nh.tabindex,
content: Zn.content,
popperStyle: Zn.popperStyle,
popperClass: Zn.popperClass,
enterable: {
...Zn.enterable,
default: !0
},
effect: {
...Zn.effect,
default: "light"
},
teleported: Zn.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
}
}), ER = {
"update:visible": (n) => gf(n),
"before-enter": () => !0,
"before-leave": () => !0,
"after-enter": () => !0,
"after-leave": () => !0
}, AR = "onUpdate:visible", CR = De({
name: "ElPopover"
}), LR = /* @__PURE__ */ De({
...CR,
props: TR,
emits: ER,
setup(n, { expose: e, emit: t }) {
const i = n, r = ce(() => i[AR]), s = it("popover"), o = Ae(), a = ce(() => {
var y;
return (y = H(o)) == null ? void 0 : y.popperRef;
}), c = ce(() => [
{
width: Zc(i.width)
},
i.popperStyle
]), l = ce(() => [s.b(), i.popperClass, { [s.m("plain")]: !!i.content }]), d = ce(() => i.transition === `${s.namespace.value}-fade-in-linear`), h = () => {
var y;
(y = o.value) == null || y.hide();
}, p = () => {
t("before-enter");
}, g = () => {
t("before-leave");
}, f = () => {
t("after-enter");
}, u = () => {
t("update:visible", !1), t("after-leave");
};
return e({
popperRef: a,
hide: h
}), (y, v) => (pe(), He(H(Bf), Oi({
ref_key: "tooltipRef",
ref: o
}, 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": H(l),
"popper-style": H(c),
teleported: y.teleported,
persistent: y.persistent,
"gpu-acceleration": H(d),
"onUpdate:visible": H(r),
onBeforeShow: p,
onBeforeHide: g,
onShow: f,
onHide: u
}), {
content: fe(() => [
y.title ? (pe(), Re("div", {
key: 0,
class: Le(H(s).e("title")),
role: "title"
}, wt(y.title), 3)) : Ge("v-if", !0),
Xe(y.$slots, "default", {}, () => [
yt(wt(y.content), 1)
])
]),
default: fe(() => [
y.$slots.reference ? Xe(y.$slots, "reference", { key: 0 }) : Ge("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 RR = /* @__PURE__ */ at(LR, [["__file", "popover.vue"]]);
const ag = (n, e) => {
const t = e.arg || e.value, i = t == null ? void 0 : t.popperRef;
i && (i.triggerRef = n);
};
var PR = {
mounted(n, e) {
ag(n, e);
},
updated(n, e) {
ag(n, e);
}
};
const IR = "popover", OR = yE(PR, IR), Mu = vn(RR, {
directive: OR
}), Cy = Symbol("sliderContextKey"), DR = dt({
modelValue: {
type: Ye([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: Do,
inputSize: Do,
showStops: Boolean,
showTooltip: {
type: Boolean,
default: !0
},
formatTooltip: {
type: Ye(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: Ye(Function),
default: void 0
},
tooltipClass: {
type: String,
default: void 0
},
placement: {
type: String,
values: ia,
default: "top"
},
marks: {
type: Ye(Object)
},
validateEvent: {
type: Boolean,
default: !0
},
...Gs(["ariaLabel"])
}), ih = (n) => St(n) || Un(n) && n.every(St), NR = {
[Dt]: ih,
[Ss]: ih,
[Qr]: ih
}, FR = (n, e, t) => {
const i = Ae();
return on(async () => {
n.range ? (Array.isArray(n.modelValue) ? (e.firstValue = Math.max(n.min, n.modelValue[0]), e.secondValue = Math.min(n.max, n.modelValue[1])) : (e.firstValue = n.min, e.secondValue = n.max), e.oldValue = [e.firstValue, e.secondValue]) : (typeof n.modelValue != "number" || Number.isNaN(n.modelValue) ? e.firstValue = n.min : e.firstValue = Math.min(n.max, Math.max(n.min, n.modelValue)), e.oldValue = e.firstValue), pn(window, "resize", t), await Mt(), t();
}), {
sliderWrapper: i
};
}, BR = (n) => ce(() => n.marks ? Object.keys(n.marks).map(Number.parseFloat).sort((t, i) => t - i).filter((t) => t <= n.max && t >= n.min).map((t) => ({
point: t,
position: (t - n.min) * 100 / (n.max - n.min),
mark: n.marks[t]
})) : []), zR = (n, e, t) => {
const { form: i, formItem: r } = gl(), s = In(), o = Ae(), a = Ae(), c = {
firstButton: o,
secondButton: a
}, l = ce(() => n.disabled || (i == null ? void 0 : i.disabled) || !1), d = ce(() => Math.min(e.firstValue, e.secondValue)), h = ce(() => Math.max(e.firstValue, e.secondValue)), p = ce(() => n.range ? `${100 * (h.value - d.value) / (n.max - n.min)}%` : `${100 * (e.firstValue - n.min) / (n.max - n.min)}%`), g = ce(() => n.range ? `${100 * (d.value - n.min) / (n.max - n.min)}%` : "0%"), f = ce(() => n.vertical ? { height: n.height } : {}), u = ce(() => n.vertical ? {
height: p.value,
bottom: g.value
} : {
width: p.value,
left: g.value
}), y = () => {
s.value && (e.sliderSize = s.value[`client${n.vertical ? "Height" : "Width"}`]);
}, v = (C) => {
const A = n.min + C * (n.max - n.min) / 100;
if (!n.range)
return o;
let P;
return Math.abs(d.value - A) < Math.abs(h.value - A) ? P = e.firstValue < e.secondValue ? "firstButton" : "secondButton" : P = e.firstValue > e.secondValue ? "firstButton" : "secondButton", c[P];
}, m = (C) => {
const A = v(C);
return A.value.setPosition(C), A;
}, w = (C) => {
e.firstValue = C ?? n.min, T(n.range ? [d.value, h.value] : C ?? n.min);
}, S = (C) => {
e.secondValue = C, n.range && T([d.value, h.value]);
}, T = (C) => {
t(Dt, C), t(Ss, C);
}, M = async () => {
await Mt(), t(Qr, n.range ? [d.value, h.value] : n.modelValue);
}, x = (C) => {
var A, P, I, b, O, N;
if (l.value || e.dragging)
return;
y();
let D = 0;
if (n.vertical) {
const B = (I = (P = (A = C.touches) == null ? void 0 : A.item(0)) == null ? void 0 : P.clientY) != null ? I : C.clientY;
D = (s.value.getBoundingClientRect().bottom - B) / e.sliderSize * 100;
} else {
const B = (N = (O = (b = C.touches) == null ? void 0 : b.item(0)) == null ? void 0 : O.clientX) != null ? N : C.clientX, U = s.value.getBoundingClientRect().left;
D = (B - U) / e.sliderSize * 100;
}
if (!(D < 0 || D > 100))
return m(D);
};
return {
elFormItem: r,
slider: s,
firstButton: o,
secondButton: a,
sliderDisabled: l,
minValue: d,
maxValue: h,
runwayStyle: f,
barStyle: u,
resetSize: y,
setPosition: m,
emitChange: M,
onSliderWrapperPrevent: (C) => {
var A, P;
((A = c.firstButton.value) != null && A.dragging || (P = c.secondButton.value) != null && P.dragging) && C.preventDefault();
},
onSliderClick: (C) => {
x(C) && M();
},
onSliderDown: async (C) => {
const A = x(C);
A && (await Mt(), A.value.onButtonDown(C));
},
onSliderMarkerDown: (C) => {
l.value || e.dragging || m(C);
},
setFirstValue: w,
setSecondValue: S
};
}, { left: UR, down: VR, right: kR, up: GR, home: HR, end: WR, pageUp: jR, pageDown: $R } = Di, ZR = (n, e, t) => {
const i = Ae(), r = Ae(!1), s = ce(() => e.value instanceof Function), o = ce(() => s.value && e.value(n.modelValue) || n.modelValue), a = ad(() => {
t.value && (r.value = !0);
}, 50), c = ad(() => {
t.value && (r.value = !1);
}, 50);
return {
tooltip: i,
tooltipVisible: r,
formatValue: o,
displayTooltip: a,
hideTooltip: c
};
}, XR = (n, e, t) => {
const {
disabled: i,
min: r,
max: s,
step: o,
showTooltip: a,
precision: c,
sliderSize: l,
formatTooltip: d,
emitChange: h,
resetSize: p,
updateDragging: g
} = ht(Cy), { tooltip: f, tooltipVisible: u, formatValue: y, displayTooltip: v, hideTooltip: m } = ZR(n, d, a), w = Ae(), S = ce(() => `${(n.modelValue - r.value) / (s.value - r.value) * 100}%`), T = ce(() => n.vertical ? { bottom: S.value } : { left: S.value }), M = () => {
e.hovering = !0, v();
}, x = () => {
e.hovering = !1, e.dragging || m();
}, _ = (k) => {
i.value || (k.preventDefault(), N(k), window.addEventListener("mousemove", D), window.addEventListener("touchmove", D), window.addEventListener("mouseup", B), window.addEventListener("touchend", B), window.addEventListener("contextmenu", B), w.value.focus());
}, E = (k) => {
i.value || (e.newPosition = Number.parseFloat(S.value) + k / (s.value - r.value) * 100, U(e.newPosition), h());
}, L = () => {
E(-o.value);
}, R = () => {
E(o.value);
}, C = () => {
E(-o.value * 4);
}, A = () => {
E(o.value * 4);
}, P = () => {
i.value || (U(0), h());
}, I = () => {
i.value || (U(100), h());
}, b = (k) => {
let K = !0;
[UR, VR].includes(k.key) ? L() : [kR, GR].includes(k.key) ? R() : k.key === HR ? P() : k.key === WR ? I() : k.key === $R ? C() : k.key === jR ? A() : K = !1, K && k.preventDefault();
}, O = (k) => {
let K, ie;
return k.type.startsWith("touch") ? (ie = k.touches[0].clientY, K = k.touches[0].clientX) : (ie = k.clientY, K = k.clientX), {
clientX: K,
clientY: ie
};
}, N = (k) => {
e.dragging = !0, e.isClick = !0;
const { clientX: K, clientY: ie } = O(k);
n.vertical ? e.startY = ie : e.startX = K, e.startPosition = Number.parseFloat(S.value), e.newPosition = e.startPosition;
}, D = (k) => {
if (e.dragging) {
e.isClick = !1, v(), p();
let K;
const { clientX: ie, clientY: j } = O(k);
n.vertical ? (e.currentY = j, K = (e.startY - e.currentY) / l.value * 100) : (e.currentX = ie, K = (e.currentX - e.startX) / l.value * 100), e.newPosition = e.startPosition + K, U(e.newPosition);
}
}, B = () => {
e.dragging && (setTimeout(() => {
e.dragging = !1, e.hovering || m(), e.isClick || U(e.newPosition), h();
}, 0), window.removeEventListener("mousemove", D), window.removeEventListener("touchmove", D), window.removeEventListener("mouseup", B), window.removeEventListener("touchend", B), window.removeEventListener("contextmenu", B));
}, U = async (k) => {
if (k === null || Number.isNaN(+k))
return;
k < 0 ? k = 0 : k > 100 && (k = 100);
const K = 100 / ((s.value - r.value) / o.value);
let j = Math.round(k / K) * K * (s.value - r.value) * 0.01 + r.value;
j = Number.parseFloat(j.toFixed(c.value)), j !== n.modelValue && t(Dt, j), !e.dragging && n.modelValue !== e.oldValue && (e.oldValue = n.modelValue), await Mt(), e.dragging && v(), f.value.updatePopper();
};
return Ke(() => e.dragging, (k) => {
g(k);
}), pn(w, "touchstart", _, { passive: !1 }), {
disabled: i,
button: w,
tooltip: f,
tooltipVisible: u,
showTooltip: a,
wrapperStyle: T,
formatValue: y,
handleMouseEnter: M,
handleMouseLeave: x,
onButtonDown: _,
onKeyDown: b,
setPosition: U
};
}, YR = (n, e, t, i) => ({
stops: ce(() => {
if (!n.showStops || n.min > n.max)
return [];
if (n.step === 0)
return en("ElSlider", "step should not be 0."), [];
const o = (n.max - n.min) / n.step, a = 100 * n.step / (n.max - n.min), c = Array.from({ length: o - 1 }).map((l, d) => (d + 1) * a);
return n.range ? c.filter((l) => l < 100 * (t.value - n.min) / (n.max - n.min) || l > 100 * (i.value - n.min) / (n.max - n.min)) : c.filter((l) => l > 100 * (e.firstValue - n.min) / (n.max - n.min));
}),
getStopStyle: (o) => n.vertical ? { bottom: `${o}%` } : { left: `${o}%` }
}), JR = (n, e, t, i, r, s) => {
const o = (l) => {
r(Dt, l), r(Ss, l);
}, a = () => n.range ? ![t.value, i.value].every((l, d) => l === e.oldValue[d]) : n.modelValue !== e.oldValue, c = () => {
var l, d;
n.min > n.max && na("Slider", "min should not be greater than max.");
const h = n.modelValue;
n.range && Array.isArray(h) ? h[1] < n.min ? o([n.min, n.min]) : h[0] > n.max ? o([n.max, n.max]) : h[0] < n.min ? o([n.min, h[1]]) : h[1] > n.max ? o([h[0], n.max]) : (e.firstValue = h[0], e.secondValue = h[1], a() && (n.validateEvent && ((l = s == null ? void 0 : s.validate) == null || l.call(s, "change").catch((p) => en(p))), e.oldValue = h.slice())) : !n.range && typeof h == "number" && !Number.isNaN(h) && (h < n.min ? o(n.min) : h > n.max ? o(n.max) : (e.firstValue = h, a() && (n.validateEvent && ((d = s == null ? void 0 : s.validate) == null || d.call(s, "change").catch((p) => en(p))), e.oldValue = h)));
};
c(), Ke(() => e.dragging, (l) => {
l || c();
}), Ke(() => n.modelValue, (l, d) => {
e.dragging || Array.isArray(l) && Array.isArray(d) && l.every((h, p) => h === d[p]) && e.firstValue === l[0] && e.secondValue === l[1] || c();
}, {
deep: !0
}), Ke(() => [n.min, n.max], () => {
c();
});
}, qR = dt({
modelValue: {
type: Number,
default: 0
},
vertical: Boolean,
tooltipClass: String,
placement: {
type: String,
values: ia,
default: "top"
}
}), KR = {
[Dt]: (n) => St(n)
}, QR = De({
name: "ElSliderButton"
}), eP = /* @__PURE__ */ De({
...QR,
props: qR,
emits: KR,
setup(n, { expose: e, emit: t }) {
const i = n, r = it("slider"), s = qn({
hovering: !1,
dragging: !1,
isClick: !1,
startX: 0,
currentX: 0,
startY: 0,
currentY: 0,
startPosition: 0,
newPosition: 0,
oldValue: i.modelValue
}), {
disabled: o,
button: a,
tooltip: c,
showTooltip: l,
tooltipVisible: d,
wrapperStyle: h,
formatValue: p,
handleMouseEnter: g,
handleMouseLeave: f,
onButtonDown: u,
onKeyDown: y,
setPosition: v
} = XR(i, s, t), { hovering: m, dragging: w } = cr(s);
return e({
onButtonDown: u,
onKeyDown: y,
setPosition: v,
hovering: m,
dragging: w
}), (S, T) => (pe(), Re("div", {
ref_key: "button",
ref: a,
class: Le([H(r).e("button-wrapper"), { hover: H(m), dragging: H(w) }]),
style: Ot(H(h)),
tabindex: H(o) ? -1 : 0,
onMouseenter: H(g),
onMouseleave: H(f),
onMousedown: H(u),
onFocus: H(g),
onBlur: H(f),
onKeydown: H(y)
}, [
ae(H(Bf), {
ref_key: "tooltip",
ref: c,
visible: H(d),
placement: S.placement,
"fallback-placements": ["top", "bottom", "right", "left"],
"stop-popper-mouse-event": !1,
"popper-class": S.tooltipClass,
disabled: !H(l),
persistent: ""
}, {
content: fe(() => [
Be("span", null, wt(H(p)), 1)
]),
default: fe(() => [
Be("div", {
class: Le([H(r).e("button"), { hover: H(m), dragging: H(w) }])
}, null, 2)
]),
_: 1
}, 8, ["visible", "placement", "popper-class", "disabled"])
], 46, ["tabindex", "onMouseenter", "onMouseleave", "onMousedown", "onFocus", "onBlur", "onKeydown"]));
}
});
var lg = /* @__PURE__ */ at(eP, [["__file", "button.vue"]]);
const tP = dt({
mark: {
type: Ye([String, Object]),
default: void 0
}
});
var nP = De({
name: "ElSliderMarker",
props: tP,
setup(n) {
const e = it("slider"), t = ce(() => On(n.mark) ? n.mark : n.mark.label), i = ce(() => On(n.mark) ? void 0 : n.mark.style);
return () => bo("div", {
class: e.e("marks-text"),
style: i.value
}, t.value);
}
});
const iP = De({
name: "ElSlider"
}), rP = /* @__PURE__ */ De({
...iP,
props: DR,
emits: NR,
setup(n, { expose: e, emit: t }) {
const i = n, r = it("slider"), { t: s } = mu(), o = qn({
firstValue: 0,
secondValue: 0,
oldValue: 0,
dragging: !1,
sliderSize: 1
}), {
elFormItem: a,
slider: c,
firstButton: l,
secondButton: d,
sliderDisabled: h,
minValue: p,
maxValue: g,
runwayStyle: f,
barStyle: u,
resetSize: y,
emitChange: v,
onSliderWrapperPrevent: m,
onSliderClick: w,
onSliderDown: S,
onSliderMarkerDown: T,
setFirstValue: M,
setSecondValue: x
} = zR(i, o, t), { stops: _, getStopStyle: E } = YR(i, o, p, g), { inputId: L, isLabeledByFormItem: R } = Pf(i, {
formItemContext: a
}), C = ra(), A = ce(() => i.inputSize || C.value), P = ce(() => i.ariaLabel || s("el.slider.defaultLabel", {
min: i.min,
max: i.max
})), I = ce(() => i.range ? i.rangeStartLabel || s("el.slider.defaultRangeStartLabel") : P.value), b = ce(() => i.formatValueText ? i.formatValueText(K.value) : `${K.value}`), O = ce(() => i.rangeEndLabel || s("el.slider.defaultRangeEndLabel")), N = ce(() => i.formatValueText ? i.formatValueText(ie.value) : `${ie.value}`), D = ce(() => [
r.b(),
r.m(C.value),
r.is("vertical", i.vertical),
{ [r.m("with-input")]: i.showInput }
]), B = BR(i);
JR(i, o, p, g, t, a);
const U = ce(() => {
const W = [i.min, i.max, i.step].map((q) => {
const Q = `${q}`.split(".")[1];
return Q ? Q.length : 0;
});
return Math.max.apply(null, W);
}), { sliderWrapper: k } = FR(i, o, y), { firstValue: K, secondValue: ie, sliderSize: j } = cr(o), G = (W) => {
o.dragging = W;
};
return pn(k, "touchstart", m, {
passive: !1
}), pn(k, "touchmove", m, {
passive: !1
}), gn(Cy, {
...cr(i),
sliderSize: j,
disabled: h,
precision: U,
emitChange: v,
resetSize: y,
updateDragging: G
}), e({
onSliderClick: w
}), (W, q) => {
var Q, ee;
return pe(), Re("div", {
id: W.range ? H(L) : void 0,
ref_key: "sliderWrapper",
ref: k,
class: Le(H(D)),
role: W.range ? "group" : void 0,
"aria-label": W.range && !H(R) ? H(P) : void 0,
"aria-labelledby": W.range && H(R) ? (Q = H(a)) == null ? void 0 : Q.labelId : void 0
}, [
Be("div", {
ref_key: "slider",
ref: c,
class: Le([
H(r).e("runway"),
{ "show-input": W.showInput && !W.range },
H(r).is("disabled", H(h))
]),
style: Ot(H(f)),
onMousedown: H(S),
onTouchstartPassive: H(S)
}, [
Be("div", {
class: Le(H(r).e("bar")),
style: Ot(H(u))
}, null, 6),
ae(lg, {
id: W.range ? void 0 : H(L),
ref_key: "firstButton",
ref: l,
"model-value": H(K),
vertical: W.vertical,
"tooltip-class": W.tooltipClass,
placement: W.placement,
role: "slider",
"aria-label": W.range || !H(R) ? H(I) : void 0,
"aria-labelledby": !W.range && H(R) ? (ee = H(a)) == null ? void 0 : ee.labelId : void 0,
"aria-valuemin": W.min,
"aria-valuemax": W.range ? H(ie) : W.max,
"aria-valuenow": H(K),
"aria-valuetext": H(b),
"aria-orientation": W.vertical ? "vertical" : "horizontal",
"aria-disabled": H(h),
"onUpdate:modelValue": H(M)
}, 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"]),
W.range ? (pe(), He(lg, {
key: 0,
ref_key: "secondButton",
ref: d,
"model-value": H(ie),
vertical: W.vertical,
"tooltip-class": W.tooltipClass,
placement: W.placement,
role: "slider",
"aria-label": H(O),
"aria-valuemin": H(K),
"aria-valuemax": W.max,
"aria-valuenow": H(ie),
"aria-valuetext": H(N),
"aria-orientation": W.vertical ? "vertical" : "horizontal",
"aria-disabled": H(h),
"onUpdate:modelValue": H(x)
}, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : Ge("v-if", !0),
W.showStops ? (pe(), Re("div", { key: 1 }, [
(pe(!0), Re(Wt, null, ri(H(_), (ne, Y) => (pe(), Re("div", {
key: Y,
class: Le(H(r).e("stop")),
style: Ot(H(E)(ne))
}, null, 6))), 128))
])) : Ge("v-if", !0),
H(B).length > 0 ? (pe(), Re(Wt, { key: 2 }, [
Be("div", null, [
(pe(!0), Re(Wt, null, ri(H(B), (ne, Y) => (pe(), Re("div", {
key: Y,
style: Ot(H(E)(ne.position)),
class: Le([H(r).e("stop"), H(r).e("marks-stop")])
}, null, 6))), 128))
]),
Be("div", {
class: Le(H(r).e("marks"))
}, [
(pe(!0), Re(Wt, null, ri(H(B), (ne, Y) => (pe(), He(H(nP), {
key: Y,
mark: ne.mark,
style: Ot(H(E)(ne.position)),
onMousedown: fn((te) => H(T)(ne.position), ["stop"])
}, null, 8, ["mark", "style", "onMousedown"]))), 128))
], 2)
], 64)) : Ge("v-if", !0)
], 46, ["onMousedown", "onTouchstartPassive"]),
W.showInput && !W.range ? (pe(), He(H(yr), {
key: 0,
ref: "input",
"model-value": H(K),
class: Le(H(r).e("input")),
step: W.step,
disabled: H(h),
controls: W.showInputControls,
min: W.min,
max: W.max,
precision: H(U),
debounce: W.debounce,
size: H(A),
"onUpdate:modelValue": H(M),
onChange: H(v)
}, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "precision", "debounce", "size", "onUpdate:modelValue", "onChange"])) : Ge("v-if", !0)
], 10, ["id", "role", "aria-label", "aria-labelledby"]);
};
}
});
var sP = /* @__PURE__ */ at(rP, [["__file", "slider.vue"]]);
const ci = vn(sP), Su = Symbol("tabsRootContextKey"), oP = dt({
tabs: {
type: Ye(Array),
default: () => tr([])
}
}), Ly = "ElTabBar", aP = De({
name: Ly
}), lP = /* @__PURE__ */ De({
...aP,
props: oP,
setup(n, { expose: e }) {
const t = n, i = cn(), r = ht(Su);
r || na(Ly, "");
const s = it("tabs"), o = Ae(), a = Ae(), c = () => {
let g = 0, f = 0;
const u = ["top", "bottom"].includes(r.props.tabPosition) ? "width" : "height", y = u === "width" ? "x" : "y", v = y === "x" ? "left" : "top";
return t.tabs.every((m) => {
var w, S;
const T = (S = (w = i.parent) == null ? void 0 : w.refs) == null ? void 0 : S[`tab-${m.uid}`];
if (!T)
return !1;
if (!m.active)
return !0;
g = T[`offset${Br(v)}`], f = T[`client${Br(u)}`];
const M = window.getComputedStyle(T);
return u === "width" && (f -= Number.parseFloat(M.paddingLeft) + Number.parseFloat(M.paddingRight), g += Number.parseFloat(M.paddingLeft)), !1;
}), {
[u]: `${f}px`,
transform: `translate${Br(y)}(${g}px)`
};
}, l = () => a.value = c(), d = [], h = () => {
var g;
d.forEach((u) => u.stop()), d.length = 0;
const f = (g = i.parent) == null ? void 0 : g.refs;
if (f) {
for (const u in f)
if (u.startsWith("tab-")) {
const y = f[u];
y && d.push(ii(y, l));
}
}
};
Ke(() => t.tabs, async () => {
await Mt(), l(), h();
}, { immediate: !0 });
const p = ii(o, () => l());
return li(() => {
d.forEach((g) => g.stop()), d.length = 0, p.stop();
}), e({
ref: o,
update: l
}), (g, f) => (pe(), Re("div", {
ref_key: "barRef",
ref: o,
class: Le([H(s).e("active-bar"), H(s).is(H(r).props.tabPosition)]),
style: Ot(a.value)
}, null, 6));
}
});
var cP = /* @__PURE__ */ at(lP, [["__file", "tab-bar.vue"]]);
const uP = dt({
panes: {
type: Ye(Array),
default: () => tr([])
},
currentName: {
type: [String, Number],
default: ""
},
editable: Boolean,
type: {
type: String,
values: ["card", "border-card", ""],
default: ""
},
stretch: Boolean
}), hP = {
tabClick: (n, e, t) => t instanceof Event,
tabRemove: (n, e) => e instanceof Event
}, cg = "ElTabNav", dP = De({
name: cg,
props: uP,
emits: hP,
setup(n, {
expose: e,
emit: t
}) {
const i = ht(Su);
i || na(cg, "");
const r = it("tabs"), s = D1(), o = Z1(), a = Ae(), c = Ae(), l = Ae(), d = Ae(), h = Ae(!1), p = Ae(0), g = Ae(!1), f = Ae(!0), u = ce(() => ["top", "bottom"].includes(i.props.tabPosition) ? "width" : "height"), y = ce(() => ({
transform: `translate${u.value === "width" ? "X" : "Y"}(-${p.value}px)`
})), v = () => {
if (!a.value)
return;
const _ = a.value[`offset${Br(u.value)}`], E = p.value;
if (!E)
return;
const L = E > _ ? E - _ : 0;
p.value = L;
}, m = () => {
if (!a.value || !c.value)
return;
const _ = c.value[`offset${Br(u.value)}`], E = a.value[`offset${Br(u.value)}`], L = p.value;
if (_ - L <= E)
return;
const R = _ - L > E * 2 ? L + E : _ - E;
p.value = R;
}, w = async () => {
const _ = c.value;
if (!h.value || !l.value || !a.value || !_)
return;
await Mt();
const E = l.value.querySelector(".is-active");
if (!E)
return;
const L = a.value, R = ["top", "bottom"].includes(i.props.tabPosition), C = E.getBoundingClientRect(), A = L.getBoundingClientRect(), P = R ? _.offsetWidth - A.width : _.offsetHeight - A.height, I = p.value;
let b = I;
R ? (C.left < A.left && (b = I - (A.left - C.left)), C.right > A.right && (b = I + C.right - A.right)) : (C.top < A.top && (b = I - (A.top - C.top)), C.bottom > A.bottom && (b = I + (C.bottom - A.bottom))), b = Math.max(b, 0), p.value = Math.min(b, P);
}, S = () => {
var _;
if (!c.value || !a.value)
return;
n.stretch && ((_ = d.value) == null || _.update());
const E = c.value[`offset${Br(u.value)}`], L = a.value[`offset${Br(u.value)}`], R = p.value;
L < E ? (h.value = h.value || {}, h.value.prev = R, h.value.next = R + L < E, E - R < L && (p.value = E - L)) : (h.value = !1, R > 0 && (p.value = 0));
}, T = (_) => {
const E = _.code, {
up: L,
down: R,
left: C,
right: A
} = Di;
if (![L, R, C, A].includes(E))
return;
const P = Array.from(_.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")), I = P.indexOf(_.target);
let b;
E === C || E === L ? I === 0 ? b = P.length - 1 : b = I - 1 : I < P.length - 1 ? b = I + 1 : b = 0, P[b].focus({
preventScroll: !0
}), P[b].click(), M();
}, M = () => {
f.value && (g.value = !0);
}, x = () => g.value = !1;
return Ke(s, (_) => {
_ === "hidden" ? f.value = !1 : _ === "visible" && setTimeout(() => f.value = !0, 50);
}), Ke(o, (_) => {
_ ? setTimeout(() => f.value = !0, 50) : f.value = !1;
}), ii(l, S), on(() => setTimeout(() => w(), 0)), sf(() => S()), e({
scrollToActiveTab: w,
removeFocus: x
}), () => {
const _ = h.value ? [ae("span", {
class: [r.e("nav-prev"), r.is("disabled", !h.value.prev)],
onClick: v
}, [ae(Bt, null, {
default: () => [ae(jr, null, null)]
})]), ae("span", {
class: [r.e("nav-next"), r.is("disabled", !h.value.next)],
onClick: m
}, [ae(Bt, null, {
default: () => [ae($r, null, null)]
})])] : null, E = n.panes.map((L, R) => {
var C, A, P, I;
const b = L.uid, O = L.props.disabled, N = (A = (C = L.props.name) != null ? C : L.index) != null ? A : `${R}`, D = !O && (L.isClosable || n.editable);
L.index = `${R}`;
const B = D ? ae(Bt, {
class: "is-icon-close",
onClick: (K) => t("tabRemove", L, K)
}, {
default: () => [ae(cd, null, null)]
}) : null, U = ((I = (P = L.slots).label) == null ? void 0 : I.call(P)) || L.props.label, k = !O && L.active ? 0 : -1;
return ae("div", {
ref: `tab-${b}`,
class: [r.e("item"), r.is(i.props.tabPosition), r.is("active", L.active), r.is("disabled", O), r.is("closable", D), r.is("focus", g.value)],
id: `tab-${N}`,
key: `tab-${b}`,
"aria-controls": `pane-${N}`,
role: "tab",
"aria-selected": L.active,
tabindex: k,
onFocus: () => M(),
onBlur: () => x(),
onClick: (K) => {
x(), t("tabClick", L, N, K);
},
onKeydown: (K) => {
D && (K.code === Di.delete || K.code === Di.backspace) && t("tabRemove", L, K);
}
}, [U, B]);
});
return ae("div", {
ref: l,
class: [r.e("nav-wrap"), r.is("scrollable", !!h.value), r.is(i.props.tabPosition)]
}, [_, ae("div", {
class: r.e("nav-scroll"),
ref: a
}, [ae("div", {
class: [r.e("nav"), r.is(i.props.tabPosition), r.is("stretch", n.stretch && ["top", "bottom"].includes(i.props.tabPosition))],
ref: c,
style: y.value,
role: "tablist",
onKeydown: T
}, [n.type ? null : ae(cP, {
ref: d,
tabs: [...n.panes]
}, null), E])])]);
};
}
}), fP = dt({
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: Ye(Function),
default: () => !0
},
stretch: Boolean
}), rh = (n) => On(n) || St(n), pP = {
[Dt]: (n) => rh(n),
tabClick: (n, e) => e instanceof Event,
tabChange: (n) => rh(n),
edit: (n, e) => ["remove", "add"].includes(e),
tabRemove: (n) => rh(n),
tabAdd: () => !0
}, mP = De({
name: "ElTabs",
props: fP,
emits: pP,
setup(n, {
emit: e,
slots: t,
expose: i
}) {
var r;
const s = it("tabs"), o = ce(() => ["left", "right"].includes(n.tabPosition)), {
children: a,
addChild: c,
removeChild: l
} = $A(cn(), "ElTabPane"), d = Ae(), h = Ae((r = n.modelValue) != null ? r : "0"), p = async (v, m = !1) => {
var w, S, T;
if (!(h.value === v || yi(v)))
try {
await ((w = n.beforeLeave) == null ? void 0 : w.call(n, v, h.value)) !== !1 && (h.value = v, m && (e(Dt, v), e("tabChange", v)), (T = (S = d.value) == null ? void 0 : S.removeFocus) == null || T.call(S));
} catch {
}
}, g = (v, m, w) => {
v.props.disabled || (p(m, !0), e("tabClick", v, w));
}, f = (v, m) => {
v.props.disabled || yi(v.props.name) || (m.stopPropagation(), e("edit", v.props.name, "remove"), e("tabRemove", v.props.name));
}, u = () => {
e("edit", void 0, "add"), e("tabAdd");
};
Ke(() => n.modelValue, (v) => p(v)), Ke(h, async () => {
var v;
await Mt(), (v = d.value) == null || v.scrollToActiveTab();
}), gn(Su, {
props: n,
currentName: h,
registerPane: (v) => {
a.value.push(v);
},
sortPane: c,
unregisterPane: l
}), i({
currentName: h
});
const y = ({
render: v
}) => v();
return () => {
const v = t["add-icon"], m = n.editable || n.addable ? ae("div", {
class: [s.e("new-tab"), o.value && s.e("new-tab-vertical")],
tabindex: "0",
onClick: u,
onKeydown: (T) => {
T.code === Di.enter && u();
}
}, [v ? Xe(t, "add-icon") : ae(Bt, {
class: s.is("icon-plus")
}, {
default: () => [ae(fu, null, null)]
})]) : null, w = ae("div", {
class: [s.e("header"), o.value && s.e("header-vertical"), s.is(n.tabPosition)]
}, [ae(y, {
render: () => {
const T = a.value.some((M) => M.slots.label);
return ae(dP, {
ref: d,
currentName: h.value,
editable: n.editable,
type: n.type,
panes: a.value,
stretch: n.stretch,
onTabClick: g,
onTabRemove: f
}, {
$stable: !T
});
}
}, null), m]), S = ae("div", {
class: s.e("content")
}, [Xe(t, "default")]);
return ae("div", {
class: [s.b(), s.m(n.tabPosition), {
[s.m("card")]: n.type === "card",
[s.m("border-card")]: n.type === "border-card"
}]
}, [S, w]);
};
}
}), gP = dt({
label: {
type: String,
default: ""
},
name: {
type: [String, Number]
},
closable: Boolean,
disabled: Boolean,
lazy: Boolean
}), Ry = "ElTabPane", vP = De({
name: Ry
}), yP = /* @__PURE__ */ De({
...vP,
props: gP,
setup(n) {
const e = n, t = cn(), i = ou(), r = ht(Su);
r || na(Ry, "usage: ");
const s = it("tab-pane"), o = Ae(), a = ce(() => e.closable || r.props.closable), c = Wp(() => {
var g;
return r.currentName.value === ((g = e.name) != null ? g : o.value);
}), l = Ae(c.value), d = ce(() => {
var g;
return (g = e.name) != null ? g : o.value;
}), h = Wp(() => !e.lazy || l.value || c.value);
Ke(c, (g) => {
g && (l.value = !0);
});
const p = qn({
uid: t.uid,
slots: i,
props: e,
paneName: d,
active: c,
index: o,
isClosable: a
});
return r.registerPane(p), on(() => {
r.sortPane(p);
}), c0(() => {
r.unregisterPane(p.uid);
}), (g, f) => H(h) ? Ft((pe(), Re("div", {
key: 0,
id: `pane-${H(d)}`,
class: Le(H(s).b()),
role: "tabpanel",
"aria-hidden": !H(c),
"aria-labelledby": `tab-${H(d)}`
}, [
Xe(g.$slots, "default")
], 10, ["id", "aria-hidden", "aria-labelledby"])), [
[xn, H(c)]
]) : Ge("v-if", !0);
}
});
var Py = /* @__PURE__ */ at(yP, [["__file", "tab-pane.vue"]]);
const Iy = vn(mP, {
TabPane: Py
}), Oy = gr(Py);
function bP(n) {
let e;
const t = Ae(!1), i = qn({
...n,
originalPosition: "",
originalOverflow: "",
visible: !1
});
function r(p) {
i.text = p;
}
function s() {
const p = i.parent, g = h.ns;
if (!p.vLoadingAddClassList) {
let f = p.getAttribute("loading-number");
f = Number.parseInt(f) - 1, f ? p.setAttribute("loading-number", f.toString()) : ($c(p, g.bm("parent", "relative")), p.removeAttribute("loading-number")), $c(p, g.bm("parent", "hidden"));
}
o(), d.unmount();
}
function o() {
var p, g;
(g = (p = h.$el) == null ? void 0 : p.parentNode) == null || g.removeChild(h.$el);
}
function a() {
var p;
n.beforeClose && !n.beforeClose() || (t.value = !0, clearTimeout(e), e = setTimeout(c, 400), i.visible = !1, (p = n.closed) == null || p.call(n));
}
function c() {
if (!t.value)
return;
const p = i.parent;
t.value = !1, p.vLoadingAddClassList = void 0, s();
}
const l = De({
name: "ElLoading",
setup(p, { expose: g }) {
const { ns: f, zIndex: u } = eC("loading");
return g({
ns: f,
zIndex: u
}), () => {
const y = i.spinner || i.svg, v = bo("svg", {
class: "circular",
viewBox: i.svgViewBox ? i.svgViewBox : "0 0 50 50",
...y ? { innerHTML: y } : {}
}, [
bo("circle", {
class: "path",
cx: "25",
cy: "25",
r: "20",
fill: "none"
})
]), m = i.text ? bo("p", { class: f.b("text") }, [i.text]) : void 0;
return bo(hl, {
name: f.b("fade"),
onAfterLeave: c
}, {
default: fe(() => [
Ft(ae("div", {
style: {
backgroundColor: i.background || ""
},
class: [
f.b("mask"),
i.customClass,
i.fullscreen ? "is-fullscreen" : ""
]
}, [
bo("div", {
class: f.b("spinner")
}, [v, m])
]), [[xn, i.visible]])
])
});
};
}
}), d = h1(l), h = d.mount(document.createElement("div"));
return {
...cr(i),
setText: r,
removeElLoadingChild: o,
close: a,
handleAfterLeave: c,
vm: h,
get $el() {
return h.$el;
}
};
}
let Gl;
const gd = function(n = {}) {
if (!rn)
return;
const e = xP(n);
if (e.fullscreen && Gl)
return Gl;
const t = bP({
...e,
closed: () => {
var r;
(r = e.closed) == null || r.call(e), e.fullscreen && (Gl = void 0);
}
});
wP(e, e.parent, t), ug(e, e.parent, t), e.parent.vLoadingAddClassList = () => ug(e, e.parent, t);
let i = e.parent.getAttribute("loading-number");
return i ? i = `${Number.parseInt(i) + 1}` : i = "1", e.parent.setAttribute("loading-number", i), e.parent.appendChild(t.$el), Mt(() => t.visible.value = e.visible), e.fullscreen && (Gl = t), t;
}, xP = (n) => {
var e, t, i, r;
let s;
return On(n.target) ? s = (e = document.querySelector(n.target)) != null ? e : document.body : s = n.target || document.body, {
parent: s === document.body || n.body ? document.body : s,
background: n.background || "",
svg: n.svg || "",
svgViewBox: n.svgViewBox || "",
spinner: n.spinner || !1,
text: n.text || "",
fullscreen: s === document.body && ((t = n.fullscreen) != null ? t : !0),
lock: (i = n.lock) != null ? i : !1,
customClass: n.customClass || "",
visible: (r = n.visible) != null ? r : !0,
beforeClose: n.beforeClose,
closed: n.closed,
target: s
};
}, wP = async (n, e, t) => {
const { nextZIndex: i } = t.vm.zIndex || t.vm._.exposed.zIndex, r = {};
if (n.fullscreen)
t.originalPosition.value = va(document.body, "position"), t.originalOverflow.value = va(document.body, "overflow"), r.zIndex = i();
else if (n.parent === document.body) {
t.originalPosition.value = va(document.body, "position"), await Mt();
for (const s of ["top", "left"]) {
const o = s === "top" ? "scrollTop" : "scrollLeft";
r[s] = `${n.target.getBoundingClientRect()[s] + document.body[o] + document.documentElement[o] - Number.parseInt(va(document.body, `margin-${s}`), 10)}px`;
}
for (const s of ["height", "width"])
r[s] = `${n.target.getBoundingClientRect()[s]}px`;
} else
t.originalPosition.value = va(e, "position");
for (const [s, o] of Object.entries(r))
t.$el.style[s] = o;
}, ug = (n, e, t) => {
const i = t.vm.ns || t.vm._.exposed.ns;
["absolute", "fixed", "sticky"].includes(t.originalPosition.value) ? $c(e, i.bm("parent", "relative")) : Am(e, i.bm("parent", "relative")), n.fullscreen && n.lock ? Am(e, i.bm("parent", "hidden")) : $c(e, i.bm("parent", "hidden"));
}, Uc = Symbol("ElLoading"), hg = (n, e) => {
var t, i, r, s;
const o = e.instance, a = (p) => Pn(e.value) ? e.value[p] : void 0, c = (p) => {
const g = On(p) && (o == null ? void 0 : o[p]) || p;
return g && Ae(g);
}, l = (p) => c(a(p) || n.getAttribute(`element-loading-${tM(p)}`)), d = (t = a("fullscreen")) != null ? t : e.modifiers.fullscreen, h = {
text: l("text"),
svg: l("svg"),
svgViewBox: l("svgViewBox"),
spinner: l("spinner"),
background: l("background"),
customClass: l("customClass"),
fullscreen: d,
target: (i = a("target")) != null ? i : d ? void 0 : n,
body: (r = a("body")) != null ? r : e.modifiers.body,
lock: (s = a("lock")) != null ? s : e.modifiers.lock
};
n[Uc] = {
options: h,
instance: gd(h)
};
}, MP = (n, e) => {
for (const t of Object.keys(e))
Ls(e[t]) && (e[t].value = n[t]);
}, vd = {
mounted(n, e) {
e.value && hg(n, e);
},
updated(n, e) {
const t = n[Uc];
e.oldValue !== e.value && (e.value && !e.oldValue ? hg(n, e) : e.value && e.oldValue ? Pn(e.value) && MP(e.value, t.options) : t == null || t.instance.close());
},
unmounted(n) {
var e;
(e = n[Uc]) == null || e.instance.close(), n[Uc] = null;
}
}, SP = {
install(n) {
n.directive("loading", vd), n.config.globalProperties.$loading = gd;
},
directive: vd,
service: gd
};
var Dy = { exports: {} }, dg = {}, fg;
function _P() {
return fg || (fg = 1, function(n) {
var e = function() {
try {
return !!Symbol.iterator;
} catch {
return !1;
}
}, t = e(), i = function(l) {
var d = {
next: function() {
var h = l.shift();
return { done: h === void 0, value: h };
}
};
return t && (d[Symbol.iterator] = function() {
return d;
}), d;
}, r = function(l) {
return encodeURIComponent(l).replace(/%20/g, "+");
}, s = function(l) {
return decodeURIComponent(String(l).replace(/\+/g, " "));
}, o = function() {
var l = function(h) {
Object.defineProperty(this, "_entries", { writable: !0, value: {} });
var p = typeof h;
if (p !== "undefined") if (p === "string")
h !== "" && this._fromString(h);
else if (h instanceof l) {
var g = this;
h.forEach(function(v, m) {
g.append(m, v);
});
} else if (h !== null && p === "object")
if (Object.prototype.toString.call(h) === "[object Array]")
for (var f = 0; f < h.length; f++) {
var u = h[f];
if (Object.prototype.toString.call(u) === "[object Array]" || u.length !== 2)
this.append(u[0], u[1]);
else
throw new TypeError("Expected [string, any] as entry at index " + f + " of URLSearchParams's input");
}
else
for (var y in h)
h.hasOwnProperty(y) && this.append(y, h[y]);
else
throw new TypeError("Unsupported input's type for URLSearchParams");
}, d = l.prototype;
d.append = function(h, p) {
h in this._entries ? this._entries[h].push(String(p)) : this._entries[h] = [String(p)];
}, d.delete = function(h) {
delete this._entries[h];
}, d.get = function(h) {
return h in this._entries ? this._entries[h][0] : null;
}, d.getAll = function(h) {
return h in this._entries ? this._entries[h].slice(0) : [];
}, d.has = function(h) {
return h in this._entries;
}, d.set = function(h, p) {
this._entries[h] = [String(p)];
}, d.forEach = function(h, p) {
var g;
for (var f in this._entries)
if (this._entries.hasOwnProperty(f)) {
g = this._entries[f];
for (var u = 0; u < g.length; u++)
h.call(p, g[u], f, this);
}
}, d.keys = function() {
var h = [];
return this.forEach(function(p, g) {
h.push(g);
}), i(h);
}, d.values = function() {
var h = [];
return this.forEach(function(p) {
h.push(p);
}), i(h);
}, d.entries = function() {
var h = [];
return this.forEach(function(p, g) {
h.push([g, p]);
}), i(h);
}, t && (d[Symbol.iterator] = d.entries), d.toString = function() {
var h = [];
return this.forEach(function(p, g) {
h.push(r(g) + "=" + r(p));
}), h.join("&");
}, n.URLSearchParams = l;
}, a = function() {
try {
var l = n.URLSearchParams;
return new l("?a=1").toString() === "a=1" && typeof l.prototype.set == "function" && typeof l.prototype.entries == "function";
} catch {
return !1;
}
};
a() || o();
var c = n.URLSearchParams.prototype;
typeof c.sort != "function" && (c.sort = function() {
var l = this, d = [];
this.forEach(function(p, g) {
d.push([g, p]), l._entries || l.delete(g);
}), d.sort(function(p, g) {
return p[0] < g[0] ? -1 : p[0] > g[0] ? 1 : 0;
}), l._entries && (l._entries = {});
for (var h = 0; h < d.length; h++)
this.append(d[h][0], d[h][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 d = [];
this.forEach(function(f, u) {
d.push(u);
});
for (var h = 0; h < d.length; h++)
this.delete(d[h]);
}
l = l.replace(/^\?/, "");
for (var p = l.split("&"), g, h = 0; h < p.length; h++)
g = p[h].split("="), this.append(
s(g[0]),
g.length > 1 ? s(g[1]) : ""
);
}
});
}(
typeof Fr < "u" ? Fr : typeof window < "u" ? window : typeof self < "u" ? self : Fr
), function(n) {
var e = function() {
try {
var r = new n.URL("b", "http://a");
return r.pathname = "c d", r.href === "http://a/c%20d" && r.searchParams;
} catch {
return !1;
}
}, t = function() {
var r = n.URL, s = function(c, l) {
typeof c != "string" && (c = String(c)), l && typeof l != "string" && (l = String(l));
var d = document, h;
if (l && (n.location === void 0 || l !== n.location.href)) {
l = l.toLowerCase(), d = document.implementation.createHTMLDocument(""), h = d.createElement("base"), h.href = l, d.head.appendChild(h);
try {
if (h.href.indexOf(l) !== 0) throw new Error(h.href);
} catch (w) {
throw new Error("URL unable to set base " + l + " due to " + w);
}
}
var p = d.createElement("a");
p.href = c, h && (d.body.appendChild(p), p.href = p.href);
var g = d.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 f = new n.URLSearchParams(this.search), u = !0, y = !0, v = this;
["append", "delete", "set"].forEach(function(w) {
var S = f[w];
f[w] = function() {
S.apply(f, arguments), u && (y = !1, v.search = f.toString(), y = !0);
};
}), Object.defineProperty(this, "searchParams", {
value: f,
enumerable: !0
});
var m = void 0;
Object.defineProperty(this, "_updateSearchParams", {
enumerable: !1,
configurable: !1,
writable: !1,
value: function() {
this.search !== m && (m = this.search, y && (u = !1, this.searchParams._fromString(this.search), u = !0));
}
});
}, o = s.prototype, a = function(c) {
Object.defineProperty(o, c, {
get: function() {
return this._anchorElement[c];
},
set: function(l) {
this._anchorElement[c] = l;
},
enumerable: !0
});
};
["hash", "host", "hostname", "port", "protocol"].forEach(function(c) {
a(c);
}), Object.defineProperty(o, "search", {
get: function() {
return this._anchorElement.search;
},
set: function(c) {
this._anchorElement.search = c, this._updateSearchParams();
},
enumerable: !0
}), Object.defineProperties(o, {
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
}
}), s.createObjectURL = function(c) {
return r.createObjectURL.apply(r, arguments);
}, s.revokeObjectURL = function(c) {
return r.revokeObjectURL.apply(r, arguments);
}, n.URL = s;
};
if (e() || t(), n.location !== void 0 && !("origin" in n.location)) {
var i = function() {
return n.location.protocol + "//" + n.location.hostname + (n.location.port ? ":" + n.location.port : "");
};
try {
Object.defineProperty(n.location, "origin", {
get: i,
enumerable: !0
});
} catch {
setInterval(function() {
n.location.origin = i();
}, 100);
}
}
}(
typeof Fr < "u" ? Fr : typeof window < "u" ? window : typeof self < "u" ? self : Fr
)), dg;
}
/**
* @license
* Copyright 2010-2021 Three.js Authors
* SPDX-License-Identifier: MIT
*/
const Uf = "130", TP = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }, EP = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, Ny = 0, yd = 1, Fy = 2, AP = 3, CP = 0, Vf = 1, By = 2, wo = 3, Xr = 0, qt = 1, Yr = 2, kf = 1, LP = 2, or = 0, _o = 1, bd = 2, xd = 3, wd = 4, zy = 5, ys = 100, Uy = 101, Vy = 102, Md = 103, Sd = 104, ky = 200, Gy = 201, Hy = 202, Wy = 203, Gf = 204, Hf = 205, jy = 206, $y = 207, Zy = 208, Xy = 209, Yy = 210, Jy = 0, qy = 1, Ky = 2, Kc = 3, Qy = 4, eb = 5, tb = 6, nb = 7, vl = 0, ib = 1, rb = 2, Vr = 0, sb = 1, ob = 2, ab = 3, lb = 4, cb = 5, _u = 300, yl = 301, bl = 302, Qc = 303, eu = 304, la = 306, xl = 307, Jr = 1e3, mn = 1001, No = 1002, Kt = 1003, Ka = 1004, RP = 1004, Qa = 1005, PP = 1005, jt = 1006, Tu = 1007, IP = 1007, br = 1008, OP = 1008, Ps = 1009, ub = 1010, hb = 1011, el = 1012, db = 1013, Va = 1014, nr = 1015, Ts = 1016, fb = 1017, pb = 1018, mb = 1019, To = 1020, gb = 1021, ar = 1022, Yn = 1023, vb = 1024, yb = 1025, bb = Yn, Es = 1026, Fo = 1027, xb = 1028, wb = 1029, Mb = 1030, Sb = 1031, _b = 1032, Tb = 1033, _d = 33776, Td = 33777, Ed = 33778, Ad = 33779, Cd = 35840, Ld = 35841, Rd = 35842, Pd = 35843, Eb = 36196, Id = 37492, Od = 37496, Ab = 37808, Cb = 37809, Lb = 37810, Rb = 37811, Pb = 37812, Ib = 37813, Ob = 37814, Db = 37815, Nb = 37816, Fb = 37817, Bb = 37818, zb = 37819, Ub = 37820, Vb = 37821, kb = 36492, Gb = 37840, Hb = 37841, Wb = 37842, jb = 37843, $b = 37844, Zb = 37845, Xb = 37846, Yb = 37847, Jb = 37848, qb = 37849, Kb = 37850, Qb = 37851, ex = 37852, tx = 37853, nx = 2200, ix = 2201, rx = 2202, Bo = 2300, Is = 2301, Vc = 2302, xs = 2400, ws = 2401, tl = 2402, Eu = 2500, Wf = 2501, sx = 0, ox = 1, jf = 2, Dn = 3e3, Os = 3001, Au = 3007, Cu = 3002, ax = 3003, $f = 3004, Zf = 3005, Xf = 3006, lx = 3200, cx = 3201, ts = 0, ux = 1, DP = 0, kc = 7680, NP = 7681, FP = 7682, BP = 7683, zP = 34055, UP = 34056, VP = 5386, kP = 512, GP = 513, HP = 514, WP = 515, jP = 516, $P = 517, ZP = 518, hx = 519, zo = 35044, Uo = 35048, XP = 35040, YP = 35045, JP = 35049, qP = 35041, KP = 35046, QP = 35050, eI = 35042, tI = "100", Dd = "300 es";
class ns {
addEventListener(e, t) {
this._listeners === void 0 && (this._listeners = {});
const i = this._listeners;
i[e] === void 0 && (i[e] = []), i[e].indexOf(t) === -1 && i[e].push(t);
}
hasEventListener(e, t) {
if (this._listeners === void 0) return !1;
const i = this._listeners;
return i[e] !== void 0 && i[e].indexOf(t) !== -1;
}
removeEventListener(e, t) {
if (this._listeners === void 0) return;
const r = this._listeners[e];
if (r !== void 0) {
const s = r.indexOf(t);
s !== -1 && r.splice(s, 1);
}
}
dispatchEvent(e) {
if (this._listeners === void 0) return;
const i = this._listeners[e.type];
if (i !== void 0) {
e.target = this;
const r = i.slice(0);
for (let s = 0, o = r.length; s < o; s++)
r[s].call(this, e);
e.target = null;
}
}
}
const yn = [];
for (let n = 0; n < 256; n++)
yn[n] = (n < 16 ? "0" : "") + n.toString(16);
let Hl = 1234567;
const As = Math.PI / 180, nl = 180 / Math.PI;
function Jn() {
const n = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, i = Math.random() * 4294967295 | 0;
return (yn[n & 255] + yn[n >> 8 & 255] + yn[n >> 16 & 255] + yn[n >> 24 & 255] + "-" + yn[e & 255] + yn[e >> 8 & 255] + "-" + yn[e >> 16 & 15 | 64] + yn[e >> 24 & 255] + "-" + yn[t & 63 | 128] + yn[t >> 8 & 255] + "-" + yn[t >> 16 & 255] + yn[t >> 24 & 255] + yn[i & 255] + yn[i >> 8 & 255] + yn[i >> 16 & 255] + yn[i >> 24 & 255]).toUpperCase();
}
function wn(n, e, t) {
return Math.max(e, Math.min(t, n));
}
function Yf(n, e) {
return (n % e + e) % e;
}
function nI(n, e, t, i, r) {
return i + (n - e) * (r - i) / (t - e);
}
function iI(n, e, t) {
return n !== e ? (t - n) / (e - n) : 0;
}
function ka(n, e, t) {
return (1 - t) * n + t * e;
}
function rI(n, e, t, i) {
return ka(n, e, 1 - Math.exp(-t * i));
}
function sI(n, e = 1) {
return e - Math.abs(Yf(n, e * 2) - e);
}
function oI(n, e, t) {
return n <= e ? 0 : n >= t ? 1 : (n = (n - e) / (t - e), n * n * (3 - 2 * n));
}
function aI(n, e, t) {
return n <= e ? 0 : n >= t ? 1 : (n = (n - e) / (t - e), n * n * n * (n * (n * 6 - 15) + 10));
}
function lI(n, e) {
return n + Math.floor(Math.random() * (e - n + 1));
}
function cI(n, e) {
return n + Math.random() * (e - n);
}
function uI(n) {
return n * (0.5 - Math.random());
}
function hI(n) {
return n !== void 0 && (Hl = n % 2147483647), Hl = Hl * 16807 % 2147483647, (Hl - 1) / 2147483646;
}
function dI(n) {
return n * As;
}
function fI(n) {
return n * nl;
}
function Nd(n) {
return (n & n - 1) === 0 && n !== 0;
}
function dx(n) {
return Math.pow(2, Math.ceil(Math.log(n) / Math.LN2));
}
function fx(n) {
return Math.pow(2, Math.floor(Math.log(n) / Math.LN2));
}
function pI(n, e, t, i, r) {
const s = Math.cos, o = Math.sin, a = s(t / 2), c = o(t / 2), l = s((e + i) / 2), d = o((e + i) / 2), h = s((e - i) / 2), p = o((e - i) / 2), g = s((i - e) / 2), f = o((i - e) / 2);
switch (r) {
case "XYX":
n.set(a * d, c * h, c * p, a * l);
break;
case "YZY":
n.set(c * p, a * d, c * h, a * l);
break;
case "ZXZ":
n.set(c * h, c * p, a * d, a * l);
break;
case "XZX":
n.set(a * d, c * f, c * g, a * l);
break;
case "YXY":
n.set(c * g, a * d, c * f, a * l);
break;
case "ZYZ":
n.set(c * f, c * g, a * d, a * l);
break;
default:
console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + r);
}
}
var Fd = /* @__PURE__ */ Object.freeze({
__proto__: null,
DEG2RAD: As,
RAD2DEG: nl,
generateUUID: Jn,
clamp: wn,
euclideanModulo: Yf,
mapLinear: nI,
inverseLerp: iI,
lerp: ka,
damp: rI,
pingpong: sI,
smoothstep: oI,
smootherstep: aI,
randInt: lI,
randFloat: cI,
randFloatSpread: uI,
seededRandom: hI,
degToRad: dI,
radToDeg: fI,
isPowerOfTwo: Nd,
ceilPowerOfTwo: dx,
floorPowerOfTwo: fx,
setQuaternionFromProperEuler: pI
});
class Pe {
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, i = this.y, r = e.elements;
return this.x = r[0] * t + r[3] * i + r[6], this.y = r[1] * t + r[4] * i + r[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 i = this.length();
return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(t, i)));
}
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, i = this.y - e.y;
return t * t + i * i;
}
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, i) {
return this.x = e.x + (t.x - e.x) * i, this.y = e.y + (t.y - e.y) * i, 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, i) {
return i !== 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 i = Math.cos(t), r = Math.sin(t), s = this.x - e.x, o = this.y - e.y;
return this.x = s * i - o * r + e.x, this.y = s * r + o * i + e.y, this;
}
random() {
return this.x = Math.random(), this.y = Math.random(), this;
}
}
Pe.prototype.isVector2 = !0;
class ln {
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, i, r, s, o, a, c, l) {
const d = this.elements;
return d[0] = e, d[1] = r, d[2] = a, d[3] = t, d[4] = s, d[5] = c, d[6] = i, d[7] = o, d[8] = l, this;
}
identity() {
return this.set(
1,
0,
0,
0,
1,
0,
0,
0,
1
), this;
}
copy(e) {
const t = this.elements, i = e.elements;
return t[0] = i[0], t[1] = i[1], t[2] = i[2], t[3] = i[3], t[4] = i[4], t[5] = i[5], t[6] = i[6], t[7] = i[7], t[8] = i[8], this;
}
extractBasis(e, t, i) {
return e.setFromMatrix3Column(this, 0), t.setFromMatrix3Column(this, 1), i.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 i = e.elements, r = t.elements, s = this.elements, o = i[0], a = i[3], c = i[6], l = i[1], d = i[4], h = i[7], p = i[2], g = i[5], f = i[8], u = r[0], y = r[3], v = r[6], m = r[1], w = r[4], S = r[7], T = r[2], M = r[5], x = r[8];
return s[0] = o * u + a * m + c * T, s[3] = o * y + a * w + c * M, s[6] = o * v + a * S + c * x, s[1] = l * u + d * m + h * T, s[4] = l * y + d * w + h * M, s[7] = l * v + d * S + h * x, s[2] = p * u + g * m + f * T, s[5] = p * y + g * w + f * M, s[8] = p * v + g * S + f * x, 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], i = e[1], r = e[2], s = e[3], o = e[4], a = e[5], c = e[6], l = e[7], d = e[8];
return t * o * d - t * a * l - i * s * d + i * a * c + r * s * l - r * o * c;
}
invert() {
const e = this.elements, t = e[0], i = e[1], r = e[2], s = e[3], o = e[4], a = e[5], c = e[6], l = e[7], d = e[8], h = d * o - a * l, p = a * c - d * s, g = l * s - o * c, f = t * h + i * p + r * g;
if (f === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
const u = 1 / f;
return e[0] = h * u, e[1] = (r * l - d * i) * u, e[2] = (a * i - r * o) * u, e[3] = p * u, e[4] = (d * t - r * c) * u, e[5] = (r * s - a * t) * u, e[6] = g * u, e[7] = (i * c - l * t) * u, e[8] = (o * t - i * s) * u, 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, i, r, s, o, a) {
const c = Math.cos(s), l = Math.sin(s);
return this.set(
i * c,
i * l,
-i * (c * o + l * a) + o + e,
-r * l,
r * c,
-r * (-l * o + c * a) + a + t,
0,
0,
1
), this;
}
scale(e, t) {
const i = this.elements;
return i[0] *= e, i[3] *= e, i[6] *= e, i[1] *= t, i[4] *= t, i[7] *= t, this;
}
rotate(e) {
const t = Math.cos(e), i = Math.sin(e), r = this.elements, s = r[0], o = r[3], a = r[6], c = r[1], l = r[4], d = r[7];
return r[0] = t * s + i * c, r[3] = t * o + i * l, r[6] = t * a + i * d, r[1] = -i * s + t * c, r[4] = -i * o + t * l, r[7] = -i * a + t * d, this;
}
translate(e, t) {
const i = this.elements;
return i[0] += e * i[2], i[3] += e * i[5], i[6] += e * i[8], i[1] += t * i[2], i[4] += t * i[5], i[7] += t * i[8], this;
}
equals(e) {
const t = this.elements, i = e.elements;
for (let r = 0; r < 9; r++)
if (t[r] !== i[r]) return !1;
return !0;
}
fromArray(e, t = 0) {
for (let i = 0; i < 9; i++)
this.elements[i] = e[i + t];
return this;
}
toArray(e = [], t = 0) {
const i = this.elements;
return e[t] = i[0], e[t + 1] = i[1], e[t + 2] = i[2], e[t + 3] = i[3], e[t + 4] = i[4], e[t + 5] = i[5], e[t + 6] = i[6], e[t + 7] = i[7], e[t + 8] = i[8], e;
}
clone() {
return new this.constructor().fromArray(this.elements);
}
}
ln.prototype.isMatrix3 = !0;
let qs;
class Hs {
static getDataURL(e) {
if (/^data:/i.test(e.src) || typeof HTMLCanvasElement > "u")
return e.src;
let t;
if (e instanceof HTMLCanvasElement)
t = e;
else {
qs === void 0 && (qs = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas")), qs.width = e.width, qs.height = e.height;
const i = qs.getContext("2d");
e instanceof ImageData ? i.putImageData(e, 0, 0) : i.drawImage(e, 0, 0, e.width, e.height), t = qs;
}
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 mI = 0;
class nn extends ns {
constructor(e = nn.DEFAULT_IMAGE, t = nn.DEFAULT_MAPPING, i = mn, r = mn, s = jt, o = br, a = Yn, c = Ps, l = 1, d = Dn) {
super(), Object.defineProperty(this, "id", { value: mI++ }), this.uuid = Jn(), this.name = "", this.image = e, this.mipmaps = [], this.mapping = t, this.wrapS = i, this.wrapT = r, this.magFilter = s, this.minFilter = o, this.anisotropy = l, this.format = a, this.internalFormat = null, this.type = c, this.offset = new Pe(0, 0), this.repeat = new Pe(1, 1), this.center = new Pe(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new ln(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.encoding = d, 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 i = {
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 r = this.image;
if (r.uuid === void 0 && (r.uuid = Jn()), !t && e.images[r.uuid] === void 0) {
let s;
if (Array.isArray(r)) {
s = [];
for (let o = 0, a = r.length; o < a; o++)
r[o].isDataTexture ? s.push(sh(r[o].image)) : s.push(sh(r[o]));
} else
s = sh(r);
e.images[r.uuid] = {
uuid: r.uuid,
url: s
};
}
i.image = r.uuid;
}
return t || (e.textures[this.uuid] = i), i;
}
dispose() {
this.dispatchEvent({ type: "dispose" });
}
transformUv(e) {
if (this.mapping !== _u) return e;
if (e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1)
switch (this.wrapS) {
case Jr:
e.x = e.x - Math.floor(e.x);
break;
case mn:
e.x = e.x < 0 ? 0 : 1;
break;
case No:
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 Jr:
e.y = e.y - Math.floor(e.y);
break;
case mn:
e.y = e.y < 0 ? 0 : 1;
break;
case No:
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++;
}
}
nn.DEFAULT_IMAGE = void 0;
nn.DEFAULT_MAPPING = _u;
nn.prototype.isTexture = !0;
function sh(n) {
return typeof HTMLImageElement < "u" && n instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && n instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && n instanceof ImageBitmap ? Hs.getDataURL(n) : n.data ? {
data: Array.prototype.slice.call(n.data),
width: n.width,
height: n.height,
type: n.data.constructor.name
} : (console.warn("THREE.Texture: Unable to serialize Texture."), {});
}
class _t {
constructor(e = 0, t = 0, i = 0, r = 1) {
this.x = e, this.y = t, this.z = i, this.w = r;
}
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, i, r) {
return this.x = e, this.y = t, this.z = i, this.w = r, 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, i = this.y, r = this.z, s = this.w, o = e.elements;
return this.x = o[0] * t + o[4] * i + o[8] * r + o[12] * s, this.y = o[1] * t + o[5] * i + o[9] * r + o[13] * s, this.z = o[2] * t + o[6] * i + o[10] * r + o[14] * s, this.w = o[3] * t + o[7] * i + o[11] * r + o[15] * s, 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, i, r, s;
const c = e.elements, l = c[0], d = c[4], h = c[8], p = c[1], g = c[5], f = c[9], u = c[2], y = c[6], v = c[10];
if (Math.abs(d - p) < 0.01 && Math.abs(h - u) < 0.01 && Math.abs(f - y) < 0.01) {
if (Math.abs(d + p) < 0.1 && Math.abs(h + u) < 0.1 && Math.abs(f + y) < 0.1 && Math.abs(l + g + v - 3) < 0.1)
return this.set(1, 0, 0, 0), this;
t = Math.PI;
const w = (l + 1) / 2, S = (g + 1) / 2, T = (v + 1) / 2, M = (d + p) / 4, x = (h + u) / 4, _ = (f + y) / 4;
return w > S && w > T ? w < 0.01 ? (i = 0, r = 0.707106781, s = 0.707106781) : (i = Math.sqrt(w), r = M / i, s = x / i) : S > T ? S < 0.01 ? (i = 0.707106781, r = 0, s = 0.707106781) : (r = Math.sqrt(S), i = M / r, s = _ / r) : T < 0.01 ? (i = 0.707106781, r = 0.707106781, s = 0) : (s = Math.sqrt(T), i = x / s, r = _ / s), this.set(i, r, s, t), this;
}
let m = Math.sqrt((y - f) * (y - f) + (h - u) * (h - u) + (p - d) * (p - d));
return Math.abs(m) < 1e-3 && (m = 1), this.x = (y - f) / m, this.y = (h - u) / m, this.z = (p - d) / m, this.w = Math.acos((l + g + v - 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 i = this.length();
return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(t, i)));
}
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, i) {
return this.x = e.x + (t.x - e.x) * i, this.y = e.y + (t.y - e.y) * i, this.z = e.z + (t.z - e.z) * i, this.w = e.w + (t.w - e.w) * i, 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, i) {
return i !== 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;
}
}
_t.prototype.isVector4 = !0;
class bi extends ns {
constructor(e, t, i = {}) {
super(), this.width = e, this.height = t, this.depth = 1, this.scissor = new _t(0, 0, e, t), this.scissorTest = !1, this.viewport = new _t(0, 0, e, t), this.texture = new nn(void 0, i.mapping, i.wrapS, i.wrapT, i.magFilter, i.minFilter, i.format, i.type, i.anisotropy, i.encoding), this.texture.image = { width: e, height: t, depth: 1 }, this.texture.generateMipmaps = i.generateMipmaps !== void 0 ? i.generateMipmaps : !1, this.texture.minFilter = i.minFilter !== void 0 ? i.minFilter : jt, this.depthBuffer = i.depthBuffer !== void 0 ? i.depthBuffer : !0, this.stencilBuffer = i.stencilBuffer !== void 0 ? i.stencilBuffer : !1, this.depthTexture = i.depthTexture !== void 0 ? i.depthTexture : null;
}
setTexture(e) {
e.image = {
width: this.width,
height: this.height,
depth: this.depth
}, this.texture = e;
}
setSize(e, t, i = 1) {
(this.width !== e || this.height !== t || this.depth !== i) && (this.width = e, this.height = t, this.depth = i, this.texture.image.width = e, this.texture.image.height = t, this.texture.image.depth = i, 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" });
}
}
bi.prototype.isWebGLRenderTarget = !0;
class px extends bi {
constructor(e, t, i) {
super(e, t);
const r = this.texture;
this.texture = [];
for (let s = 0; s < i; s++)
this.texture[s] = r.clone();
}
setSize(e, t, i = 1) {
if (this.width !== e || this.height !== t || this.depth !== i) {
this.width = e, this.height = t, this.depth = i;
for (let r = 0, s = this.texture.length; r < s; r++)
this.texture[r].image.width = e, this.texture[r].image.height = t, this.texture[r].image.depth = i;
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, i = e.texture.length; t < i; t++)
this.texture[t] = e.texture[t].clone();
return this;
}
}
px.prototype.isWebGLMultipleRenderTargets = !0;
class Jf extends bi {
constructor(e, t, i) {
super(e, t, i), this.samples = 4;
}
copy(e) {
return super.copy.call(this, e), this.samples = e.samples, this;
}
}
Jf.prototype.isWebGLMultisampleRenderTarget = !0;
class Sn {
constructor(e = 0, t = 0, i = 0, r = 1) {
this._x = e, this._y = t, this._z = i, this._w = r;
}
static slerp(e, t, i, r) {
return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."), i.slerpQuaternions(e, t, r);
}
static slerpFlat(e, t, i, r, s, o, a) {
let c = i[r + 0], l = i[r + 1], d = i[r + 2], h = i[r + 3];
const p = s[o + 0], g = s[o + 1], f = s[o + 2], u = s[o + 3];
if (a === 0) {
e[t + 0] = c, e[t + 1] = l, e[t + 2] = d, e[t + 3] = h;
return;
}
if (a === 1) {
e[t + 0] = p, e[t + 1] = g, e[t + 2] = f, e[t + 3] = u;
return;
}
if (h !== u || c !== p || l !== g || d !== f) {
let y = 1 - a;
const v = c * p + l * g + d * f + h * u, m = v >= 0 ? 1 : -1, w = 1 - v * v;
if (w > Number.EPSILON) {
const T = Math.sqrt(w), M = Math.atan2(T, v * m);
y = Math.sin(y * M) / T, a = Math.sin(a * M) / T;
}
const S = a * m;
if (c = c * y + p * S, l = l * y + g * S, d = d * y + f * S, h = h * y + u * S, y === 1 - a) {
const T = 1 / Math.sqrt(c * c + l * l + d * d + h * h);
c *= T, l *= T, d *= T, h *= T;
}
}
e[t] = c, e[t + 1] = l, e[t + 2] = d, e[t + 3] = h;
}
static multiplyQuaternionsFlat(e, t, i, r, s, o) {
const a = i[r], c = i[r + 1], l = i[r + 2], d = i[r + 3], h = s[o], p = s[o + 1], g = s[o + 2], f = s[o + 3];
return e[t] = a * f + d * h + c * g - l * p, e[t + 1] = c * f + d * p + l * h - a * g, e[t + 2] = l * f + d * g + a * p - c * h, e[t + 3] = d * f - a * h - 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, i, r) {
return this._x = e, this._y = t, this._z = i, this._w = r, 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 i = e._x, r = e._y, s = e._z, o = e._order, a = Math.cos, c = Math.sin, l = a(i / 2), d = a(r / 2), h = a(s / 2), p = c(i / 2), g = c(r / 2), f = c(s / 2);
switch (o) {
case "XYZ":
this._x = p * d * h + l * g * f, this._y = l * g * h - p * d * f, this._z = l * d * f + p * g * h, this._w = l * d * h - p * g * f;
break;
case "YXZ":
this._x = p * d * h + l * g * f, this._y = l * g * h - p * d * f, this._z = l * d * f - p * g * h, this._w = l * d * h + p * g * f;
break;
case "ZXY":
this._x = p * d * h - l * g * f, this._y = l * g * h + p * d * f, this._z = l * d * f + p * g * h, this._w = l * d * h - p * g * f;
break;
case "ZYX":
this._x = p * d * h - l * g * f, this._y = l * g * h + p * d * f, this._z = l * d * f - p * g * h, this._w = l * d * h + p * g * f;
break;
case "YZX":
this._x = p * d * h + l * g * f, this._y = l * g * h + p * d * f, this._z = l * d * f - p * g * h, this._w = l * d * h - p * g * f;
break;
case "XZY":
this._x = p * d * h - l * g * f, this._y = l * g * h - p * d * f, this._z = l * d * f + p * g * h, this._w = l * d * h + p * g * f;
break;
default:
console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + o);
}
return t !== !1 && this._onChangeCallback(), this;
}
setFromAxisAngle(e, t) {
const i = t / 2, r = Math.sin(i);
return this._x = e.x * r, this._y = e.y * r, this._z = e.z * r, this._w = Math.cos(i), this._onChangeCallback(), this;
}
setFromRotationMatrix(e) {
const t = e.elements, i = t[0], r = t[4], s = t[8], o = t[1], a = t[5], c = t[9], l = t[2], d = t[6], h = t[10], p = i + a + h;
if (p > 0) {
const g = 0.5 / Math.sqrt(p + 1);
this._w = 0.25 / g, this._x = (d - c) * g, this._y = (s - l) * g, this._z = (o - r) * g;
} else if (i > a && i > h) {
const g = 2 * Math.sqrt(1 + i - a - h);
this._w = (d - c) / g, this._x = 0.25 * g, this._y = (r + o) / g, this._z = (s + l) / g;
} else if (a > h) {
const g = 2 * Math.sqrt(1 + a - i - h);
this._w = (s - l) / g, this._x = (r + o) / g, this._y = 0.25 * g, this._z = (c + d) / g;
} else {
const g = 2 * Math.sqrt(1 + h - i - a);
this._w = (o - r) / g, this._x = (s + l) / g, this._y = (c + d) / g, this._z = 0.25 * g;
}
return this._onChangeCallback(), this;
}
setFromUnitVectors(e, t) {
let i = e.dot(t) + 1;
return i < Number.EPSILON ? (i = 0, Math.abs(e.x) > Math.abs(e.z) ? (this._x = -e.y, this._y = e.x, this._z = 0, this._w = i) : (this._x = 0, this._y = -e.z, this._z = e.y, this._w = i)) : (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 = i), this.normalize();
}
angleTo(e) {
return 2 * Math.acos(Math.abs(wn(this.dot(e), -1, 1)));
}
rotateTowards(e, t) {
const i = this.angleTo(e);
if (i === 0) return this;
const r = Math.min(1, t / i);
return this.slerp(e, r), 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 i = e._x, r = e._y, s = e._z, o = e._w, a = t._x, c = t._y, l = t._z, d = t._w;
return this._x = i * d + o * a + r * l - s * c, this._y = r * d + o * c + s * a - i * l, this._z = s * d + o * l + i * c - r * a, this._w = o * d - i * a - r * c - s * l, this._onChangeCallback(), this;
}
slerp(e, t) {
if (t === 0) return this;
if (t === 1) return this.copy(e);
const i = this._x, r = this._y, s = this._z, o = this._w;
let a = o * e._w + i * e._x + r * e._y + s * e._z;
if (a < 0 ? (this._w = -e._w, this._x = -e._x, this._y = -e._y, this._z = -e._z, a = -a) : this.copy(e), a >= 1)
return this._w = o, this._x = i, this._y = r, this._z = s, this;
const c = 1 - a * a;
if (c <= Number.EPSILON) {
const g = 1 - t;
return this._w = g * o + t * this._w, this._x = g * i + t * this._x, this._y = g * r + t * this._y, this._z = g * s + t * this._z, this.normalize(), this._onChangeCallback(), this;
}
const l = Math.sqrt(c), d = Math.atan2(l, a), h = Math.sin((1 - t) * d) / l, p = Math.sin(t * d) / l;
return this._w = o * h + this._w * p, this._x = i * h + this._x * p, this._y = r * h + this._y * p, this._z = s * h + this._z * p, this._onChangeCallback(), this;
}
slerpQuaternions(e, t, i) {
this.copy(e).slerp(t, i);
}
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() {
}
}
Sn.prototype.isQuaternion = !0;
class X {
constructor(e = 0, t = 0, i = 0) {
this.x = e, this.y = t, this.z = i;
}
set(e, t, i) {
return i === void 0 && (i = this.z), this.x = e, this.y = t, this.z = i, 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(pg.setFromEuler(e));
}
applyAxisAngle(e, t) {
return this.applyQuaternion(pg.setFromAxisAngle(e, t));
}
applyMatrix3(e) {
const t = this.x, i = this.y, r = this.z, s = e.elements;
return this.x = s[0] * t + s[3] * i + s[6] * r, this.y = s[1] * t + s[4] * i + s[7] * r, this.z = s[2] * t + s[5] * i + s[8] * r, this;
}
applyNormalMatrix(e) {
return this.applyMatrix3(e).normalize();
}
applyMatrix4(e) {
const t = this.x, i = this.y, r = this.z, s = e.elements, o = 1 / (s[3] * t + s[7] * i + s[11] * r + s[15]);
return this.x = (s[0] * t + s[4] * i + s[8] * r + s[12]) * o, this.y = (s[1] * t + s[5] * i + s[9] * r + s[13]) * o, this.z = (s[2] * t + s[6] * i + s[10] * r + s[14]) * o, this;
}
applyQuaternion(e) {
const t = this.x, i = this.y, r = this.z, s = e.x, o = e.y, a = e.z, c = e.w, l = c * t + o * r - a * i, d = c * i + a * t - s * r, h = c * r + s * i - o * t, p = -s * t - o * i - a * r;
return this.x = l * c + p * -s + d * -a - h * -o, this.y = d * c + p * -o + h * -s - l * -a, this.z = h * c + p * -a + l * -o - d * -s, 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, i = this.y, r = this.z, s = e.elements;
return this.x = s[0] * t + s[4] * i + s[8] * r, this.y = s[1] * t + s[5] * i + s[9] * r, this.z = s[2] * t + s[6] * i + s[10] * r, 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 i = this.length();
return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(t, i)));
}
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, i) {
return this.x = e.x + (t.x - e.x) * i, this.y = e.y + (t.y - e.y) * i, this.z = e.z + (t.z - e.z) * i, 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 i = e.x, r = e.y, s = e.z, o = t.x, a = t.y, c = t.z;
return this.x = r * c - s * a, this.y = s * o - i * c, this.z = i * a - r * o, this;
}
projectOnVector(e) {
const t = e.lengthSq();
if (t === 0) return this.set(0, 0, 0);
const i = e.dot(this) / t;
return this.copy(e).multiplyScalar(i);
}
projectOnPlane(e) {
return oh.copy(this).projectOnVector(e), this.sub(oh);
}
reflect(e) {
return this.sub(oh.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 i = this.dot(e) / t;
return Math.acos(wn(i, -1, 1));
}
distanceTo(e) {
return Math.sqrt(this.distanceToSquared(e));
}
distanceToSquared(e) {
const t = this.x - e.x, i = this.y - e.y, r = this.z - e.z;
return t * t + i * i + r * r;
}
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, i) {
const r = Math.sin(t) * e;
return this.x = r * Math.sin(i), this.y = Math.cos(t) * e, this.z = r * Math.cos(i), this;
}
setFromCylindrical(e) {
return this.setFromCylindricalCoords(e.radius, e.theta, e.y);
}
setFromCylindricalCoords(e, t, i) {
return this.x = e * Math.sin(t), this.y = i, 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(), i = this.setFromMatrixColumn(e, 1).length(), r = this.setFromMatrixColumn(e, 2).length();
return this.x = t, this.y = i, this.z = r, 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, i) {
return i !== 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;
}
}
X.prototype.isVector3 = !0;
const oh = /* @__PURE__ */ new X(), pg = /* @__PURE__ */ new Sn();
class Hn {
constructor(e = new X(1 / 0, 1 / 0, 1 / 0), t = new X(-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, i = 1 / 0, r = 1 / 0, s = -1 / 0, o = -1 / 0, a = -1 / 0;
for (let c = 0, l = e.length; c < l; c += 3) {
const d = e[c], h = e[c + 1], p = e[c + 2];
d < t && (t = d), h < i && (i = h), p < r && (r = p), d > s && (s = d), h > o && (o = h), p > a && (a = p);
}
return this.min.set(t, i, r), this.max.set(s, o, a), this;
}
setFromBufferAttribute(e) {
let t = 1 / 0, i = 1 / 0, r = 1 / 0, s = -1 / 0, o = -1 / 0, a = -1 / 0;
for (let c = 0, l = e.count; c < l; c++) {
const d = e.getX(c), h = e.getY(c), p = e.getZ(c);
d < t && (t = d), h < i && (i = h), p < r && (r = p), d > s && (s = d), h > o && (o = h), p > a && (a = p);
}
return this.min.set(t, i, r), this.max.set(s, o, a), this;
}
setFromPoints(e) {
this.makeEmpty();
for (let t = 0, i = e.length; t < i; t++)
this.expandByPoint(e[t]);
return this;
}
setFromCenterAndSize(e, t) {
const i = ba.copy(t).multiplyScalar(0.5);
return this.min.copy(e).sub(i), this.max.copy(e).add(i), 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(), ah.copy(t.boundingBox), ah.applyMatrix4(e.matrixWorld), this.union(ah));
const i = e.children;
for (let r = 0, s = i.length; r < s; r++)
this.expandByObject(i[r]);
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, ba), ba.distanceToSquared(e.center) <= e.radius * e.radius;
}
intersectsPlane(e) {
let t, i;
return e.normal.x > 0 ? (t = e.normal.x * this.min.x, i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x, i = e.normal.x * this.min.x), e.normal.y > 0 ? (t += e.normal.y * this.min.y, i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y, i += e.normal.y * this.min.y), e.normal.z > 0 ? (t += e.normal.z * this.min.z, i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z, i += e.normal.z * this.min.z), t <= -e.constant && i >= -e.constant;
}
intersectsTriangle(e) {
if (this.isEmpty())
return !1;
this.getCenter(xa), Wl.subVectors(this.max, xa), Ks.subVectors(e.a, xa), Qs.subVectors(e.b, xa), eo.subVectors(e.c, xa), Sr.subVectors(Qs, Ks), _r.subVectors(eo, Qs), cs.subVectors(Ks, eo);
let t = [
0,
-Sr.z,
Sr.y,
0,
-_r.z,
_r.y,
0,
-cs.z,
cs.y,
Sr.z,
0,
-Sr.x,
_r.z,
0,
-_r.x,
cs.z,
0,
-cs.x,
-Sr.y,
Sr.x,
0,
-_r.y,
_r.x,
0,
-cs.y,
cs.x,
0
];
return !lh(t, Ks, Qs, eo, Wl) || (t = [1, 0, 0, 0, 1, 0, 0, 0, 1], !lh(t, Ks, Qs, eo, Wl)) ? !1 : (jl.crossVectors(Sr, _r), t = [jl.x, jl.y, jl.z], lh(t, Ks, Qs, eo, Wl));
}
clampPoint(e, t) {
return t.copy(e).clamp(this.min, this.max);
}
distanceToPoint(e) {
return ba.copy(e).clamp(this.min, this.max).sub(e).length();
}
getBoundingSphere(e) {
return this.getCenter(e.center), e.radius = this.getSize(ba).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 : ($i[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), $i[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), $i[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), $i[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), $i[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), $i[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), $i[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), $i[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints($i), 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);
}
}
Hn.prototype.isBox3 = !0;
const $i = [
/* @__PURE__ */ new X(),
/* @__PURE__ */ new X(),
/* @__PURE__ */ new X(),
/* @__PURE__ */ new X(),
/* @__PURE__ */ new X(),
/* @__PURE__ */ new X(),
/* @__PURE__ */ new X(),
/* @__PURE__ */ new X()
], ba = /* @__PURE__ */ new X(), ah = /* @__PURE__ */ new Hn(), Ks = /* @__PURE__ */ new X(), Qs = /* @__PURE__ */ new X(), eo = /* @__PURE__ */ new X(), Sr = /* @__PURE__ */ new X(), _r = /* @__PURE__ */ new X(), cs = /* @__PURE__ */ new X(), xa = /* @__PURE__ */ new X(), Wl = /* @__PURE__ */ new X(), jl = /* @__PURE__ */ new X(), us = /* @__PURE__ */ new X();
function lh(n, e, t, i, r) {
for (let s = 0, o = n.length - 3; s <= o; s += 3) {
us.fromArray(n, s);
const a = r.x * Math.abs(us.x) + r.y * Math.abs(us.y) + r.z * Math.abs(us.z), c = e.dot(us), l = t.dot(us), d = i.dot(us);
if (Math.max(-Math.max(c, l, d), Math.min(c, l, d)) > a)
return !1;
}
return !0;
}
const gI = /* @__PURE__ */ new Hn(), mg = /* @__PURE__ */ new X(), ch = /* @__PURE__ */ new X(), uh = /* @__PURE__ */ new X();
class xr {
constructor(e = new X(), t = -1) {
this.center = e, this.radius = t;
}
set(e, t) {
return this.center.copy(e), this.radius = t, this;
}
setFromPoints(e, t) {
const i = this.center;
t !== void 0 ? i.copy(t) : gI.setFromPoints(e).getCenter(i);
let r = 0;
for (let s = 0, o = e.length; s < o; s++)
r = Math.max(r, i.distanceToSquared(e[s]));
return this.radius = Math.sqrt(r), 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 i = this.center.distanceToSquared(e);
return t.copy(e), i > 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) {
uh.subVectors(e, this.center);
const t = uh.lengthSq();
if (t > this.radius * this.radius) {
const i = Math.sqrt(t), r = (i - this.radius) * 0.5;
this.center.add(uh.multiplyScalar(r / i)), this.radius += r;
}
return this;
}
union(e) {
return ch.subVectors(e.center, this.center).normalize().multiplyScalar(e.radius), this.expandByPoint(mg.copy(e.center).add(ch)), this.expandByPoint(mg.copy(e.center).sub(ch)), this;
}
equals(e) {
return e.center.equals(this.center) && e.radius === this.radius;
}
clone() {
return new this.constructor().copy(this);
}
}
const Zi = /* @__PURE__ */ new X(), hh = /* @__PURE__ */ new X(), $l = /* @__PURE__ */ new X(), Tr = /* @__PURE__ */ new X(), dh = /* @__PURE__ */ new X(), Zl = /* @__PURE__ */ new X(), fh = /* @__PURE__ */ new X();
class is {
constructor(e = new X(), t = new X(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, Zi)), this;
}
closestPointToPoint(e, t) {
t.subVectors(e, this.origin);
const i = t.dot(this.direction);
return i < 0 ? t.copy(this.origin) : t.copy(this.direction).multiplyScalar(i).add(this.origin);
}
distanceToPoint(e) {
return Math.sqrt(this.distanceSqToPoint(e));
}
distanceSqToPoint(e) {
const t = Zi.subVectors(e, this.origin).dot(this.direction);
return t < 0 ? this.origin.distanceToSquared(e) : (Zi.copy(this.direction).multiplyScalar(t).add(this.origin), Zi.distanceToSquared(e));
}
distanceSqToSegment(e, t, i, r) {
hh.copy(e).add(t).multiplyScalar(0.5), $l.copy(t).sub(e).normalize(), Tr.copy(this.origin).sub(hh);
const s = e.distanceTo(t) * 0.5, o = -this.direction.dot($l), a = Tr.dot(this.direction), c = -Tr.dot($l), l = Tr.lengthSq(), d = Math.abs(1 - o * o);
let h, p, g, f;
if (d > 0)
if (h = o * c - a, p = o * a - c, f = s * d, h >= 0)
if (p >= -f)
if (p <= f) {
const u = 1 / d;
h *= u, p *= u, g = h * (h + o * p + 2 * a) + p * (o * h + p + 2 * c) + l;
} else
p = s, h = Math.max(0, -(o * p + a)), g = -h * h + p * (p + 2 * c) + l;
else
p = -s, h = Math.max(0, -(o * p + a)), g = -h * h + p * (p + 2 * c) + l;
else
p <= -f ? (h = Math.max(0, -(-o * s + a)), p = h > 0 ? -s : Math.min(Math.max(-s, -c), s), g = -h * h + p * (p + 2 * c) + l) : p <= f ? (h = 0, p = Math.min(Math.max(-s, -c), s), g = p * (p + 2 * c) + l) : (h = Math.max(0, -(o * s + a)), p = h > 0 ? s : Math.min(Math.max(-s, -c), s), g = -h * h + p * (p + 2 * c) + l);
else
p = o > 0 ? -s : s, h = Math.max(0, -(o * p + a)), g = -h * h + p * (p + 2 * c) + l;
return i && i.copy(this.direction).multiplyScalar(h).add(this.origin), r && r.copy($l).multiplyScalar(p).add(hh), g;
}
intersectSphere(e, t) {
Zi.subVectors(e.center, this.origin);
const i = Zi.dot(this.direction), r = Zi.dot(Zi) - i * i, s = e.radius * e.radius;
if (r > s) return null;
const o = Math.sqrt(s - r), a = i - o, c = i + o;
return a < 0 && c < 0 ? null : a < 0 ? this.at(c, t) : this.at(a, 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 i = -(this.origin.dot(e.normal) + e.constant) / t;
return i >= 0 ? i : null;
}
intersectPlane(e, t) {
const i = this.distanceToPlane(e);
return i === null ? null : this.at(i, t);
}
intersectsPlane(e) {
const t = e.distanceToPoint(this.origin);
return t === 0 || e.normal.dot(this.direction) * t < 0;
}
intersectBox(e, t) {
let i, r, s, o, a, c;
const l = 1 / this.direction.x, d = 1 / this.direction.y, h = 1 / this.direction.z, p = this.origin;
return l >= 0 ? (i = (e.min.x - p.x) * l, r = (e.max.x - p.x) * l) : (i = (e.max.x - p.x) * l, r = (e.min.x - p.x) * l), d >= 0 ? (s = (e.min.y - p.y) * d, o = (e.max.y - p.y) * d) : (s = (e.max.y - p.y) * d, o = (e.min.y - p.y) * d), i > o || s > r || ((s > i || i !== i) && (i = s), (o < r || r !== r) && (r = o), h >= 0 ? (a = (e.min.z - p.z) * h, c = (e.max.z - p.z) * h) : (a = (e.max.z - p.z) * h, c = (e.min.z - p.z) * h), i > c || a > r) || ((a > i || i !== i) && (i = a), (c < r || r !== r) && (r = c), r < 0) ? null : this.at(i >= 0 ? i : r, t);
}
intersectsBox(e) {
return this.intersectBox(e, Zi) !== null;
}
intersectTriangle(e, t, i, r, s) {
dh.subVectors(t, e), Zl.subVectors(i, e), fh.crossVectors(dh, Zl);
let o = this.direction.dot(fh), a;
if (o > 0) {
if (r) return null;
a = 1;
} else if (o < 0)
a = -1, o = -o;
else
return null;
Tr.subVectors(this.origin, e);
const c = a * this.direction.dot(Zl.crossVectors(Tr, Zl));
if (c < 0)
return null;
const l = a * this.direction.dot(dh.cross(Tr));
if (l < 0 || c + l > o)
return null;
const d = -a * Tr.dot(fh);
return d < 0 ? null : this.at(d / o, s);
}
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, i, r, s, o, a, c, l, d, h, p, g, f, u, y) {
const v = this.elements;
return v[0] = e, v[4] = t, v[8] = i, v[12] = r, v[1] = s, v[5] = o, v[9] = a, v[13] = c, v[2] = l, v[6] = d, v[10] = h, v[14] = p, v[3] = g, v[7] = f, v[11] = u, v[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, i = e.elements;
return t[0] = i[0], t[1] = i[1], t[2] = i[2], t[3] = i[3], t[4] = i[4], t[5] = i[5], t[6] = i[6], t[7] = i[7], t[8] = i[8], t[9] = i[9], t[10] = i[10], t[11] = i[11], t[12] = i[12], t[13] = i[13], t[14] = i[14], t[15] = i[15], this;
}
copyPosition(e) {
const t = this.elements, i = e.elements;
return t[12] = i[12], t[13] = i[13], t[14] = i[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, i) {
return e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), i.setFromMatrixColumn(this, 2), this;
}
makeBasis(e, t, i) {
return this.set(
e.x,
t.x,
i.x,
0,
e.y,
t.y,
i.y,
0,
e.z,
t.z,
i.z,
0,
0,
0,
0,
1
), this;
}
extractRotation(e) {
const t = this.elements, i = e.elements, r = 1 / to.setFromMatrixColumn(e, 0).length(), s = 1 / to.setFromMatrixColumn(e, 1).length(), o = 1 / to.setFromMatrixColumn(e, 2).length();
return t[0] = i[0] * r, t[1] = i[1] * r, t[2] = i[2] * r, t[3] = 0, t[4] = i[4] * s, t[5] = i[5] * s, t[6] = i[6] * s, t[7] = 0, t[8] = i[8] * o, t[9] = i[9] * o, t[10] = i[10] * o, 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, i = e.x, r = e.y, s = e.z, o = Math.cos(i), a = Math.sin(i), c = Math.cos(r), l = Math.sin(r), d = Math.cos(s), h = Math.sin(s);
if (e.order === "XYZ") {
const p = o * d, g = o * h, f = a * d, u = a * h;
t[0] = c * d, t[4] = -c * h, t[8] = l, t[1] = g + f * l, t[5] = p - u * l, t[9] = -a * c, t[2] = u - p * l, t[6] = f + g * l, t[10] = o * c;
} else if (e.order === "YXZ") {
const p = c * d, g = c * h, f = l * d, u = l * h;
t[0] = p + u * a, t[4] = f * a - g, t[8] = o * l, t[1] = o * h, t[5] = o * d, t[9] = -a, t[2] = g * a - f, t[6] = u + p * a, t[10] = o * c;
} else if (e.order === "ZXY") {
const p = c * d, g = c * h, f = l * d, u = l * h;
t[0] = p - u * a, t[4] = -o * h, t[8] = f + g * a, t[1] = g + f * a, t[5] = o * d, t[9] = u - p * a, t[2] = -o * l, t[6] = a, t[10] = o * c;
} else if (e.order === "ZYX") {
const p = o * d, g = o * h, f = a * d, u = a * h;
t[0] = c * d, t[4] = f * l - g, t[8] = p * l + u, t[1] = c * h, t[5] = u * l + p, t[9] = g * l - f, t[2] = -l, t[6] = a * c, t[10] = o * c;
} else if (e.order === "YZX") {
const p = o * c, g = o * l, f = a * c, u = a * l;
t[0] = c * d, t[4] = u - p * h, t[8] = f * h + g, t[1] = h, t[5] = o * d, t[9] = -a * d, t[2] = -l * d, t[6] = g * h + f, t[10] = p - u * h;
} else if (e.order === "XZY") {
const p = o * c, g = o * l, f = a * c, u = a * l;
t[0] = c * d, t[4] = -h, t[8] = l * d, t[1] = p * h + u, t[5] = o * d, t[9] = g * h - f, t[2] = f * h - g, t[6] = a * d, t[10] = u * h + 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(vI, e, yI);
}
lookAt(e, t, i) {
const r = this.elements;
return Wn.subVectors(e, t), Wn.lengthSq() === 0 && (Wn.z = 1), Wn.normalize(), Er.crossVectors(i, Wn), Er.lengthSq() === 0 && (Math.abs(i.z) === 1 ? Wn.x += 1e-4 : Wn.z += 1e-4, Wn.normalize(), Er.crossVectors(i, Wn)), Er.normalize(), Xl.crossVectors(Wn, Er), r[0] = Er.x, r[4] = Xl.x, r[8] = Wn.x, r[1] = Er.y, r[5] = Xl.y, r[9] = Wn.y, r[2] = Er.z, r[6] = Xl.z, r[10] = Wn.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 i = e.elements, r = t.elements, s = this.elements, o = i[0], a = i[4], c = i[8], l = i[12], d = i[1], h = i[5], p = i[9], g = i[13], f = i[2], u = i[6], y = i[10], v = i[14], m = i[3], w = i[7], S = i[11], T = i[15], M = r[0], x = r[4], _ = r[8], E = r[12], L = r[1], R = r[5], C = r[9], A = r[13], P = r[2], I = r[6], b = r[10], O = r[14], N = r[3], D = r[7], B = r[11], U = r[15];
return s[0] = o * M + a * L + c * P + l * N, s[4] = o * x + a * R + c * I + l * D, s[8] = o * _ + a * C + c * b + l * B, s[12] = o * E + a * A + c * O + l * U, s[1] = d * M + h * L + p * P + g * N, s[5] = d * x + h * R + p * I + g * D, s[9] = d * _ + h * C + p * b + g * B, s[13] = d * E + h * A + p * O + g * U, s[2] = f * M + u * L + y * P + v * N, s[6] = f * x + u * R + y * I + v * D, s[10] = f * _ + u * C + y * b + v * B, s[14] = f * E + u * A + y * O + v * U, s[3] = m * M + w * L + S * P + T * N, s[7] = m * x + w * R + S * I + T * D, s[11] = m * _ + w * C + S * b + T * B, s[15] = m * E + w * A + S * O + T * U, 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], i = e[4], r = e[8], s = e[12], o = e[1], a = e[5], c = e[9], l = e[13], d = e[2], h = e[6], p = e[10], g = e[14], f = e[3], u = e[7], y = e[11], v = e[15];
return f * (+s * c * h - r * l * h - s * a * p + i * l * p + r * a * g - i * c * g) + u * (+t * c * g - t * l * p + s * o * p - r * o * g + r * l * d - s * c * d) + y * (+t * l * h - t * a * g - s * o * h + i * o * g + s * a * d - i * l * d) + v * (-r * a * d - t * c * h + t * a * p + r * o * h - i * o * p + i * c * d);
}
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, i) {
const r = this.elements;
return e.isVector3 ? (r[12] = e.x, r[13] = e.y, r[14] = e.z) : (r[12] = e, r[13] = t, r[14] = i), this;
}
invert() {
const e = this.elements, t = e[0], i = e[1], r = e[2], s = e[3], o = e[4], a = e[5], c = e[6], l = e[7], d = e[8], h = e[9], p = e[10], g = e[11], f = e[12], u = e[13], y = e[14], v = e[15], m = h * y * l - u * p * l + u * c * g - a * y * g - h * c * v + a * p * v, w = f * p * l - d * y * l - f * c * g + o * y * g + d * c * v - o * p * v, S = d * u * l - f * h * l + f * a * g - o * u * g - d * a * v + o * h * v, T = f * h * c - d * u * c - f * a * p + o * u * p + d * a * y - o * h * y, M = t * m + i * w + r * S + s * T;
if (M === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
const x = 1 / M;
return e[0] = m * x, e[1] = (u * p * s - h * y * s - u * r * g + i * y * g + h * r * v - i * p * v) * x, e[2] = (a * y * s - u * c * s + u * r * l - i * y * l - a * r * v + i * c * v) * x, e[3] = (h * c * s - a * p * s - h * r * l + i * p * l + a * r * g - i * c * g) * x, e[4] = w * x, e[5] = (d * y * s - f * p * s + f * r * g - t * y * g - d * r * v + t * p * v) * x, e[6] = (f * c * s - o * y * s - f * r * l + t * y * l + o * r * v - t * c * v) * x, e[7] = (o * p * s - d * c * s + d * r * l - t * p * l - o * r * g + t * c * g) * x, e[8] = S * x, e[9] = (f * h * s - d * u * s - f * i * g + t * u * g + d * i * v - t * h * v) * x, e[10] = (o * u * s - f * a * s + f * i * l - t * u * l - o * i * v + t * a * v) * x, e[11] = (d * a * s - o * h * s - d * i * l + t * h * l + o * i * g - t * a * g) * x, e[12] = T * x, e[13] = (d * u * r - f * h * r + f * i * p - t * u * p - d * i * y + t * h * y) * x, e[14] = (f * a * r - o * u * r - f * i * c + t * u * c + o * i * y - t * a * y) * x, e[15] = (o * h * r - d * a * r + d * i * c - t * h * c - o * i * p + t * a * p) * x, this;
}
scale(e) {
const t = this.elements, i = e.x, r = e.y, s = e.z;
return t[0] *= i, t[4] *= r, t[8] *= s, t[1] *= i, t[5] *= r, t[9] *= s, t[2] *= i, t[6] *= r, t[10] *= s, t[3] *= i, t[7] *= r, t[11] *= s, this;
}
getMaxScaleOnAxis() {
const e = this.elements, t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2], i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6], r = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
return Math.sqrt(Math.max(t, i, r));
}
makeTranslation(e, t, i) {
return this.set(
1,
0,
0,
e,
0,
1,
0,
t,
0,
0,
1,
i,
0,
0,
0,
1
), this;
}
makeRotationX(e) {
const t = Math.cos(e), i = Math.sin(e);
return this.set(
1,
0,
0,
0,
0,
t,
-i,
0,
0,
i,
t,
0,
0,
0,
0,
1
), this;
}
makeRotationY(e) {
const t = Math.cos(e), i = Math.sin(e);
return this.set(
t,
0,
i,
0,
0,
1,
0,
0,
-i,
0,
t,
0,
0,
0,
0,
1
), this;
}
makeRotationZ(e) {
const t = Math.cos(e), i = Math.sin(e);
return this.set(
t,
-i,
0,
0,
i,
t,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
), this;
}
makeRotationAxis(e, t) {
const i = Math.cos(t), r = Math.sin(t), s = 1 - i, o = e.x, a = e.y, c = e.z, l = s * o, d = s * a;
return this.set(
l * o + i,
l * a - r * c,
l * c + r * a,
0,
l * a + r * c,
d * a + i,
d * c - r * o,
0,
l * c - r * a,
d * c + r * o,
s * c * c + i,
0,
0,
0,
0,
1
), this;
}
makeScale(e, t, i) {
return this.set(
e,
0,
0,
0,
0,
t,
0,
0,
0,
0,
i,
0,
0,
0,
0,
1
), this;
}
makeShear(e, t, i, r, s, o) {
return this.set(
1,
i,
s,
0,
e,
1,
o,
0,
t,
r,
1,
0,
0,
0,
0,
1
), this;
}
compose(e, t, i) {
const r = this.elements, s = t._x, o = t._y, a = t._z, c = t._w, l = s + s, d = o + o, h = a + a, p = s * l, g = s * d, f = s * h, u = o * d, y = o * h, v = a * h, m = c * l, w = c * d, S = c * h, T = i.x, M = i.y, x = i.z;
return r[0] = (1 - (u + v)) * T, r[1] = (g + S) * T, r[2] = (f - w) * T, r[3] = 0, r[4] = (g - S) * M, r[5] = (1 - (p + v)) * M, r[6] = (y + m) * M, r[7] = 0, r[8] = (f + w) * x, r[9] = (y - m) * x, r[10] = (1 - (p + u)) * x, r[11] = 0, r[12] = e.x, r[13] = e.y, r[14] = e.z, r[15] = 1, this;
}
decompose(e, t, i) {
const r = this.elements;
let s = to.set(r[0], r[1], r[2]).length();
const o = to.set(r[4], r[5], r[6]).length(), a = to.set(r[8], r[9], r[10]).length();
this.determinant() < 0 && (s = -s), e.x = r[12], e.y = r[13], e.z = r[14], hi.copy(this);
const l = 1 / s, d = 1 / o, h = 1 / a;
return hi.elements[0] *= l, hi.elements[1] *= l, hi.elements[2] *= l, hi.elements[4] *= d, hi.elements[5] *= d, hi.elements[6] *= d, hi.elements[8] *= h, hi.elements[9] *= h, hi.elements[10] *= h, t.setFromRotationMatrix(hi), i.x = s, i.y = o, i.z = a, this;
}
makePerspective(e, t, i, r, s, o) {
o === void 0 && console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");
const a = this.elements, c = 2 * s / (t - e), l = 2 * s / (i - r), d = (t + e) / (t - e), h = (i + r) / (i - r), p = -(o + s) / (o - s), g = -2 * o * s / (o - s);
return a[0] = c, a[4] = 0, a[8] = d, a[12] = 0, a[1] = 0, a[5] = l, a[9] = h, a[13] = 0, a[2] = 0, a[6] = 0, a[10] = p, a[14] = g, a[3] = 0, a[7] = 0, a[11] = -1, a[15] = 0, this;
}
makeOrthographic(e, t, i, r, s, o) {
const a = this.elements, c = 1 / (t - e), l = 1 / (i - r), d = 1 / (o - s), h = (t + e) * c, p = (i + r) * l, g = (o + s) * d;
return a[0] = 2 * c, a[4] = 0, a[8] = 0, a[12] = -h, a[1] = 0, a[5] = 2 * l, a[9] = 0, a[13] = -p, a[2] = 0, a[6] = 0, a[10] = -2 * d, a[14] = -g, a[3] = 0, a[7] = 0, a[11] = 0, a[15] = 1, this;
}
equals(e) {
const t = this.elements, i = e.elements;
for (let r = 0; r < 16; r++)
if (t[r] !== i[r]) return !1;
return !0;
}
fromArray(e, t = 0) {
for (let i = 0; i < 16; i++)
this.elements[i] = e[i + t];
return this;
}
toArray(e = [], t = 0) {
const i = this.elements;
return e[t] = i[0], e[t + 1] = i[1], e[t + 2] = i[2], e[t + 3] = i[3], e[t + 4] = i[4], e[t + 5] = i[5], e[t + 6] = i[6], e[t + 7] = i[7], e[t + 8] = i[8], e[t + 9] = i[9], e[t + 10] = i[10], e[t + 11] = i[11], e[t + 12] = i[12], e[t + 13] = i[13], e[t + 14] = i[14], e[t + 15] = i[15], e;
}
}
$e.prototype.isMatrix4 = !0;
const to = /* @__PURE__ */ new X(), hi = /* @__PURE__ */ new $e(), vI = /* @__PURE__ */ new X(0, 0, 0), yI = /* @__PURE__ */ new X(1, 1, 1), Er = /* @__PURE__ */ new X(), Xl = /* @__PURE__ */ new X(), Wn = /* @__PURE__ */ new X(), gg = /* @__PURE__ */ new $e(), vg = /* @__PURE__ */ new Sn();
class Ws {
constructor(e = 0, t = 0, i = 0, r = Ws.DefaultOrder) {
this._x = e, this._y = t, this._z = i, this._order = r;
}
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, i, r = this._order) {
return this._x = e, this._y = t, this._z = i, this._order = r, 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, i = !0) {
const r = e.elements, s = r[0], o = r[4], a = r[8], c = r[1], l = r[5], d = r[9], h = r[2], p = r[6], g = r[10];
switch (t) {
case "XYZ":
this._y = Math.asin(wn(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(-d, g), this._z = Math.atan2(-o, s)) : (this._x = Math.atan2(p, l), this._z = 0);
break;
case "YXZ":
this._x = Math.asin(-wn(d, -1, 1)), Math.abs(d) < 0.9999999 ? (this._y = Math.atan2(a, g), this._z = Math.atan2(c, l)) : (this._y = Math.atan2(-h, s), this._z = 0);
break;
case "ZXY":
this._x = Math.asin(wn(p, -1, 1)), Math.abs(p) < 0.9999999 ? (this._y = Math.atan2(-h, g), this._z = Math.atan2(-o, l)) : (this._y = 0, this._z = Math.atan2(c, s));
break;
case "ZYX":
this._y = Math.asin(-wn(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._x = Math.atan2(p, g), this._z = Math.atan2(c, s)) : (this._x = 0, this._z = Math.atan2(-o, l));
break;
case "YZX":
this._z = Math.asin(wn(c, -1, 1)), Math.abs(c) < 0.9999999 ? (this._x = Math.atan2(-d, l), this._y = Math.atan2(-h, s)) : (this._x = 0, this._y = Math.atan2(a, g));
break;
case "XZY":
this._z = Math.asin(-wn(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._x = Math.atan2(p, l), this._y = Math.atan2(a, s)) : (this._x = Math.atan2(-d, g), this._y = 0);
break;
default:
console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + t);
}
return this._order = t, i === !0 && this._onChangeCallback(), this;
}
setFromQuaternion(e, t, i) {
return gg.makeRotationFromQuaternion(e), this.setFromRotationMatrix(gg, t, i);
}
setFromVector3(e, t = this._order) {
return this.set(e.x, e.y, e.z, t);
}
reorder(e) {
return vg.setFromEuler(this), this.setFromQuaternion(vg, 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 X(this._x, this._y, this._z);
}
_onChange(e) {
return this._onChangeCallback = e, this;
}
_onChangeCallback() {
}
}
Ws.prototype.isEuler = !0;
Ws.DefaultOrder = "XYZ";
Ws.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"];
class qf {
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 bI = 0;
const yg = /* @__PURE__ */ new X(), no = /* @__PURE__ */ new Sn(), Xi = /* @__PURE__ */ new $e(), Yl = /* @__PURE__ */ new X(), wa = /* @__PURE__ */ new X(), xI = /* @__PURE__ */ new X(), wI = /* @__PURE__ */ new Sn(), bg = /* @__PURE__ */ new X(1, 0, 0), xg = /* @__PURE__ */ new X(0, 1, 0), wg = /* @__PURE__ */ new X(0, 0, 1), MI = { type: "added" }, Mg = { type: "removed" };
class ot extends ns {
constructor() {
super(), Object.defineProperty(this, "id", { value: bI++ }), this.uuid = Jn(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = ot.DefaultUp.clone();
const e = new X(), t = new Ws(), i = new Sn(), r = new X(1, 1, 1);
function s() {
i.setFromEuler(t, !1);
}
function o() {
t.setFromQuaternion(i, void 0, !1);
}
t._onChange(s), i._onChange(o), Object.defineProperties(this, {
position: {
configurable: !0,
enumerable: !0,
value: e
},
rotation: {
configurable: !0,
enumerable: !0,
value: t
},
quaternion: {
configurable: !0,
enumerable: !0,
value: i
},
scale: {
configurable: !0,
enumerable: !0,
value: r
},
modelViewMatrix: {
value: new $e()
},
normalMatrix: {
value: new ln()
}
}), this.matrix = new $e(), this.matrixWorld = new $e(), this.matrixAutoUpdate = ot.DefaultMatrixAutoUpdate, this.matrixWorldNeedsUpdate = !1, this.layers = new qf(), 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 no.setFromAxisAngle(e, t), this.quaternion.multiply(no), this;
}
rotateOnWorldAxis(e, t) {
return no.setFromAxisAngle(e, t), this.quaternion.premultiply(no), this;
}
rotateX(e) {
return this.rotateOnAxis(bg, e);
}
rotateY(e) {
return this.rotateOnAxis(xg, e);
}
rotateZ(e) {
return this.rotateOnAxis(wg, e);
}
translateOnAxis(e, t) {
return yg.copy(e).applyQuaternion(this.quaternion), this.position.add(yg.multiplyScalar(t)), this;
}
translateX(e) {
return this.translateOnAxis(bg, e);
}
translateY(e) {
return this.translateOnAxis(xg, e);
}
translateZ(e) {
return this.translateOnAxis(wg, e);
}
localToWorld(e) {
return e.applyMatrix4(this.matrixWorld);
}
worldToLocal(e) {
return e.applyMatrix4(Xi.copy(this.matrixWorld).invert());
}
lookAt(e, t, i) {
e.isVector3 ? Yl.copy(e) : Yl.set(e, t, i);
const r = this.parent;
this.updateWorldMatrix(!0, !1), wa.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Xi.lookAt(wa, Yl, this.up) : Xi.lookAt(Yl, wa, this.up), this.quaternion.setFromRotationMatrix(Xi), r && (Xi.extractRotation(r.matrixWorld), no.setFromRotationMatrix(Xi), this.quaternion.premultiply(no.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(MI)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e), this);
}
remove(e) {
if (arguments.length > 1) {
for (let i = 0; i < arguments.length; i++)
this.remove(arguments[i]);
return this;
}
const t = this.children.indexOf(e);
return t !== -1 && (e.parent = null, this.children.splice(t, 1), e.dispatchEvent(Mg)), 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(Mg);
}
return this.children.length = 0, this;
}
attach(e) {
return this.updateWorldMatrix(!0, !1), Xi.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), Xi.multiply(e.parent.matrixWorld)), e.applyMatrix4(Xi), 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 i = 0, r = this.children.length; i < r; i++) {
const o = this.children[i].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(wa, e, xI), e;
}
getWorldScale(e) {
return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(wa, wI, 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 i = 0, r = t.length; i < r; i++)
t[i].traverse(e);
}
traverseVisible(e) {
if (this.visible === !1) return;
e(this);
const t = this.children;
for (let i = 0, r = t.length; i < r; i++)
t[i].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 i = 0, r = t.length; i < r; i++)
t[i].updateMatrixWorld(e);
}
updateWorldMatrix(e, t) {
const i = this.parent;
if (e === !0 && i !== null && i.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 r = this.children;
for (let s = 0, o = r.length; s < o; s++)
r[s].updateWorldMatrix(!1, !0);
}
}
toJSON(e) {
const t = e === void 0 || typeof e == "string", i = {};
t && (e = {
geometries: {},
materials: {},
textures: {},
images: {},
shapes: {},
skeletons: {},
animations: {}
}, i.metadata = {
version: 4.5,
type: "Object",
generator: "Object3D.toJSON"
});
const r = {};
r.uuid = this.uuid, r.type = this.type, this.name !== "" && (r.name = this.name), this.castShadow === !0 && (r.castShadow = !0), this.receiveShadow === !0 && (r.receiveShadow = !0), this.visible === !1 && (r.visible = !1), this.frustumCulled === !1 && (r.frustumCulled = !1), this.renderOrder !== 0 && (r.renderOrder = this.renderOrder), JSON.stringify(this.userData) !== "{}" && (r.userData = this.userData), r.layers = this.layers.mask, r.matrix = this.matrix.toArray(), this.matrixAutoUpdate === !1 && (r.matrixAutoUpdate = !1), this.isInstancedMesh && (r.type = "InstancedMesh", r.count = this.count, r.instanceMatrix = this.instanceMatrix.toJSON(), this.instanceColor !== null && (r.instanceColor = this.instanceColor.toJSON()));
function s(a, c) {
return a[c.uuid] === void 0 && (a[c.uuid] = c.toJSON(e)), c.uuid;
}
if (this.isScene)
this.background && (this.background.isColor ? r.background = this.background.toJSON() : this.background.isTexture && (r.background = this.background.toJSON(e).uuid)), this.environment && this.environment.isTexture && (r.environment = this.environment.toJSON(e).uuid);
else if (this.isMesh || this.isLine || this.isPoints) {
r.geometry = s(e.geometries, this.geometry);
const a = this.geometry.parameters;
if (a !== void 0 && a.shapes !== void 0) {
const c = a.shapes;
if (Array.isArray(c))
for (let l = 0, d = c.length; l < d; l++) {
const h = c[l];
s(e.shapes, h);
}
else
s(e.shapes, c);
}
}
if (this.isSkinnedMesh && (r.bindMode = this.bindMode, r.bindMatrix = this.bindMatrix.toArray(), this.skeleton !== void 0 && (s(e.skeletons, this.skeleton), r.skeleton = this.skeleton.uuid)), this.material !== void 0)
if (Array.isArray(this.material)) {
const a = [];
for (let c = 0, l = this.material.length; c < l; c++)
a.push(s(e.materials, this.material[c]));
r.material = a;
} else
r.material = s(e.materials, this.material);
if (this.children.length > 0) {
r.children = [];
for (let a = 0; a < this.children.length; a++)
r.children.push(this.children[a].toJSON(e).object);
}
if (this.animations.length > 0) {
r.animations = [];
for (let a = 0; a < this.animations.length; a++) {
const c = this.animations[a];
r.animations.push(s(e.animations, c));
}
}
if (t) {
const a = o(e.geometries), c = o(e.materials), l = o(e.textures), d = o(e.images), h = o(e.shapes), p = o(e.skeletons), g = o(e.animations);
a.length > 0 && (i.geometries = a), c.length > 0 && (i.materials = c), l.length > 0 && (i.textures = l), d.length > 0 && (i.images = d), h.length > 0 && (i.shapes = h), p.length > 0 && (i.skeletons = p), g.length > 0 && (i.animations = g);
}
return i.object = r, i;
function o(a) {
const c = [];
for (const l in a) {
const d = a[l];
delete d.metadata, c.push(d);
}
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 i = 0; i < e.children.length; i++) {
const r = e.children[i];
this.add(r.clone());
}
return this;
}
}
ot.DefaultUp = new X(0, 1, 0);
ot.DefaultMatrixAutoUpdate = !0;
ot.prototype.isObject3D = !0;
const di = /* @__PURE__ */ new X(), Yi = /* @__PURE__ */ new X(), ph = /* @__PURE__ */ new X(), Ji = /* @__PURE__ */ new X(), io = /* @__PURE__ */ new X(), ro = /* @__PURE__ */ new X(), Sg = /* @__PURE__ */ new X(), mh = /* @__PURE__ */ new X(), gh = /* @__PURE__ */ new X(), vh = /* @__PURE__ */ new X();
class Qt {
constructor(e = new X(), t = new X(), i = new X()) {
this.a = e, this.b = t, this.c = i;
}
static getNormal(e, t, i, r) {
r.subVectors(i, t), di.subVectors(e, t), r.cross(di);
const s = r.lengthSq();
return s > 0 ? r.multiplyScalar(1 / Math.sqrt(s)) : r.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, i, r, s) {
di.subVectors(r, t), Yi.subVectors(i, t), ph.subVectors(e, t);
const o = di.dot(di), a = di.dot(Yi), c = di.dot(ph), l = Yi.dot(Yi), d = Yi.dot(ph), h = o * l - a * a;
if (h === 0)
return s.set(-2, -1, -1);
const p = 1 / h, g = (l * c - a * d) * p, f = (o * d - a * c) * p;
return s.set(1 - g - f, f, g);
}
static containsPoint(e, t, i, r) {
return this.getBarycoord(e, t, i, r, Ji), Ji.x >= 0 && Ji.y >= 0 && Ji.x + Ji.y <= 1;
}
static getUV(e, t, i, r, s, o, a, c) {
return this.getBarycoord(e, t, i, r, Ji), c.set(0, 0), c.addScaledVector(s, Ji.x), c.addScaledVector(o, Ji.y), c.addScaledVector(a, Ji.z), c;
}
static isFrontFacing(e, t, i, r) {
return di.subVectors(i, t), Yi.subVectors(e, t), di.cross(Yi).dot(r) < 0;
}
set(e, t, i) {
return this.a.copy(e), this.b.copy(t), this.c.copy(i), this;
}
setFromPointsAndIndices(e, t, i, r) {
return this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[r]), 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 di.subVectors(this.c, this.b), Yi.subVectors(this.a, this.b), di.cross(Yi).length() * 0.5;
}
getMidpoint(e) {
return e.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);
}
getNormal(e) {
return Qt.getNormal(this.a, this.b, this.c, e);
}
getPlane(e) {
return e.setFromCoplanarPoints(this.a, this.b, this.c);
}
getBarycoord(e, t) {
return Qt.getBarycoord(e, this.a, this.b, this.c, t);
}
getUV(e, t, i, r, s) {
return Qt.getUV(e, this.a, this.b, this.c, t, i, r, s);
}
containsPoint(e) {
return Qt.containsPoint(e, this.a, this.b, this.c);
}
isFrontFacing(e) {
return Qt.isFrontFacing(this.a, this.b, this.c, e);
}
intersectsBox(e) {
return e.intersectsTriangle(this);
}
closestPointToPoint(e, t) {
const i = this.a, r = this.b, s = this.c;
let o, a;
io.subVectors(r, i), ro.subVectors(s, i), mh.subVectors(e, i);
const c = io.dot(mh), l = ro.dot(mh);
if (c <= 0 && l <= 0)
return t.copy(i);
gh.subVectors(e, r);
const d = io.dot(gh), h = ro.dot(gh);
if (d >= 0 && h <= d)
return t.copy(r);
const p = c * h - d * l;
if (p <= 0 && c >= 0 && d <= 0)
return o = c / (c - d), t.copy(i).addScaledVector(io, o);
vh.subVectors(e, s);
const g = io.dot(vh), f = ro.dot(vh);
if (f >= 0 && g <= f)
return t.copy(s);
const u = g * l - c * f;
if (u <= 0 && l >= 0 && f <= 0)
return a = l / (l - f), t.copy(i).addScaledVector(ro, a);
const y = d * f - g * h;
if (y <= 0 && h - d >= 0 && g - f >= 0)
return Sg.subVectors(s, r), a = (h - d) / (h - d + (g - f)), t.copy(r).addScaledVector(Sg, a);
const v = 1 / (y + u + p);
return o = u * v, a = p * v, t.copy(i).addScaledVector(io, o).addScaledVector(ro, a);
}
equals(e) {
return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c);
}
}
let SI = 0;
class sn extends ns {
constructor() {
super(), Object.defineProperty(this, "id", { value: SI++ }), this.uuid = Jn(), this.name = "", this.type = "Material", this.fog = !0, this.blending = _o, this.side = Xr, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.blendSrc = Gf, this.blendDst = Hf, this.blendEquation = ys, 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 = kc, this.stencilZFail = kc, this.stencilZPass = kc, 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 i = e[t];
if (i === 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 = i === kf;
continue;
}
const r = this[t];
if (r === void 0) {
console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.");
continue;
}
r && r.isColor ? r.set(i) : r && r.isVector3 && i && i.isVector3 ? r.copy(i) : this[t] = i;
}
}
toJSON(e) {
const t = e === void 0 || typeof e == "string";
t && (e = {
textures: {},
images: {}
});
const i = {
metadata: {
version: 4.5,
type: "Material",
generator: "Material.toJSON"
}
};
i.uuid = this.uuid, i.type = this.type, this.name !== "" && (i.name = this.name), this.color && this.color.isColor && (i.color = this.color.getHex()), this.roughness !== void 0 && (i.roughness = this.roughness), this.metalness !== void 0 && (i.metalness = this.metalness), this.sheen && this.sheen.isColor && (i.sheen = this.sheen.getHex()), this.emissive && this.emissive.isColor && (i.emissive = this.emissive.getHex()), this.emissiveIntensity && this.emissiveIntensity !== 1 && (i.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (i.specular = this.specular.getHex()), this.shininess !== void 0 && (i.shininess = this.shininess), this.clearcoat !== void 0 && (i.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (i.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (i.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (i.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (i.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, i.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.map && this.map.isTexture && (i.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (i.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (i.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (i.lightMap = this.lightMap.toJSON(e).uuid, i.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (i.aoMap = this.aoMap.toJSON(e).uuid, i.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (i.bumpMap = this.bumpMap.toJSON(e).uuid, i.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (i.normalMap = this.normalMap.toJSON(e).uuid, i.normalMapType = this.normalMapType, i.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (i.displacementMap = this.displacementMap.toJSON(e).uuid, i.displacementScale = this.displacementScale, i.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (i.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (i.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (i.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (i.specularMap = this.specularMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (i.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (i.combine = this.combine)), this.envMapIntensity !== void 0 && (i.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (i.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (i.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (i.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (i.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (i.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (i.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (i.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && (i.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (i.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (i.size = this.size), this.shadowSide !== null && (i.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (i.sizeAttenuation = this.sizeAttenuation), this.blending !== _o && (i.blending = this.blending), this.side !== Xr && (i.side = this.side), this.vertexColors && (i.vertexColors = !0), this.opacity < 1 && (i.opacity = this.opacity), this.transparent === !0 && (i.transparent = this.transparent), i.depthFunc = this.depthFunc, i.depthTest = this.depthTest, i.depthWrite = this.depthWrite, i.colorWrite = this.colorWrite, i.stencilWrite = this.stencilWrite, i.stencilWriteMask = this.stencilWriteMask, i.stencilFunc = this.stencilFunc, i.stencilRef = this.stencilRef, i.stencilFuncMask = this.stencilFuncMask, i.stencilFail = this.stencilFail, i.stencilZFail = this.stencilZFail, i.stencilZPass = this.stencilZPass, this.rotation && this.rotation !== 0 && (i.rotation = this.rotation), this.polygonOffset === !0 && (i.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (i.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (i.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth && this.linewidth !== 1 && (i.linewidth = this.linewidth), this.dashSize !== void 0 && (i.dashSize = this.dashSize), this.gapSize !== void 0 && (i.gapSize = this.gapSize), this.scale !== void 0 && (i.scale = this.scale), this.dithering === !0 && (i.dithering = !0), this.alphaTest > 0 && (i.alphaTest = this.alphaTest), this.alphaToCoverage === !0 && (i.alphaToCoverage = this.alphaToCoverage), this.premultipliedAlpha === !0 && (i.premultipliedAlpha = this.premultipliedAlpha), this.wireframe === !0 && (i.wireframe = this.wireframe), this.wireframeLinewidth > 1 && (i.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (i.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (i.wireframeLinejoin = this.wireframeLinejoin), this.morphTargets === !0 && (i.morphTargets = !0), this.morphNormals === !0 && (i.morphNormals = !0), this.flatShading === !0 && (i.flatShading = this.flatShading), this.visible === !1 && (i.visible = !1), this.toneMapped === !1 && (i.toneMapped = !1), JSON.stringify(this.userData) !== "{}" && (i.userData = this.userData);
function r(s) {
const o = [];
for (const a in s) {
const c = s[a];
delete c.metadata, o.push(c);
}
return o;
}
if (t) {
const s = r(e.textures), o = r(e.images);
s.length > 0 && (i.textures = s), o.length > 0 && (i.images = o);
}
return i;
}
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 i = null;
if (t !== null) {
const r = t.length;
i = new Array(r);
for (let s = 0; s !== r; ++s)
i[s] = t[s].clone();
}
return this.clippingPlanes = i, 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++;
}
}
sn.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
}, fi = { h: 0, s: 0, l: 0 }, Jl = { h: 0, s: 0, l: 0 };
function yh(n, e, t) {
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? n + (e - n) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? n + (e - n) * 6 * (2 / 3 - t) : n;
}
function bh(n) {
return n < 0.04045 ? n * 0.0773993808 : Math.pow(n * 0.9478672986 + 0.0521327014, 2.4);
}
function xh(n) {
return n < 31308e-7 ? n * 12.92 : 1.055 * Math.pow(n, 0.41666) - 0.055;
}
class Fe {
constructor(e, t, i) {
return t === void 0 && i === void 0 ? this.set(e) : this.setRGB(e, t, i);
}
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, i) {
return this.r = e, this.g = t, this.b = i, this;
}
setHSL(e, t, i) {
if (e = Yf(e, 1), t = wn(t, 0, 1), i = wn(i, 0, 1), t === 0)
this.r = this.g = this.b = i;
else {
const r = i <= 0.5 ? i * (1 + t) : i + t - i * t, s = 2 * i - r;
this.r = yh(s, r, e + 1 / 3), this.g = yh(s, r, e), this.b = yh(s, r, e - 1 / 3);
}
return this;
}
setStyle(e) {
function t(r) {
r !== void 0 && parseFloat(r) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.");
}
let i;
if (i = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)) {
let r;
const s = i[1], o = i[2];
switch (s) {
case "rgb":
case "rgba":
if (r = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
return this.r = Math.min(255, parseInt(r[1], 10)) / 255, this.g = Math.min(255, parseInt(r[2], 10)) / 255, this.b = Math.min(255, parseInt(r[3], 10)) / 255, t(r[4]), this;
if (r = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))
return this.r = Math.min(100, parseInt(r[1], 10)) / 100, this.g = Math.min(100, parseInt(r[2], 10)) / 100, this.b = Math.min(100, parseInt(r[3], 10)) / 100, t(r[4]), this;
break;
case "hsl":
case "hsla":
if (r = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)) {
const a = parseFloat(r[1]) / 360, c = parseInt(r[2], 10) / 100, l = parseInt(r[3], 10) / 100;
return t(r[4]), this.setHSL(a, c, l);
}
break;
}
} else if (i = /^\#([A-Fa-f\d]+)$/.exec(e)) {
const r = i[1], s = r.length;
if (s === 3)
return this.r = parseInt(r.charAt(0) + r.charAt(0), 16) / 255, this.g = parseInt(r.charAt(1) + r.charAt(1), 16) / 255, this.b = parseInt(r.charAt(2) + r.charAt(2), 16) / 255, this;
if (s === 6)
return this.r = parseInt(r.charAt(0) + r.charAt(1), 16) / 255, this.g = parseInt(r.charAt(2) + r.charAt(3), 16) / 255, this.b = parseInt(r.charAt(4) + r.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 i = t > 0 ? 1 / t : 1;
return this.r = Math.pow(e.r, i), this.g = Math.pow(e.g, i), this.b = Math.pow(e.b, i), this;
}
convertGammaToLinear(e) {
return this.copyGammaToLinear(this, e), this;
}
convertLinearToGamma(e) {
return this.copyLinearToGamma(this, e), this;
}
copySRGBToLinear(e) {
return this.r = bh(e.r), this.g = bh(e.g), this.b = bh(e.b), this;
}
copyLinearToSRGB(e) {
return this.r = xh(e.r), this.g = xh(e.g), this.b = xh(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, i = this.g, r = this.b, s = Math.max(t, i, r), o = Math.min(t, i, r);
let a, c;
const l = (o + s) / 2;
if (o === s)
a = 0, c = 0;
else {
const d = s - o;
switch (c = l <= 0.5 ? d / (s + o) : d / (2 - s - o), s) {
case t:
a = (i - r) / d + (i < r ? 6 : 0);
break;
case i:
a = (r - t) / d + 2;
break;
case r:
a = (t - i) / d + 4;
break;
}
a /= 6;
}
return e.h = a, 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, i) {
return this.getHSL(fi), fi.h += e, fi.s += t, fi.l += i, this.setHSL(fi.h, fi.s, fi.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, i) {
return this.r = e.r + (t.r - e.r) * i, this.g = e.g + (t.g - e.g) * i, this.b = e.b + (t.b - e.b) * i, this;
}
lerpHSL(e, t) {
this.getHSL(fi), e.getHSL(Jl);
const i = ka(fi.h, Jl.h, t), r = ka(fi.s, Jl.s, t), s = ka(fi.l, Jl.l, t);
return this.setHSL(i, r, s), 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();
}
}
Fe.NAMES = mx;
Fe.prototype.isColor = !0;
Fe.prototype.r = 1;
Fe.prototype.g = 1;
Fe.prototype.b = 1;
class Vn extends sn {
constructor(e) {
super(), this.type = "MeshBasicMaterial", this.color = new Fe(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;
}
}
Vn.prototype.isMeshBasicMaterial = !0;
const At = /* @__PURE__ */ new X(), ql = /* @__PURE__ */ new Pe();
class nt {
constructor(e, t, i) {
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 = i === !0, this.usage = zo, 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, i) {
e *= this.itemSize, i *= t.itemSize;
for (let r = 0, s = this.itemSize; r < s; r++)
this.array[e + r] = t.array[i + r];
return this;
}
copyArray(e) {
return this.array.set(e), this;
}
copyColorsArray(e) {
const t = this.array;
let i = 0;
for (let r = 0, s = e.length; r < s; r++) {
let o = e[r];
o === void 0 && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r), o = new Fe()), t[i++] = o.r, t[i++] = o.g, t[i++] = o.b;
}
return this;
}
copyVector2sArray(e) {
const t = this.array;
let i = 0;
for (let r = 0, s = e.length; r < s; r++) {
let o = e[r];
o === void 0 && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r), o = new Pe()), t[i++] = o.x, t[i++] = o.y;
}
return this;
}
copyVector3sArray(e) {
const t = this.array;
let i = 0;
for (let r = 0, s = e.length; r < s; r++) {
let o = e[r];
o === void 0 && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r), o = new X()), t[i++] = o.x, t[i++] = o.y, t[i++] = o.z;
}
return this;
}
copyVector4sArray(e) {
const t = this.array;
let i = 0;
for (let r = 0, s = e.length; r < s; r++) {
let o = e[r];
o === void 0 && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r), o = new _t()), t[i++] = o.x, t[i++] = o.y, t[i++] = o.z, t[i++] = o.w;
}
return this;
}
applyMatrix3(e) {
if (this.itemSize === 2)
for (let t = 0, i = this.count; t < i; t++)
ql.fromBufferAttribute(this, t), ql.applyMatrix3(e), this.setXY(t, ql.x, ql.y);
else if (this.itemSize === 3)
for (let t = 0, i = this.count; t < i; t++)
At.fromBufferAttribute(this, t), At.applyMatrix3(e), this.setXYZ(t, At.x, At.y, At.z);
return this;
}
applyMatrix4(e) {
for (let t = 0, i = this.count; t < i; t++)
At.x = this.getX(t), At.y = this.getY(t), At.z = this.getZ(t), At.applyMatrix4(e), this.setXYZ(t, At.x, At.y, At.z);
return this;
}
applyNormalMatrix(e) {
for (let t = 0, i = this.count; t < i; t++)
At.x = this.getX(t), At.y = this.getY(t), At.z = this.getZ(t), At.applyNormalMatrix(e), this.setXYZ(t, At.x, At.y, At.z);
return this;
}
transformDirection(e) {
for (let t = 0, i = this.count; t < i; t++)
At.x = this.getX(t), At.y = this.getY(t), At.z = this.getZ(t), At.transformDirection(e), this.setXYZ(t, At.x, At.y, At.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, i) {
return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = i, this;
}
setXYZ(e, t, i, r) {
return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = i, this.array[e + 2] = r, this;
}
setXYZW(e, t, i, r, s) {
return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = i, this.array[e + 2] = r, this.array[e + 3] = s, 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 !== zo && (e.usage = this.usage), (this.updateRange.offset !== 0 || this.updateRange.count !== -1) && (e.updateRange = this.updateRange), e;
}
}
nt.prototype.isBufferAttribute = !0;
class gx extends nt {
constructor(e, t, i) {
super(new Int8Array(e), t, i);
}
}
class vx extends nt {
constructor(e, t, i) {
super(new Uint8Array(e), t, i);
}
}
class yx extends nt {
constructor(e, t, i) {
super(new Uint8ClampedArray(e), t, i);
}
}
class bx extends nt {
constructor(e, t, i) {
super(new Int16Array(e), t, i);
}
}
class Lu extends nt {
constructor(e, t, i) {
super(new Uint16Array(e), t, i);
}
}
class xx extends nt {
constructor(e, t, i) {
super(new Int32Array(e), t, i);
}
}
class Ru extends nt {
constructor(e, t, i) {
super(new Uint32Array(e), t, i);
}
}
class wx extends nt {
constructor(e, t, i) {
super(new Uint16Array(e), t, i);
}
}
wx.prototype.isFloat16BufferAttribute = !0;
class We extends nt {
constructor(e, t, i) {
super(new Float32Array(e), t, i);
}
}
class Mx extends nt {
constructor(e, t, i) {
super(new Float64Array(e), t, i);
}
}
function Sx(n) {
if (n.length === 0) return -1 / 0;
let e = n[0];
for (let t = 1, i = n.length; t < i; ++t)
n[t] > e && (e = n[t]);
return e;
}
const _I = {
Int8Array,
Uint8Array,
Uint8ClampedArray,
Int16Array,
Uint16Array,
Int32Array,
Uint32Array,
Float32Array,
Float64Array
};
function Mo(n, e) {
return new _I[n](e);
}
let TI = 0;
const ti = /* @__PURE__ */ new $e(), wh = /* @__PURE__ */ new ot(), so = /* @__PURE__ */ new X(), jn = /* @__PURE__ */ new Hn(), Ma = /* @__PURE__ */ new Hn(), dn = /* @__PURE__ */ new X();
class Je extends ns {
constructor() {
super(), Object.defineProperty(this, "id", { value: TI++ }), this.uuid = Jn(), 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 (Sx(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, i = 0) {
this.groups.push({
start: e,
count: t,
materialIndex: i
});
}
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 i = this.attributes.normal;
if (i !== void 0) {
const s = new ln().getNormalMatrix(e);
i.applyNormalMatrix(s), i.needsUpdate = !0;
}
const r = this.attributes.tangent;
return r !== void 0 && (r.transformDirection(e), r.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this;
}
applyQuaternion(e) {
return ti.makeRotationFromQuaternion(e), this.applyMatrix4(ti), this;
}
rotateX(e) {
return ti.makeRotationX(e), this.applyMatrix4(ti), this;
}
rotateY(e) {
return ti.makeRotationY(e), this.applyMatrix4(ti), this;
}
rotateZ(e) {
return ti.makeRotationZ(e), this.applyMatrix4(ti), this;
}
translate(e, t, i) {
return ti.makeTranslation(e, t, i), this.applyMatrix4(ti), this;
}
scale(e, t, i) {
return ti.makeScale(e, t, i), this.applyMatrix4(ti), this;
}
lookAt(e) {
return wh.lookAt(e), wh.updateMatrix(), this.applyMatrix4(wh.matrix), this;
}
center() {
return this.computeBoundingBox(), this.boundingBox.getCenter(so).negate(), this.translate(so.x, so.y, so.z), this;
}
setFromPoints(e) {
const t = [];
for (let i = 0, r = e.length; i < r; i++) {
const s = e[i];
t.push(s.x, s.y, s.z || 0);
}
return this.setAttribute("position", new We(t, 3)), this;
}
computeBoundingBox() {
this.boundingBox === null && (this.boundingBox = new Hn());
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 X(-1 / 0, -1 / 0, -1 / 0),
new X(1 / 0, 1 / 0, 1 / 0)
);
return;
}
if (e !== void 0) {
if (this.boundingBox.setFromBufferAttribute(e), t)
for (let i = 0, r = t.length; i < r; i++) {
const s = t[i];
jn.setFromBufferAttribute(s), this.morphTargetsRelative ? (dn.addVectors(this.boundingBox.min, jn.min), this.boundingBox.expandByPoint(dn), dn.addVectors(this.boundingBox.max, jn.max), this.boundingBox.expandByPoint(dn)) : (this.boundingBox.expandByPoint(jn.min), this.boundingBox.expandByPoint(jn.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 xr());
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 X(), 1 / 0);
return;
}
if (e) {
const i = this.boundingSphere.center;
if (jn.setFromBufferAttribute(e), t)
for (let s = 0, o = t.length; s < o; s++) {
const a = t[s];
Ma.setFromBufferAttribute(a), this.morphTargetsRelative ? (dn.addVectors(jn.min, Ma.min), jn.expandByPoint(dn), dn.addVectors(jn.max, Ma.max), jn.expandByPoint(dn)) : (jn.expandByPoint(Ma.min), jn.expandByPoint(Ma.max));
}
jn.getCenter(i);
let r = 0;
for (let s = 0, o = e.count; s < o; s++)
dn.fromBufferAttribute(e, s), r = Math.max(r, i.distanceToSquared(dn));
if (t)
for (let s = 0, o = t.length; s < o; s++) {
const a = t[s], c = this.morphTargetsRelative;
for (let l = 0, d = a.count; l < d; l++)
dn.fromBufferAttribute(a, l), c && (so.fromBufferAttribute(e, l), dn.add(so)), r = Math.max(r, i.distanceToSquared(dn));
}
this.boundingSphere.radius = Math.sqrt(r), 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 i = e.array, r = t.position.array, s = t.normal.array, o = t.uv.array, a = r.length / 3;
t.tangent === void 0 && this.setAttribute("tangent", new nt(new Float32Array(4 * a), 4));
const c = t.tangent.array, l = [], d = [];
for (let L = 0; L < a; L++)
l[L] = new X(), d[L] = new X();
const h = new X(), p = new X(), g = new X(), f = new Pe(), u = new Pe(), y = new Pe(), v = new X(), m = new X();
function w(L, R, C) {
h.fromArray(r, L * 3), p.fromArray(r, R * 3), g.fromArray(r, C * 3), f.fromArray(o, L * 2), u.fromArray(o, R * 2), y.fromArray(o, C * 2), p.sub(h), g.sub(h), u.sub(f), y.sub(f);
const A = 1 / (u.x * y.y - y.x * u.y);
isFinite(A) && (v.copy(p).multiplyScalar(y.y).addScaledVector(g, -u.y).multiplyScalar(A), m.copy(g).multiplyScalar(u.x).addScaledVector(p, -y.x).multiplyScalar(A), l[L].add(v), l[R].add(v), l[C].add(v), d[L].add(m), d[R].add(m), d[C].add(m));
}
let S = this.groups;
S.length === 0 && (S = [{
start: 0,
count: i.length
}]);
for (let L = 0, R = S.length; L < R; ++L) {
const C = S[L], A = C.start, P = C.count;
for (let I = A, b = A + P; I < b; I += 3)
w(
i[I + 0],
i[I + 1],
i[I + 2]
);
}
const T = new X(), M = new X(), x = new X(), _ = new X();
function E(L) {
x.fromArray(s, L * 3), _.copy(x);
const R = l[L];
T.copy(R), T.sub(x.multiplyScalar(x.dot(R))).normalize(), M.crossVectors(_, R);
const A = M.dot(d[L]) < 0 ? -1 : 1;
c[L * 4] = T.x, c[L * 4 + 1] = T.y, c[L * 4 + 2] = T.z, c[L * 4 + 3] = A;
}
for (let L = 0, R = S.length; L < R; ++L) {
const C = S[L], A = C.start, P = C.count;
for (let I = A, b = A + P; I < b; I += 3)
E(i[I + 0]), E(i[I + 1]), E(i[I + 2]);
}
}
computeVertexNormals() {
const e = this.index, t = this.getAttribute("position");
if (t !== void 0) {
let i = this.getAttribute("normal");
if (i === void 0)
i = new nt(new Float32Array(t.count * 3), 3), this.setAttribute("normal", i);
else
for (let p = 0, g = i.count; p < g; p++)
i.setXYZ(p, 0, 0, 0);
const r = new X(), s = new X(), o = new X(), a = new X(), c = new X(), l = new X(), d = new X(), h = new X();
if (e)
for (let p = 0, g = e.count; p < g; p += 3) {
const f = e.getX(p + 0), u = e.getX(p + 1), y = e.getX(p + 2);
r.fromBufferAttribute(t, f), s.fromBufferAttribute(t, u), o.fromBufferAttribute(t, y), d.subVectors(o, s), h.subVectors(r, s), d.cross(h), a.fromBufferAttribute(i, f), c.fromBufferAttribute(i, u), l.fromBufferAttribute(i, y), a.add(d), c.add(d), l.add(d), i.setXYZ(f, a.x, a.y, a.z), i.setXYZ(u, c.x, c.y, c.z), i.setXYZ(y, l.x, l.y, l.z);
}
else
for (let p = 0, g = t.count; p < g; p += 3)
r.fromBufferAttribute(t, p + 0), s.fromBufferAttribute(t, p + 1), o.fromBufferAttribute(t, p + 2), d.subVectors(o, s), h.subVectors(r, s), d.cross(h), i.setXYZ(p + 0, d.x, d.y, d.z), i.setXYZ(p + 1, d.x, d.y, d.z), i.setXYZ(p + 2, d.x, d.y, d.z);
this.normalizeNormals(), i.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 i = this.attributes;
for (const r in i) {
if (e.attributes[r] === void 0) continue;
const o = i[r].array, a = e.attributes[r], c = a.array, l = a.itemSize * t, d = Math.min(c.length, o.length - l);
for (let h = 0, p = l; h < d; h++, p++)
o[p] = c[h];
}
return this;
}
normalizeNormals() {
const e = this.attributes.normal;
for (let t = 0, i = e.count; t < i; t++)
dn.fromBufferAttribute(e, t), dn.normalize(), e.setXYZ(t, dn.x, dn.y, dn.z);
}
toNonIndexed() {
function e(a, c) {
const l = a.array, d = a.itemSize, h = a.normalized, p = new l.constructor(c.length * d);
let g = 0, f = 0;
for (let u = 0, y = c.length; u < y; u++) {
a.isInterleavedBufferAttribute ? g = c[u] * a.data.stride + a.offset : g = c[u] * d;
for (let v = 0; v < d; v++)
p[f++] = l[g++];
}
return new nt(p, d, h);
}
if (this.index === null)
return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."), this;
const t = new Je(), i = this.index.array, r = this.attributes;
for (const a in r) {
const c = r[a], l = e(c, i);
t.setAttribute(a, l);
}
const s = this.morphAttributes;
for (const a in s) {
const c = [], l = s[a];
for (let d = 0, h = l.length; d < h; d++) {
const p = l[d], g = e(p, i);
c.push(g);
}
t.morphAttributes[a] = c;
}
t.morphTargetsRelative = this.morphTargetsRelative;
const o = this.groups;
for (let a = 0, c = o.length; a < c; a++) {
const l = o[a];
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 i = this.attributes;
for (const c in i) {
const l = i[c];
e.data.attributes[c] = l.toJSON(e.data);
}
const r = {};
let s = !1;
for (const c in this.morphAttributes) {
const l = this.morphAttributes[c], d = [];
for (let h = 0, p = l.length; h < p; h++) {
const g = l[h];
d.push(g.toJSON(e.data));
}
d.length > 0 && (r[c] = d, s = !0);
}
s && (e.data.morphAttributes = r, e.data.morphTargetsRelative = this.morphTargetsRelative);
const o = this.groups;
o.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(o)));
const a = this.boundingSphere;
return a !== null && (e.data.boundingSphere = {
center: a.center.toArray(),
radius: a.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 i = e.index;
i !== null && this.setIndex(i.clone(t));
const r = e.attributes;
for (const l in r) {
const d = r[l];
this.setAttribute(l, d.clone(t));
}
const s = e.morphAttributes;
for (const l in s) {
const d = [], h = s[l];
for (let p = 0, g = h.length; p < g; p++)
d.push(h[p].clone(t));
this.morphAttributes[l] = d;
}
this.morphTargetsRelative = e.morphTargetsRelative;
const o = e.groups;
for (let l = 0, d = o.length; l < d; l++) {
const h = o[l];
this.addGroup(h.start, h.count, h.materialIndex);
}
const a = e.boundingBox;
a !== null && (this.boundingBox = a.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(), oo = /* @__PURE__ */ new is(), Mh = /* @__PURE__ */ new xr(), Ar = /* @__PURE__ */ new X(), Cr = /* @__PURE__ */ new X(), Lr = /* @__PURE__ */ new X(), Sh = /* @__PURE__ */ new X(), _h = /* @__PURE__ */ new X(), Th = /* @__PURE__ */ new X(), Kl = /* @__PURE__ */ new X(), Ql = /* @__PURE__ */ new X(), ec = /* @__PURE__ */ new X(), tc = /* @__PURE__ */ new Pe(), nc = /* @__PURE__ */ new Pe(), ic = /* @__PURE__ */ new Pe(), Eh = /* @__PURE__ */ new X(), rc = /* @__PURE__ */ new X();
class tn extends ot {
constructor(e = new Je(), t = new Vn()) {
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, i = Object.keys(t);
if (i.length > 0) {
const r = t[i[0]];
if (r !== void 0) {
this.morphTargetInfluences = [], this.morphTargetDictionary = {};
for (let s = 0, o = r.length; s < o; s++) {
const a = r[s].name || String(s);
this.morphTargetInfluences.push(0), this.morphTargetDictionary[a] = s;
}
}
}
} 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 i = this.geometry, r = this.material, s = this.matrixWorld;
if (r === void 0 || (i.boundingSphere === null && i.computeBoundingSphere(), Mh.copy(i.boundingSphere), Mh.applyMatrix4(s), e.ray.intersectsSphere(Mh) === !1) || (_g.copy(s).invert(), oo.copy(e.ray).applyMatrix4(_g), i.boundingBox !== null && oo.intersectsBox(i.boundingBox) === !1))
return;
let o;
if (i.isBufferGeometry) {
const a = i.index, c = i.attributes.position, l = i.morphAttributes.position, d = i.morphTargetsRelative, h = i.attributes.uv, p = i.attributes.uv2, g = i.groups, f = i.drawRange;
if (a !== null)
if (Array.isArray(r))
for (let u = 0, y = g.length; u < y; u++) {
const v = g[u], m = r[v.materialIndex], w = Math.max(v.start, f.start), S = Math.min(v.start + v.count, f.start + f.count);
for (let T = w, M = S; T < M; T += 3) {
const x = a.getX(T), _ = a.getX(T + 1), E = a.getX(T + 2);
o = sc(this, m, e, oo, c, l, d, h, p, x, _, E), o && (o.faceIndex = Math.floor(T / 3), o.face.materialIndex = v.materialIndex, t.push(o));
}
}
else {
const u = Math.max(0, f.start), y = Math.min(a.count, f.start + f.count);
for (let v = u, m = y; v < m; v += 3) {
const w = a.getX(v), S = a.getX(v + 1), T = a.getX(v + 2);
o = sc(this, r, e, oo, c, l, d, h, p, w, S, T), o && (o.faceIndex = Math.floor(v / 3), t.push(o));
}
}
else if (c !== void 0)
if (Array.isArray(r))
for (let u = 0, y = g.length; u < y; u++) {
const v = g[u], m = r[v.materialIndex], w = Math.max(v.start, f.start), S = Math.min(v.start + v.count, f.start + f.count);
for (let T = w, M = S; T < M; T += 3) {
const x = T, _ = T + 1, E = T + 2;
o = sc(this, m, e, oo, c, l, d, h, p, x, _, E), o && (o.faceIndex = Math.floor(T / 3), o.face.materialIndex = v.materialIndex, t.push(o));
}
}
else {
const u = Math.max(0, f.start), y = Math.min(c.count, f.start + f.count);
for (let v = u, m = y; v < m; v += 3) {
const w = v, S = v + 1, T = v + 2;
o = sc(this, r, e, oo, c, l, d, h, p, w, S, T), o && (o.faceIndex = Math.floor(v / 3), t.push(o));
}
}
} else i.isGeometry && console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");
}
}
tn.prototype.isMesh = !0;
function EI(n, e, t, i, r, s, o, a) {
let c;
if (e.side === qt ? c = i.intersectTriangle(o, s, r, !0, a) : c = i.intersectTriangle(r, s, o, e.side !== Yr, a), c === null) return null;
rc.copy(a), rc.applyMatrix4(n.matrixWorld);
const l = t.ray.origin.distanceTo(rc);
return l < t.near || l > t.far ? null : {
distance: l,
point: rc.clone(),
object: n
};
}
function sc(n, e, t, i, r, s, o, a, c, l, d, h) {
Ar.fromBufferAttribute(r, l), Cr.fromBufferAttribute(r, d), Lr.fromBufferAttribute(r, h);
const p = n.morphTargetInfluences;
if (e.morphTargets && s && p) {
Kl.set(0, 0, 0), Ql.set(0, 0, 0), ec.set(0, 0, 0);
for (let f = 0, u = s.length; f < u; f++) {
const y = p[f], v = s[f];
y !== 0 && (Sh.fromBufferAttribute(v, l), _h.fromBufferAttribute(v, d), Th.fromBufferAttribute(v, h), o ? (Kl.addScaledVector(Sh, y), Ql.addScaledVector(_h, y), ec.addScaledVector(Th, y)) : (Kl.addScaledVector(Sh.sub(Ar), y), Ql.addScaledVector(_h.sub(Cr), y), ec.addScaledVector(Th.sub(Lr), y)));
}
Ar.add(Kl), Cr.add(Ql), Lr.add(ec);
}
n.isSkinnedMesh && (n.boneTransform(l, Ar), n.boneTransform(d, Cr), n.boneTransform(h, Lr));
const g = EI(n, e, t, i, Ar, Cr, Lr, Eh);
if (g) {
a && (tc.fromBufferAttribute(a, l), nc.fromBufferAttribute(a, d), ic.fromBufferAttribute(a, h), g.uv = Qt.getUV(Eh, Ar, Cr, Lr, tc, nc, ic, new Pe())), c && (tc.fromBufferAttribute(c, l), nc.fromBufferAttribute(c, d), ic.fromBufferAttribute(c, h), g.uv2 = Qt.getUV(Eh, Ar, Cr, Lr, tc, nc, ic, new Pe()));
const f = {
a: l,
b: d,
c: h,
normal: new X(),
materialIndex: 0
};
Qt.getNormal(Ar, Cr, Lr, f.normal), g.face = f;
}
return g;
}
class hr extends Je {
constructor(e = 1, t = 1, i = 1, r = 1, s = 1, o = 1) {
super(), this.type = "BoxGeometry", this.parameters = {
width: e,
height: t,
depth: i,
widthSegments: r,
heightSegments: s,
depthSegments: o
};
const a = this;
r = Math.floor(r), s = Math.floor(s), o = Math.floor(o);
const c = [], l = [], d = [], h = [];
let p = 0, g = 0;
f("z", "y", "x", -1, -1, i, t, e, o, s, 0), f("z", "y", "x", 1, -1, i, t, -e, o, s, 1), f("x", "z", "y", 1, 1, e, i, t, r, o, 2), f("x", "z", "y", 1, -1, e, i, -t, r, o, 3), f("x", "y", "z", 1, -1, e, t, i, r, s, 4), f("x", "y", "z", -1, -1, e, t, -i, r, s, 5), this.setIndex(c), this.setAttribute("position", new We(l, 3)), this.setAttribute("normal", new We(d, 3)), this.setAttribute("uv", new We(h, 2));
function f(u, y, v, m, w, S, T, M, x, _, E) {
const L = S / x, R = T / _, C = S / 2, A = T / 2, P = M / 2, I = x + 1, b = _ + 1;
let O = 0, N = 0;
const D = new X();
for (let B = 0; B < b; B++) {
const U = B * R - A;
for (let k = 0; k < I; k++) {
const K = k * L - C;
D[u] = K * m, D[y] = U * w, D[v] = P, l.push(D.x, D.y, D.z), D[u] = 0, D[y] = 0, D[v] = M > 0 ? 1 : -1, d.push(D.x, D.y, D.z), h.push(k / x), h.push(1 - B / _), O += 1;
}
}
for (let B = 0; B < _; B++)
for (let U = 0; U < x; U++) {
const k = p + U + I * B, K = p + U + I * (B + 1), ie = p + (U + 1) + I * (B + 1), j = p + (U + 1) + I * B;
c.push(k, K, j), c.push(K, ie, j), N += 6;
}
a.addGroup(g, N, E), g += N, p += O;
}
}
static fromJSON(e) {
return new hr(e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments);
}
}
function Vo(n) {
const e = {};
for (const t in n) {
e[t] = {};
for (const i in n[t]) {
const r = n[t][i];
r && (r.isColor || r.isMatrix3 || r.isMatrix4 || r.isVector2 || r.isVector3 || r.isVector4 || r.isTexture || r.isQuaternion) ? e[t][i] = r.clone() : Array.isArray(r) ? e[t][i] = r.slice() : e[t][i] = r;
}
}
return e;
}
function En(n) {
const e = {};
for (let t = 0; t < n.length; t++) {
const i = Vo(n[t]);
for (const r in i)
e[r] = i[r];
}
return e;
}
const _x = { clone: Vo, merge: En };
var AI = `void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`, CI = `void main() {
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;
class dr extends sn {
constructor(e) {
super(), this.type = "ShaderMaterial", this.defines = {}, this.uniforms = {}, this.vertexShader = AI, this.fragmentShader = CI, 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 = Vo(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 r in this.uniforms) {
const o = this.uniforms[r].value;
o && o.isTexture ? t.uniforms[r] = {
type: "t",
value: o.toJSON(e).uuid
} : o && o.isColor ? t.uniforms[r] = {
type: "c",
value: o.getHex()
} : o && o.isVector2 ? t.uniforms[r] = {
type: "v2",
value: o.toArray()
} : o && o.isVector3 ? t.uniforms[r] = {
type: "v3",
value: o.toArray()
} : o && o.isVector4 ? t.uniforms[r] = {
type: "v4",
value: o.toArray()
} : o && o.isMatrix3 ? t.uniforms[r] = {
type: "m3",
value: o.toArray()
} : o && o.isMatrix4 ? t.uniforms[r] = {
type: "m4",
value: o.toArray()
} : t.uniforms[r] = {
value: o
};
}
Object.keys(this.defines).length > 0 && (t.defines = this.defines), t.vertexShader = this.vertexShader, t.fragmentShader = this.fragmentShader;
const i = {};
for (const r in this.extensions)
this.extensions[r] === !0 && (i[r] = !0);
return Object.keys(i).length > 0 && (t.extensions = i), t;
}
}
dr.prototype.isShaderMaterial = !0;
class wl extends ot {
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 an extends wl {
constructor(e = 50, t = 1, i = 0.1, r = 2e3) {
super(), this.type = "PerspectiveCamera", this.fov = e, this.zoom = 1, this.near = i, this.far = r, 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 = nl * 2 * Math.atan(t), this.updateProjectionMatrix();
}
/**
* Calculates the focal length from the current .fov and .filmGauge.
*/
getFocalLength() {
const e = Math.tan(As * 0.5 * this.fov);
return 0.5 * this.getFilmHeight() / e;
}
getEffectiveFOV() {
return nl * 2 * Math.atan(
Math.tan(As * 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, i, r, s, o) {
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 = i, this.view.offsetY = r, this.view.width = s, this.view.height = o, this.updateProjectionMatrix();
}
clearViewOffset() {
this.view !== null && (this.view.enabled = !1), this.updateProjectionMatrix();
}
updateProjectionMatrix() {
const e = this.near;
let t = e * Math.tan(As * 0.5 * this.fov) / this.zoom, i = 2 * t, r = this.aspect * i, s = -0.5 * r;
const o = this.view;
if (this.view !== null && this.view.enabled) {
const c = o.fullWidth, l = o.fullHeight;
s += o.offsetX * r / c, t -= o.offsetY * i / l, r *= o.width / c, i *= o.height / l;
}
const a = this.filmOffset;
a !== 0 && (s += e * a / this.getFilmWidth()), this.projectionMatrix.makePerspective(s, s + r, t, t - i, 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;
}
}
an.prototype.isPerspectiveCamera = !0;
const ao = 90, lo = 1;
class Pu extends ot {
constructor(e, t, i) {
if (super(), this.type = "CubeCamera", i.isWebGLCubeRenderTarget !== !0) {
console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");
return;
}
this.renderTarget = i;
const r = new an(ao, lo, e, t);
r.layers = this.layers, r.up.set(0, -1, 0), r.lookAt(new X(1, 0, 0)), this.add(r);
const s = new an(ao, lo, e, t);
s.layers = this.layers, s.up.set(0, -1, 0), s.lookAt(new X(-1, 0, 0)), this.add(s);
const o = new an(ao, lo, e, t);
o.layers = this.layers, o.up.set(0, 0, 1), o.lookAt(new X(0, 1, 0)), this.add(o);
const a = new an(ao, lo, e, t);
a.layers = this.layers, a.up.set(0, 0, -1), a.lookAt(new X(0, -1, 0)), this.add(a);
const c = new an(ao, lo, e, t);
c.layers = this.layers, c.up.set(0, -1, 0), c.lookAt(new X(0, 0, 1)), this.add(c);
const l = new an(ao, lo, e, t);
l.layers = this.layers, l.up.set(0, -1, 0), l.lookAt(new X(0, 0, -1)), this.add(l);
}
update(e, t) {
this.parent === null && this.updateMatrixWorld();
const i = this.renderTarget, [r, s, o, a, c, l] = this.children, d = e.xr.enabled, h = e.getRenderTarget();
e.xr.enabled = !1;
const p = i.texture.generateMipmaps;
i.texture.generateMipmaps = !1, e.setRenderTarget(i, 0), e.render(t, r), e.setRenderTarget(i, 1), e.render(t, s), e.setRenderTarget(i, 2), e.render(t, o), e.setRenderTarget(i, 3), e.render(t, a), e.setRenderTarget(i, 4), e.render(t, c), i.texture.generateMipmaps = p, e.setRenderTarget(i, 5), e.render(t, l), e.setRenderTarget(h), e.xr.enabled = d;
}
}
class ca extends nn {
constructor(e, t, i, r, s, o, a, c, l, d) {
e = e !== void 0 ? e : [], t = t !== void 0 ? t : yl, a = a !== void 0 ? a : ar, super(e, t, i, r, s, o, a, c, l, d), this._needsFlipEnvMap = !0, this.flipY = !1;
}
get images() {
return this.image;
}
set images(e) {
this.image = e;
}
}
ca.prototype.isCubeTexture = !0;
class Iu extends bi {
constructor(e, t, i) {
Number.isInteger(t) && (console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"), t = i), super(e, e, t), t = t || {}, this.texture = new ca(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 : jt, this.texture._needsFlipEnvMap = !1;
}
fromEquirectangularTexture(e, t) {
this.texture.type = t.type, this.texture.format = Yn, this.texture.encoding = t.encoding, this.texture.generateMipmaps = t.generateMipmaps, this.texture.minFilter = t.minFilter, this.texture.magFilter = t.magFilter;
const i = {
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 );
}
`
)
}, r = new hr(5, 5, 5), s = new dr({
name: "CubemapFromEquirect",
uniforms: Vo(i.uniforms),
vertexShader: i.vertexShader,
fragmentShader: i.fragmentShader,
side: qt,
blending: or
});
s.uniforms.tEquirect.value = t;
const o = new tn(r, s), a = t.minFilter;
return t.minFilter === br && (t.minFilter = jt), new Pu(1, 10, this).update(e, o), t.minFilter = a, o.geometry.dispose(), o.material.dispose(), this;
}
clear(e, t, i, r) {
const s = e.getRenderTarget();
for (let o = 0; o < 6; o++)
e.setRenderTarget(this, o), e.clear(t, i, r);
e.setRenderTarget(s);
}
}
Iu.prototype.isWebGLCubeRenderTarget = !0;
const Ah = /* @__PURE__ */ new X(), LI = /* @__PURE__ */ new X(), RI = /* @__PURE__ */ new ln();
class Li {
constructor(e = new X(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, i, r) {
return this.normal.set(e, t, i), this.constant = r, this;
}
setFromNormalAndCoplanarPoint(e, t) {
return this.normal.copy(e), this.constant = -t.dot(this.normal), this;
}
setFromCoplanarPoints(e, t, i) {
const r = Ah.subVectors(i, t).cross(LI.subVectors(e, t)).normalize();
return this.setFromNormalAndCoplanarPoint(r, 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 i = e.delta(Ah), r = this.normal.dot(i);
if (r === 0)
return this.distanceToPoint(e.start) === 0 ? t.copy(e.start) : null;
const s = -(e.start.dot(this.normal) + this.constant) / r;
return s < 0 || s > 1 ? null : t.copy(i).multiplyScalar(s).add(e.start);
}
intersectsLine(e) {
const t = this.distanceToPoint(e.start), i = this.distanceToPoint(e.end);
return t < 0 && i > 0 || i < 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 i = t || RI.getNormalMatrix(e), r = this.coplanarPoint(Ah).applyMatrix4(e), s = this.normal.applyMatrix3(i).normalize();
return this.constant = -r.dot(s), 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);
}
}
Li.prototype.isPlane = !0;
const co = /* @__PURE__ */ new xr(), oc = /* @__PURE__ */ new X();
class Ml {
constructor(e = new Li(), t = new Li(), i = new Li(), r = new Li(), s = new Li(), o = new Li()) {
this.planes = [e, t, i, r, s, o];
}
set(e, t, i, r, s, o) {
const a = this.planes;
return a[0].copy(e), a[1].copy(t), a[2].copy(i), a[3].copy(r), a[4].copy(s), a[5].copy(o), this;
}
copy(e) {
const t = this.planes;
for (let i = 0; i < 6; i++)
t[i].copy(e.planes[i]);
return this;
}
setFromProjectionMatrix(e) {
const t = this.planes, i = e.elements, r = i[0], s = i[1], o = i[2], a = i[3], c = i[4], l = i[5], d = i[6], h = i[7], p = i[8], g = i[9], f = i[10], u = i[11], y = i[12], v = i[13], m = i[14], w = i[15];
return t[0].setComponents(a - r, h - c, u - p, w - y).normalize(), t[1].setComponents(a + r, h + c, u + p, w + y).normalize(), t[2].setComponents(a + s, h + l, u + g, w + v).normalize(), t[3].setComponents(a - s, h - l, u - g, w - v).normalize(), t[4].setComponents(a - o, h - d, u - f, w - m).normalize(), t[5].setComponents(a + o, h + d, u + f, w + m).normalize(), this;
}
intersectsObject(e) {
const t = e.geometry;
return t.boundingSphere === null && t.computeBoundingSphere(), co.copy(t.boundingSphere).applyMatrix4(e.matrixWorld), this.intersectsSphere(co);
}
intersectsSprite(e) {
return co.center.set(0, 0, 0), co.radius = 0.7071067811865476, co.applyMatrix4(e.matrixWorld), this.intersectsSphere(co);
}
intersectsSphere(e) {
const t = this.planes, i = e.center, r = -e.radius;
for (let s = 0; s < 6; s++)
if (t[s].distanceToPoint(i) < r)
return !1;
return !0;
}
intersectsBox(e) {
const t = this.planes;
for (let i = 0; i < 6; i++) {
const r = t[i];
if (oc.x = r.normal.x > 0 ? e.max.x : e.min.x, oc.y = r.normal.y > 0 ? e.max.y : e.min.y, oc.z = r.normal.z > 0 ? e.max.z : e.min.z, r.distanceToPoint(oc) < 0)
return !1;
}
return !0;
}
containsPoint(e) {
const t = this.planes;
for (let i = 0; i < 6; i++)
if (t[i].distanceToPoint(e) < 0)
return !1;
return !0;
}
clone() {
return new this.constructor().copy(this);
}
}
function Tx() {
let n = null, e = !1, t = null, i = null;
function r(s, o) {
t(s, o), i = n.requestAnimationFrame(r);
}
return {
start: function() {
e !== !0 && t !== null && (i = n.requestAnimationFrame(r), e = !0);
},
stop: function() {
n.cancelAnimationFrame(i), e = !1;
},
setAnimationLoop: function(s) {
t = s;
},
setContext: function(s) {
n = s;
}
};
}
function PI(n, e) {
const t = e.isWebGL2, i = /* @__PURE__ */ new WeakMap();
function r(l, d) {
const h = l.array, p = l.usage, g = n.createBuffer();
n.bindBuffer(d, g), n.bufferData(d, h, p), l.onUploadCallback();
let f = 5126;
return h instanceof Float32Array ? f = 5126 : h instanceof Float64Array ? console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.") : h instanceof Uint16Array ? l.isFloat16BufferAttribute ? t ? f = 5131 : console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.") : f = 5123 : h instanceof Int16Array ? f = 5122 : h instanceof Uint32Array ? f = 5125 : h instanceof Int32Array ? f = 5124 : h instanceof Int8Array ? f = 5120 : (h instanceof Uint8Array || h instanceof Uint8ClampedArray) && (f = 5121), {
buffer: g,
type: f,
bytesPerElement: h.BYTES_PER_ELEMENT,
version: l.version
};
}
function s(l, d, h) {
const p = d.array, g = d.updateRange;
n.bindBuffer(h, l), g.count === -1 ? n.bufferSubData(h, 0, p) : (t ? n.bufferSubData(
h,
g.offset * p.BYTES_PER_ELEMENT,
p,
g.offset,
g.count
) : n.bufferSubData(
h,
g.offset * p.BYTES_PER_ELEMENT,
p.subarray(g.offset, g.offset + g.count)
), g.count = -1);
}
function o(l) {
return l.isInterleavedBufferAttribute && (l = l.data), i.get(l);
}
function a(l) {
l.isInterleavedBufferAttribute && (l = l.data);
const d = i.get(l);
d && (n.deleteBuffer(d.buffer), i.delete(l));
}
function c(l, d) {
if (l.isGLBufferAttribute) {
const p = i.get(l);
(!p || p.version < l.version) && i.set(l, {
buffer: l.buffer,
type: l.type,
bytesPerElement: l.elementSize,
version: l.version
});
return;
}
l.isInterleavedBufferAttribute && (l = l.data);
const h = i.get(l);
h === void 0 ? i.set(l, r(l, d)) : h.version < l.version && (s(h.buffer, l, d), h.version = l.version);
}
return {
get: o,
remove: a,
update: c
};
}
class Ds extends Je {
constructor(e = 1, t = 1, i = 1, r = 1) {
super(), this.type = "PlaneGeometry", this.parameters = {
width: e,
height: t,
widthSegments: i,
heightSegments: r
};
const s = e / 2, o = t / 2, a = Math.floor(i), c = Math.floor(r), l = a + 1, d = c + 1, h = e / a, p = t / c, g = [], f = [], u = [], y = [];
for (let v = 0; v < d; v++) {
const m = v * p - o;
for (let w = 0; w < l; w++) {
const S = w * h - s;
f.push(S, -m, 0), u.push(0, 0, 1), y.push(w / a), y.push(1 - v / c);
}
}
for (let v = 0; v < c; v++)
for (let m = 0; m < a; m++) {
const w = m + l * v, S = m + l * (v + 1), T = m + 1 + l * (v + 1), M = m + 1 + l * v;
g.push(w, S, M), g.push(S, T, M);
}
this.setIndex(g), this.setAttribute("position", new We(f, 3)), this.setAttribute("normal", new We(u, 3)), this.setAttribute("uv", new We(y, 2));
}
static fromJSON(e) {
return new Ds(e.width, e.height, e.widthSegments, e.heightSegments);
}
}
var II = `#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, vUv ).g;
#endif`, OI = `#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`, DI = `#ifdef ALPHATEST
if ( diffuseColor.a < ALPHATEST ) discard;
#endif`, NI = `#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`, FI = `#ifdef USE_AOMAP
uniform sampler2D aoMap;
uniform float aoMapIntensity;
#endif`, BI = "vec3 transformed = vec3( position );", zI = `vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
vec3 objectTangent = vec3( tangent.xyz );
#endif`, UI = `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`, VI = `#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`, kI = `#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`, GI = `#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`, HI = `#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
#endif`, WI = `#if NUM_CLIPPING_PLANES > 0
vClipPosition = - mvPosition.xyz;
#endif`, jI = `#if defined( USE_COLOR_ALPHA )
diffuseColor *= vColor;
#elif defined( USE_COLOR )
diffuseColor.rgb *= vColor;
#endif`, $I = `#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR )
varying vec3 vColor;
#endif`, ZI = `#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
varying vec3 vColor;
#endif`, XI = `#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`, YI = `#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 );
}`, JI = `#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`, qI = `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`, KI = `#ifdef USE_DISPLACEMENTMAP
uniform sampler2D displacementMap;
uniform float displacementScale;
uniform float displacementBias;
#endif`, QI = `#ifdef USE_DISPLACEMENTMAP
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );
#endif`, eO = `#ifdef USE_EMISSIVEMAP
vec4 emissiveColor = texture2D( emissiveMap, vUv );
emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;
totalEmissiveRadiance *= emissiveColor.rgb;
#endif`, tO = `#ifdef USE_EMISSIVEMAP
uniform sampler2D emissiveMap;
#endif`, nO = "gl_FragColor = linearToOutputTexel( gl_FragColor );", iO = `
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 );
}`, rO = `#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`, sO = `#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`, oO = `#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`, aO = `#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`, lO = `#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`, cO = `#ifdef USE_FOG
fogDepth = - mvPosition.z;
#endif`, uO = `#ifdef USE_FOG
varying float fogDepth;
#endif`, hO = `#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`, dO = `#ifdef USE_FOG
uniform vec3 fogColor;
varying float fogDepth;
#ifdef FOG_EXP2
uniform float fogDensity;
#else
uniform float fogNear;
uniform float fogFar;
#endif
#endif`, fO = `#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
}`, pO = `#ifdef USE_LIGHTMAP
vec4 lightMapTexel= texture2D( lightMap, vUv2 );
reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
#endif`, mO = `#ifdef USE_LIGHTMAP
uniform sampler2D lightMap;
uniform float lightMapIntensity;
#endif`, gO = `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`, vO = `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`, yO = `#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`, bO = `ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`, xO = `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)`, wO = `BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`, MO = `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)`, SO = `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`, _O = `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 );
}`, TO = `
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`, EO = `#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`, AO = `#if defined( RE_IndirectDiffuse )
RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );
#endif`, CO = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`, LO = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
uniform float logDepthBufFC;
varying float vFragDepth;
varying float vIsPerspective;
#endif`, RO = `#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGDEPTHBUF_EXT
varying float vFragDepth;
varying float vIsPerspective;
#else
uniform float logDepthBufFC;
#endif
#endif`, PO = `#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`, IO = `#ifdef USE_MAP
vec4 texelColor = texture2D( map, vUv );
texelColor = mapTexelToLinear( texelColor );
diffuseColor *= texelColor;
#endif`, OO = `#ifdef USE_MAP
uniform sampler2D map;
#endif`, DO = `#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`, NO = `#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`, FO = `float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
vec4 texelMetalness = texture2D( metalnessMap, vUv );
metalnessFactor *= texelMetalness.b;
#endif`, BO = `#ifdef USE_METALNESSMAP
uniform sampler2D metalnessMap;
#endif`, zO = `#ifdef USE_MORPHNORMALS
objectNormal *= morphTargetBaseInfluence;
objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
#endif`, UO = `#ifdef USE_MORPHTARGETS
uniform float morphTargetBaseInfluence;
#ifndef USE_MORPHNORMALS
uniform float morphTargetInfluences[ 8 ];
#else
uniform float morphTargetInfluences[ 4 ];
#endif
#endif`, VO = `#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`, kO = `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;`, GO = `#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`, HO = `#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`, WO = `#ifdef CLEARCOAT
vec3 clearcoatNormal = geometryNormal;
#endif`, jO = `#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`, $O = `#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`, ZO = `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 );
}`, XO = `#ifdef PREMULTIPLIED_ALPHA
gl_FragColor.rgb *= gl_FragColor.a;
#endif`, YO = `vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_INSTANCING
mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`, JO = `#ifdef DITHERING
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`, qO = `#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`, KO = `float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
vec4 texelRoughness = texture2D( roughnessMap, vUv );
roughnessFactor *= texelRoughness.g;
#endif`, QO = `#ifdef USE_ROUGHNESSMAP
uniform sampler2D roughnessMap;
#endif`, e3 = `#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`, t3 = `#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`, n3 = `#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`, i3 = `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;
}`, r3 = `#ifdef USE_SKINNING
mat4 boneMatX = getBoneMatrix( skinIndex.x );
mat4 boneMatY = getBoneMatrix( skinIndex.y );
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`, s3 = `#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`, o3 = `#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`, a3 = `#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`, l3 = `float specularStrength;
#ifdef USE_SPECULARMAP
vec4 texelSpecular = texture2D( specularMap, vUv );
specularStrength = texelSpecular.r;
#else
specularStrength = 1.0;
#endif`, c3 = `#ifdef USE_SPECULARMAP
uniform sampler2D specularMap;
#endif`, u3 = `#if defined( TONE_MAPPING )
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`, h3 = `#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; }`, d3 = `#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`, f3 = `#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`, p3 = `#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )
varying vec2 vUv;
#endif`, m3 = `#ifdef USE_UV
#ifdef UVS_VERTEX_ONLY
vec2 vUv;
#else
varying vec2 vUv;
#endif
uniform mat3 uvTransform;
#endif`, g3 = `#ifdef USE_UV
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
#endif`, v3 = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
varying vec2 vUv2;
#endif`, y3 = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
attribute vec2 uv2;
varying vec2 vUv2;
uniform mat3 uv2Transform;
#endif`, b3 = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;
#endif`, x3 = `#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`, w3 = `uniform sampler2D t2D;
varying vec2 vUv;
void main() {
vec4 texColor = texture2D( t2D, vUv );
gl_FragColor = mapTexelToLinear( texColor );
#include
#include
}`, M3 = `varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
gl_Position = vec4( position.xy, 1.0, 1.0 );
}`, S3 = `#include
uniform float opacity;
varying vec3 vWorldDirection;
#include
void main() {
vec3 vReflect = vWorldDirection;
#include
gl_FragColor = envColor;
gl_FragColor.a *= opacity;
#include
#include
}`, _3 = `varying vec3 vWorldDirection;
#include
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include
#include
gl_Position.z = gl_Position.w;
}`, T3 = `#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
}`, E3 = `#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;
}`, A3 = `#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 );
}`, C3 = `#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;
}`, L3 = `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
}`, R3 = `varying vec3 vWorldDirection;
#include
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include
#include
}`, P3 = `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
}`, I3 = `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
}`, O3 = `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
}`, D3 = `#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
}`, N3 = `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
}`, F3 = `#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
}`, B3 = `#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
}`, z3 = `#define MATCAP
varying vec3 vViewPosition;
#ifndef FLAT_SHADED
varying vec3 vNormal;
#endif
#include